^1743061852647
@
sname
FastLocateDialog
slabel
FastLocateDialog
sdescriptors
xworker.swt.widgets.Display
  @/@shell
  sname
  shell
  stext
  res:res.w_exp:searchDialog:查找
  sNO_TRIM
  false
  sCLOSE
  true
  sTITLE
  true
  sMIN
  false
  sMAX
  false
  sBORDER
  false
  sRESIZE
  true
  sON_TOP
  false
  sTOOL
  true
  sNO_FOCUS
  false
  swidth
  680
  sheight
  480
  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/@shellGirdLayout
    sname
    shellGirdLayout
    snumColumns
    1
    smakeColumnsEqualWidth
    false
    smarginWidth
    5
    smarginHeight
    5
    smarginLeft
    0
    smarginTop
    0
    smarginRight
    0
    smarginBottom
    0
    shorizontalSpacing
    5
    sverticalSpacing
    5
    slabel
    shellGirdLayout
    sdescriptors
    xworker.swt.Layouts/@GridLayout
    sid
    shellGirdLayout
    @/@shell/@searchComposite
    sname
    searchComposite
    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
    sdescriptors
    xworker.swt.Widgets/@Composite
    sid
    searchComposite
      @/@shell/@searchComposite/@searchCompositeGridData
      sname
      searchCompositeGridData
      sstyle
      FILL_HORIZONTAL
      shorizontalIndent
      0
      swidth
      -1
      sheight
      -1
      shorizontalAlignment
      BEGINNING
      sverticalAlignment
      CENTER
      shorizontalSpan
      1
      sverticalSpan
      1
      sgrabExcessHorizontalSpace
      false
      sgrabExcessVerticalSpace
      false
      slabel
      searchCompositeGridData
      sdescriptors
      xworker.swt.Commons/@GridData
      sid
      searchCompositeGridData
      @/@shell/@searchComposite/@searchCompositeGridLayout
      sname
      searchCompositeGridLayout
      snumColumns
      3
      smakeColumnsEqualWidth
      false
      smarginWidth
      5
      smarginHeight
      5
      smarginLeft
      0
      smarginTop
      0
      smarginRight
      0
      smarginBottom
      0
      shorizontalSpacing
      5
      sverticalSpacing
      5
      slabel
      searchCompositeGridLayout
      sdescriptors
      xworker.swt.Layouts/@GridLayout
      sid
      searchCompositeGridLayout
      @/@shell/@searchComposite/@searchLabel
      sname
      searchLabel
      sBORDER
      false
      stype
      HORIZONTAL
      sshadow
      SHADOW_OUT
      salignment
      LEFT
      stext
      res:res.w_exp:searchLabel:查找：
      scapture
      false
      senabled
      true
      sredraw
      true
      svisible
      true
      slabel
      searchLabel
      sdescriptors
      xworker.swt.Widgets/@Label
      sid
      searchLabel
      @/@shell/@searchComposite/@searchText
      sname
      searchText
      sstyle
      SINGLE
      sH_SCROLL
      false
      sV_SCROLL
      false
      sWRAP
      false
      sREAD_ONLY
      false
      sPASSWORD
      false
      sSEARCH
      false
      sCANCEL
      false
      sBORDER
      true
      salign
      LEFT
      slabel
      searchText
      sdescriptors
      xworker.swt.Widgets/@Text
      sid
      searchText
        @/@shell/@searchComposite/@searchText/@searchTextGridData
        sname
        searchTextGridData
        sstyle
        FILL_HORIZONTAL
        shorizontalIndent
        0
        swidth
        -1
        sheight
        -1
        shorizontalAlignment
        BEGINNING
        sverticalAlignment
        CENTER
        shorizontalSpan
        1
        sverticalSpan
        1
        sgrabExcessHorizontalSpace
        false
        sgrabExcessVerticalSpace
        false
        slabel
        searchTextGridData
        sdescriptors
        xworker.swt.Commons/@GridData
        sid
        searchTextGridData
        @/@shell/@searchComposite/@searchText/@listeners
        sname
        listeners
        slabel
        listeners
        sdescriptors
        xworker.swt.events.Listeners/@listeners
        sid
        listeners
          @/@shell/@searchComposite/@searchText/@listeners/@searchTextDefaultSelection
          sname
          searchTextDefaultSelection
          stype
          DefaultSelection
          sref
          searchButtnSelection
          slabel
          searchTextDefaultSelection
          sdescriptors
          xworker.swt.events.Listeners/@listeners/@Listener
          sid
          searchTextDefaultSelection
      @/@shell/@searchComposite/@searchButton
      sname
      searchButton
      stext
      res:res.w_exp:searchButton:查找（&F）
      stype
      SWT.PUSH
      sflat
      false
      sborder
      false
      sselected
      false
      scapture
      false
      senabled
      true
      sredraw
      true
      svisible
      true
      slabel
      searchButton
      sdescriptors
      xworker.swt.Widgets/@Button
      sid
      searchButton
        @/@shell/@searchComposite/@searchButton/@listeners
        sname
        listeners
        slabel
        listeners
        sdescriptors
        xworker.swt.events.Listeners/@listeners
        sid
        listeners
          @/@shell/@searchComposite/@searchButton/@listeners/@searchButtnSelection
          sname
          searchButtnSelection
          stype
          Selection
          slabel
          searchButtnSelection
          sdescriptors
          xworker.swt.events.Listeners/@listeners/@Listener
          sid
          searchButtnSelection
            @/@shell/@searchComposite/@searchButton/@listeners/@searchButtnSelection/@Seach
            sname
            Seach
            sisSynchronized
            false
            sthrowException
            true
            suseOtherAction
            false
            svarScope
            Global
            sdisableGlobalContext
            false
            Scode
#$@text#$@
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.TreeItem;

//查找
String searchFor = searchText.getText();

def searchThing = currentThing;
if(currentButton.getSelection()){
    searchThing = currentThing;
}else{
    searchThing = thing;
}

def results = [];
if(nodeButton.getSelection()){
    searchNode(searchFor.toUpperCase(), searchThing, results);
} else if(attributeNameButton.getSelection()){
    serachName(searchFor.toUpperCase(), searchThing, results);
} else {
    searchValue(searchFor.toUpperCase(), searchThing, results);
}   

//更新结果树
for(item in resultTree.getItems()){
    item.dispose();
}
for(result in results){
    def treeItem = new TreeItem(resultTree, SWT.NONE);
    treeItem.setText([result.name] as String[]);
    
    for(child in result.childs){
        def subItem  = new TreeItem(treeItem, SWT.NONE);
        subItem.setText([child.metadata.name, child.metadata.label, child.getThingName(),  getPath(child)] as String[]);
        subItem.setData(child);
    }
    
    treeItem.setExpanded(true);
}

//添加一个搜索结果到结果集中
def addResult(thing, results){
    def thingName = thing.getThingName();
    def rset = null;
    for(r in results){
        if(r.name == thingName){
            rset = r;
            break;
        }
    }
    
    if(rset == null){
        rset = ["name":thingName, childs:[]];
        addToList(rset, results);
    }
    addToList(thing, rset.childs);
}

//按照名字的先后顺序加入数据
def addToList(data, list){
    def added = false;
    for(int i=0; i<list.size(); i++){
        if(data.name < list.get(i).name){
            list.add(i, data);
            added = true;
            break;
        }
    }
    
    if(!added){
        list.add(data);
    }
}
def getPath(dataObj){
    String path = dataObj.metadata.name.toUpperCase();
    if(dataObj.getParent() != null){
        path = dataObj.getParent().metadata.name + "/" + dataObj.metadata.name;
    }
    
    return path;
}

def searchNode(str, dataObj, results){
    for(objName in dataObj.getThingNames()){
        //println objName;
        if(objName.toUpperCase().indexOf(str) != -1){        
            addResult(dataObj, results);
            break;    
        }
    }
    
    for(childObj in dataObj.childs){
        searchNode(str, childObj, results);
    }
}

def serachName(str, dataObj, results){
    def map = dataObj.getAttributes();
    for(key in map.keySet()){
        if(key.toUpperCase().indexOf(str) != -1){            
            addResult(dataObj, results);
        }
    }
    
    for(childObj in dataObj.childs){
        serachName(str, childObj, results);
    }
}

def searchValue(str, dataObj, results){
    def map = dataObj.getAttributes();
    for(key in map.keySet()){
        def v = map.get(key);
        if(v instanceof String && v.toUpperCase().indexOf(str) != -1){
            addResult(dataObj, results);
            break;
        }
    }
    
    for(childObj in dataObj.childs){
        searchValue(str, childObj, results);
    }
}
#$@text#$@
            sdescriptors
            xworker.lang.actions.Actions/@GroovyAction
            sid
            Seach
        @/@shell/@searchComposite/@searchButton/@RowData
        sname
        RowData
        sexclude
        false
        swidth
        80
        sheight
        -1
        slabel
        RowData
        sdescriptors
        xworker.swt.layout.LayoutDatas/@RowData
        sid
        RowData
        @/@shell/@searchComposite/@searchButton/@GridData
        sname
        GridData
        shorizontalIndent
        0
        swidth
        80
        sheight
        -1
        shorizontalAlignment
        BEGINNING
        sverticalAlignment
        CENTER
        shorizontalSpan
        1
        sverticalSpan
        1
        sgrabExcessHorizontalSpace
        false
        sgrabExcessVerticalSpace
        false
        slabel
        GridData
        sdescriptors
        xworker.swt.layout.LayoutDatas/@GridData
        sid
        GridData
      @/@shell/@searchComposite/@replaceLabel
      sname
      replaceLabel
      sBORDER
      false
      stype
      HORIZONTAL
      sshadow
      SHADOW_OUT
      salignment
      LEFT
      stext
      label:xworker.swt.ide.worldexplorer.swt.i18n.I18nResource/@searchDialog/@replaceLabel
      scapture
      false
      senabled
      true
      sredraw
      true
      svisible
      true
      slabel
      replaceLabel
      sdescriptors
      xworker.swt.Widgets/@Label
      sid
      replaceLabel
      @/@shell/@searchComposite/@replaceText
      sname
      replaceText
      sstyle
      SINGLE
      sH_SCROLL
      false
      sV_SCROLL
      false
      sWRAP
      false
      sREAD_ONLY
      false
      sPASSWORD
      false
      sSEARCH
      false
      sCANCEL
      false
      sBORDER
      true
      salign
      LEFT
      scapture
      false
      senabled
      true
      sredraw
      true
      svisible
      true
      slabel
      replaceText
      sdescriptors
      xworker.swt.Widgets/@Text
      sid
      replaceText
        @/@shell/@searchComposite/@replaceText/@replaceTextGridData
        sname
        replaceTextGridData
        sstyle
        FILL_HORIZONTAL
        shorizontalIndent
        0
        swidth
        -1
        sheight
        -1
        shorizontalAlignment
        BEGINNING
        sverticalAlignment
        CENTER
        shorizontalSpan
        1
        sverticalSpan
        1
        sgrabExcessHorizontalSpace
        false
        sgrabExcessVerticalSpace
        false
        slabel
        replaceTextGridData
        sdescriptors
        xworker.swt.layout.LayoutDatas/@GridData
        sid
        replaceTextGridData
      @/@shell/@searchComposite/@replaceButton
      sname
      replaceButton
      stext
      label:xworker.swt.ide.worldexplorer.swt.i18n.I18nResource/@searchDialog/@replace
      stype
      SWT.PUSH
      sflat
      false
      sborder
      false
      sselected
      false
      scapture
      false
      senabled
      true
      sredraw
      true
      svisible
      true
      slabel
      replaceButton
      sdescriptors
      xworker.swt.Widgets/@Button
      sid
      replaceButton
        @/@shell/@searchComposite/@replaceButton/@Listeners
        sname
        Listeners
        slabel
        Listeners
        sdescriptors
        xworker.swt.widgets.Widget/@Listeners
        sid
        Listeners
          @/@shell/@searchComposite/@replaceButton/@Listeners/@replaceButtonSelection
          sname
          replaceButtonSelection
          stype
          Selection
          slabel
          replaceButtonSelection
          sdescriptors
          xworker.swt.events.Listeners/@listeners/@Listener
          sid
          replaceButtonSelection
            @/@shell/@searchComposite/@replaceButton/@Listeners/@replaceButtonSelection/@GroovyAction
            sname
            GroovyAction
            sisSynchronized
            false
            sthrowException
            true
            suseOtherAction
            false
            svarScope
            Global
            sdisableGlobalContext
            false
            Scode
#$@text#$@
import org.xmeta.util.ThingUtil;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;

def box = new MessageBox(shell, SWT.OK | SWT.CANCEL | SWT.ICON_WARNING);
box.setText("Replace");
box.setMessage("确实要替换吗？");
if(SWT.OK == box.open()){
    ThingUtil.replaceThing(thing, searchText.getText(), replaceText.getText());
}
#$@text#$@
            sinterpretationType
            Action
            sdescriptors
            xworker.lang.actions.Actions/@GroovyAction
            sid
            GroovyAction
        @/@shell/@searchComposite/@replaceButton/@GridData
        sname
        GridData
        shorizontalIndent
        0
        swidth
        80
        sheight
        -1
        shorizontalAlignment
        BEGINNING
        sverticalAlignment
        CENTER
        shorizontalSpan
        1
        sverticalSpan
        1
        sgrabExcessHorizontalSpace
        false
        sgrabExcessVerticalSpace
        false
        slabel
        GridData
        sdescriptors
        xworker.swt.layout.LayoutDatas/@GridData
        sid
        GridData
      @/@shell/@searchComposite/@blankLabel
      sname
      blankLabel
      sBORDER
      false
      stype
      HORIZONTAL
      sshadow
      SHADOW_OUT
      salignment
      LEFT
      scapture
      false
      senabled
      true
      sredraw
      true
      spack
      false
      svisible
      true
      slabel
      blankLabel
      sdescriptors
      xworker.swt.Widgets/@Label
      sid
      blankLabel
      @/@shell/@searchComposite/@searchOptionComposite
      sname
      searchOptionComposite
      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
      sdescriptors
      xworker.swt.Widgets/@Composite
      sid
      searchOptionComposite
        @/@shell/@searchComposite/@searchOptionComposite/@searchOptionComposite
        sname
        searchOptionComposite
        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
        searchOptionComposite
        sdescriptors
        xworker.swt.Layouts/@RowLayout
        sid
        searchOptionComposite
        @/@shell/@searchComposite/@searchOptionComposite/@scopeCompsite
        sname
        valueScopeCompsite
        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
        scopeCompsite
          @/@shell/@searchComposite/@searchOptionComposite/@scopeCompsite/@searchOptionComposite
          sname
          searchOptionComposite
          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
          searchOptionComposite
          sdescriptors
          xworker.swt.Layouts/@RowLayout
          sid
          searchOptionComposite
          @/@shell/@searchComposite/@searchOptionComposite/@scopeCompsite/@searchScopeLabel
          sname
          searchScopeLabel
          sBORDER
          false
          stype
          HORIZONTAL
          sshadow
          SHADOW_OUT
          salignment
          LEFT
          stext
          label:xworker.swt.ide.worldexplorer.swt.i18n.I18nResource/@searchDialog/@seachType
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          slabel
          searchScopeLabel
          sdescriptors
          xworker.swt.Widgets/@Label
          sid
          searchScopeLabel
          @/@shell/@searchComposite/@searchOptionComposite/@scopeCompsite/@nodeButton
          sname
          nodeButton
          stext
          label:xworker.swt.ide.worldexplorer.swt.i18n.I18nResource/@searchDialog/@thing
          stype
          SWT.RADIO
          sflat
          false
          sborder
          false
          sselected
          false
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          slabel
          nodeButton
          sdescriptors
          xworker.swt.Widgets/@Button
          sid
          nodeButton
          @/@shell/@searchComposite/@searchOptionComposite/@scopeCompsite/@attributeNameButton
          sname
          attributeNameButton
          stext
          label:xworker.swt.ide.worldexplorer.swt.i18n.I18nResource/@searchDialog/@attributeName
          stype
          SWT.RADIO
          sflat
          false
          sborder
          false
          sselected
          false
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          slabel
          attributeNameButton
          sdescriptors
          xworker.swt.Widgets/@Button
          sid
          attributeNameButton
          @/@shell/@searchComposite/@searchOptionComposite/@scopeCompsite/@valueButton
          sname
          valueButton
          stext
          res:res.w_exp:value:值
          stype
          SWT.RADIO
          sflat
          false
          sborder
          false
          sselected
          true
          scapture
          false
          senabled
          true
          sredraw
          true
          spack
          false
          svisible
          true
          slabel
          valueButton
          sdescriptors
          xworker.swt.Widgets/@Button
          sid
          valueButton
        @/@shell/@searchComposite/@searchOptionComposite/@scopeCompsite1
        sname
        scopeCompsite
        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
        scopeCompsite1
          @/@shell/@searchComposite/@searchOptionComposite/@scopeCompsite1/@searchOptionComposite
          sname
          searchOptionComposite
          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
          searchOptionComposite
          sdescriptors
          xworker.swt.Layouts/@RowLayout
          sid
          searchOptionComposite
          @/@shell/@searchComposite/@searchOptionComposite/@scopeCompsite1/@searchScopeLabel
          sname
          searchScopeLabel
          sBORDER
          false
          stype
          HORIZONTAL
          sshadow
          SHADOW_OUT
          salignment
          LEFT
          stext
          label:xworker.swt.ide.worldexplorer.swt.i18n.I18nResource/@searchDialog/@searchScope
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          slabel
          searchScopeLabel
          sdescriptors
          xworker.swt.Widgets/@Label
          sid
          searchScopeLabel
          @/@shell/@searchComposite/@searchOptionComposite/@scopeCompsite1/@nodeButton
          sname
          currentButton
          stext
          label:xworker.swt.ide.worldexplorer.swt.i18n.I18nResource/@searchDialog/@currentThing
          stype
          SWT.RADIO
          sflat
          false
          sborder
          false
          sselected
          false
          scapture
          false
          senabled
          true
          sredraw
          true
          spack
          false
          svisible
          true
          slabel
          currentButton
          sdescriptors
          xworker.swt.Widgets/@Button
          sid
          nodeButton
          @/@shell/@searchComposite/@searchOptionComposite/@scopeCompsite1/@attributeNameButton
          sname
          allButton
          stext
          label:xworker.swt.ide.worldexplorer.swt.i18n.I18nResource/@searchDialog/@allThing
          stype
          SWT.RADIO
          sflat
          false
          sborder
          false
          sselected
          true
          scapture
          false
          senabled
          true
          sredraw
          true
          spack
          false
          svisible
          true
          slabel
          allButton
          sdescriptors
          xworker.swt.Widgets/@Button
          sid
          attributeNameButton
      @/@shell/@searchComposite/@blankButton2
      sname
      blankButton2
      sBORDER
      false
      stype
      HORIZONTAL
      sshadow
      SHADOW_OUT
      salignment
      LEFT
      scapture
      false
      senabled
      true
      sredraw
      true
      spack
      false
      svisible
      true
      slabel
      blankButton2
      sdescriptors
      xworker.swt.Widgets/@Label
      sid
      blankButton2
    @/@shell/@searchResultComposite
    sname
    searchResultComposite
    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
    sdescriptors
    xworker.swt.Widgets/@Composite
    sid
    searchResultComposite
      @/@shell/@searchResultComposite/@searchResultCompositeGridData
      sname
      searchResultCompositeGridData
      sstyle
      FILL_BOTH
      shorizontalIndent
      0
      swidth
      -1
      sheight
      -1
      shorizontalAlignment
      BEGINNING
      sverticalAlignment
      CENTER
      shorizontalSpan
      1
      sverticalSpan
      1
      sgrabExcessHorizontalSpace
      false
      sgrabExcessVerticalSpace
      false
      slabel
      searchResultCompositeGridData
      sdescriptors
      xworker.swt.Commons/@GridData
      sid
      searchResultCompositeGridData
      @/@shell/@searchResultComposite/@searchResultCompositeFillLayout
      sname
      searchResultCompositeFillLayout
      stype
      SWT.HORIZONTAL
      slabel
      searchResultCompositeFillLayout
      sdescriptors
      xworker.swt.Layouts/@FillLayout
      sid
      searchResultCompositeFillLayout
      @/@shell/@searchResultComposite/@resultTree
      sname
      resultTree
      sselectStyle
      SINGLE
      sV_SCROLL
      true
      sH_SCROLL
      true
      sCHECK
      false
      sFULL_SELECTION
      true
      sHIDE_SELECTION
      true
      sBORDER
      true
      slineVisible
      true
      smultipleColumns
      true
      sheaderVisible
      true
      ssortIndicator
      true
      smoveableColumns
      true
      sheadImages
      false
      ssubImages
      false
      scheckSelection
      false
      slabel
      resultTree
      sdescriptors
      xworker.swt.Widgets/@Tree
      sid
      resultTree
        @/@shell/@searchResultComposite/@resultTree/@thingName
        sname
        thingName
        stext
        label:xworker.swt.ide.worldexplorer.swt.i18n.I18nResource/@searchDialog/@thing
        swidth
        250
        slabel
        thingName
        sdescriptors
        xworker.swt.widgets.Tree/@TreeColumn
        sid
        thingName
        @/@shell/@searchResultComposite/@resultTree/@nameColumn
        sname
        nameColumn
        stext
        label:xworker.swt.ide.worldexplorer.swt.i18n.I18nResource/@searchDialog/@labelColumn
        swidth
        150
        slabel
        nameColumn
        sdescriptors
        xworker.swt.widgets.Tree/@TreeColumn
        sid
        nameColumn
        @/@shell/@searchResultComposite/@resultTree/@labelColumn
        sname
        labelColumn
        stext
        label:xworker.swt.ide.worldexplorer.swt.i18n.I18nResource/@searchDialog/@nameColumn
        swidth
        150
        slabel
        labelColumn
        sdescriptors
        xworker.swt.widgets.Tree/@TreeColumn
        sid
        labelColumn
        @/@shell/@searchResultComposite/@resultTree/@pathColumn
        sname
        pathColumn
        stext
        label:xworker.swt.ide.worldexplorer.swt.i18n.I18nResource/@thingTableColumn/@path
        swidth
        500
        slabel
        pathColumn
        sdescriptors
        xworker.swt.widgets.Tree/@TreeColumn
        sid
        pathColumn
        @/@shell/@searchResultComposite/@resultTree/@listeners
        sname
        listeners
        slabel
        listeners
        sdescriptors
        xworker.swt.events.Listeners/@listeners
        sid
        listeners
          @/@shell/@searchResultComposite/@resultTree/@listeners/@resultDableSelection
          sname
          resultDableSelection
          stype
          DefaultSelection
          slabel
          resultDableSelection
          sdescriptors
          xworker.swt.events.Listeners/@listeners/@Listener
          sid
          resultDableSelection
            @/@shell/@searchResultComposite/@resultTree/@listeners/@resultDableSelection/@GroovyAction
            sname
            GroovyAction
            sisSynchronized
            false
            sthrowException
            true
            suseOtherAction
            false
            svarScope
            Global
            sdisableGlobalContext
            false
            Scode
#$@text#$@
import org.eclipse.swt.SWT;

//打开编辑器相应的节点
def dataObj = resultTree.getSelection()[0].getData();
if(dataObj == null){
    return;
}

def it = null;
for(item in parentContext.innerOutline.getItems()){
    it = getItem(dataObj, item);
    if(it != null) break;
}

it.getParent().setSelection(it);	
it.getParent().notifyListeners(SWT.Selection, null);

def getItem(dataObj, item){
    if(item.getData().metadata.path == dataObj.metadata.path){
        return item;
    }
    
    for(subItem in item.getItems()){
        def it = getItem(dataObj, subItem);
        if(it != null) return it;
    }
    
    return null;
}
#$@text#$@
            sinterpretationType
            Action
            sdescriptors
            xworker.lang.actions.Actions/@GroovyAction
            sid
            GroovyAction
    @/@shell/@Code
    sname
    Code
    sisSynchronized
    false
    sthrowException
    false
    suseOtherAction
    false
    svarScope
    Global
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.TreeItem;
//thing = world.getThing("core.editor.swt.dialogs.SearchReplaceDialog/@shell");

//nodeButton.setSelection(true);
initTreeItem(currentThing, resultTree);

def initTreeItem(thing, treeItem){
    def item = new TreeItem(treeItem, SWT.NONE);
    item.setText([thing.metadata.label, thing.metadata.label,  thing.getThingName(), thing.metadata.path] as String[]);
    item.setData(thing);
    
    for(child in thing.getChilds()){
        initTreeItem(child, item);
    }
    item.setExpanded(true);    
}
#$@text#$@
    sai_needGenerate
    false
    sai_rootThingXml
    true
    sai_promptContainsVars
    true
    sinterpretationType
    Action
    screateLocalVarScope
    false
    ssaveReturn
    false
    sswitchResult
    false
    sdebugLog
    false
    sdescriptors
    xworker.swt.Widgets/@Code
    sid
    Code
