^1639992263868
@
sname
JdkScript
slabel
JdkScript
sdescriptors
xworker.lang.MetaDescriptor3
sextends
xworker.lang.actions.AbstractJdkScriptAction
smany
true
seditCols
2
sinitialization
false
sgroup
thing.action
smodifier
public
sinheritDescription
false
Sdescription
#$@text#$@
<p><strong>JdkScript</strong></p>

<p>使用JDK1.6的Script定义的动作，即支持使用JSR-223规范的脚本。</p>

<p><strong>使用方法</strong></p>

<ul>
	<li><strong>设置脚本引擎的类库</strong><br />
	XWorker并且内置各种脚本语言的类库，所以需要自行下载并把相应类库放到XWorker的lib目录下。<br />
	&nbsp;</li>
	<li><strong>发现脚本</strong><br />
	可以从language属性下拉选择已知的脚本，或自行输入脚本的名称和脚本的文件后缀名。<br />
	&nbsp;</li>
	<li><strong>脚本路径</strong><br />
	可以通过code直接编写脚本，也可以指定脚本文件，其中code编写的脚本也会生成到目录下，它们的目录是&lt;worldPath&gt;/scripts/。</li>
</ul>

<p><strong>变量管理</strong></p>

<p>&nbsp;&nbsp;&nbsp; 可以直接使用变量上下文中的变量，需要自行管理变量上下文中的变量。变量上下文中的默认变量：</p>

<ul>
	<li><strong>actionContext: ActionContext</strong><br />
	变量上下文自身。<br />
	&nbsp;</li>
	<li><strong>world: World</strong><br />
	org.xmeta.World对象，事物模型的总容器。</li>
</ul>

<p><strong>建议使用GroovyAction</strong></p>

<p>&nbsp;&nbsp;&nbsp; 建议使用GroovyAction的动作作为脚本，由于JdkScript用的还比较少，所以暂时还不清楚有哪些优缺点。</p>
#$@text#$@
snotXmlAttribute
false
sjson_isArray
false
sth_createIndex
true
sth_registThing
child|xworker.lang.util.DescriptorsIndex
sth_registMyChilds
false
sth_registDisabled
false
sth_mark
false
  @/@name
  sname
  name
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  name
  @/@language
  sname
  language
  sinputtype
  inputSelect
  sshowLabel
  true
  sreadOnly
  false
  sdefault
  javascript
  sinheritDescription
  false
  sdescription
  <p>在这里选的脚本引擎，如果没有可以输入。</p>
  svalidateAllowBlank
  true
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  language
    @/@language/@javascript
    sname
    javascript
    slabel
    JavaScript
    svalue
    javascript
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute/@value
    sid
    javascript
    @/@language/@SwtObject
    sname
    SwtObject
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute/@SwtObject
    sth_createIndex
    false
    sth_mark
    false
    sid
    SwtObject
      @/@language/@SwtObject/@inputExtend
      sname
      inputExtend
      sdescriptors
      xworker.lang.MetaDescriptor3/@attribute/@SwtObject/@inputExtend
      sth_createIndex
      false
      sth_mark
      false
      sid
      inputExtend
        @/@language/@SwtObject/@inputExtend/@listeners
        sname
        listeners
        sdescriptors
        xworker.swt.events.Listeners/@listeners
        sth_createIndex
        false
        sth_mark
        false
        sid
        listeners
          @/@language/@SwtObject/@inputExtend/@listeners/@modify
          sname
          modify
          stype
          Modify
          sdescriptors
          xworker.swt.events.Listeners/@listeners/@Listener
          sth_createIndex
          false
          sth_mark
          false
          sid
          modify
            @/@language/@SwtObject/@inputExtend/@listeners/@modify/@GroovyAction
            sname
            GroovyAction
            sisSynchronized
            false
            sthrowException
            true
            suseOtherAction
            false
            svarScope
            Local
            sdisableGlobalContext
            false
            Scode
#$@text#$@
def script = languageInput.getText();
switch(script){
    case "JavaScript":
        fileExtInput.setText("js");
        break;
    case "Lua":
        fileExtInput.setText("lua");
        break;
    case "Python":
        fileExtInput.setText("py");
        break;
    case "Ruby":
        fileExtInput.setText("rb");
        break;
}
#$@text#$@
            sinterpretationType
            Action
            screateLocalVarScope
            false
            ssaveReturn
            false
            sdescriptors
            xworker.lang.actions.Actions/@GroovyAction
            sth_createIndex
            false
            sth_mark
            false
            sid
            GroovyAction
    @/@language/@Lua
    sname
    Lua
    slabel
    Lua
    svalue
    lua
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute/@value
    sth_createIndex
    false
    sth_mark
    false
    sid
    Lua
    @/@language/@Phython
    sname
    Python
    slabel
    Python
    svalue
    python
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute/@value
    sth_createIndex
    false
    sth_mark
    false
    sid
    Phython
    @/@language/@Ruby
    sname
    Ruby
    slabel
    ruby
    svalue
    Ruby
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute/@value
    sth_createIndex
    false
    sth_mark
    false
    sid
    Ruby
  @/@scriptFilePath
  sname
  scriptFilePath
  ssize
  60
  sshowLabel
  true
  sreadOnly
  false
  sinheritDescription
  false
  Sdescription
#$@text#$@
<p>脚本的文件路径，相对路径是&lt;worldPath&gt;/scripts/。</p>

<p>通过Code生成的脚本文件也是放在&lt;worldPath&gt;/scripts/目录下的。</p>
#$@text#$@
  svalidateAllowBlank
  true
  LvalidateOnBlur
  true
  LallowDecimals
  true
  LallowNegative
  true
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sth_createIndex
  false
  sth_mark
  false
  sid
  scriptFilePath
  @/@fileExt
  sname
  fileExt
  sshowLabel
  true
  sreadOnly
  false
  sinheritDescription
  false
  svalidateAllowBlank
  true
  LvalidateOnBlur
  true
  LallowDecimals
  true
  LallowNegative
  true
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sth_createIndex
  false
  sth_mark
  false
  sid
  fileExt
  @/@code
  sname
  code
  slabel
  code
  sinputtype
  codeEditor
  scolspan
  2
  sinputattrs
  rows="15" cols="70" codeName="JavaScript" codeType="JavaScript"
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  code
  @/@description
  sname
  description
  sinputtype
  html
  scolspan
  2
  sgroup
  描述
  sinputattrs
  Width='480';Height='300';ToolbarSet="SwtEdit"
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  description
  @/@swtMenus
  sname
  swtMenus
  slabel
  swtMenus
  sdescriptors
  xworker.lang.MetaDescriptor3/@swtMenus
  sextends
  xworker.lang.actions.ActionMenu/@swtMenus
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  swtMenus
