^1729818436335
@
sname
ThingMenuEditor
slabel
ThingMenuEditor
sdescriptors
xworker.swt.widgets.Display
  @/@shell
  sname
  shell
  stext
  lang:d=模型菜单&en=Model menu
  sNO_TRIM
  false
  sCLOSE
  true
  sTITLE
  true
  sMIN
  false
  sMAX
  false
  sBORDER
  false
  sRESIZE
  true
  sON_TOP
  false
  sTOOL
  false
  sNO_FOCUS
  false
  swidth
  300
  sheight
  480
  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
  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/@menuTree
    sname
    menuTree
    sselectStyle
    SINGLE
    sV_SCROLL
    true
    sH_SCROLL
    true
    sCHECK
    false
    sFULL_SELECTION
    false
    sHIDE_SELECTION
    true
    sBORDER
    true
    slineVisible
    false
    smultipleColumns
    false
    sheaderVisible
    false
    ssortIndicator
    true
    smoveableColumns
    false
    sheadImages
    false
    ssubImages
    false
    scheckSelection
    false
    scapture
    false
    senabled
    true
    sredraw
    true
    stoolTipText
    选择双击可以打开菜单定义
    svisible
    true
    slabel
    menuTree
    sdescriptors
    xworker.swt.Widgets/@Tree
    sid
    menuTree
      @/@shell/@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.layout.LayoutDatas/@GridData
      sid
      menuTreeGridData
      @/@shell/@menuTree/@5808
      sname
      Listeners
      slabel
      Listeners
      sdescriptors
      xworker.swt.widgets.Widget/@Listeners
      sid
      5808
        @/@shell/@menuTree/@5808/@5809
        sname
        menuTreeSelection
        stype
        DefaultSelection
        slabel
        menuTreeSelection
        sdescriptors
        xworker.swt.events.Listeners/@listeners/@Listener
        sid
        5809
          @/@shell/@menuTree/@5808/@5809/@5810
          sname
          menuTreeAction
          sisSynchronized
          false
          sthrowException
          true
          suseOtherAction
          false
          svarScope
          Global
          sdisableGlobalContext
          false
          Scode
#$@text#$@
def path = menuTree.getSelection()[0].getData();
if(path != null){
    def thing = world.getThing(path);
    if(thing != null){
        explorerActions.doAction("openThing", [thing:thing]);
    }
}

shell.dispose();
#$@text#$@
          sinterpretationType
          Action
          screateLocalVarScope
          false
          ssaveReturn
          false
          sdescriptors
          xworker.lang.actions.Actions/@GroovyAction
          sid
          5810
    @/@shell/@2028
    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
    2028
      @/@shell/@2028/@2029
      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
      2029
      @/@shell/@2028/@2030
      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
      2030
      @/@shell/@2028/@2032
      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
      2032
        @/@shell/@2028/@2032/@2033
        sname
        RowData
        sexclude
        false
        swidth
        80
        sheight
        -1
        slabel
        RowData
        sdescriptors
        xworker.swt.layout.LayoutDatas/@RowData
        sid
        2033
        @/@shell/@2028/@2032/@2223
        sname
        Listeners
        slabel
        Listeners
        sdescriptors
        xworker.swt.widgets.Widget/@Listeners
        sid
        2223
          @/@shell/@2028/@2032/@2223/@2224
          sname
          closeButtonSelection
          stype
          Selection
          slabel
          closeButtonSelection
          sdescriptors
          xworker.swt.events.Listeners/@listeners/@Listener
          sid
          2224
            @/@shell/@2028/@2032/@2223/@2224/@2225
            sname
            closeButtonAction
            sisSynchronized
            false
            sthrowException
            true
            suseOtherAction
            false
            svarScope
            Global
            sdisableGlobalContext
            false
            scode
            shell.dispose();
            sdescriptors
            xworker.lang.actions.Actions/@GroovyAction
            sid
            2225
    @/@shell/@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;

import xworker.swt.listeners.SwtMenuListener;
import xworker.lang.thingeditor.ThingMenu;

def thing = actionContext.get("thing");
if(thing == null){
    def item = new TreeItem(menuTree, SWT.NONE);
    item.setText("没有指定事物或事物不存在");
}else{
    def menus = [];
    SwtMenuListener swtMenu = SwtMenuListener.getInstance();
    String[] paths = thing.getDescriptors()[0].metadata.getPaths();
    menus = swtMenu.getMenu(thing, paths, "data");
    
    for(menu in menus){
        def item = new TreeItem(menuTree, SWT.NONE);
        item.setText(menu.metadata.label);
        item.setData(menu.metadata.path);
        for(child in menu.childs){
            initMenuItem(item, child);
        }    
        item.setExpanded(true);
    }
}

//新的菜单
//println actionContext.get("menu");
if(actionContext.get("menu") != null){
    def rootMenu = actionContext.get("menu").getRoot();
    for(menu in rootMenu.getChilds()){
        def item = new TreeItem(menuTree, SWT.NONE);
        item.setText(menu.getThing().getMetadata().getLabel());
        item.setData(menu.getThing().getMetadata().getPath());
        for(child in menu.getChilds()){
            initThingMenuItem(item, child);
        }
        item.setExpanded(true);
    }
}

def initMenuItem(item, child){
    def childItem = new TreeItem(item, SWT.NONE);
    childItem.setText(child.metadata.label);
    childItem.setData(child.metadata.path);
    
    for(cchild in child.childs){
        initMenuItem(childItem, cchild);
    }
    childItem.setExpanded(true);
}

def initThingMenuItem(item, child){
    def childItem = new TreeItem(item, SWT.NONE);
    childItem.setText(child.thing.metadata.label);
    childItem.setData(child.thing.metadata.path);
    
    for(cchild in child.childs){
        initThingMenuItem(childItem, cchild);
    }
    childItem.setExpanded(true);
}
#$@text#$@
    sinterpretationType
    Action
    screateLocalVarScope
    false
    ssaveReturn
    false
    sswitchResult
    false
    sdebugLog
    false
    sdescriptors
    xworker.swt.Widgets/@Code
    sid
    init
  @/@scripts
  sname
  scripts
  sdescriptors
  xworker.swt.widgets.Display/@scripts1,xworker.swt.widgets.Display/@Shell,xworker.lang.actions.Actions/@GroovyAction
  sid
  scripts
    @/@scripts/@oepnThingMenuEditor
    sname
    oepnThingMenuEditor
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Global
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import org.xmeta.ActionContext;

def ac = new ActionContext();
ac.put("explorerActions", explorerActions);
ac.put("thing", currentThing);
ac.put("menu", actionContext.get("menu"));

def shellThing = world.get("xworker.ide.worldexplorer.swt.dialogs.ThingMenuEditor/@shell");
def shell = shellThing.doAction("create", ac);
shell.open();
#$@text#$@
    sinterpretationType
    Action
    screateLocalVarScope
    false
    ssaveReturn
    false
    sswitchResult
    false
    sdebugLog
    false
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    oepnThingMenuEditor
    @/@scripts/@openThingQueryDialog
    sname
    openThingQueryDialog
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Global
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import org.xmeta.ActionContext;

def ac = new ActionContext();
ac.put("explorerActions", explorerActions);
ac.put("thing", currentThing);

def shellThing = world.get("xworker.ide.db.dbindex.app.swt.ThingQueryerByKeyword/@shell");
def shell = shellThing.doAction("create", ac);
shell.open();
#$@text#$@
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    openThingQueryDialog
    @/@scripts/@openLastEditThings
    sname
    openLastEditThings
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Global
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import org.xmeta.ActionContext;

def ac = new ActionContext();
ac.put("explorerActions", explorerActions);
ac.put("thing", currentThing);

def shellThing = world.get("xworker.ide.worldexplorer.swt.tools.LastEditedThingsViewer/@shell");
def shell = shellThing.doAction("create", ac);
shell.open();
#$@text#$@
    sinterpretationType
    Action
    screateLocalVarScope
    false
    ssaveReturn
    false
    sswitchResult
    false
    sdebugLog
    false
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    openLastEditThings
    @/@scripts/@openProblemShell
    sname
    openProblemShell
    ssingleInstance
    true
    sanotherThread
    true
    sshellPath
    xworker.ide.worldexplorer.swt.dialogs.ProblemsDialog/@shell
    sinterpretationType
    Self
    sattributeTemplate
    false
    schildsAttributeTemplate
    false
    svarScope
    Local
    sisSynchronized
    false
    sthrowException
    true
    screateLocalVarScope
    false
    ssaveReturn
    false
    sswitchResult
    false
    sdisableGlobalContext
    false
    sdebugLog
    false
    sdescriptors
    xworker.swt.actions.ShellActions/@OpenShell
    sid
    openProblemShell
    @/@scripts/@resetToolTip
    sname
    resetToolTip
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Local
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import xworker.swt.util.PoolableControlFactory;

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

def toolTipShell = PoolableControlFactory.borrowControl(parentContext.editPartComposite.getShell(), "xworker.ide.worldexplorer.swt.util.HtmlToolTip/@shell", actionContext);
if(toolTipShell != null){
    toolTipShell.dispose();
}

def box = new MessageBox(parentContext.editPartComposite.getShell(), SWT.OK | SWT.ICON_INFORMATION);
box.setMessage("由于未知原因，ToolTip总是一段时间后不能显示，且ToolTip所在的Shell也未见异常，因此用此菜单重置，若发现真实原因后可取消此菜单");
box.setText("ToolTip");
box.open();
#$@text#$@
    sinterpretationType
    Action
    screateLocalVarScope
    false
    ssaveReturn
    false
    sswitchResult
    false
    sdebugLog
    false
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sth_createIndex
    false
    sth_mark
    false
    sid
    resetToolTip
