^1595842537794
@
sname
ProjectSet
slabel
ProjectSet
sdescriptors
xworker.lang.MetaDescriptor3
sextends
xworker.lang.actions.SelfAction
smany
true
seditCols
2
sformNoLabel
false
sinitialization
false
smodifier
public
sinheritDescription
false
Sdescription
#$@text#$@
<p>项目初始化工具，可以把指定的项目添加到World中。</p>

<h3>导入目录中的模型项目</h3>

<p>&nbsp;&nbsp;&nbsp; 方法是添加ProjectDir子节点。</p>

<h3>导入Jar中的模型项目</h3>

<p>&nbsp;&nbsp;&nbsp; 一个Jar只能有一个项目，在Jar的根下放一个名字为&lsquo;.dml&rsquo;文件，内容是name=xxx，其中xxx是项目名。可以把.dml文件放到Java项目的源文件下，打包时自动添加到Jar中。</p>

<p>&nbsp;&nbsp;&nbsp; 把Jar拷贝到XWorker的lib目录下，当XWorker启动后会自动识别项目。</p>
#$@text#$@
snotXmlAttribute
false
sjson_isArray
false
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
  @/@actions
  sname
  actions
  sdescriptors
  xworker.lang.MetaDescriptor3/@actions
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_mark
  false
  sid
  actions
    @/@actions/@run
    sname
    run
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    suseOuterJava
    true
    souterClassName
    xworker.ide.worldexplorer.actions.ProjectSetActions
    smethodName
    run
    sdisableGlobalContext
    false
    sattributeTemplate
    false
    sinterpretationType
    Action
    svarScope
    Global
    screateLocalVarScope
    false
    ssaveReturn
    false
    sdescriptors
    xworker.lang.actions.Actions/@JavaAction
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    run
    @/@actions/@addProject
    sname
    addProject
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    suseOuterJava
    true
    suseInnerJava
    false
    souterClassName
    xworker.ide.worldexplorer.actions.ProjectSetActions
    smethodName
    addProject
    sdisableGlobalContext
    false
    sdescription
    <p>添加一个目录下的事物管理器（项目）到xworker，并初始化。</p>
    sattributeTemplate
    false
    sinterpretationType
    Action
    svarScope
    Global
    screateLocalVarScope
    false
    ssaveReturn
    false
    sdebugLog
    false
    sdescriptors
    xworker.lang.actions.Actions/@JavaAction
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    addProject
      @/@actions/@addProject/@ins
      sisValidate
      false
      sname
      ins
      sdescriptors
      xworker.lang.actions.Inout/@ins
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_mark
      false
      sid
      ins
        @/@actions/@addProject/@ins/@dir
        sname
        projectFile
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_mark
        false
        sid
        dir
        @/@actions/@addProject/@ins/@isWorkspace
        sname
        isWorkspace
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_mark
        false
        sid
        isWorkspace
        @/@actions/@addProject/@ins/@initAttributes
        sname
        initAttributes
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        initAttributes
  @/@name
  sname
  name
  sshowLabel
  true
  sreadOnly
  false
  sinheritDescription
  false
  svalidateAllowBlank
  true
  LvalidateOnBlur
  true
  LallowDecimals
  true
  LallowNegative
  true
  snotXmlAttribute
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_mark
  false
  sid
  name
  @/@label
  sname
  label
  sshowLabel
  true
  sreadOnly
  false
  sinheritDescription
  false
  svalidateAllowBlank
  true
  LvalidateOnBlur
  true
  LallowDecimals
  true
  LallowNegative
  true
  snotXmlAttribute
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_mark
  false
  sid
  label
  @/@description
  sname
  description
  sinputtype
  html
  sshowLabel
  true
  sreadOnly
  false
  sinheritDescription
  false
  svalidateAllowBlank
  true
  LvalidateOnBlur
  true
  LallowDecimals
  true
  LallowNegative
  true
  snotXmlAttribute
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_mark
  false
  sid
  description
  @/@ProjectDir
  sname
  ProjectDir
  sdescriptors
  xworker.lang.MetaDescriptor3/@thing
  smany
  true
  seditCols
  2
  sformNoLabel
  false
  sinitialization
  false
  smodifier
  public
  sinheritDescription
  false
  Sdescription
#$@text#$@
<p>设置模型项目或模型工作区（包含多个模型项目的目录）。</p>
#$@text#$@
  snotXmlAttribute
  false
  sjson_isArray
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_mark
  false
  sid
  ProjectDir
    @/@ProjectDir/@name
    sname
    name
    sshowLabel
    true
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    name
    @/@ProjectDir/@label
    sname
    label
    sshowLabel
    true
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    label
    @/@ProjectDir/@dir
    sname
    dir
    sinputtype
    filePath
    ssize
    60
    sshowLabel
    true
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    dir
    @/@ProjectDir/@isWorkspace
    sname
    isWorkspace
    sinputtype
    truefalse
    sshowLabel
    true
    sreadOnly
    false
    sdefault
    false
    sinheritDescription
    false
    sdescription
    <p>如果是Workspace将添加该目录下的项目，即它的子目录被当做是项目</p>
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    isWorkspace
    @/@ProjectDir/@exclude
    sname
    exclude
    ssize
    60
    sshowLabel
    true
    sreadOnly
    false
    sdefault
    \.svn
    sinheritDescription
    false
    Sdescription
#$@text#$@
<p>如果isWorkspace=true，那么目录下要排除的目录。</p>

<p>使用正则表达式。</p>
#$@text#$@
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    exclude
    @/@ProjectDir/@isThingRoot
    sname
    isThingRoot
    sinputtype
    truefalse
    sshowLabel
    true
    sreadOnly
    false
    sdefault
    false
    sinheritDescription
    false
    sdescription
    <p>如果为true那么项目目录就是事物文件的存储目录。如果模型事物的文件放在things目录下的，或者是数据库、Redis等其它类型存储的模型的，那么应该选择false。</p>
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    isThingRoot
    @/@ProjectDir/@description
    sname
    description
    sinputtype
    html
    sshowLabel
    true
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    description
  @/@sswtMenus
  sname
  sswtMenus
  sdescriptors
  xworker.lang.MetaDescriptor3/@swtMenus
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_noThingRegistViewer
  false
  sth_fileMonitor
  false
  sth_mark
  false
  sth_registQueryOnlySelf
  false
  sid
  sswtMenus
    @/@sswtMenus/@menuDefine
    sname
    menuDefine
    sdescriptors
    xworker.lang.MetaDescriptor3/@swtMenus/@menuDefine
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_noThingRegistViewer
    false
    sth_fileMonitor
    false
    sth_mark
    false
    sth_registQueryOnlySelf
    false
    sid
    menuDefine
      @/@sswtMenus/@menuDefine/@ProjectSet
      sname
      ProjectSet
      sdescriptors
      xworker.lang.ThingMenu/@menuDefine/@menu
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_noThingRegistViewer
      false
      sth_fileMonitor
      false
      sth_mark
      false
      sth_registQueryOnlySelf
      false
      sid
      ProjectSet
    @/@sswtMenus/@menuSetting
    sname
    menuSetting
    smenuType
    ProjectSet
    sdescriptors
    xworker.lang.MetaDescriptor3/@swtMenus/@menuSetting
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_noThingRegistViewer
    false
    sth_fileMonitor
    false
    sth_mark
    false
    sth_registQueryOnlySelf
    false
    sid
    menuSetting
      @/@sswtMenus/@menuSetting/@addSourceXWorkerProjects
      sname
      addSourceXWorkerProjects
      slabel
      添加源码下的XWorker其它项目
      sisSplit
      false
      sattachParam
      true
      sdescriptors
      xworker.lang.ThingMenu/@menuSetting/@menu
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_noThingRegistViewer
      false
      sth_fileMonitor
      false
      sth_mark
      false
      sth_registQueryOnlySelf
      false
      sid
      addSourceXWorkerProjects
        @/@sswtMenus/@menuSetting/@addSourceXWorkerProjects/@actions
        sname
        actions
        sdescriptors
        xworker.lang.Menu/@actions
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_noThingRegistViewer
        false
        sth_fileMonitor
        false
        sth_mark
        false
        sth_registQueryOnlySelf
        false
        sid
        actions
          @/@sswtMenus/@menuSetting/@addSourceXWorkerProjects/@actions/@run
          sname
          run
          sisSynchronized
          false
          sthrowException
          true
          suseOtherAction
          false
          svarScope
          Local
          sdisableGlobalContext
          false
          Scode
#$@text#$@
import org.xmeta.Thing;

def projects = [
    "xworker_ai", "xworker_app","xworker_core",
    "xworker_dataobject","xworker_function","xworker_jfreechart",
    "xworker_libgdx", "xworker_misc", "xworker_swt",
    "xworker_uiflow", "xworker_web" 
];

def file = new File("../xworker_swt/src/main/resources");
if(file.exists() == false){
    envError(actionContext);
    return;
}

for(name in projects){
    add(currentThing, name);
}
currentThing.save();

def add(projectSet, name){
    if(exists(projectSet, name)){
        return;
    }
    
    def child = new Thing("xworker.ide.worldexplorer.things.ProjectSet/@ProjectDir");
    child.set("name", name);
    child.set("dir", "..\\" + name + "\\src\\main\\resources\\");
    child.set("isThingRoot", "true");
    projectSet.addChild(child);
}

def exists(projectSet, name){
    for(child in projectSet.getChilds()){
        if(child.getMetadata().getName() == name){
            return true;
        }
    }
    
    return false;
}
#$@text#$@
          sinterpretationType
          Action
          screateLocalVarScope
          false
          ssaveReturn
          false
          sswitchResult
          false
          sdebugLog
          false
          sdescriptors
          xworker.lang.actions.Actions/@GroovyAction
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_registDisabled
          false
          sth_noThingRegistViewer
          false
          sth_fileMonitor
          false
          sth_mark
          false
          sth_registQueryOnlySelf
          false
          sid
          run
            @/@sswtMenus/@menuSetting/@addSourceXWorkerProjects/@actions/@run/@ActionDefined
            sname
            ActionDefined
            sdescriptors
            xworker.lang.actions.Inout/@ActionDefined
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_registDisabled
            false
            sth_noThingRegistViewer
            false
            sth_fileMonitor
            false
            sth_mark
            false
            sth_registQueryOnlySelf
            false
            sid
            ActionDefined
              @/@sswtMenus/@menuSetting/@addSourceXWorkerProjects/@actions/@run/@ActionDefined/@envError
              sname
              envError
              sshell
              ognl:coolBar.setShell()
              sicon
              ICON_ERROR
              sbuttons
              OK
              stitle
              lang:d=添加项目&en=Add Projects
              smessage
              lang:d=当前XWorker不是运行在XWorker的源码下，不能添加源码下的项目。&en=At present, xworker is not running under the source code of xworker. You cannot add projects under the source code.
              sinterpretationType
              Self
              sattributeTemplate
              false
              schildsAttributeTemplate
              false
              svarScope
              Local
              sisSynchronized
              false
              sthrowException
              true
              screateLocalVarScope
              false
              ssaveReturn
              false
              sswitchResult
              false
              sdisableGlobalContext
              false
              sdebugLog
              false
              sdescriptors
              xworker.swt.actions.MessageBoxActions/@MessageBox
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_registDisabled
              false
              sth_noThingRegistViewer
              false
              sth_fileMonitor
              false
              sth_mark
              false
              sth_registQueryOnlySelf
              false
              sid
              envError
