^1640692630533
@
sname
ShellComposite
slabel
ShellComposite
sdescriptors
xworker.lang.MetaDescriptor3
sextends
xworker.swt.layout.LayoutDatas
smany
true
seditCols
2
sinitialization
false
sgroup
net.jsch
smodifier
public
sinheritDescription
false
Sdescription
#$@text#$@
<p>一个简单的Ssh窗口，可以执行脚本命令，由于不能解析ssh窗口的格式，所以显示可能不是太好。</p>

<p>可以重写的方法</p>

<ul>
	<li><strong>getSession</strong><br />
	返回Jsch的Session，可以通过相关事物xworker.jsch.Session的实例创建。</li>
</ul>
#$@text#$@
snotXmlAttribute
false
sth_createIndex
true
sth_registThing
child|xworker.swt.Widgets
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/@create
    sname
    create
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Local
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import org.xmeta.ActionContext;

//获取Shell对应的控件text
def textThing = world.getThing("xworker.jsch.ssh.swt.ShellComposite/@text");

//获取jsch的Session对象
def session = self.doAction("getSession", actionContext);

//创建shell控件
def ac = new ActionContext();
ac.put("parent", actionContext.get("parent"));
ac.put("session", session);
ac.put("thing", self);
def text = textThing.doAction("create", ac);
text.setData("actionContext", ac);

//执行子节点，比如布局什么的
actionContext.peek().put("parent", text);
for(child in self.getChilds()){
    child.doAction("create", actionContext);
}

//保存text
actionContext.getScope(0).put(self.getMetadata().getName(), text);

return text;
#$@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
    create
    @/@actions/@getSession
    sname
    getSession
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Local
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import org.xmeta.util.UtilData;

import com.jcraft.jsch.Session;

def session = UtilData.getData(self, "session", actionContext);
if(session instanceof Session){
    return session;
}else{
    return session.doAction("create", 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
    getSession
  @/@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
  @/@sessionThing
  sname
  session
  sinputtype
  dataSelector
  ssize
  60
  sshowLabel
  true
  sreadOnly
  false
  sinheritDescription
  false
  sdescription
  <p>可以是Session实例或Thing对象，可以用var或ognl等。</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
  sessionThing
  @/@closeSession
  sname
  closeSession
  sinputtype
  truefalse
  sshowLabel
  true
  sreadOnly
  false
  sdefault
  true
  sinheritDescription
  false
  sdescription
  <p>是否在SWT控件销毁时同时同步会话。</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
  closeSession
  @/@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
  @/@text
  sname
  text
  sstyle
  MULTI
  sFULL_SELECTION
  false
  sREAD_ONLY
  false
  sWRAP
  false
  sH_SCROLL
  true
  sV_SCROLL
  true
  sBORDER
  false
  salign
  LEFT
  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/@StyledText
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_mark
  false
  sid
  text
    @/@text/@RunAction
    sname
    RunAction
    sdescriptors
    xworker.swt.xworker.RunAction
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    RunAction
      @/@text/@RunAction/@KeyInputToInputStream
      sname
      KeyInputToInputStream
      sstyledTextVarName
      text
      sinputStreamVarName
      in
      seventDoit
      false
      sinterpretationType
      Self
      sattributeTemplate
      false
      schildsAttributeTemplate
      false
      svarScope
      Local
      sisSynchronized
      false
      sthrowException
      true
      suseOtherAction
      false
      screateLocalVarScope
      false
      ssaveReturn
      false
      sdisableGlobalContext
      false
      sdescriptors
      xworker.swt.actions.StyledTextActions/@InputToInputStream
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_mark
      false
      sid
      KeyInputToInputStream
      @/@text/@RunAction/@BindInputStream
      sname
      BindInputStream
      sstyledTextVarName
      text
      scharset
      utf-8
      sautoScroolToBottom
      true
      screateThread
      true
      sinterpretationType
      Self
      sattributeTemplate
      false
      schildsAttributeTemplate
      false
      svarScope
      Local
      sisSynchronized
      false
      sthrowException
      true
      suseOtherAction
      false
      screateLocalVarScope
      false
      ssaveReturn
      false
      sdisableGlobalContext
      false
      sdescriptors
      xworker.swt.actions.StyledTextActions/@BindInputStream
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_mark
      false
      sid
      BindInputStream
        @/@text/@RunAction/@BindInputStream/@actions
        sname
        actions
        sdescriptors
        xworker.swt.actions.StyledTextActions/@BindInputStream/@actions1
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_mark
        false
        sid
        actions
          @/@text/@RunAction/@BindInputStream/@actions/@getInputStream
          sname
          getInputStream
          spipedOutputStream
          true
          spipedOutputStreamVar
          out
          sinterpretationType
          Self
          sattributeTemplate
          false
          schildsAttributeTemplate
          false
          svarScope
          Local
          sisSynchronized
          false
          sthrowException
          true
          suseOtherAction
          false
          screateLocalVarScope
          false
          ssaveReturn
          false
          sdisableGlobalContext
          false
          sdescriptors
          xworker.core.java.io.CreatePipedInputStream
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_mark
          false
          sid
          getInputStream
      @/@text/@RunAction/@Shell
      sname
      Shell
      ssessionVar
      session
      sinputStream
      in
      soutputStream
      out
      sinterpretationType
      Self
      sattributeTemplate
      false
      schildsAttributeTemplate
      false
      svarScope
      Global
      sisSynchronized
      false
      sthrowException
      true
      suseOtherAction
      false
      screateLocalVarScope
      false
      ssaveReturn
      true
      sreturnVarName
      shellChannel
      sdisableGlobalContext
      false
      sdescriptors
      xworker.jsch.Shell
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_mark
      false
      sid
      Shell
    @/@text/@listeners
    sname
    listeners
    sdescriptors
    xworker.swt.events.Listeners/@listeners
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    listeners
      @/@text/@listeners/@textDispose
      sname
      textDispose
      stype
      Dispose
      sdescriptors
      xworker.swt.events.Listeners/@listeners/@Listener
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_mark
      false
      sid
      textDispose
        @/@text/@listeners/@textDispose/@GroovyAction
        sname
        GroovyAction
        sisSynchronized
        false
        sthrowException
        true
        suseOtherAction
        false
        svarScope
        Local
        sdisableGlobalContext
        false
        Scode
#$@text#$@
//结束后关闭shell的链接
if(actionContext.get("shellChannel") !=null){
    try{
        shellChannel.disconnect();
    }catch(Exception e){
        log.error("close shell channel error", e);
    }
}

//关闭session
if(thing.getBoolean("closeSession")){
    session.disconnect();
}
#$@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
  @/@actions1
  sname
  actions
  slabel
  Actions
  sdescriptors
  xworker.lang.MetaDescriptor2/@thing
  sextends
  xworker.lang.actions.Actions
  smany
  true
  seditCols
  2
  Sdescription
#$@text#$@
<p>动作集合，通过子节点可以添加各种动作，动作通常是一个可执行的程序。</p>
<p>事物的第一个动作集合的子事物才可以作为事物的行为，第二个及其他动作集合就不能作为事物的行为使用了，事物的行为默认找第一个动作集合。</p>
<p>事物的run方法一般是这个事物转化为动作之后执行的方法。</p>
#$@text#$@
  szh_label
  动作
  sth_createIndex
  false
  sid
  actions1
    @/@actions1/@name
    sname
    name
    sdescriptors
    xworker.lang.MetaDescriptor2/@attribute
    sid
    name
