^1651551053727
@
sname
SelectAttributeDialog
slabel
SelectAttributeDialog
sdescription
<p>选择属性的弹出对话框。</p>
sdescriptors
xworker.swt.widgets.Display
sth_createIndex
false
  @/@shell
  sname
  shell
  stext
  lang:d=选择属性&en=Select Attribute
  sNO_TRIM
  false
  sCLOSE
  true
  sTITLE
  true
  sMIN
  true
  sMAX
  true
  sBORDER
  false
  sRESIZE
  true
  sON_TOP
  false
  sTOOL
  false
  sNO_FOCUS
  false
  swidth
  320
  sheight
  400
  scenterScreen
  true
  spack
  false
  smaximized
  false
  sfullScreen
  false
  sdesign
  true
  sisIde
  false
  sdesignDefaultOpen
  false
  sexitOnDispose
  false
  sH_SCROLL
  false
  sV_SCROLL
  false
  sNO_BACKGROUND
  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.Display/@Shell
  sth_createIndex
  false
  sid
  shell
    @/@shell/@shellGridLayout
    sname
    shellGridLayout
    smakeColumnsEqualWidth
    false
    smarginWidth
    5
    smarginHeight
    5
    smarginLeft
    0
    smarginTop
    0
    smarginRight
    0
    smarginBottom
    0
    shorizontalSpacing
    5
    sverticalSpacing
    5
    sdescriptors
    xworker.swt.Layouts/@GridLayout
    sth_createIndex
    false
    sid
    shellGridLayout
    @/@shell/@dataTable
    sname
    dataTable
    sselectStyle
    SINGLE
    sV_SCROLL
    true
    sH_SCROLL
    true
    sCHECK
    false
    sFULL_SELECTION
    true
    sHIDE_SELECTION
    false
    sBORDER
    true
    slineVisible
    true
    smultipleColumns
    true
    sheaderVisible
    true
    ssortIndicator
    true
    smoveableColumns
    true
    sheadImages
    false
    ssubImages
    false
    sVIRTUAL
    false
    scapture
    false
    senabled
    true
    sredraw
    true
    svisible
    true
    sdescriptors
    xworker.swt.Widgets/@Table
    sth_createIndex
    false
    sid
    dataTable
      @/@shell/@dataTable/@DataStore
      sname
      dataStore
      sattachToParent
      true
      sloadBackground
      true
      sautoLoad
      true
      sautoSave
      false
      spaging
      extend
      spageSize
      50
      sstoreSortField
      _extend
      sstoreSortDir
      ASC
      seditable
      extend
      seditmethod
      extend
      sdescriptors
      xworker.swt.widgets.Table/@DataStore
      sth_createIndex
      false
      sid
      DataStore
        @/@shell/@dataTable/@DataStore/@dataObjects
        sname
        dataObjects
        sdescriptors
        xworker.swt.app.view.swt.data.DataStore/@DataObjects
        sth_createIndex
        false
        sid
        dataObjects
          @/@shell/@dataTable/@DataStore/@dataObjects/@ListDataObject
          sname
          ListDataObject
          slistData
          attributes
          seditCols
          2
          spaging
          false
          sreadUrl
          do?sc=xworker.web.app.view.extjs.server.DataObjectStore/@read
          screateUrl
          do?sc=xworker.web.app.view.extjs.server.DataObjectStore/@create
          supdateUrl
          do?sc=xworker.web.app.view.extjs.server.DataObjectStore/@update
          sdestroyUrl
          do?sc=xworker.web.app.view.extjs.server.DataObjectStore/@destroy
          LstoreAutoDestroy
          false
          sstoreAutoLoad
          false
          LstoreAutoSave
          true
          LstoreBatch
          true
          LstorePruneModifiedRecords
          false
          LstoreRemoteSort
          false
          LstoreRestful
          false
          sstoreRoot
          'rows'
          sstoreSuccessProperty
          'success'
          sstoreTotalProperty
          'totalCount'
          sstoreMessageProperty
          'msg'
          sgridEditable
          false
          sformReadUrl
          do?sc=xworker.web.app.view.extjs.server.DataObjectForm/@read
          sformCreateUrl
          do?sc=xworker.web.app.view.extjs.server.DataObjectForm/@create
          sformUpdateUrl
          do?sc=xworker.web.app.view.extjs.server.DataObjectForm/@update
          sformDestroyUrl
          do?sc=xworker.web.app.view.extjs.server.DataObjectForm/@delete
          spaging_afterPageText
          页 共
          spaging_beforePageText
          第
          Lpaging_displayInfo
          false
          spaging_displayMsg
          第{0}-第{1}条，共{2}条
          spaging_emptyMsg
          没有数据
          spaging_firstText
          首页
          spaging_lastText
          最后一页
          spaging_nextText
          下一页
          Lpaging_prependButtons
          false
          spaging_prevText
          上一页
          spaging_refreshText
          刷新
          sgridColumnLocking
          false
          sgridLockText
          '锁定'
          sgridUnlockText
          '解锁'
          scolumnGroup
          false
          sgridCheckable
          false
          sgridRowNumber
          false
          sgridGrouping
          false
          sgridGroupTextTpl
          '{text} ({[values.rs.length]} 条)'
          sgridRowExpander
          false
          sautoGenerateId
          false
          sidGenerateType
          action
          sidAction
          generateId
          sstoreSortDir
          ASC
          sautoInit
          false
          sautoInitAction
          autoInit
          sdescriptors
          xworker.dataObject.DataObjects/@ListDataObject
          sth_createIndex
          false
          sid
          ListDataObject
            @/@shell/@dataTable/@DataStore/@dataObjects/@ListDataObject/@name
            sname
            name
            slabel
            名称
            spropertyPath
            name
            stype
            string
            soptional
            true
            skey
            false
            sdataField
            true
            sviewField
            true
            sreadField
            true
            screateEditor
            true
            seditEditor
            true
            sviewEditor
            true
            sgridEditor
            true
            squeryEditor
            true
            sreadOnly
            false
            seditable
            true
            sshowLabel
            true
            slabelAlign
            right
            slabelVAlign
            baseline
            svalidateAllowBlank
            true
            LvalidateOnBlur
            true
            LallowDecimals
            true
            LallowNegative
            true
            sshowInTable
            true
            sgridWidth
            145
            sgridFixed
            false
            sgridHidden
            false
            sgridHideable
            true
            sgridSortable
            false
            scolumnLocked
            false
            sgridGroupable
            true
            sgridMenuDisabled
            false
            sgridResizable
            true
            sdescriptors
            xworker.dataObject.java.ListDataObject/@attribute
            sth_createIndex
            false
            sid
            name
            @/@shell/@dataTable/@DataStore/@dataObjects/@ListDataObject/@label
            sname
            label
            slabel
            标签
            spropertyPath
            label
            stype
            string
            soptional
            true
            skey
            false
            sdataField
            true
            sviewField
            true
            sreadField
            true
            screateEditor
            true
            seditEditor
            true
            sviewEditor
            true
            sgridEditor
            true
            squeryEditor
            true
            sreadOnly
            false
            seditable
            true
            sshowLabel
            true
            slabelAlign
            right
            slabelVAlign
            baseline
            svalidateAllowBlank
            true
            LvalidateOnBlur
            true
            LallowDecimals
            true
            LallowNegative
            true
            sshowInTable
            true
            sgridWidth
            145
            sgridFixed
            false
            sgridHidden
            false
            sgridHideable
            true
            sgridSortable
            false
            scolumnLocked
            false
            sgridGroupable
            true
            sgridMenuDisabled
            false
            sgridResizable
            true
            sdescriptors
            xworker.dataObject.java.ListDataObject/@attribute
            sth_createIndex
            false
            sid
            label
        @/@shell/@dataTable/@DataStore/@Listeners
        sname
        Listeners
        sdescriptors
        xworker.swt.app.view.swt.data.DataStore/@Listeners
        sth_createIndex
        false
        sid
        Listeners
          @/@shell/@dataTable/@DataStore/@Listeners/@Listener
          sname
          Listener
          sdescriptors
          xworker.swt.app.view.swt.data.DataStore/@Listeners/@Listener
          sth_createIndex
          false
          sid
          Listener
            @/@shell/@dataTable/@DataStore/@Listeners/@Listener/@actions
            sname
            actions
            sdescriptors
            xworker.swt.app.view.swt.data.DataStore/@Listeners/@Listener/@actions1
            sth_createIndex
            false
            sid
            actions
              @/@shell/@dataTable/@DataStore/@Listeners/@Listener/@actions/@onLoaded
              sname
              onLoaded
              smethod
              disable
              scontrolList
              okButton
              sinterpretationType
              Self
              svarScope
              Local
              sdescriptors
              xworker.swt.actions.ControlActions/@Enabled
              sth_createIndex
              false
              sid
              onLoaded
      @/@shell/@dataTable/@dataTableGridData
      sname
      dataTableGridData
      sstyle
      FILL_BOTH
      shorizontalIndent
      0
      swidth
      -1
      sheight
      -1
      shorizontalAlignment
      BEGINNING
      sverticalAlignment
      CENTER
      shorizontalSpan
      1
      sverticalSpan
      1
      sgrabExcessHorizontalSpace
      false
      sgrabExcessVerticalSpace
      false
      sdescriptors
      xworker.swt.layout.LayoutDatas/@GridData
      sth_createIndex
      false
      sid
      dataTableGridData
      @/@shell/@dataTable/@14627
      sname
      Listeners
      sdescriptors
      xworker.swt.widgets.Widget/@Listeners
      sth_createIndex
      false
      sid
      14627
        @/@shell/@dataTable/@14627/@14628
        sname
        dataTableSelection
        stype
        Selection
        sdescriptors
        xworker.swt.events.Listeners/@listeners/@Listener
        sth_createIndex
        false
        sid
        14628
          @/@shell/@dataTable/@14627/@14628/@Enabled
          sname
          Enabled
          smethod
          enable
          scontrolList
          okButton
          sinterpretationType
          Self
          svarScope
          Local
          sdescriptors
          xworker.swt.actions.ControlActions/@Enabled
          sth_createIndex
          false
          sid
          Enabled
        @/@shell/@dataTable/@14627/@dataTabledefaultSelection
        sname
        dataTabledefaultSelection
        stype
        DefaultSelection
        sref
        okButtonSelection
        sdescriptors
        xworker.swt.events.Listeners/@listeners/@Listener
        sth_createIndex
        false
        sid
        dataTabledefaultSelection
    @/@shell/@12214
    sname
    buttonComposite
    sBORDER
    false
    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
    12214
      @/@shell/@12214/@12215
      sname
      buttonCompositeGridData
      sstyle
      FILL_HORIZONTAL
      shorizontalIndent
      0
      swidth
      -1
      sheight
      -1
      shorizontalAlignment
      END
      sverticalAlignment
      CENTER
      shorizontalSpan
      1
      sverticalSpan
      1
      sgrabExcessHorizontalSpace
      false
      sgrabExcessVerticalSpace
      false
      sdescriptors
      xworker.swt.layout.LayoutDatas/@GridData
      sid
      12215
      @/@shell/@12214/@12216
      sname
      buttonCompositeRowLayout
      sfill
      false
      sjustify
      false
      smarginWidth
      0
      smarginHeight
      0
      smarginLeft
      3
      smarginTop
      3
      smarginRight
      3
      smarginBottom
      3
      spack
      true
      sspacing
      3
      stype
      SWT.HORIZONTAL
      swrap
      true
      sdescriptors
      xworker.swt.Layouts/@RowLayout
      sid
      12216
      @/@shell/@12214/@12217
      sname
      okButton
      stext
      确定
      stype
      SWT.PUSH
      sflat
      false
      sborder
      false
      sselected
      false
      scapture
      false
      senabled
      false
      sredraw
      true
      svisible
      true
      sdescriptors
      xworker.swt.Widgets/@Button
      sth_createIndex
      false
      sid
      12217
        @/@shell/@12214/@12217/@12218
        sname
        RowData
        sexclude
        false
        swidth
        80
        sheight
        -1
        sdescriptors
        xworker.swt.layout.LayoutDatas/@RowData
        sth_createIndex
        false
        sid
        12218
        @/@shell/@12214/@12217/@12219
        sname
        Listeners
        sdescriptors
        xworker.swt.widgets.Widget/@Listeners
        sth_createIndex
        false
        sid
        12219
          @/@shell/@12214/@12217/@12219/@12220
          sname
          okButtonSelection
          stype
          Selection
          sdescriptors
          xworker.swt.events.Listeners/@listeners/@Listener
          sth_createIndex
          false
          sid
          12220
            @/@shell/@12214/@12217/@12219/@12220/@GroovyAction
            sname
            GroovyAction
            sisSynchronized
            false
            sthrowException
            true
            suseOtherAction
            false
            svarScope
            Local
            sdisableGlobalContext
            false
            Scode
#$@text#$@
actionContext.getScope(0).put("result", dataTable.getSelection()[0].getData().get("name"));
shell.dispose();
#$@text#$@
            sdescriptors
            xworker.lang.actions.Actions/@GroovyAction
            sth_createIndex
            false
            sid
            GroovyAction
      @/@shell/@12214/@12221
      sname
      cancelButton
      stext
      取消
      stype
      SWT.PUSH
      sflat
      false
      sborder
      false
      sselected
      false
      scapture
      false
      senabled
      true
      sredraw
      true
      svisible
      true
      sdescriptors
      xworker.swt.Widgets/@Button
      sth_createIndex
      false
      sid
      12221
        @/@shell/@12214/@12221/@12222
        sname
        RowData
        sexclude
        false
        swidth
        80
        sheight
        -1
        sdescriptors
        xworker.swt.layout.LayoutDatas/@RowData
        sth_createIndex
        false
        sid
        12222
        @/@shell/@12214/@12221/@12223
        sname
        Listeners
        sdescriptors
        xworker.swt.widgets.Widget/@Listeners
        sth_createIndex
        false
        sid
        12223
          @/@shell/@12214/@12221/@12223/@12224
          sname
          cancelButtonSelection
          stype
          Selection
          sdescriptors
          xworker.swt.events.Listeners/@listeners/@Listener
          sth_createIndex
          false
          sid
          12224
            @/@shell/@12214/@12221/@12223/@12224/@ShellNormalActions
            sname
            ShellNormalActions
            sshellName
            shell
            smethod
            dispose
            sinterpretationType
            Self
            svarScope
            Local
            sdescriptors
            xworker.swt.actions.ShellActions/@ShellNormalActions1
            sth_createIndex
            false
            sid
            ShellNormalActions
    @/@shell/@init
    sname
    init
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Local
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import org.xmeta.util.UtilString;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;
import org.xmeta.Thing;
import xworker.lang.util.XWorkerUtils;

//参数列表
def params = UtilString.getParams(param, ",");
def indicator = params.dataObjectIndicator;
def attributeThing = null;
//println parentContext.thing;
//println parentContext.thing.parent;
if(indicator == null || indicator == "" || indicator == "self"){
    attributeThing = parentContext.thing.getDescriptor();
}else if(indicator == "parent"){
    attributeThing = parentContext.thing.getParent();
}else if(indicator.startsWith("action:")){
    def action = indicator.substring(7, indicator.length());
    //log.info("action=" + action + ", parentContext=" + parentContext.getLabel());
    attributeThing = parentContext.thing.doAction(action, parentContext);
}else if(indicator.startsWith("parent:")){
    def name = indicator.substring(7, indicator.length());
    attributeThing = XWorkerUtils.getParentVar(actionContext, name);
}else if(indicator.startsWith("thing:")){
    def path = indicator.substring(6, indicator.length());
    attributeThing = world.getThing(path);
}else{
    def values = parentContext.model.doAction("getValue", parentContext);
    //log.info("values=" + values);    
    attributeThing = world.getThing(values.get(indicator));
}

//log.info("attributeThing=" + attributeThing);
if(attributeThing == null || !(attributeThing instanceof Thing)){
    return;
}

def attributes = [];
for(attribute in attributeThing.get("attribute@")){
    def attr = [:];
    attr.name = attribute.metadata.name;
    attr.label = attribute.metadata.label;
    attributes.add(attr);
}

def context = [:];
for(child in attributeThing.get("thing@")){
    def childThing = world.getThing(child.dataObjectPath);
    if(childThing == null){
        continue;
    }
    
    addThingAttribute(child.metadata.name, childThing, attributes, context);
}
actionContext.getScope(0).put("attributes", attributes);
dataStore.doAction("load", actionContext);

def addThingAttribute(name, thing, attributes, context){
    if(context.get(thing.metadata.path) != null){
        return;
    }
    
    context.put(thing.metadata.path, thing);
    
    for(attribute in thing.get("attribute@")){
        def attr = [:];
        attr.name = name + "." + attribute.metadata.name;
        attr.label = attribute.metadata.label;
        attributes.add(attr);
    }
    
    for(child in thing.get("thing@")){
        def childThing = world.getThing(child.dataObjectPath);
        if(childThing == null){
            continue;
        }
        addThingAttribute(name + "." + childThing.metadata.name, childThing, attributes, context);
    }
}
#$@text#$@
    sinterpretationType
    Action
    screateLocalVarScope
    false
    ssaveReturn
    false
    sswitchResult
    false
    sdebugLog
    false
    sdescriptors
    xworker.swt.Widgets/@Code
    sth_createIndex
    false
    sid
    init
