^1640696289520
@
sname
ThingRelationDialog
slabel
ThingRelationDialog
sdescriptors
xworker.swt.widgets.Display
  @/@shell
  sname
  shell
  stext
  label:xworker.swt.ide.worldexplorer.swt.i18n.I18nResource/@thingRelationDialog
  sNO_TRIM
  false
  sCLOSE
  true
  sTITLE
  true
  sMIN
  true
  sMAX
  true
  sBORDER
  false
  sRESIZE
  true
  sON_TOP
  false
  sTOOL
  false
  sNO_FOCUS
  false
  swidth
  800
  sheight
  600
  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/@coolBar
    sname
    coolBar
    stype
    HORIZONTAL
    sBORDER
    false
    sFLAT
    false
    slabel
    coolBar
    sdescriptors
    xworker.swt.Widgets/@CoolBar
    sid
    coolBar
      @/@shell/@coolBar/@coolItem
      sname
      coolItem
      sDROP_DOWN
      false
      slabel
      coolItem
      sdescriptors
      xworker.swt.widgets.CoolBar/@CoolItem
      sid
      coolItem
        @/@shell/@coolBar/@coolItem/@toolBar
        sname
        toolBar
        stype
        HORIZONTAL
        sFLAT
        true
        sWRAP
        false
        sBORDER
        false
        sSHADOW_OUT
        false
        sRIGHT
        false
        slabel
        toolBar
        sdescriptors
        xworker.swt.widgets.CoolBar/@CoolItem/@ToolBar
        sid
        toolBar
          @/@shell/@coolBar/@coolItem/@toolBar/@refreshButton
          sname
          closeButton
          stype
          PUSH
          stext
          label:xworker.swt.ide.worldexplorer.swt.i18n.I18nResource/@thingRelationDialog/@closeButton
          senabled
          true
          slabel
          refreshButton
          sdescriptors
          xworker.swt.widgets.ToolBar/@ToolItem
          sid
          refreshButton
            @/@shell/@coolBar/@coolItem/@toolBar/@refreshButton/@listeners
            sname
            listeners
            slabel
            listeners
            sdescriptors
            xworker.swt.events.Listeners/@listeners
            sid
            listeners
              @/@shell/@coolBar/@coolItem/@toolBar/@refreshButton/@listeners/@refreshButtonSeleciton
              sname
              closeButtonSeleciton
              stype
              Selection
              slabel
              refreshButtonSeleciton
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sid
              refreshButtonSeleciton
                @/@shell/@coolBar/@coolItem/@toolBar/@refreshButton/@listeners/@refreshButtonSeleciton/@GroovyAction
                sname
                GroovyAction
                sisSynchronized
                false
                sthrowException
                true
                suseOtherAction
                false
                svarScope
                Global
                sdisableGlobalContext
                false
                scode
                shell.dispose();
                sdescriptors
                xworker.lang.actions.Actions/@GroovyAction
                sid
                GroovyAction
      @/@shell/@coolBar/@coolBarGirdData
      sname
      coolBarGirdData
      sstyle
      FILL_HORIZONTAL
      shorizontalIndent
      0
      swidth
      -1
      sheight
      -1
      shorizontalAlignment
      BEGINNING
      sverticalAlignment
      CENTER
      shorizontalSpan
      1
      sverticalSpan
      1
      sgrabExcessHorizontalSpace
      false
      sgrabExcessVerticalSpace
      false
      slabel
      coolBarGirdData
      sdescriptors
      xworker.swt.Commons/@GridData
      sid
      coolBarGirdData
    @/@shell/@mainSash
    sname
    mainSash
    sstyle
    HORIZONTAL
    sSMOOTH
    false
    sweights
    30,70
    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/@SashForm
    sid
    mainSash
      @/@shell/@mainSash/@menuComposite
      sname
      menuComposite
      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
      menuComposite
        @/@shell/@mainSash/@menuComposite/@menuCompositeGridLayout
        sname
        menuCompositeGridLayout
        smakeColumnsEqualWidth
        false
        smarginWidth
        0
        smarginHeight
        0
        smarginLeft
        0
        smarginTop
        0
        smarginRight
        0
        smarginBottom
        0
        shorizontalSpacing
        5
        sverticalSpacing
        5
        slabel
        menuCompositeGridLayout
        sdescriptors
        xworker.swt.Layouts/@GridLayout
        sid
        menuCompositeGridLayout
        @/@shell/@mainSash/@menuComposite/@menuTree
        sname
        menuTree
        sselectStyle
        SINGLE
        sV_SCROLL
        true
        sH_SCROLL
        true
        sCHECK
        false
        sFULL_SELECTION
        false
        sHIDE_SELECTION
        false
        sBORDER
        true
        slineVisible
        false
        smultipleColumns
        false
        sheaderVisible
        false
        ssortIndicator
        false
        smoveableColumns
        false
        sheadImages
        false
        ssubImages
        false
        slabel
        menuTree
        sdescriptors
        xworker.swt.Widgets/@Tree
        sid
        menuTree
          @/@shell/@mainSash/@menuComposite/@menuTree/@listeners
          sname
          listeners
          slabel
          listeners
          sdescriptors
          xworker.swt.events.Listeners/@listeners
          sid
          listeners
            @/@shell/@mainSash/@menuComposite/@menuTree/@listeners/@menuTreeSelection
            sname
            menuTreeSelection
            stype
            Selection
            slabel
            menuTreeSelection
            sdescriptors
            xworker.swt.events.Listeners/@listeners/@Listener
            sid
            menuTreeSelection
              @/@shell/@mainSash/@menuComposite/@menuTree/@listeners/@menuTreeSelection/@GroovyAction
              sname
              GroovyAction
              sisSynchronized
              false
              sthrowException
              true
              suseOtherAction
              false
              svarScope
              Global
              sdisableGlobalContext
              false
              Scode
#$@text#$@
import org.xmeta.ActionContext;
import org.xmeta.Thing;

//获取当前选中的节点
def item = menuTree.getSelection()[0];
treeItem = item;
relationThing = item.getData();

//获得节点中的数据
def data = item.getData();
if(data.thingName == "ThingRelation" || data.thingName == "Category"){
    mainCompositeStackLayout.topControl = browser;
    mainComposite.layout();
    openUrl("do?sc=xworker.ide.worldexplorer.swt.http.ThingDoc/@desc&thing=" + data.metadata.path, false);
}else if(data.thingName == "UI"){
    if(item.getData("composite") != null){
        mainCompositeStackLayout.topControl = item.getData("composite");
        mainComposite.layout();
    }else{
        def newAcContext = new ActionContext();
        newAcContext.putAll(actionContext);
        newAcContext.put("parent", mainComposite);
        def composite = data.doAction("createUI", newAcContext);
        if(composite != null){
            item.setData("composite", composite);
            mainCompositeStackLayout.topControl = composite;
            mainComposite.layout();
        }
    }
}else if(data.thingName == "Action"){
    openAction(data);
}

return;
if(data != null){
    if(data.value instanceof Thing){
        pathLabel.setText(data.value.metadata.path);
        pathLabel.update();
    }else{
        pathLabel.setText("");
        pathLabel.update();
    }
    
    if(data.type == "note"){
        openUrl("do?sc=xworker.web.thingNote.ThingNote/@index&path=" + data.value.metadata.path, false);
    }else if(data.type == "doc"){
        openUrl("do?sc=xworker.ide.worldexplorer.swt.http.ThingDoc/@view&thing=" + data.value.metadata.path, false);
    }else if(data.type == "templateDescription"){
        for(treeItem in listTree.getItems()){
            treeItem.dispose();
        }
        def context = [:];
        for(descriptor in thing.getAllDescriptors()){
            actions.doAction("initListTree", ["descriptor":descriptor, "type":"template", "context":context]);
        }
        
        leditExampleButton.setEnabled(false);
        leditButton.setEnabled(false);
        lopenButton.setEnabled(false);
        mainCompositeStackLayout.topControl = listComposite;
        mainComposite.layout();
    }else if(data.type == "template"){
        for(treeItem in listTree.getItems()){
            treeItem.dispose();
        }
        actions.doAction("initListTree", ["descriptor":data.value, "type":"template", "context":[:]]);
        leditExampleButton.setEnabled(false);
        leditButton.setEnabled(false);
        lopenButton.setEnabled(false);
        mainCompositeStackLayout.topControl = listComposite;
        mainComposite.layout();
    }else if(data.type == "guideDescription"){
        for(treeItem in listTree.getItems()){
            treeItem.dispose();
        }
        def context = [:];
        for(descriptor in thing.getAllDescriptors()){
            actions.doAction("initListTree", ["descriptor":descriptor, "type":"guide", "context":context]);
        }
        mainCompositeStackLayout.topControl = listComposite;
        mainComposite.layout();
    }else if(data.type == "guide"){
        for(treeItem in listTree.getItems()){
            treeItem.dispose();
        }
        actions.doAction("initListTree", ["descriptor":data.value, "type":"guide", "context":[:]]);
        mainCompositeStackLayout.topControl = listComposite;
        mainComposite.layout();
    }else if(data.type == "xworker.exampleAll"){
        for(treeItem in listTree.getItems()){
            treeItem.dispose();
        }
        def context = [:];
        for(descriptor in thing.getAllDescriptors()){
            actions.doAction("initListTree", ["descriptor":descriptor, "type":"xworker.example", "context":context]);
        }
        leditExampleButton.setEnabled(false);
        leditButton.setEnabled(false);
        lopenButton.setEnabled(false);
        mainCompositeStackLayout.topControl = listComposite;
        mainComposite.layout();
    }else if(data.type == "xworker.example"){
        for(treeItem in listTree.getItems()){
            treeItem.dispose();
        }        
        actions.doAction("initListTree", ["descriptor":data.value, "type":"xworker.example", "context":[:]]);
        leditExampleButton.setEnabled(false);
        leditButton.setEnabled(false);
        lopenButton.setEnabled(false);
        mainCompositeStackLayout.topControl = listComposite;
        mainComposite.layout();
    }else if(data.type == "noteDescription"){
        openUrl("do?sc=xworker.web.thingNote.ThingNote/@index", false);
    }else if(data.type == "docDescription"){
        openUrl("do?sc=xworker.ide.worldexplorer.swt.http.ThingDoc/@desc&thing=xworker.ide.worldexplorer.swt.http.ThingDoc/@view", false);
    }else if(data.type == "thingDesc"){
        openUrl("do?sc=xworker.ide.worldexplorer.swt.http.ThingDoc/@desc&thing=" + data.value.metadata.path, false);
    }
}else{
    mainCompositeStackLayout.topControl = blankComposite;
    mainComposite.layout();
}

def openUrl(url, isOuterUrl){
    if(isOuterUrl){
        browser.setUrl(url);
    }else{
        def globalCfg = world.getThing("_local.xworker.config.GlobalConfig");
        browser.setUrl(globalCfg.webUrl + url);
    }
        
    mainCompositeStackLayout.topControl = browser;
    mainComposite.layout();
}

def openAction(actionThing){
    def globalCfg = world.getThing("_local.xworker.config.GlobalConfig");
    actionBrowser.setUrl(globalCfg.webUrl + "do?sc=xworker.ide.worldexplorer.swt.http.ThingDoc/@desc&thing=" + actionThing.metadata.path);
    mainCompositeStackLayout.topControl = actionComposite;
    mainComposite.layout();    
}
#$@text#$@
              sdescriptors
              xworker.lang.actions.Actions/@GroovyAction
              sid
              GroovyAction
          @/@shell/@mainSash/@menuComposite/@menuTree/@menuTreeGridData
          sname
          menuTreeGridData
          sstyle
          FILL_BOTH
          shorizontalIndent
          0
          swidth
          -1
          sheight
          -1
          shorizontalAlignment
          BEGINNING
          sverticalAlignment
          CENTER
          shorizontalSpan
          1
          sverticalSpan
          1
          sgrabExcessHorizontalSpace
          false
          sgrabExcessVerticalSpace
          false
          slabel
          menuTreeGridData
          sdescriptors
          xworker.swt.Commons/@GridData
          sid
          menuTreeGridData
      @/@shell/@mainSash/@mainPanel
      sname
      mainPanel
      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
      mainPanel
        @/@shell/@mainSash/@mainPanel/@mianPanelGridLayout
        sname
        mianPanelGridLayout
        snumColumns
        2
        smakeColumnsEqualWidth
        false
        smarginWidth
        0
        smarginHeight
        0
        smarginLeft
        0
        smarginTop
        0
        smarginRight
        0
        smarginBottom
        0
        shorizontalSpacing
        5
        sverticalSpacing
        5
        slabel
        mianPanelGridLayout
        sdescriptors
        xworker.swt.Layouts/@GridLayout
        sid
        mianPanelGridLayout
        @/@shell/@mainSash/@mainPanel/@mainComposite
        sname
        mainComposite
        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
        mainComposite
          @/@shell/@mainSash/@mainPanel/@mainComposite/@mainCompositeGridData
          sname
          mainCompositeGridData
          sstyle
          FILL_BOTH
          shorizontalIndent
          0
          swidth
          -1
          sheight
          -1
          shorizontalAlignment
          BEGINNING
          sverticalAlignment
          CENTER
          shorizontalSpan
          2
          sverticalSpan
          1
          sgrabExcessHorizontalSpace
          false
          sgrabExcessVerticalSpace
          false
          slabel
          mainCompositeGridData
          sdescriptors
          xworker.swt.layout.LayoutDatas/@GridData
          sid
          mainCompositeGridData
          @/@shell/@mainSash/@mainPanel/@mainComposite/@browser
          sname
          browser
          sMOZILLA
          false
          slabel
          browser
          sdescriptors
          xworker.swt.Widgets/@Browser
          sid
          browser
          @/@shell/@mainSash/@mainPanel/@mainComposite/@blankComposite
          sname
          blankComposite
          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
          blankComposite
          @/@shell/@mainSash/@mainPanel/@mainComposite/@actionComposite
          sname
          actionComposite
          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
          actionComposite
            @/@shell/@mainSash/@mainPanel/@mainComposite/@actionComposite/@actionCompositeGridLayout
            sname
            actionCompositeGridLayout
            snumColumns
            1
            smakeColumnsEqualWidth
            false
            smarginWidth
            5
            smarginHeight
            5
            smarginLeft
            0
            smarginTop
            0
            smarginRight
            0
            smarginBottom
            0
            shorizontalSpacing
            5
            sverticalSpacing
            5
            slabel
            actionCompositeGridLayout
            sdescriptors
            xworker.swt.Layouts/@GridLayout
            sid
            actionCompositeGridLayout
            @/@shell/@mainSash/@mainPanel/@mainComposite/@actionComposite/@actionBrowser
            sname
            actionBrowser
            sMOZILLA
            false
            slabel
            actionBrowser
            sdescriptors
            xworker.swt.Widgets/@Browser
            sid
            actionBrowser
              @/@shell/@mainSash/@mainPanel/@mainComposite/@actionComposite/@actionBrowser/@actionBrowserGridData
              sname
              actionBrowserGridData
              sstyle
              FILL_BOTH
              shorizontalIndent
              0
              swidth
              -1
              sheight
              -1
              shorizontalAlignment
              BEGINNING
              sverticalAlignment
              CENTER
              shorizontalSpan
              1
              sverticalSpan
              1
              sgrabExcessHorizontalSpace
              false
              sgrabExcessVerticalSpace
              false
              slabel
              actionBrowserGridData
              sdescriptors
              xworker.swt.layout.LayoutDatas/@GridData
              sid
              actionBrowserGridData
            @/@shell/@mainSash/@mainPanel/@mainComposite/@actionComposite/@buttonComposite
            sname
            actionButtonComposite
            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
            buttonComposite
              @/@shell/@mainSash/@mainPanel/@mainComposite/@actionComposite/@buttonComposite/@actionButtonCompositeGridData
              sname
              actionButtonCompositeGridData
              sstyle
              FILL_HORIZONTAL
              shorizontalIndent
              0
              swidth
              -1
              sheight
              -1
              shorizontalAlignment
              END
              sverticalAlignment
              CENTER
              shorizontalSpan
              1
              sverticalSpan
              1
              sgrabExcessHorizontalSpace
              false
              sgrabExcessVerticalSpace
              false
              slabel
              actionButtonCompositeGridData
              sdescriptors
              xworker.swt.layout.LayoutDatas/@GridData
              sid
              actionButtonCompositeGridData
              @/@shell/@mainSash/@mainPanel/@mainComposite/@actionComposite/@buttonComposite/@actionExecuteButton
              sname
              actionExecuteButton
              stext
              执行
              stype
              SWT.PUSH
              sflat
              false
              sborder
              false
              sselected
              false
              scapture
              false
              senabled
              true
              sredraw
              true
              svisible
              true
              slabel
              actionExecuteButton
              sdescriptors
              xworker.swt.Widgets/@Button
              sid
              actionExecuteButton
                @/@shell/@mainSash/@mainPanel/@mainComposite/@actionComposite/@buttonComposite/@actionExecuteButton/@Listeners
                sname
                Listeners
                slabel
                Listeners
                sdescriptors
                xworker.swt.widgets.Widget/@Listeners
                sid
                Listeners
                  @/@shell/@mainSash/@mainPanel/@mainComposite/@actionComposite/@buttonComposite/@actionExecuteButton/@Listeners/@actionExecuteButtonselection
                  sname
                  actionExecuteButtonselection
                  stype
                  Selection
                  sref
                  xworker.swt.ide.worldexplorer.swt.dialogs.ThingRelationDialog/@shell/@actions/@executeAction
                  slabel
                  actionExecuteButtonselection
                  sdescriptors
                  xworker.swt.events.Listeners/@listeners/@Listener
                  sid
                  actionExecuteButtonselection
              @/@shell/@mainSash/@mainPanel/@mainComposite/@actionComposite/@buttonComposite/@buttonCompositeRowLayout
              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
              buttonCompositeRowLayout
          @/@shell/@mainSash/@mainPanel/@mainComposite/@mainCompositeStackLayout
          sname
          mainCompositeStackLayout
          stopControl
          browser
          slabel
          mainCompositeStackLayout
          sdescriptors
          xworker.swt.Layouts/@StackLayout
          sid
          mainCompositeStackLayout
      @/@shell/@mainSash/@mainSashGridData
      sname
      mainSashGridData
      sstyle
      FILL_BOTH
      shorizontalIndent
      0
      swidth
      -1
      sheight
      -1
      shorizontalAlignment
      BEGINNING
      sverticalAlignment
      CENTER
      shorizontalSpan
      1
      sverticalSpan
      1
      sgrabExcessHorizontalSpace
      false
      sgrabExcessVerticalSpace
      false
      slabel
      mainSashGridData
      sdescriptors
      xworker.swt.layout.LayoutDatas/@GridData
      sid
      mainSashGridData
    @/@shell/@actions
    sname
    actions
    slabel
    actions
    sdescriptors
    xworker.swt.Widgets/@actions
    sid
    actions
      @/@shell/@actions/@init
      sname
      init
      sisSynchronized
      false
      sthrowException
      true
      suseOtherAction
      false
      svarScope
      Global
      sdisableGlobalContext
      false
      Scode
#$@text#$@
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.TreeItem;

//浏览器绑定脚本
browser.addStatusTextListener(utilBrowser);
actionBrowser.addStatusTextListener(utilBrowser);

//初始化关系树，关系是定义在事物的属性thingRelationPath上的，thingRelationPath指向
//一个关系事物，关系事物的结构是xworker.core.relation.ThingRelation
//元事物定义的基本关系事物xworker.core.relations.MetaThingRelation

def thingRelation = world.getThing(thing.thingRelationPath);
if(thingRelation != null){
    initRelationTree(thingRelation, menuTree);
}

for(ext in thing.getAllExtends()){
    def tr = world.getThing(ext.thingRelationPath);
    if(tr != null){
        initRelationTree(tr, menuTree);
    }
}

for(ext in thing.getAllDescriptors()){
    def tr = world.getThing(ext.thingRelationPath);
    if(tr != null){
        initRelationTree(tr, menuTree);
    }
}

def initRelationTree(thing, treeItem){
    def item = new TreeItem(treeItem, SWT.NONE);
    
    item.setText(thing.metadata.label);
    item.setData(thing);
    
    for(child in thing.getAllChilds()){
        if(child.thingName == "ThingRelation" || child.thingName == "UI" || child.thingName == "Action"){
        	initRelationTree(child, item);
        }
    }
    item.setExpanded(true);
}
#$@text#$@
      sdescriptors
      xworker.lang.actions.Actions/@GroovyAction
      sid
      init
      @/@shell/@actions/@setThing
      sname
      setThing
      sisSynchronized
      false
      sthrowException
      true
      suseOtherAction
      false
      svarScope
      Global
      sdisableGlobalContext
      false
      Scode
#$@text#$@
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.TreeItem;

//浏览器绑定脚本
browser.addStatusTextListener(utilBrowser);
descBrowser.addStatusTextListener(utilBrowser);

def thingRelation = world.getThing(thing.thingRelationPath);
if(thingRelation != null){
    initRelationTree(thingRelation, menuTree);
}

for(ext in thing.getAllExtends()){
    def tr = world.getThing(ext.thingRelationPath);
    if(tr != null){
        initRelationTree(tr, menuTree);
    }
}

for(ext in thing.getAllDescriptors()){
    def tr = world.getThing(ext.thingRelationPath);
    if(tr != null){
        initRelationTree(tr, menuTree);
    }
}

def initRelationTree(thing, treeItem){
    def item = new TreeItem(treeItem, SWT.NONE);
    
    item.setText(thing.metadata.label);
    item.setData(thing);
    
    for(child in thing.getChilds()){
        initRelationTree(child, item);
    }
}
#$@text#$@
      sdescription
      <p>好像没有地方再用，是否可以删除？</p>
      sdescriptors
      xworker.lang.actions.Actions/@GroovyAction
      sid
      setThing
      @/@shell/@actions/@executeAction
      sname
      executeAction
      sisSynchronized
      false
      sthrowException
      true
      suseOtherAction
      false
      svarScope
      Global
      sdisableGlobalContext
      false
      scode
      relationThing.doAction("doAction", actionContext);
      sdescriptors
      xworker.lang.actions.Actions/@GroovyAction
      sid
      executeAction
