^1648187580515
@
sname
XmlImportTextDialog
slabel
XmlImportTextDialog
sdescriptors
xworker.swt.widgets.Display
  @/@shell
  sname
  shell
  stext
  res:res.w_exp:importEditXml:导入XML
  sNO_TRIM
  false
  sCLOSE
  true
  sTITLE
  true
  sMIN
  false
  sMAX
  true
  sBORDER
  false
  sRESIZE
  true
  sON_TOP
  false
  sTOOL
  false
  sNO_FOCUS
  false
  swidth
  1024
  sheight
  768
  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/@resources
    sname
    resources
    sdescriptors
    xworker.swt.Widgets/@Resource
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    resources
      @/@shell/@resources/@I18nResource
      sname
      I18nResource
      sdescriptors
      xworker.swt.util.Resource/@I18nResource
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      I18nResource
        @/@shell/@resources/@I18nResource/@parseXmlButton
        sname
        parseXmlButton
        slabel
        分析XML
        sen_label
        Parse XML
        sdescriptors
        xworker.core.util.I18nResource/@resource
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        parseXmlButton
    @/@shell/@mainComposite
    sname
    xmlComposite
    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
    spack
    false
    svisible
    true
    stext
    res:res.w_exp:importEditXml:导入XML
    sNO_TRIM
    false
    sCLOSE
    true
    sTITLE
    true
    sMIN
    false
    sMAX
    true
    sRESIZE
    true
    sON_TOP
    false
    sTOOL
    false
    swidth
    640
    sheight
    480
    scenterScreen
    true
    smaximized
    false
    sfullScreen
    false
    sdescriptors
    xworker.swt.Widgets/@Composite,xworker.swt.widgets.Display/@Shell
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    mainComposite
      @/@shell/@mainComposite/@shellGridLayout
      sname
      xmlGridLayout
      snumColumns
      1
      smakeColumnsEqualWidth
      false
      smarginWidth
      5
      smarginHeight
      5
      smarginLeft
      0
      smarginTop
      0
      smarginRight
      0
      smarginBottom
      0
      shorizontalSpacing
      5
      sverticalSpacing
      5
      sdescriptors
      xworker.swt.Layouts/@GridLayout
      sid
      shellGridLayout
      @/@shell/@mainComposite/@outputText
      sname
      outputText
      sstyle
      MULTI
      sFULL_SELECTION
      false
      sREAD_ONLY
      false
      sWRAP
      false
      sH_SCROLL
      true
      sV_SCROLL
      true
      sBORDER
      true
      salign
      LEFT
      sdescriptors
      ,xworker.swt.custom.StyledText
      sid
      outputText
        @/@shell/@mainComposite/@outputText/@outputTextGridData
        sname
        outputTextGridData
        sstyle
        FILL_BOTH
        shorizontalIndent
        0
        swidth
        -1
        sheight
        -1
        shorizontalAlignment
        BEGINNING
        sverticalAlignment
        CENTER
        shorizontalSpan
        1
        sverticalSpan
        1
        sgrabExcessHorizontalSpace
        false
        sgrabExcessVerticalSpace
        false
        sdescriptors
        xworker.swt.Commons/@GridData
        sid
        outputTextGridData
        @/@shell/@mainComposite/@outputText/@Colorer
        sname
        Colorer
        scodeName
        xml
        scodeType
        xml
        sdescriptors
        xworker.swt.custom.StyledText/@Colorer
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        Colorer
      @/@shell/@mainComposite/@buttonComposite
      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
      buttonComposite
        @/@shell/@mainComposite/@buttonComposite/@buttonCompositeGridData
        sname
        buttonCompositeGridData
        sstyle
        FILL_HORIZONTAL
        shorizontalIndent
        0
        swidth
        -1
        sheight
        -1
        shorizontalAlignment
        END
        sverticalAlignment
        CENTER
        shorizontalSpan
        1
        sverticalSpan
        1
        sgrabExcessHorizontalSpace
        false
        sgrabExcessVerticalSpace
        false
        sdescriptors
        xworker.swt.Commons/@GridData
        sid
        buttonCompositeGridData
        @/@shell/@mainComposite/@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
        sdescriptors
        xworker.swt.Layouts/@RowLayout
        sid
        buttonCompositeRowLayout
        @/@shell/@mainComposite/@buttonComposite/@okButton
        sname
        parseButton
        stext
        lang:d=粘贴&en=Paste
        stype
        SWT.PUSH
        sflat
        false
        sborder
        false
        sselected
        false
        scapture
        false
        senabled
        true
        sredraw
        true
        spack
        false
        svisible
        true
        sdescriptors
        xworker.swt.Widgets/@Button
        sid
        okButton
          @/@shell/@mainComposite/@buttonComposite/@okButton/@listeners
          sname
          listeners
          sdescriptors
          xworker.swt.events.Listeners/@listeners
          sid
          listeners
            @/@shell/@mainComposite/@buttonComposite/@okButton/@listeners/@okButtonSelection
            sname
            okButtonSelection
            stype
            Selection
            sdescriptors
            xworker.swt.events.Listeners/@listeners/@Listener
            sid
            okButtonSelection
              @/@shell/@mainComposite/@buttonComposite/@okButton/@listeners/@okButtonSelection/@GroovyAction
              sname
              GroovyAction
              sisSynchronized
              false
              sthrowException
              false
              suseOtherAction
              false
              svarScope
              Global
              sdisableGlobalContext
              false
              Scode
#$@text#$@
import org.xmeta.Thing;
import org.xmeta.codes.XmlCoder;

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

try{
    String xml = outputText.getText().trim();
    def thing = new Thing();
    XmlCoder.parse(thing, xml);
    
    //设置事物
    thingEditor.editorActions.doAction("setThing", ["thing": thing]);
    
    //切换到编辑事物的界面
    shellStackLayout.topControl = thingComposite;
    shell.layout();
}catch(Exception e){
    def box = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
    box.setText("解析XML错误");
    box.setMessage(e.getMessage());
    box.open();
}
#$@text#$@
              sinterpretationType
              Action
              screateLocalVarScope
              false
              ssaveReturn
              false
              sdebugLog
              false
              sdescriptors
              xworker.lang.actions.Actions/@GroovyAction
              sid
              GroovyAction
        @/@shell/@mainComposite/@buttonComposite/@closeButton
        sname
        closeButton
        stext
        lang:d=取消（&amp;C）&en=Cancel(&amp;C)
        stype
        SWT.PUSH
        sflat
        false
        sborder
        false
        sselected
        false
        scapture
        false
        senabled
        true
        sredraw
        true
        spack
        false
        svisible
        true
        sdescriptors
        xworker.swt.Widgets/@Button
        sid
        closeButton
          @/@shell/@mainComposite/@buttonComposite/@closeButton/@listeners
          sname
          listeners
          sdescriptors
          xworker.swt.events.Listeners/@listeners
          sid
          listeners
            @/@shell/@mainComposite/@buttonComposite/@closeButton/@listeners/@closeButtonSelection
            sname
            closeButtonSelection
            stype
            Selection
            sdescriptors
            xworker.swt.events.Listeners/@listeners/@Listener
            sid
            closeButtonSelection
              @/@shell/@mainComposite/@buttonComposite/@closeButton/@listeners/@closeButtonSelection/@Dispose
              sname
              Dispose
              scontrolList
              shell
              sinterpretationType
              Self
              sattributeTemplate
              false
              schildsAttributeTemplate
              false
              svarScope
              Local
              sisSynchronized
              false
              sthrowException
              true
              suseOtherAction
              false
              screateLocalVarScope
              false
              ssaveReturn
              false
              sdisableGlobalContext
              false
              sdebugLog
              false
              sdescriptors
              xworker.swt.actions.ControlActions/@Dispose
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_registDisabled
              false
              sth_mark
              false
              sid
              Dispose
    @/@shell/@thingComposite
    sname
    thingComposite
    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
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    thingComposite
      @/@shell/@thingComposite/@thingCompositeGridLayout
      sname
      thingCompositeGridLayout
      smakeColumnsEqualWidth
      false
      smarginWidth
      5
      smarginHeight
      5
      smarginLeft
      0
      smarginTop
      0
      smarginRight
      0
      smarginBottom
      0
      shorizontalSpacing
      5
      sverticalSpacing
      5
      sdescriptors
      xworker.swt.Layouts/@GridLayout
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      thingCompositeGridLayout
      @/@shell/@thingComposite/@thingEditor
      sname
      thingEditor
      stitle
      true
      sdescriptors
      xworker.swt.Widgets/@ThingEditor
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      thingEditor
        @/@shell/@thingComposite/@thingEditor/@thingEditorGridData
        sname
        thingEditorGridData
        sstyle
        FILL_BOTH
        shorizontalIndent
        0
        swidth
        -1
        sheight
        -1
        shorizontalAlignment
        BEGINNING
        sverticalAlignment
        CENTER
        shorizontalSpan
        1
        sverticalSpan
        1
        sgrabExcessHorizontalSpace
        false
        sgrabExcessVerticalSpace
        false
        sdescriptors
        xworker.swt.Commons/@GridData
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        thingEditorGridData
      @/@shell/@thingComposite/@buttonComposite
      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
      buttonComposite
        @/@shell/@thingComposite/@buttonComposite/@buttonCompositeGridData
        sname
        buttonCompositeGridData
        sstyle
        FILL_HORIZONTAL
        shorizontalIndent
        0
        swidth
        -1
        sheight
        -1
        shorizontalAlignment
        END
        sverticalAlignment
        CENTER
        shorizontalSpan
        1
        sverticalSpan
        1
        sgrabExcessHorizontalSpace
        false
        sgrabExcessVerticalSpace
        false
        sdescriptors
        xworker.swt.Commons/@GridData
        sid
        buttonCompositeGridData
        @/@shell/@thingComposite/@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
        sdescriptors
        xworker.swt.Layouts/@RowLayout
        sid
        buttonCompositeRowLayout
        @/@shell/@thingComposite/@buttonComposite/@okButton
        sname
        pasteButton
        stext
        lang:d=粘贴&en=Paste
        stype
        SWT.PUSH
        sflat
        false
        sborder
        false
        sselected
        false
        scapture
        false
        senabled
        true
        sredraw
        true
        spack
        false
        svisible
        true
        sdescriptors
        xworker.swt.Widgets/@Button
        sid
        okButton
          @/@shell/@thingComposite/@buttonComposite/@okButton/@listeners
          sname
          listeners
          sdescriptors
          xworker.swt.events.Listeners/@listeners
          sid
          listeners
            @/@shell/@thingComposite/@buttonComposite/@okButton/@listeners/@okButtonSelection
            sname
            okButtonSelection
            stype
            Selection
            sdescriptors
            xworker.swt.events.Listeners/@listeners/@Listener
            sid
            okButtonSelection
              @/@shell/@thingComposite/@buttonComposite/@okButton/@listeners/@okButtonSelection/@GroovyAction
              sname
              GroovyAction
              sisSynchronized
              false
              sthrowException
              false
              suseOtherAction
              false
              svarScope
              Global
              sdisableGlobalContext
              false
              Scode
#$@text#$@
//当前选择的事物
def thingForPaste = thingEditor.thingContext.currentThing;

//编辑器中的当前事物
def editorThing = parentContext.currentThing;

editorThing.paste(thingForPaste.detach());

refreshMenuSelection.handleEvent(null);

shell.dispose();
/*
println(thingEditor.thingContext.currentThing);

String xml = outputText.getText().trim();
if(xml != ""){
    currentThing.cognize(xml);
    currentThing.save();
    refreshMenuSelection.handleEvent(null);
}

shell.dispose();
*/
#$@text#$@
              sinterpretationType
              Action
              screateLocalVarScope
              false
              ssaveReturn
              false
              sdebugLog
              false
              sdescriptors
              xworker.lang.actions.Actions/@GroovyAction
              sid
              GroovyAction
        @/@shell/@thingComposite/@buttonComposite/@okButton1
        sname
        pasteAdChildButton
        stext
        lang:d=粘贴作为子节点&en=Paste As Child
        stype
        SWT.PUSH
        sflat
        false
        sborder
        false
        sselected
        false
        scapture
        false
        senabled
        true
        sredraw
        true
        spack
        false
        svisible
        true
        sdescriptors
        xworker.swt.Widgets/@Button
        sid
        okButton1
          @/@shell/@thingComposite/@buttonComposite/@okButton1/@listeners
          sname
          listeners
          sdescriptors
          xworker.swt.events.Listeners/@listeners
          sid
          listeners
            @/@shell/@thingComposite/@buttonComposite/@okButton1/@listeners/@okButtonSelection
            sname
            okButtonSelection
            stype
            Selection
            sdescriptors
            xworker.swt.events.Listeners/@listeners/@Listener
            sid
            okButtonSelection
              @/@shell/@thingComposite/@buttonComposite/@okButton1/@listeners/@okButtonSelection/@GroovyAction
              sname
              GroovyAction
              sisSynchronized
              false
              sthrowException
              false
              suseOtherAction
              false
              svarScope
              Global
              sdisableGlobalContext
              false
              Scode
#$@text#$@
import org.xmeta.Thing;

//当前选择的事物
def thingForPaste = thingEditor.thingContext.currentThing;

//编辑器中的当前事物
def editorThing = parentContext.currentThing;


Thing th = new Thing(null, null, null, false);
th.addChild(thingForPaste.detach());
editorThing.cognize(th);

refreshMenuSelection.handleEvent(null);

shell.dispose();
#$@text#$@
              sinterpretationType
              Action
              screateLocalVarScope
              false
              ssaveReturn
              false
              sdebugLog
              false
              sdescriptors
              xworker.lang.actions.Actions/@GroovyAction
              sid
              GroovyAction
        @/@shell/@thingComposite/@buttonComposite/@closeButton1
        sname
        returnToXmlButton
        stext
        lang:d=返回编辑XML&en=Return To XML Editor
        stype
        SWT.PUSH
        sflat
        false
        sborder
        false
        sselected
        false
        scapture
        false
        senabled
        true
        sredraw
        true
        spack
        false
        svisible
        true
        sdescriptors
        xworker.swt.Widgets/@Button
        sid
        closeButton1
          @/@shell/@thingComposite/@buttonComposite/@closeButton1/@listeners
          sname
          listeners
          sdescriptors
          xworker.swt.events.Listeners/@listeners
          sid
          listeners
            @/@shell/@thingComposite/@buttonComposite/@closeButton1/@listeners/@closeButtonSelection
            sname
            closeButtonSelection
            stype
            Selection
            sdescriptors
            xworker.swt.events.Listeners/@listeners/@Listener
            sid
            closeButtonSelection
              @/@shell/@thingComposite/@buttonComposite/@closeButton1/@listeners/@closeButtonSelection/@GroovyAction
              sname
              GroovyAction
              sisSynchronized
              false
              sthrowException
              true
              suseOtherAction
              false
              svarScope
              Global
              sdisableGlobalContext
              false
              Scode
#$@text#$@
shellStackLayout.topControl = xmlComposite;
shell.layout();
#$@text#$@
              sinterpretationType
              Action
              screateLocalVarScope
              false
              ssaveReturn
              false
              sdebugLog
              false
              sdescriptors
              xworker.lang.actions.Actions/@GroovyAction
              sid
              GroovyAction
        @/@shell/@thingComposite/@buttonComposite/@closeButton
        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
        sdescriptors
        xworker.swt.Widgets/@Button
        sid
        closeButton
          @/@shell/@thingComposite/@buttonComposite/@closeButton/@listeners
          sname
          listeners
          sdescriptors
          xworker.swt.events.Listeners/@listeners
          sid
          listeners
            @/@shell/@thingComposite/@buttonComposite/@closeButton/@listeners/@closeButtonSelection
            sname
            closeButtonSelection
            stype
            Selection
            sdescriptors
            xworker.swt.events.Listeners/@listeners/@Listener
            sid
            closeButtonSelection
              @/@shell/@thingComposite/@buttonComposite/@closeButton/@listeners/@closeButtonSelection/@Dispose
              sname
              Dispose
              scontrolList
              shell
              sinterpretationType
              Self
              sattributeTemplate
              false
              schildsAttributeTemplate
              false
              svarScope
              Local
              sisSynchronized
              false
              sthrowException
              true
              suseOtherAction
              false
              screateLocalVarScope
              false
              ssaveReturn
              false
              sdisableGlobalContext
              false
              sdebugLog
              false
              sdescriptors
              xworker.swt.actions.ControlActions/@Dispose
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_registDisabled
              false
              sth_mark
              false
              sid
              Dispose
    @/@shell/@shellStackLayout
    sname
    shellStackLayout
    stopControl
    xmlComposite
    sdescriptors
    xworker.swt.Layouts/@StackLayout
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    shellStackLayout
