^1640696314850
@
sname
ResTriggerTaskEditor
slabel
ResTriggerTaskEditor
ssingleInstance
false
scloseable
true
suseRef
false
sdescriptors
xworker.swt.app.view.swt.app.workbentch.Editor
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
  @/@Control
  sname
  Control
  sdescriptors
  xworker.swt.app.view.swt.app.workbentch.Editor/@Control
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_mark
  false
  sid
  Control
    @/@Control/@topSashForm
    sname
    topSashForm
    sstyle
    HORIZONTAL
    sSMOOTH
    false
    sweights
    60,40
    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
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    topSashForm
      @/@Control/@topSashForm/@DataObjectTreeEditComposite
      sname
      DataObjectTreeEditComposite
      sdataObject
      xworker.app.monitor.dataobjects.ResMonitorTriggers
      sidName
      id
      sparentIdName
      parentId
      squeryButton
      true
      snewButton
      false
      seditButton
      true
      seditBatchButton
      false
      saddChildButton
      false
      sdeleteButton
      true
      sselectAllButton
      false
      sselectRerverseButton
      false
      spagingToolbar
      true
      sactionContext
      dataObjectContext
      streeCheck
      false
      scheckCascade
      false
      sdebug
      false
      sdescriptors
      xworker.swt.app.view.swt.Items/@DataObjectTreeEditComposite
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_mark
      false
      sid
      DataObjectTreeEditComposite
        @/@Control/@topSashForm/@DataObjectTreeEditComposite/@Buttons
        sname
        Buttons
        sdescriptors
        xworker.swt.app.view.swt.widgets.DataObjectTreeEditComposite/@Buttons
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_mark
        false
        sid
        Buttons
          @/@Control/@topSashForm/@DataObjectTreeEditComposite/@Buttons/@addTaskButton
          sname
          addTaskButton
          stext
          添加任务
          stype
          SWT.PUSH
          sflat
          false
          sborder
          false
          sselected
          false
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          sdescriptors
          xworker.swt.app.view.swt.widgets.DataObjectTreeEditComposite/@Buttons/@Button
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_mark
          false
          sid
          addTaskButton
            @/@Control/@topSashForm/@DataObjectTreeEditComposite/@Buttons/@addTaskButton/@Listeners
            sname
            Listeners
            sdescriptors
            xworker.swt.widgets.Widget/@Listeners
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_mark
            false
            sid
            Listeners
              @/@Control/@topSashForm/@DataObjectTreeEditComposite/@Buttons/@addTaskButton/@Listeners/@addTaskButtonSelection
              sname
              addTaskButtonSelection
              stype
              Selection
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_mark
              false
              sid
              addTaskButtonSelection
                @/@Control/@topSashForm/@DataObjectTreeEditComposite/@Buttons/@addTaskButton/@Listeners/@addTaskButtonSelection/@GroovyAction
                sname
                GroovyAction
                sisSynchronized
                false
                sthrowException
                true
                suseOtherAction
                false
                svarScope
                Local
                sdisableGlobalContext
                false
                Scode
#$@text#$@
import org.xmeta.ActionContext;
import xworker.swt.util.SwtDialog;
import xworker.dataObject.DataObject;
import xworker.dataObject.utils.DataObjectUtil;

//选择数据
def ac = new ActionContext();
ac.put("parent", addTaskButton.getShell());
def shellThing = world.getThing("xworker.app.appmanager.swt.editors.monitor.SelectMonitorTriggerTaskShell");
def shell = shellThing.doAction("create", ac);
def datas = SwtDialog.open(shell, ac);

//插入数据
for(data in datas){
    def dataObject = new DataObject("xworker.app.monitor.dataobjects.ResMonitorTriggers");
    dataObject.put("taskId", data.get("id"));
    dataObject.put("taskName", data.get("name")); 
    def dataTree = dataObjectContext.dataTree;
    def parentId = 0;
    if(dataTree.getSelection() != null && dataTree.getSelection().length > 0){
        parentId = dataTree.getSelection()[0].getData().get("id");
    }
    dataObject.put("parentId", parentId);
    
    dataObject = dataObject.create(actionContext);
    
    if(dataObject != null){
        dataObjectContext.editorThing.doAction("insertDataObject", dataObjectContext, ["dataObject": dataObject]);
    }
}
#$@text#$@
                sinterpretationType
                Action
                screateLocalVarScope
                false
                ssaveReturn
                false
                sdescriptors
                xworker.lang.actions.Actions/@GroovyAction
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_mark
                false
                sid
                GroovyAction
            @/@Control/@topSashForm/@DataObjectTreeEditComposite/@Buttons/@addTaskButton/@addTaskButtonRowData
            sname
            addTaskButtonRowData
            sexclude
            false
            swidth
            100
            sheight
            -1
            sdescriptors
            xworker.swt.layout.LayoutDatas/@RowData
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_mark
            false
            sid
            addTaskButtonRowData
          @/@Control/@topSashForm/@DataObjectTreeEditComposite/@Buttons/@addTaskButton1
          sname
          taskEditParamButton
          stext
          编辑参数
          stype
          SWT.PUSH
          sflat
          false
          sborder
          false
          sselected
          false
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          sdescriptors
          xworker.swt.app.view.swt.widgets.DataObjectTreeEditComposite/@Buttons/@Button
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_mark
          false
          sid
          addTaskButton1
            @/@Control/@topSashForm/@DataObjectTreeEditComposite/@Buttons/@addTaskButton1/@Listeners
            sname
            Listeners
            sdescriptors
            xworker.swt.widgets.Widget/@Listeners
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_mark
            false
            sid
            Listeners
              @/@Control/@topSashForm/@DataObjectTreeEditComposite/@Buttons/@addTaskButton1/@Listeners/@addTaskButtonSelection
              sname
              addTaskButtonSelection
              stype
              Selection
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_mark
              false
              sid
              addTaskButtonSelection
                @/@Control/@topSashForm/@DataObjectTreeEditComposite/@Buttons/@addTaskButton1/@Listeners/@addTaskButtonSelection/@GroovyAction
                sname
                GroovyAction
                sisSynchronized
                false
                sthrowException
                true
                suseOtherAction
                false
                svarScope
                Local
                sdisableGlobalContext
                false
                Scode
#$@text#$@
import org.xmeta.Thing;
import org.xmeta.ActionContext;
import xworker.swt.util.SwtDialog;

def dataTree = dataObjectContext.dataTree;
def paramThing = dataTree.getData("taskParamThing");
def param = new Thing(paramThing);
def item = dataTree.getSelection()[0];
def data = dataTree.getSelection()[0].getData();
param.putAll(data);

def ac = new ActionContext();
ac.put("parent", editParamButton.getShell());
ac.put("paramThing", param);

def shellThing = world.getThing("xworker.app.appmanager.swt.editors.monitor.ParamsEditor");
def newShell = shellThing.doAction("create", ac);
def dialog = new SwtDialog(newShell, ac);
def result = dialog.open();
if(result != null){
    data.putAll(result);
    //data.update(actionContext);
    dataObjectContext.dataStore.doAction("update", actionContext, ["record": data]);
}
#$@text#$@
                sinterpretationType
                Action
                screateLocalVarScope
                false
                ssaveReturn
                false
                sdescriptors
                xworker.lang.actions.Actions/@GroovyAction
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_mark
                false
                sid
                GroovyAction
            @/@Control/@topSashForm/@DataObjectTreeEditComposite/@Buttons/@addTaskButton1/@addTaskButtonRowData
            sname
            addTaskButtonRowData
            sexclude
            false
            swidth
            100
            sheight
            -1
            sdescriptors
            xworker.swt.layout.LayoutDatas/@RowData
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_mark
            false
            sid
            addTaskButtonRowData
        @/@Control/@topSashForm/@DataObjectTreeEditComposite/@actions
        sname
        actions
        sdescriptors
        xworker.swt.app.view.swt.widgets.DataObjectTreeEditComposite/@actions1
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_mark
        false
        sid
        actions
          @/@Control/@topSashForm/@DataObjectTreeEditComposite/@actions/@treeSelection
          sname
          treeSelection
          sisSynchronized
          false
          sthrowException
          true
          suseOtherAction
          false
          svarScope
          Local
          sdisableGlobalContext
          false
          Scode
#$@text#$@
import xworker.dataObject.DataObject;
import xworker.lang.util.XWorkerUtils;

editParamButton.setEnabled(false);

def dataTree = dataObjectContext.dataTree;

def task = dataTree.getSelection()[0].getData();
    
//显示任务的文档    
def taskId = task.get("taskId");
def rtask = new DataObject("xworker.app.monitor.dataobjects.ResMonitorTasks");
rtask.put("id", taskId);
rtask = rtask.load(actionContext);

//参数的名称
for(int i=5; i<=12; i++){
    def column = dataTree.getColumn(i);
    column.setText("参数" + (i - 4));
}

def taskPath = rtask.getString("taskPath");
if(taskPath != null){
    def taskThing = world.getThing(taskPath);
    if(taskThing != null){
        helpBrowser.setUrl(XWorkerUtils.getThingDescUrl(taskThing));
        
        //任务本身的参数
        def taskParamThing = taskThing.doAction("getTaskParameterThing", actionContext);
        if(taskParamThing != null){
            dataTree.setData("taskParamThing", taskParamThing);     
            
            def pthing = world.getThing(taskParamThing);
            if(pthing != null){
                for(pm in pthing.getChilds()){
                    int index = 0;
                    String name = pm.getMetadata().getLabel();;
                    String sname = pm.getString("name");
                    sname = sname.substring(5, sname.length());
                    index = 4 + Integer.parseInt(sname);
                    
                    if(index != 0){
                        def column = dataTree.getColumn(index);
                        column.setText(name);
                    }
                }
            }     
            
            taskEditParamButton.setEnabled(true); 
        }else{
            taskEditParamButton.setEnabled(false);
        }
    }
}

addResButton.setEnabled(true);
deleteResButton.setEnabled(false);
editResParamButton.setEnabled(false);
#$@text#$@
          sinterpretationType
          Action
          screateLocalVarScope
          false
          ssaveReturn
          false
          sdescriptors
          xworker.lang.actions.Actions/@GroovyAction
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_mark
          false
          sid
          treeSelection
          @/@Control/@topSashForm/@DataObjectTreeEditComposite/@actions/@treeDeleted
          sname
          treeDeleted
          sisSynchronized
          false
          sthrowException
          true
          suseOtherAction
          false
          svarScope
          Local
          sdisableGlobalContext
          false
          Scode
#$@text#$@
taskEditParamButton.setEnabled(false);

addResButton.setEnabled(false);
deleteResButton.setEnabled(false);
editResParamButton.setEnabled(false);
#$@text#$@
          sinterpretationType
          Action
          screateLocalVarScope
          false
          ssaveReturn
          false
          sdescriptors
          xworker.lang.actions.Actions/@GroovyAction
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_mark
          false
          sid
          treeDeleted
          @/@Control/@topSashForm/@DataObjectTreeEditComposite/@actions/@onStoreLoaded
          sname
          onStoreLoaded
          sisSynchronized
          false
          sthrowException
          true
          suseOtherAction
          false
          svarScope
          Local
          sdisableGlobalContext
          false
          Scode
#$@text#$@
taskEditParamButton.setEnabled(false);

addResButton.setEnabled(false);
deleteResButton.setEnabled(false);
editResParamButton.setEnabled(false);

//刷新资源
resDataStore.doAction("load", actionContext, ["params":["taskId":-1]]);
#$@text#$@
          sinterpretationType
          Action
          screateLocalVarScope
          false
          ssaveReturn
          false
          sdescriptors
          xworker.lang.actions.Actions/@GroovyAction
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_mark
          false
          sid
          onStoreLoaded
      @/@Control/@topSashForm/@rightSashForm
      sname
      rightSashForm
      sstyle
      VERTICAL
      sSMOOTH
      false
      sweights
      60,40
      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
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_mark
      false
      sid
      rightSashForm
        @/@Control/@topSashForm/@rightSashForm/@dbsComposite
        sname
        resComposite
        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_mark
        false
        sid
        dbsComposite
          @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@dbsCompositeGridLayout
          sname
          dbsCompositeGridLayout
          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_mark
          false
          sid
          dbsCompositeGridLayout
          @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@dbsLabel
          sname
          dbsLabel
          sBORDER
          false
          stype
          HORIZONTAL
          sshadow
          SHADOW_OUT
          salignment
          LEFT
          stext
          资源列表：
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          sdescriptors
          xworker.swt.Widgets/@Label
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_mark
          false
          sid
          dbsLabel
            @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@dbsLabel/@dbsLabelGridData
            sname
            dbsLabelGridData
            sstyle
            FILL_HORIZONTAL
            shorizontalIndent
            0
            swidth
            -1
            sheight
            -1
            shorizontalAlignment
            BEGINNING
            sverticalAlignment
            CENTER
            shorizontalSpan
            1
            sverticalSpan
            1
            sgrabExcessHorizontalSpace
            false
            sgrabExcessVerticalSpace
            false
            sdescriptors
            xworker.swt.layout.LayoutDatas/@GridData
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_mark
            false
            sid
            dbsLabelGridData
          @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@dbsTable
          sname
          dbsTable
          sselectStyle
          SINGLE
          sV_SCROLL
          true
          sH_SCROLL
          true
          sCHECK
          true
          sFULL_SELECTION
          true
          sHIDE_SELECTION
          true
          sBORDER
          false
          slineVisible
          true
          smultipleColumns
          true
          sheaderVisible
          true
          ssortIndicator
          true
          smoveableColumns
          true
          sheadImages
          false
          ssubImages
          false
          sVIRTUAL
          false
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          sdescriptors
          xworker.swt.Widgets/@Table
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_mark
          false
          sid
          dbsTable
            @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@dbsTable/@dbsTableGridData
            sname
            dbsTableGridData
            sstyle
            FILL_BOTH
            shorizontalIndent
            0
            swidth
            -1
            sheight
            -1
            shorizontalAlignment
            BEGINNING
            sverticalAlignment
            CENTER
            shorizontalSpan
            1
            sverticalSpan
            1
            sgrabExcessHorizontalSpace
            false
            sgrabExcessVerticalSpace
            false
            sdescriptors
            xworker.swt.layout.LayoutDatas/@GridData
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_mark
            false
            sid
            dbsTableGridData
            @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@dbsTable/@dbDataStore
            sname
            resDataStore
            sattachToParent
            true
            sloadBackground
            true
            sautoLoad
            false
            sautoSave
            true
            sdataObject
            xworker.app.monitor.dataobjects.ResMonitorResItems
            spaging
            extend
            spageSize
            50
            sstoreSortField
            _extend
            sstoreSortDir
            ASC
            seditable
            extend
            seditmethod
            extend
            sdescriptors
            xworker.swt.widgets.Table/@DataStore
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_mark
            false
            sid
            dbDataStore
              @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@dbsTable/@dbDataStore/@queryConfig
              sname
              queryConfig
              sattributeName
              taskId
              sdataName
              taskId
              boperator
              1
              sjoin
              and
              signoreNull
              true
              sdummySql
              false
              saddOneDay
              false
              sdescriptors
              xworker.swt.app.view.swt.data.DataStore/@Condition
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_mark
              false
              sid
              queryConfig
            @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@dbsTable/@Listeners
            sname
            Listeners
            sdescriptors
            xworker.swt.widgets.Widget/@Listeners
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_mark
            false
            sid
            Listeners
              @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@dbsTable/@Listeners/@dbsTableSelection
              sname
              dbsTableSelection
              stype
              Selection
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_mark
              false
              sid
              dbsTableSelection
                @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@dbsTable/@Listeners/@dbsTableSelection/@GroovyAction
                sname
                GroovyAction
                sisSynchronized
                false
                sthrowException
                true
                suseOtherAction
                false
                svarScope
                Local
                sdisableGlobalContext
                false
                Scode
#$@text#$@
deleteDbButton.setEnabled(true);
if(tasksTable.getData("paramThing") != null){
    editParamButton.setEnabled(true);
}
#$@text#$@
                sinterpretationType
                Action
                screateLocalVarScope
                false
                ssaveReturn
                false
                sdescriptors
                xworker.lang.actions.Actions/@GroovyAction
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_mark
                false
                sid
                GroovyAction
          @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163
          sname
          dbsButtonComposite
          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
          18163
            @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@18164
            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.layout.LayoutDatas/@GridData
            sid
            18164
            @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@18165
            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
            18165
            @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@18166
            sname
            addResButton
            stext
            添加资源
            stype
            SWT.PUSH
            sflat
            false
            sborder
            false
            sselected
            false
            scapture
            false
            senabled
            true
            sredraw
            true
            svisible
            true
            sdescriptors
            xworker.swt.Widgets/@Button
            sth_createIndex
            false
            sid
            18166
              @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@18166/@18167
              sname
              RowData
              sexclude
              false
              swidth
              80
              sheight
              -1
              sdescriptors
              xworker.swt.layout.LayoutDatas/@RowData
              sth_createIndex
              false
              sid
              18167
              @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@18166/@18168
              sname
              Listeners
              sdescriptors
              xworker.swt.widgets.Widget/@Listeners
              sth_createIndex
              false
              sid
              18168
                @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@18166/@18168/@18169
                sname
                addTaskButtonSelection
                stype
                Selection
                sdescriptors
                xworker.swt.events.Listeners/@listeners/@Listener
                sth_createIndex
                false
                sid
                18169
                  @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@18166/@18168/@18169/@GroovyAction
                  sname
                  GroovyAction
                  sisSynchronized
                  false
                  sthrowException
                  true
                  suseOtherAction
                  false
                  svarScope
                  Local
                  sdisableGlobalContext
                  false
                  Scode
#$@text#$@
import org.xmeta.ActionContext;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;

import xworker.swt.util.SwtDialog;
import xworker.dataObject.DataObject;
import xworker.dataObject.utils.DataObjectUtil;

//任务
def dataTree = dataObjectContext.dataTree;
def task = dataTree.getSelection()[0].getData();
def taskDataObject = new DataObject("xworker.app.monitor.dataobjects.ResMonitorTasks");
taskDataObject.put("id", task.taskId);
taskDataObject = taskDataObject.load(actionContext);
//log.info("" + taskDataObject.taskPath);
def taskThing = world.getThing(taskDataObject.taskPath);
if(taskThing == null){
    def box = new MessageBox(tasksTable.getShell(), SWT.ICON_WARNING | SWT.OK);
    box.setText("添加资源");
    box.setMessage("任务不存在！任务没有设置taskPath或taskPath指向的事物不存在！");
    box.open();
    return;
}

def resSelectorPath = taskThing.doAction("getResSelectorPath");
if(resSelectorPath == null || world.getThing(resSelectorPath) == null){
    def box = new MessageBox(tasksTable.getShell(), SWT.ICON_WARNING | SWT.OK);
    box.setText("添加资源");
    box.setMessage("通过任务事物getResSelectorPath获取的选择资源的窗口事物不存在！");
    box.open();
    return;
}

//选择数据
def ac = new ActionContext();
ac.put("parent", addTaskButton.getShell());
def shellThing = world.getThing(resSelectorPath);
def shell = shellThing.doAction("create", ac);
def datas = SwtDialog.open(shell, ac);

//插入数据
for(data in datas){
    def dataObject = new DataObject("xworker.app.monitor.dataobjects.ResMonitorTriggerTaskResItems");
    dataObject.put("taskId",tasksTable.getSelection()[0].getData().get("id"));
    dataObject.put("resId", data.get("id"));
    dataObject.put("resName", data.get("name")); 
    dataObject.put("status", 1);
    DataObjectUtil.createIfNotExists(dataObject, ["resId", "taskId"] as String[], actionContext);
}

//重新刷新
resDataStore.doAction("reload", actionContext);
#$@text#$@
                  sinterpretationType
                  Action
                  screateLocalVarScope
                  false
                  ssaveReturn
                  false
                  sdescriptors
                  xworker.lang.actions.Actions/@GroovyAction
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_mark
                  false
                  sid
                  GroovyAction
            @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@18170
            sname
            deleteResButton
            stext
            删除资源
            stype
            SWT.PUSH
            sflat
            false
            sborder
            false
            sselected
            false
            scapture
            false
            senabled
            true
            sredraw
            true
            svisible
            true
            sdescriptors
            xworker.swt.Widgets/@Button
            sth_createIndex
            false
            sid
            18170
              @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@18170/@18171
              sname
              RowData
              sexclude
              false
              swidth
              80
              sheight
              -1
              sdescriptors
              xworker.swt.layout.LayoutDatas/@RowData
              sth_createIndex
              false
              sid
              18171
              @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@18170/@18172
              sname
              Listeners
              sdescriptors
              xworker.swt.widgets.Widget/@Listeners
              sth_createIndex
              false
              sid
              18172
                @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@18170/@18172/@18173
                sname
                deleteTaskButtonSelection
                stype
                Selection
                sdescriptors
                xworker.swt.events.Listeners/@listeners/@Listener
                sth_createIndex
                false
                sid
                18173
                  @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@18170/@18172/@18173/@DataStoreAction
                  sname
                  DataStoreAction
                  sstoreName
                  dbDataStore
                  smethod
                  remove
                  srecordSource
                  DataObjectTable
                  srecordName
                  dbsTable
                  sdeleteConfirm
                  true
                  scrateConfirm
                  false
                  supdateConfirm
                  false
                  scommitConfirm
                  false
                  supdateBatchConfirm
                  true
                  sremoveBatchConfirm
                  true
                  sdeleteMessage
                  却是要删除选中的资源么？
                  sinterpretationType
                  Self
                  sattributeTemplate
                  false
                  schildsAttributeTemplate
                  false
                  svarScope
                  Local
                  sisSynchronized
                  false
                  sthrowException
                  true
                  suseOtherAction
                  false
                  screateLocalVarScope
                  false
                  ssaveReturn
                  false
                  sdisableGlobalContext
                  false
                  sdescriptors
                  xworker.swt.app.view.swt.data.DataStoreAction
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_mark
                  false
                  sid
                  DataStoreAction
            @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@181701
            sname
            editResParamButton
            stext
            编辑参数
            stype
            SWT.PUSH
            sflat
            false
            sborder
            false
            sselected
            false
            scapture
            false
            senabled
            false
            sredraw
            true
            svisible
            true
            sdescriptors
            xworker.swt.Widgets/@Button
            sth_createIndex
            false
            sid
            181701
              @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@181701/@18171
              sname
              RowData
              sexclude
              false
              swidth
              80
              sheight
              -1
              sdescriptors
              xworker.swt.layout.LayoutDatas/@RowData
              sth_createIndex
              false
              sid
              18171
              @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@181701/@18172
              sname
              Listeners
              sdescriptors
              xworker.swt.widgets.Widget/@Listeners
              sth_createIndex
              false
              sid
              18172
                @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@181701/@18172/@editParamButtonSelection
                sname
                editParamButtonSelection
                stype
                Selection
                sdescriptors
                xworker.swt.events.Listeners/@listeners/@Listener
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_mark
                false
                sid
                editParamButtonSelection
                  @/@Control/@topSashForm/@rightSashForm/@dbsComposite/@18163/@181701/@18172/@editParamButtonSelection/@GroovyAction
                  sname
                  GroovyAction
                  sisSynchronized
                  false
                  sthrowException
                  true
                  suseOtherAction
                  false
                  svarScope
                  Local
                  sdisableGlobalContext
                  false
                  Scode
#$@text#$@
import org.xmeta.Thing;
import org.xmeta.ActionContext;
import xworker.swt.util.SwtDialog;

def paramThing = tasksTable.getData("paramThing");
def param = new Thing(paramThing);
def item = dbsTable.getSelection()[0];
def data = dbsTable.getSelection()[0].getData();
param.putAll(data);

def ac = new ActionContext();
ac.put("parent", editParamButton.getShell());
ac.put("paramThing", param);

def shellThing = world.getThing("xworker.app.appmanager.swt.editors.monitor.ParamsEditor");
def newShell = shellThing.doAction("create", ac);
def dialog = new SwtDialog(newShell, ac);
def result = dialog.open();
if(result != null){
    data.putAll(result);
    //data.update(actionContext);
    dbDataStore.doAction("update", actionContext, ["record": data]);
}
#$@text#$@
                  sinterpretationType
                  Action
                  screateLocalVarScope
                  false
                  ssaveReturn
                  false
                  sdescriptors
                  xworker.lang.actions.Actions/@GroovyAction
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_mark
                  false
                  sid
                  GroovyAction
        @/@Control/@topSashForm/@rightSashForm/@helpBrowser
        sname
        helpBrowser
        sMOZILLA
        false
        sWEBKIT
        false
        sjavascriptEnabled
        true
        sdescriptors
        xworker.swt.Widgets/@Browser
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_mark
        false
        sid
        helpBrowser
          @/@Control/@topSashForm/@rightSashForm/@helpBrowser/@UtilBrowser
          sname
          UtilBrowser
          sdescriptors
          xworker.swt.browser.Browser/@UtilBrowser
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_mark
          false
          sid
          UtilBrowser
