^1525500444897
@
sname
MultiSelectCombo
slabel
MultiSelectCombo
sdescriptors
xworker.lang.MetaDescriptor3
sextends
xworker.swt.layout.LayoutDatas
smany
true
seditCols
2
sinitialization
false
sgroup
xworker
smodifier
public
sinheritDescription
false
Sdescription
#$@text#$@
<p>一个通过弹出有CheckBox表格的多选下拉框。</p>
<p>创建方法返回的是一个ActionContainer，可以调用这个ActionContainer的setValues、setValue和getValue方法等。查看<a href="javascript.invoke('shell.xworkeruitest.eclipse.swt.xworker.TestMultiSelectCombo/@shell')">示例</a>。</p>
#$@text#$@
sid
MultiSelectCombo
  @/@actions
  sname
  actions
  slabel
  actions
  sdescriptors
  xworker.lang.MetaDescriptor3/@actions,xworker.swt.Widgets/@actions
  sid
  actions
    @/@actions/@create
    sname
    create
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    suseOuterJava
    true
    souterClassName
    xworker.swt.xworker.MultiSelectComboCreator
    smethodName
    create
    sdisableGlobalContext
    false
    sdescriptors
    xworker.lang.actions.JavaAction
    sid
    create
  @/@name
  sname
  name
  sinheritDescription
  false
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  name
  @/@label
  sname
  label
  sinheritDescription
  false
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  label
  @/@READONLY
  sname
  READONLY
  sinputtype
  truefalse
  sdefault
  true
  sinheritDescription
  false
  Sdescription
#$@text#$@
<p>下拉列表的Text是否是只读的，如果是只读的那么只能在下拉列表中选择数据，如果是非只读的那么可以直接输入数据而不用从下拉列表中选择数据，非只读的情况下可以输入下拉列表中不存在的数据。</p>
<p>手工输入的数据在读取值时会和数据列表首先从标签上匹配，如果匹配那么返回的实际是数据的标识字段，如果没有匹配的那么返回输入的原值。</p>
#$@text#$@
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  READONLY
  @/@BORDER
  sname
  BORDER
  sinputtype
  truefalse
  sdefault
  true
  sinheritDescription
  false
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  BORDER
  @/@id
  sname
  idName
  sinheritDescription
  false
  sdescription
  <p>复合数据的标识字段名。</p>
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  id
  @/@valueLabel
  sname
  labelName
  sinheritDescription
  false
  sdescription
  <p>复合数据要显示的字段名。</p>
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  valueLabel
  @/@actions1
  sname
  actions
  slabel
  actions
  sdescriptors
  xworker.swt.Widgets/@actions
  sid
  actions1
    @/@actions1/@setValue
    sname
    setValue
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    suseOuterJava
    true
    souterClassName
    xworker.swt.xworker.MultiSelectComboCreator
    smethodName
    setValue
    sdisableGlobalContext
    false
    sdescriptors
    xworker.lang.actions.JavaAction
    sid
    setValue
    @/@actions1/@getValue
    sname
    getValue
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    suseOuterJava
    true
    souterClassName
    xworker.swt.xworker.MultiSelectComboCreator
    smethodName
    getValue
    sdisableGlobalContext
    false
    sdescriptors
    xworker.lang.actions.JavaAction
    sid
    getValue
    @/@actions1/@getControl
    sname
    getControl
    svariable
    text
    sinterpretationType
    Self
    sdescriptors
    xworker.lang.actions.Actions/@Return
    sid
    getControl
    @/@actions1/@getRootControl
    sname
    getRootControl
    svariable
    composite
    sinterpretationType
    Self
    sdescriptors
    xworker.lang.actions.Actions/@Return
    sid
    getRootControl
  @/@dataSource
  sname
  dataSource
  sinputtype
  select
  sdefault
  selfValues
  sinheritDescription
  false
  Sdescription
#$@text#$@
<p>选择列表的数据源。</p>
<ul>
    <li>selfValues<br />
    多选下拉框自定义的值子事物。<br />
    &nbsp;</li>
    <li>dataStore<br />
    数据仓库。<br />
    &nbsp;</li>
    <li>varList<br />
    变量上下文中的List变量。</li>
</ul>
#$@text#$@
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  dataSource
    @/@dataSource/@selfValues
    sname
    selfValues
    slabel
    selfValues
    svalue
    selfValues
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute/@value
    sid
    selfValues
    @/@dataSource/@dataStore
    sname
    dataStore
    slabel
    dataStore
    svalue
    dataStore
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute/@value
    sid
    dataStore
    @/@dataSource/@selfStore
    sname
    selfDataStore
    slabel
    selfDataStore
    svalue
    selfDataStore
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute/@value
    sid
    selfStore
    @/@dataSource/@varList
    sname
    varList
    slabel
    varList
    svalue
    varList
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute/@value
    sid
    varList
  @/@dataName
  sname
  dataName
  sinheritDescription
  false
  sdescription
  <p>dataStore或者varList的名称。</p>
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  dataName
  @/@filter
  sname
  filter
  sinputtype
  truefalse
  sdefault
  false
  sinheritDescription
  false
  sdescription
  <p>是否打开过滤。</p>
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  filter
  @/@tableComposite
  sname
  tableComposite
  sBORDER
  true
  sH_SCROLL
  false
  sV_SCROLL
  false
  sNO_BACKGROUND
  false
  sNO_FOCUS
  false
  sNO_MERGE_PAINTS
  false
  sNO_REDRAW_RESIZE
  false
  sNO_RADIO_GROUP
  false
  sEMBEDDED
  false
  sDOUBLE_BUFFERED
  false
  scapture
  false
  senabled
  true
  sredraw
  true
  svisible
  true
  sdescriptors
  xworker.swt.widgets.Composite
  sid
  tableComposite
    @/@tableComposite/@tableCompositeGridLayout
    sname
    tableCompositeGridLayout
    smakeColumnsEqualWidth
    false
    smarginWidth
    0
    smarginHeight
    0
    smarginLeft
    0
    smarginTop
    0
    smarginRight
    0
    smarginBottom
    0
    shorizontalSpacing
    0
    sverticalSpacing
    0
    slabel
    tableCompositeGridLayout
    sdescriptors
    xworker.swt.Layouts/@GridLayout
    sid
    tableCompositeGridLayout
    @/@tableComposite/@searchText
    sname
    searchText
    sstyle
    SINGLE
    sH_SCROLL
    false
    sV_SCROLL
    false
    sWRAP
    false
    sREAD_ONLY
    false
    sPASSWORD
    false
    sSEARCH
    false
    sCANCEL
    false
    sBORDER
    true
    salign
    LEFT
    scapture
    false
    senabled
    true
    sredraw
    true
    svisible
    true
    slabel
    searchText
    sdescriptors
    xworker.swt.Widgets/@Text
    sid
    searchText
      @/@tableComposite/@searchText/@searchTextGridData
      sname
      searchTextGridData
      sstyle
      FILL_HORIZONTAL
      shorizontalIndent
      0
      swidth
      -1
      sheight
      -1
      shorizontalAlignment
      BEGINNING
      sverticalAlignment
      CENTER
      shorizontalSpan
      1
      sverticalSpan
      1
      sgrabExcessHorizontalSpace
      false
      sgrabExcessVerticalSpace
      false
      slabel
      searchTextGridData
      sdescriptors
      xworker.swt.layout.LayoutDatas/@GridData
      sid
      searchTextGridData
      @/@tableComposite/@searchText/@1578
      sname
      Listeners
      slabel
      Listeners
      sdescriptors
      xworker.swt.widgets.Widget/@Listeners
      sid
      1578
        @/@tableComposite/@searchText/@1578/@1579
        sname
        searchTextSelection
        stype
        Modify
        slabel
        searchTextSelection
        sdescriptors
        xworker.swt.events.Listeners/@listeners/@Listener
        sid
        1579
          @/@tableComposite/@searchText/@1578/@1579/@1580
          sname
          searchTextAction
          sisSynchronized
          false
          sthrowException
          true
          suseOtherAction
          false
          suseOuterJava
          true
          souterClassName
          xworker.swt.xworker.MultiSelectComboCreator
          smethodName
          searchTextAction
          sdisableGlobalContext
          false
          sdescriptors
          xworker.lang.actions.JavaAction
          sid
          1580
        @/@tableComposite/@searchText/@1578/@searchTextDefaultSelection
        sname
        searchTextDefaultSelection
        stype
        DefaultSelection
        slabel
        searchTextDefaultSelection
        sdescriptors
        xworker.swt.events.Listeners/@listeners/@Listener
        sid
        searchTextDefaultSelection
          @/@tableComposite/@searchText/@1578/@searchTextDefaultSelection/@shell
          sname
          shell
          sshellName
          shell
          smethod
          dispose
          sinterpretationType
          Self
          sdescriptors
          xworker.swt.actions.ShellActions/@ShellNormalActions1
          sid
          shell
    @/@tableComposite/@table
    sname
    table
    sselectStyle
    SINGLE
    sV_SCROLL
    true
    sH_SCROLL
    false
    sCHECK
    true
    sFULL_SELECTION
    true
    sHIDE_SELECTION
    false
    sBORDER
    false
    slineVisible
    false
    smultipleColumns
    false
    sheaderVisible
    false
    ssortIndicator
    false
    smoveableColumns
    false
    sheadImages
    false
    ssubImages
    false
    sVIRTUAL
    true
    scapture
    false
    senabled
    true
    sredraw
    true
    svisible
    true
    slabel
    table
    sdescriptors
    xworker.swt.widgets.Table
    sid
    table
      @/@tableComposite/@table/@labelColumn
      sname
      labelColumn
      swidth
      -1
      slabel
      labelColumn
      sdescriptors
      xworker.swt.widgets.Table/@TableColumn
      sid
      labelColumn
      @/@tableComposite/@table/@Listeners
      sname
      Listeners
      slabel
      Listeners
      sdescriptors
      xworker.swt.widgets.Widget/@Listeners
      sid
      Listeners
        @/@tableComposite/@table/@Listeners/@tableSelection
        sname
        tableSelection
        stype
        Selection
        slabel
        tableSelection
        sdescriptors
        xworker.swt.events.Listeners/@listeners/@Listener
        sid
        tableSelection
          @/@tableComposite/@table/@Listeners/@tableSelection/@tableSelection
          sname
          tableSelection
          sisSynchronized
          false
          sthrowException
          true
          suseOtherAction
          false
          suseOuterJava
          true
          souterClassName
          xworker.swt.xworker.MultiSelectComboCreator
          smethodName
          tableSelection
          sdisableGlobalContext
          false
          sdescriptors
          xworker.lang.actions.JavaAction
          sid
          tableSelection
        @/@tableComposite/@table/@Listeners/@tableDefaultSelection
        sname
        tableDefaultSelection
        stype
        DefaultSelection
        slabel
        tableDefaultSelection
        sdescriptors
        xworker.swt.events.Listeners/@listeners/@Listener
        sid
        tableDefaultSelection
          @/@tableComposite/@table/@Listeners/@tableDefaultSelection/@shell
          sname
          shell
          smethod
          dispose
          sinterpretationType
          Self
          sdescriptors
          xworker.swt.actions.ShellActions/@ShellNormalActions1
          sid
          shell
      @/@tableComposite/@table/@tableGridData
      sname
      tableGridData
      sstyle
      FILL_BOTH
      shorizontalIndent
      0
      swidth
      -1
      sheight
      -1
      shorizontalAlignment
      BEGINNING
      sverticalAlignment
      CENTER
      shorizontalSpan
      1
      sverticalSpan
      1
      sgrabExcessHorizontalSpace
      false
      sgrabExcessVerticalSpace
      false
      slabel
      tableGridData
      sdescriptors
      xworker.swt.layout.LayoutDatas/@GridData
      sid
      tableGridData
    @/@tableComposite/@init
    sname
    init
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    suseOuterJava
    true
    souterClassName
    xworker.swt.xworker.MultiSelectComboCreator
    smethodName
    init
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.TableItem;

import ognl.Ognl;
import org.xmeta.Thing;

def comboThing = parentContext.get("comboThing");

if(comboThing.getBoolean("filter") == false){
    searchText.dispose();
}

//-----------初始化表格中的待选数据-------
def dataSource = comboThing.dataSource;
def datas = null;
def idName = comboThing.idName;
def labelName = comboThing.labelName;
if(dataSource == "selfValues"){
    //自定义的数据
    datas = comboThing.get("value@");    
    idName = "name";
    labelName = "getMetadata().getLabel()";
}else if(dataSource == "dataStore"){
    //log.info("get data store，dataStore=" + comboThing.dataName);
    //log.info("dataStore=" + parentContext.parentContext.parentContext.get("dataStore"));
    //数据仓库的数据
    def dataStore = Ognl.getValue(comboThing.dataName, parentContext.parentContext.parentContext);
    //log.info("dataStore=" + dataStore);
    if(dataStore != null){
        datas = dataStore.records;
    }    
    if(datas == null){
        datas = [];
    }
}else if(dataSource == "selfDataStore"){
    //log.info(comboThing.dataName);
    def dataStore = Ognl.getValue(comboThing.dataName,  parentContext.parentContext);
    if(dataStore != null){
        datas = dataStore.records;
    }  
}else if(dataSource == "varList"){
    //变量列表
    datas = Ognl.getValue(comboThing.dataName, parentContext.parentContext.parentContext);  
}
def rowHeight = 0;

if(datas != null){
    for(data in datas){
        def dataObj = data;
        if(data instanceof String){               
            dataObj = [:];
            dataObj.put(labelName, data);
            dataObj.put(idName, data);
        }
        
        def tableItem = new TableItem(table, SWT.NONE);
        tableItem.setData(dataObj);
        if(labelName == null){
            log.info("labelName not setted");
            continue;
        }
        def label = Ognl.getValue(labelName, dataObj);
        tableItem.setText([label]);
        rowHeight += table.getItemHeight();
    }
}

def value = parentContext.get("action").doAction("getValue");
if(value == null){
    value = "";
}
for(v in value.split(",")){
    for(row	in table.items){
        def id = Ognl.getValue(idName, row.getData());
        if(id != null && id.toString() == v){
            row.setChecked(true);
        }
    }
}

//设置表格的列宽至少和表格一样长
int width = 0;
for(column in table.getColumns()){
    width += column.getWidth();
}


def shellWidth = parentContext.text.parent.size.x;
if(shellWidth <= 0){
    shellWidth = parentContext.text.parent.size.x;
}

if(width < shellWidth){
    if(rowHeight > shell.size.y){
        table.getColumn(0).setWidth(table.getColumn(0).getWidth() + shellWidth - width - 23);
    }else{
        table.getColumn(0).setWidth(table.getColumn(0).getWidth() + shellWidth - width - 7);
    }
}

def itemsCount = table.getItems().length;
if(itemsCount > comboThing.getInt("popWinMaxRows")){
    itemsCount = comboThing.getInt("popWinMaxRows");
}
int height = 9 + table.getItemHeight() * table.getItems().length;
if(searchText != null && !searchText.isDisposed()){
    height = searchText.size.y + height + 20;
}

if(height > 200){
    height = 200;
}
shell.setSize(shellWidth, height);
#$@text#$@
    sdescriptors
    xworker.swt.util.JavaCode
    sth_createIndex
    false
    sid
    init
  @/@value
  sname
  value
  sdescriptors
  xworker.lang.MetaDescriptor3/@thing
  smany
  true
  seditCols
  2
  sinitialization
  false
  smodifier
  public
  sinheritDescription
  false
  sid
  value
    @/@value/@id
    sname
    name
    sinheritDescription
    false
    LvalidateOnBlur
    false
    LallowDecimals
    false
    LallowNegative
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sid
    id
    @/@value/@label
    sname
    label
    sinheritDescription
    false
    LvalidateOnBlur
    false
    LallowDecimals
    false
    LallowNegative
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sid
    label
    @/@value/@value
    sname
    value
    sinheritDescription
    false
    LvalidateOnBlur
    false
    LallowDecimals
    false
    LallowNegative
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sid
    value
  @/@popWinMaxRows
  sname
  popWinMaxRows
  sdefault
  15
  sinheritDescription
  false
  sdescription
  <p>弹出窗口最大显示行数。</p>
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  popWinMaxRows
