^1639983267916
@
sname
ScalaAction
slabel
ScalaAction
sdescriptors
xworker.lang.MetaDescriptor3
smany
true
seditCols
2
sinitialization
false
sgroup
xworker.lang.actions.Inout,xworker.lang.actions.Action
smodifier
public
sinheritDescription
false
Sdescription
#$@text#$@
<p>使用Scala语言的动作。</p>

<p><strong>编译成Java的Class再调用</strong></p>

<p>&nbsp;&nbsp;&nbsp; Scala动作的原理是先把Scala编译成Class然后再调用，因此需要指定类名和要执行的方法名，其中方法对应于Java就是静态的参数是ActionContext的类。</p>

<p><strong>内部Scala的限制</strong></p>

<p>&nbsp;&nbsp;&nbsp; 内部Scala是Scala代码文件保存到事物管理器下，当前事物管理器是代码的源路径。</p>

<p><strong>作为脚本时的限制</strong></p>

<p>&nbsp;&nbsp;&nbsp; 作为脚本最后其实是封装到一个object下的一个名为run的方法里的，run方法的参数是actionContext变量上下文，类型是org.xmeta.ActionContext。</p>

<p><strong>第一次使用Scala</strong></p>

<ol>
	<li>在事物xworker.ide.config.decriptors.GlobalConfig中配置scalaHome，如C:Program Files (x86)scala。</li>
	<li>重新启动xworker。</li>
</ol>

<p><strong>Java9以上编译错误</strong></p>

<p>&nbsp;&nbsp;&nbsp; 把jdk中的java.base.jmod拷贝到XWorker的根目录的modules目下。</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
    suseInnerJava
    false
    souterClassName
    xworker.lang.actions.ScalaAction
    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
  @/@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
  @/@outerClassName
  sname
  outerClassName
  slabel
  Java类全名
  sinputtype
  text
  ssize
  60
  scolspan
  2
  sshowLabel
  true
  sreadOnly
  false
  sinheritDescription
  false
  sdescription
  <p>在使用外部Java或内部Java时需要填写，如果Java代码直接写到本事物中则不需要。</p>
  svalidateAllowBlank
  true
  LvalidateOnBlur
  true
  LallowDecimals
  true
  LallowNegative
  true
  snotXmlAttribute
  false
  sen_label
  Referenced Class Name
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  outerClassName
  @/@className1
  sname
  className
  slabel
  类名
  sshowLabel
  true
  sreadOnly
  false
  sinheritDescription
  false
  sdescription
  <p>代码所表示的Java类名。如：User。</p>
  svalidateAllowBlank
  true
  LvalidateOnBlur
  true
  LallowDecimals
  true
  LallowNegative
  true
  snotXmlAttribute
  false
  sen_label
  Class Name
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  className1
  @/@methodName1
  sname
  methodName
  slabel
  方法名称
  sinputtype
  text
  ssize
  40
  sshowLabel
  true
  sreadOnly
  false
  sinheritDescription
  false
  sdescription
  <p>要调用的方法名称。</p>
  svalidateAllowBlank
  true
  LvalidateOnBlur
  true
  LallowDecimals
  true
  LallowNegative
  true
  snotXmlAttribute
  false
  sen_label
  Method Name
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  methodName1
  @/@innerClassName
  sname
  useInnerScala
  slabel
  使用内部Scala
  sinputtype
  truefalse
  ssize
  60
  sshowLabel
  true
  sreadOnly
  false
  sdefault
  false
  sinheritDescription
  false
  Sdescription
#$@text#$@
<p>如果不为空表面Groovy代码是编写到当前事物的事物管理中的，说明Groovy代码并不是写到Groovy动作中。</p>

<p><strong>注意</strong></p>

<p>只有FileThingManager才能够把Groovy脚本以文件的形式放到事物管理器下，其他事物管理者都没有此功能。</p>
#$@text#$@
  svalidateAllowBlank
  true
  LvalidateOnBlur
  true
  LallowDecimals
  true
  LallowNegative
  true
  snotXmlAttribute
  false
  sen_label
  UserInnerScala
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  innerClassName
  @/@isScript
  sname
  isScript
  slabel
  是否是脚本
  sinputtype
  truefalse
  sshowLabel
  true
  sreadOnly
  false
  sdefault
  true
  sinheritDescription
  false
  sdescription
  <p>只针对使用代码（Code属性）编写Scala的情形，如果是脚本那么在编译Scala时会自动加一个Object类名，并把它封装到一个静态方法之中。</p>
  svalidateAllowBlank
  true
  LvalidateOnBlur
  true
  LallowDecimals
  true
  LallowNegative
  true
  snotXmlAttribute
  false
  sen_label
  IsScript
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  isScript
  @/@code1
  sname
  code
  slabel
  代码
  sinputtype
  codeEditor
  scolspan
  2
  sshowLabel
  true
  sinputattrs
  codeName=scala codeType=scala wrap=false fillBoth=true cols=70 rows=10
  sreadOnly
  false
  sinheritDescription
  false
  svalidateAllowBlank
  true
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  snotXmlAttribute
  false
  sen_label
  Code
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  code1
  @/@description
  sname
  description
  slabel
  描述
  sinputtype
  html
  scolspan
  2
  sgroup
  Description
  sgroupIndex
  -90
  sinputattrs
  Width='80';Height='50';ToolbarSet="SwtEdit"
  sreadOnly
  false
  sinheritDescription
  false
  svalidateAllowBlank
  true
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sen_label
  Description
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  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
