^1661934475389
@
sname
ImportAttributeDialog
slabel
ImportAttributeDialog
sdescriptors
xworker.swt.widgets.Display
  @/@shell
  sname
  shell
  stext
  导入属性
  sNO_TRIM
  false
  sCLOSE
  true
  sTITLE
  true
  sMIN
  true
  sMAX
  true
  sBORDER
  false
  sRESIZE
  true
  sON_TOP
  false
  sTOOL
  false
  sNO_FOCUS
  false
  swidth
  680
  sheight
  500
  scenterScreen
  true
  spack
  false
  smaximized
  false
  sfullScreen
  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
  sid
  shell
    @/@shell/@shellGridLayout
    sname
    shellGridLayout
    smakeColumnsEqualWidth
    false
    smarginWidth
    5
    smarginHeight
    5
    smarginLeft
    0
    smarginTop
    0
    smarginRight
    0
    smarginBottom
    0
    shorizontalSpacing
    5
    sverticalSpacing
    5
    slabel
    shellGridLayout
    sdescriptors
    xworker.swt.Layouts/@GridLayout
    sid
    shellGridLayout
    @/@shell/@selectLabel
    sname
    selectLabel
    sBORDER
    false
    stype
    HORIZONTAL
    sshadow
    SHADOW_OUT
    salignment
    LEFT
    stext
    请选择一个数据对象：
    scapture
    false
    senabled
    true
    sredraw
    true
    svisible
    true
    slabel
    selectLabel
    sdescriptors
    xworker.swt.Widgets/@Label
    sid
    selectLabel
    @/@shell/@form
    sname
    form
    sformType
    edit
    sdescriptors
    xworker.swt.app.view.swt.Items/@DataObjectForm
    sid
    form
      @/@shell/@form/@dataObjects
      sname
      dataObjects
      slabel
      dataObjects
      sdescriptors
      xworker.swt.app.view.swt.widgets.form.DataObjectForm/@DataObjects
      sid
      dataObjects
        @/@shell/@form/@dataObjects/@AbstractDataObject
        sname
        AbstractDataObject
        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/@AbstractDataObject
        sid
        AbstractDataObject
          @/@shell/@form/@dataObjects/@AbstractDataObject/@dataObjectPath
          sname
          dataObjectPath
          slabel
          数据对象路径
          stype
          string
          soptional
          true
          skey
          false
          sdataField
          true
          sviewField
          true
          sreadField
          true
          screateEditor
          true
          seditEditor
          true
          sviewEditor
          true
          sgridEditor
          true
          squeryEditor
          true
          sinputtype
          openWindow
          ssize
          60
          sreadOnly
          false
          seditable
          true
          scolspan
          2
          sshowLabel
          true
          slabelAlign
          right
          slabelVAlign
          baseline
          svalidateAllowBlank
          true
          LvalidateOnBlur
          true
          LallowDecimals
          true
          LallowNegative
          true
          sinputattrs
          xworker.swt.xworker.attributeEditor.openWins.SelectThingOpenWindow/@shell|descriptor=xworker.dataObject.DataObject,returnType=path
          sshowInTable
          true
          sgridFixed
          false
          sgridHidden
          false
          sgridHideable
          true
          sgridSortable
          false
          scolumnLocked
          false
          sgridGroupable
          true
          sgridMenuDisabled
          false
          sgridResizable
          true
          sdescriptors
          xworker.dataObject.AbstractDataObject/@attribute
          sid
          dataObjectPath
            @/@shell/@form/@dataObjects/@AbstractDataObject/@dataObjectPath/@SwtObject
            sname
            SwtObject
            slabel
            SwtObject
            sdescriptors
            xworker.dataObject.AttributeEditConfig/@SwtObject
            sid
            SwtObject
              @/@shell/@form/@dataObjects/@AbstractDataObject/@dataObjectPath/@SwtObject/@inputExtend
              sname
              inputExtend
              slabel
              inputExtend
              sdescriptors
              xworker.dataObject.AttributeEditConfig/@SwtObject/@inputExtend
              sid
              inputExtend
                @/@shell/@form/@dataObjects/@AbstractDataObject/@dataObjectPath/@SwtObject/@inputExtend/@listeners
                sname
                listeners
                slabel
                listeners
                sdescriptors
                xworker.swt.events.Listeners/@listeners
                sid
                listeners
                  @/@shell/@form/@dataObjects/@AbstractDataObject/@dataObjectPath/@SwtObject/@inputExtend/@listeners/@modifyListener
                  sname
                  modifyListener
                  stype
                  Modify
                  slabel
                  modifyListener
                  sdescriptors
                  xworker.swt.events.Listeners/@listeners/@Listener
                  sid
                  modifyListener
                    @/@shell/@form/@dataObjects/@AbstractDataObject/@dataObjectPath/@SwtObject/@inputExtend/@listeners/@modifyListener/@thingModified
                    sname
                    thingModified
                    sisSynchronized
                    false
                    sthrowException
                    true
                    suseOtherAction
                    false
                    svarScope
                    Local
                    sdisableGlobalContext
                    false
                    Scode
#$@text#$@
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.TableItem;

def dataObject = world.getThing(event.widget.getText());
if(dataObject != null){
    for(item in parentContext.dataTable.getItems()){
        item.dispose();
    }
    
    for(child in dataObject.getChilds()){
        TableItem item = new TableItem(parentContext.dataTable, SWT.NONE);
        item.setText([child.thingName, child.metadata.name, child.metadata.label, child.metadata.path] as String[]);
        item.setData(child);
    }
}
#$@text#$@
                    sdescriptors
                    xworker.lang.actions.Actions/@GroovyAction
                    sid
                    thingModified
      @/@shell/@form/@formGridData
      sname
      formGridData
      sstyle
      FILL_HORIZONTAL
      shorizontalIndent
      0
      swidth
      -1
      sheight
      -1
      shorizontalAlignment
      BEGINNING
      sverticalAlignment
      CENTER
      shorizontalSpan
      1
      sverticalSpan
      1
      sgrabExcessHorizontalSpace
      false
      sgrabExcessVerticalSpace
      false
      slabel
      formGridData
      sdescriptors
      xworker.swt.layout.LayoutDatas/@GridData
      sid
      formGridData
    @/@shell/@dataTable
    sname
    dataTable
    sselectStyle
    SINGLE
    sV_SCROLL
    true
    sH_SCROLL
    true
    sCHECK
    true
    sFULL_SELECTION
    true
    sHIDE_SELECTION
    true
    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
    slabel
    dataTable
    sdescriptors
    xworker.swt.Widgets/@Table
    sid
    dataTable
      @/@shell/@dataTable/@store
      sname
      store
      sattachToParent
      true
      sloadBackground
      true
      sautoLoad
      false
      sautoSave
      false
      spaging
      extend
      spageSize
      50
      sstoreSortField
      _extend
      sstoreSortDir
      ASC
      seditable
      extend
      seditmethod
      extend
      slabel
      store
      sdescriptors
      xworker.swt.widgets.Table/@DataStore
      sid
      store
        @/@shell/@dataTable/@store/@dataObjects
        sname
        dataObjects
        slabel
        dataObjects
        sdescriptors
        xworker.swt.app.view.swt.data.DataStore/@DataObjects
        sid
        dataObjects
          @/@shell/@dataTable/@store/@dataObjects/@AbstractDataObject
          sname
          AbstractDataObject
          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/@AbstractDataObject
          sid
          AbstractDataObject
            @/@shell/@dataTable/@store/@dataObjects/@AbstractDataObject/@type
            sname
            type
            slabel
            类型
            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
            sgridFixed
            false
            sgridHidden
            false
            sgridHideable
            true
            sgridSortable
            false
            scolumnLocked
            false
            sgridGroupable
            true
            sgridMenuDisabled
            false
            sgridResizable
            true
            sdescriptors
            xworker.dataObject.AbstractDataObject/@attribute
            sid
            type
            @/@shell/@dataTable/@store/@dataObjects/@AbstractDataObject/@name
            sname
            name
            slabel
            名称
            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
            120
            sgridFixed
            false
            sgridHidden
            false
            sgridHideable
            true
            sgridSortable
            false
            scolumnLocked
            false
            sgridGroupable
            true
            sgridMenuDisabled
            false
            sgridResizable
            true
            sdescriptors
            xworker.dataObject.AbstractDataObject/@attribute
            sid
            name
            @/@shell/@dataTable/@store/@dataObjects/@AbstractDataObject/@label
            sname
            label
            slabel
            标签
            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
            120
            sgridFixed
            false
            sgridHidden
            false
            sgridHideable
            true
            sgridSortable
            false
            scolumnLocked
            false
            sgridGroupable
            true
            sgridMenuDisabled
            false
            sgridResizable
            true
            sdescriptors
            xworker.dataObject.AbstractDataObject/@attribute
            sid
            label
            @/@shell/@dataTable/@store/@dataObjects/@AbstractDataObject/@path
            sname
            path
            slabel
            路径
            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
            400
            sgridFixed
            false
            sgridHidden
            false
            sgridHideable
            true
            sgridSortable
            false
            scolumnLocked
            false
            sgridGroupable
            true
            sgridMenuDisabled
            false
            sgridResizable
            true
            sdescriptors
            xworker.dataObject.AbstractDataObject/@attribute
            sid
            path
      @/@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
      slabel
      dataTableGridData
      sdescriptors
      xworker.swt.layout.LayoutDatas/@GridData
      sid
      dataTableGridData
    @/@shell/@3252
    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
    3252
      @/@shell/@3252/@3253
      sname
      buttonCompositeGridData
      sstyle
      FILL_HORIZONTAL
      shorizontalIndent
      0
      swidth
      -1
      sheight
      -1
      shorizontalAlignment
      END
      sverticalAlignment
      CENTER
      shorizontalSpan
      1
      sverticalSpan
      1
      sgrabExcessHorizontalSpace
      false
      sgrabExcessVerticalSpace
      false
      slabel
      buttonCompositeGridData
      sdescriptors
      xworker.swt.layout.LayoutDatas/@GridData
      sid
      3253
      @/@shell/@3252/@3254
      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
      slabel
      buttonCompositeRowLayout
      sdescriptors
      xworker.swt.Layouts/@RowLayout
      sid
      3254
      @/@shell/@3252/@3255
      sname
      importButton
      stext
      lang:d=导入&en=Import
      stype
      SWT.PUSH
      sflat
      false
      sborder
      false
      sselected
      false
      scapture
      false
      senabled
      true
      sredraw
      true
      spack
      false
      svisible
      true
      slabel
      importButton
      sdescriptors
      xworker.swt.Widgets/@Button
      sid
      3255
        @/@shell/@3252/@3255/@3256
        sname
        RowData
        sexclude
        false
        swidth
        -1
        sheight
        -1
        slabel
        RowData
        sdescriptors
        xworker.swt.layout.LayoutDatas/@RowData
        sid
        3256
        @/@shell/@3252/@3255/@3257
        sname
        Listeners
        slabel
        Listeners
        sdescriptors
        xworker.swt.widgets.Widget/@Listeners
        sid
        3257
          @/@shell/@3252/@3255/@3257/@3258
          sname
          importButtonSelection
          stype
          Selection
          slabel
          importButtonSelection
          sdescriptors
          xworker.swt.events.Listeners/@listeners/@Listener
          sid
          3258
            @/@shell/@3252/@3255/@3257/@3258/@GroovyAction
            sname
            GroovyAction
            sisSynchronized
            false
            sthrowException
            true
            suseOtherAction
            false
            svarScope
            Local
            sdisableGlobalContext
            false
            Scode
#$@text#$@
import org.xmeta.Thing;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.MessageBox;

def attributeDesc = thing.getDescriptor().doAction("getAttributeDescriptor", actionContext);

for(item in dataTable.getItems()){ 
    if(item.getChecked()){
        def itemThing = item.getData().detach();
        thing.addChild(itemThing);
        def treeItem = thingContext.get("innerOutline").getSelection()[0];
        def childTreeItem = new TreeItem(treeItem, SWT.NONE);
        childTreeItem.setText(itemThing.metadata.label + " (" + itemThing.thingName + ")");
        childTreeItem.setData(itemThing);
    }
}

def box = new MessageBox(shell, SWT.ICON_INFORMATION | SWT.OK);
box.setText("提示");
box.setMessage("导入成功");
box.open();
#$@text#$@
            sinterpretationType
            Action
            screateLocalVarScope
            false
            ssaveReturn
            false
            sdescriptors
            xworker.lang.actions.Actions/@GroovyAction
            sid
            GroovyAction
      @/@shell/@3252/@6379
      sname
      importGroupBtn
      stext
      lang:d=导入分组属性&en=Import Group Attribute
      stype
      SWT.PUSH
      sflat
      false
      sborder
      false
      sselected
      false
      scapture
      false
      senabled
      true
      sredraw
      true
      spack
      false
      svisible
      true
      slabel
      importGroupBtn
      sdescriptors
      xworker.swt.Widgets/@Button
      sid
      6379
        @/@shell/@3252/@6379/@6380
        sname
        RowData
        sexclude
        false
        swidth
        -1
        sheight
        -1
        slabel
        RowData
        sdescriptors
        xworker.swt.layout.LayoutDatas/@RowData
        sid
        6380
        @/@shell/@3252/@6379/@6381
        sname
        Listeners
        slabel
        Listeners
        sdescriptors
        xworker.swt.widgets.Widget/@Listeners
        sid
        6381
          @/@shell/@3252/@6379/@6381/@6382
          sname
          importGroupBtnSelection
          stype
          Selection
          slabel
          importGroupBtnSelection
          sdescriptors
          xworker.swt.events.Listeners/@listeners/@Listener
          sid
          6382
            @/@shell/@3252/@6379/@6381/@6382/@GroovyAction
            sname
            GroovyAction
            sisSynchronized
            false
            sthrowException
            true
            suseOtherAction
            false
            svarScope
            Local
            sdisableGlobalContext
            false
            Scode
#$@text#$@
import org.xmeta.Thing;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.MessageBox;

//选择的数据对象
def formValues = form.doAction("getValues", actionContext);
def dataObject = world.getThing(formValues.get("dataObjectPath"));
if(dataObject == null){
    def box = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
    box.setText("提示");
    box.setMessage("请先选择一个正确的数据对象。");
    box.open();
    return;
}

def attributeDesc = thing.getDescriptor().doAction("getAttributeDescriptor", actionContext);

//分组属性
def groupAttr = null;
for(child in thing.getChilds()){
    if(child.thingName == "attribute" && child.name == "groupColumns"){
        groupAttr = child;
        break;
    }
}
if(groupAttr == null){
    groupAttr = new Thing(attributeDesc);
    groupAttr.set("name", "groupColumns");
    groupAttr.set("label", "分组");
    groupAttr.set("inputtype", "select");
    thing.addChild(groupAttr);
    
    def treeItem = thingContext.get("innerOutline").getSelection()[0];
    def childTreeItem = new TreeItem(treeItem, SWT.NONE);
    childTreeItem.setText(groupAttr.metadata.label + " (" + groupAttr.thingName + ")");
    childTreeItem.setData(groupAttr);
}

//分组属性的可选值
for(objChild in dataObject.getChilds()){ 
    if(objChild.thingName == "group"){
        def groupName = objChild.name;
        boolean have = false;
        for(child in groupAttr.get("value@")){
            if(child.name == groupName){
                have = true;
                break;
            }
        }
        if(!have){
             def groupValue = new Thing(attributeDesc + "/@value");
             groupValue.name = groupName;
             groupValue.value = groupName;
             groupValue.label = objChild.label;
             groupAttr.addChild(groupValue);
             
             def treeItem = thingContext.get("innerOutline").getSelection()[0];
             for(item in treeItem.getItems()){
                 if(item.getData().thingName == "attribute" && item.getData().name == "groupColumns"){
                     treeItem = item;
                     break;
                 }
             }
             if(treeItem != null){
                 def childTreeItem = new TreeItem(treeItem, SWT.NONE);
                 childTreeItem.setText(groupValue.metadata.label + " (" + groupValue.thingName + ")");
                 childTreeItem.setData(groupValue);
             }
        }
    }
}

def box = new MessageBox(shell, SWT.ICON_INFORMATION | SWT.OK);
box.setText("提示");
box.setMessage("导入成功");
box.open();
#$@text#$@
            sinterpretationType
            Action
            screateLocalVarScope
            false
            ssaveReturn
            false
            sdescriptors
            xworker.lang.actions.Actions/@GroovyAction
            sid
            GroovyAction
      @/@shell/@3252/@6383
      sname
      importAggrateBtn
      stext
      lang:d=导入聚合属性&en=Import Project Attribute
      stype
      SWT.PUSH
      sflat
      false
      sborder
      false
      sselected
      false
      scapture
      false
      senabled
      true
      sredraw
      true
      spack
      false
      svisible
      true
      slabel
      importAggrateBtn
      sdescriptors
      xworker.swt.Widgets/@Button
      sid
      6383
        @/@shell/@3252/@6383/@6384
        sname
        RowData
        sexclude
        false
        swidth
        -1
        sheight
        -1
        slabel
        RowData
        sdescriptors
        xworker.swt.layout.LayoutDatas/@RowData
        sid
        6384
        @/@shell/@3252/@6383/@6385
        sname
        Listeners
        slabel
        Listeners
        sdescriptors
        xworker.swt.widgets.Widget/@Listeners
        sid
        6385
          @/@shell/@3252/@6383/@6385/@6386
          sname
          importAggrateBtnSelection
          stype
          Selection
          slabel
          importAggrateBtnSelection
          sdescriptors
          xworker.swt.events.Listeners/@listeners/@Listener
          sid
          6386
            @/@shell/@3252/@6383/@6385/@6386/@GroovyAction
            sname
            GroovyAction
            sisSynchronized
            false
            sthrowException
            true
            suseOtherAction
            false
            svarScope
            Local
            sdisableGlobalContext
            false
            Scode
#$@text#$@
import org.xmeta.Thing;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.MessageBox;

//选择的数据对象
def formValues = form.doAction("getValues", actionContext);
def dataObject = world.getThing(formValues.get("dataObjectPath"));
if(dataObject == null){
    def box = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
    box.setText("提示");
    box.setMessage("请先选择一个正确的数据对象。");
    box.open();
    return;
}

def attributeDesc = thing.getDescriptor().doAction("getAttributeDescriptor", actionContext);

//分组属性
def groupAttr = null;
for(child in thing.getChilds()){
    if(child.thingName == "attribute" && child.name == "aggregateColumns"){
        groupAttr = child;
        break;
    }
}
if(groupAttr == null){
    groupAttr = new Thing(attributeDesc);
    groupAttr.set("name", "aggregateColumns");
    groupAttr.set("label", "统计");
    groupAttr.set("inputtype", "select");
    thing.addChild(groupAttr);
    
    def treeItem = thingContext.get("innerOutline").getSelection()[0];
    def childTreeItem = new TreeItem(treeItem, SWT.NONE);
    childTreeItem.setText(groupAttr.metadata.label + " (" + groupAttr.thingName + ")");
    childTreeItem.setData(groupAttr);
}

//分组属性的可选值
for(objChild in dataObject.getChilds()){ 
    if(objChild.thingName == "aggregate"){
        def groupName = objChild.name;
        boolean have = false;
        for(child in groupAttr.get("value@")){
            if(child.name == groupName){
                have = true;
                break;
            }
        }
        if(!have){
             def groupValue = new Thing(attributeDesc + "/@value");
             groupValue.name = groupName;
             groupValue.value = groupName;
             groupValue.label = objChild.label;
             groupAttr.addChild(groupValue);
             
             def treeItem = thingContext.get("innerOutline").getSelection()[0];
             for(item in treeItem.getItems()){
                 if(item.getData().thingName == "attribute" && item.getData().name == "aggregateColumns"){
                     treeItem = item;
                     break;
                 }
             }
             if(treeItem != null){
                 def childTreeItem = new TreeItem(treeItem, SWT.NONE);
                 childTreeItem.setText(groupValue.metadata.label + " (" + groupValue.thingName + ")");
                 childTreeItem.setData(groupValue);
             }
        }
    }
}

def box = new MessageBox(shell, SWT.ICON_INFORMATION | SWT.OK);
box.setText("提示");
box.setMessage("导入成功");
box.open();
#$@text#$@
            sinterpretationType
            Action
            screateLocalVarScope
            false
            ssaveReturn
            false
            sdescriptors
            xworker.lang.actions.Actions/@GroovyAction
            sid
            GroovyAction
      @/@shell/@3252/@3259
      sname
      closeButton
      stext
      lang:d=关闭&en=Close
      stype
      SWT.PUSH
      sflat
      false
      sborder
      false
      sselected
      false
      scapture
      false
      senabled
      true
      sredraw
      true
      spack
      false
      svisible
      true
      slabel
      closeButton
      sdescriptors
      xworker.swt.Widgets/@Button
      sid
      3259
        @/@shell/@3252/@3259/@3260
        sname
        RowData
        sexclude
        false
        swidth
        80
        sheight
        -1
        slabel
        RowData
        sdescriptors
        xworker.swt.layout.LayoutDatas/@RowData
        sid
        3260
        @/@shell/@3252/@3259/@3261
        sname
        Listeners
        slabel
        Listeners
        sdescriptors
        xworker.swt.widgets.Widget/@Listeners
        sid
        3261
          @/@shell/@3252/@3259/@3261/@3262
          sname
          closeButtonSelection
          stype
          Selection
          slabel
          closeButtonSelection
          sdescriptors
          xworker.swt.events.Listeners/@listeners/@Listener
          sid
          3262
            @/@shell/@3252/@3259/@3261/@3262/@shellDispose
            sname
            shellDispose
            sshellName
            shell
            smethod
            dispose
            sinterpretationType
            Self
            svarScope
            Local
            sdescriptors
            xworker.swt.actions.ShellActions/@ShellNormalActions1
            sid
            shellDispose
    @/@shell/@init
    sname
    init
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Local
    sdisableGlobalContext
    false
    Scode
#$@text#$@
//查看当前正在编辑的事物有没有设置dataObject
def dataObject = currentThing.getStringBlankAsNull("dataObject");
if(dataObject != null){
    form.doAction("setValues", actionContext, ["values":["dataObjectPath":dataObject]]);
}
#$@text#$@
    sinterpretationType
    Action
    screateLocalVarScope
    false
    ssaveReturn
    false
    sdebugLog
    false
    sdescriptors
    xworker.swt.widgets.Widget/@Code
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    init
