^1639983259646
@
sname
shell
stext
初始化
sNO_TRIM
false
sCLOSE
true
sTITLE
true
sMIN
true
sMAX
true
sBORDER
false
sRESIZE
false
sON_TOP
false
sTOOL
false
sNO_FOCUS
false
swidth
400
sheight
300
scenterScreen
true
spack
false
smaximized
false
sfullScreen
false
sH_SCROLL
false
sV_SCROLL
false
sNO_BACKGROUND
false
sNO_MERGE_PAINTS
false
sNO_REDRAW_RESIZE
false
sNO_RADIO_GROUP
false
sEMBEDDED
false
sDOUBLE_BUFFERED
false
slabel
InitDialog
scapture
false
senabled
true
sredraw
true
svisible
true
sdescriptors
xworker.swt.widgets.Shell
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_registDisabled
false
sth_mark
false
  @/@shellGridLayout
  sname
  shellGridLayout
  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_registDisabled
  false
  sth_mark
  false
  sid
  shellGridLayout
  @/@browser
  sname
  browser
  sMOZILLA
  false
  sWEBKIT
  false
  sjavascriptEnabled
  true
  sdescriptors
  xworker.swt.Widgets/@Browser
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  browser
    @/@browser/@browserGridData
    sname
    browserGridData
    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_registDisabled
    false
    sth_mark
    false
    sid
    browserGridData
  @/@8560
  sname
  buttonComposite
  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
  8560
    @/@8560/@8561
    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
    8561
    @/@8560/@8562
    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
    8562
    @/@8560/@8563
    sname
    nextButton
    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
    8563
      @/@8560/@8563/@8564
      sname
      RowData
      sexclude
      false
      swidth
      80
      sheight
      -1
      sdescriptors
      xworker.swt.layout.LayoutDatas/@RowData
      sth_createIndex
      false
      sid
      8564
      @/@8560/@8563/@8565
      sname
      Listeners
      sdescriptors
      xworker.swt.widgets.Widget/@Listeners
      sth_createIndex
      false
      sid
      8565
        @/@8560/@8563/@8565/@8566
        sname
        nextButtonSelection
        stype
        Selection
        sdescriptors
        xworker.swt.events.Listeners/@listeners/@Listener
        sth_createIndex
        false
        sid
        8566
          @/@8560/@8563/@8565/@8566/@GroovyAction
          sname
          GroovyAction
          sisSynchronized
          false
          sthrowException
          true
          suseOtherAction
          false
          svarScope
          Local
          sdisableGlobalContext
          false
          Scode
#$@text#$@
import xworker.lang.util.XWorkerUtils;

def current = step.thing.getChilds().get(step.index);

def obj = current.doAction("finish");
if(obj == null || obj == true){
    step.index++;
    if(step.index >= step.thing.getChilds().size()){
        shell.dispose();
    }else{
        current = step.thing.getChilds().get(step.index);
        current.doAction("init", actionContext);      
        browser.setUrl(XWorkerUtils.getThingDescUrl(current));
    }
}
#$@text#$@
          sinterpretationType
          Action
          screateLocalVarScope
          false
          ssaveReturn
          false
          sdebugLog
          false
          sdescriptors
          xworker.lang.actions.Actions/@GroovyAction
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_registDisabled
          false
          sth_mark
          false
          sid
          GroovyAction
    @/@8560/@8567
    sname
    closeButton
    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
    8567
      @/@8560/@8567/@8568
      sname
      RowData
      sexclude
      false
      swidth
      80
      sheight
      -1
      sdescriptors
      xworker.swt.layout.LayoutDatas/@RowData
      sth_createIndex
      false
      sid
      8568
      @/@8560/@8567/@8569
      sname
      Listeners
      sdescriptors
      xworker.swt.widgets.Widget/@Listeners
      sth_createIndex
      false
      sid
      8569
        @/@8560/@8567/@8569/@8570
        sname
        closeButtonSelection
        stype
        Selection
        sdescriptors
        xworker.swt.events.Listeners/@listeners/@Listener
        sth_createIndex
        false
        sid
        8570
          @/@8560/@8567/@8569/@8570/@Dispose
          sname
          Dispose
          scontrolList
          shell
          sinterpretationType
          Self
          sattributeTemplate
          false
          schildsAttributeTemplate
          false
          svarScope
          Local
          sisSynchronized
          false
          sthrowException
          true
          suseOtherAction
          false
          screateLocalVarScope
          false
          ssaveReturn
          false
          sdisableGlobalContext
          false
          sdebugLog
          false
          sdescriptors
          xworker.swt.actions.ControlActions/@Dispose
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_registDisabled
          false
          sth_mark
          false
          sid
          Dispose
  @/@init
  sname
  init
  sisSynchronized
  false
  sthrowException
  true
  suseOtherAction
  false
  svarScope
  Local
  sdisableGlobalContext
  false
  Scode
#$@text#$@
import xworker.lang.util.XWorkerUtils;

def step = [:];
step.index = 0;
step.thing = world.getThing("xworker.swt.ide.worldexplorer.swt.dialogs.InitDialog/@thing");

actionContext.getScope(0).put("step", step);
browser.setUrl(XWorkerUtils.getThingDescUrl("xworker.swt.ide.worldexplorer.swt.dialogs.InitDialog/@thing/@thing"));
#$@text#$@
  sinterpretationType
  Action
  screateLocalVarScope
  false
  ssaveReturn
  false
  sdebugLog
  false
  sdescriptors
  xworker.swt.Widgets/@Code
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  init
  @/@thing
  sname
  thing
  slabel
  向导
  sdescriptors
  xworker.lang.MetaDescriptor3
  smany
  true
  seditCols
  2
  sinitialization
  false
  smodifier
  public
  sinheritDescription
  false
  sdescription
  <p>欢迎使用XWorker，本向导将引导您初始化XWorker。</p>
  snotXmlAttribute
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  thing
    @/@thing/@thing
    sname
    thing
    slabel
    提示
    sdescriptors
    xworker.lang.MetaDescriptor3/@thing
    smany
    true
    seditCols
    2
    sinitialization
    false
    smodifier
    public
    sinheritDescription
    false
    sdescription
    <p>欢迎使用XWorker，本向导将引导您初始化XWorker。</p>
    snotXmlAttribute
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    thing
    @/@thing/@initAppDb
    sname
    initAppDb
    slabel
    应用数据提示
    sdescriptors
    xworker.lang.MetaDescriptor3/@thing
    smany
    true
    seditCols
    2
    sinitialization
    false
    smodifier
    public
    sinheritDescription
    false
    Sdescription
#$@text#$@
<p><strong>应用数据库</strong></p>

<p>&nbsp;&nbsp;&nbsp; XWorker也是一个应用平台，这些内置的应用需要使用数据库，点击下一步设置数据库的数据源。</p>
#$@text#$@
    snotXmlAttribute
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    initAppDb
    @/@thing/@editAppDb
    sname
    editAppDb
    slabel
    编辑应用数据源
    sdescriptors
    xworker.lang.MetaDescriptor3/@thing
    smany
    true
    seditCols
    2
    sinitialization
    false
    smodifier
    public
    sinheritDescription
    false
    Sdescription
#$@text#$@
<p><strong>编辑应用数据源</strong></p>

<p>&nbsp;&nbsp;&nbsp; 现在已经打开应用数据源事物，通过编辑它设置连接数据库，编辑完后点击下一步。</p>

<p><strong>注：</strong></p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;编辑数据源事物时本窗口无需关闭，默认使用内置的derby数据库。</p>
#$@text#$@
    snotXmlAttribute
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    editAppDb
      @/@thing/@editAppDb/@actions
      sname
      actions
      sdescriptors
      xworker.lang.MetaDescriptor3/@actions
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      actions
        @/@thing/@editAppDb/@actions/@init
        sname
        init
        sisSynchronized
        false
        sthrowException
        true
        suseOtherAction
        false
        svarScope
        Local
        sdisableGlobalContext
        false
        Scode
#$@text#$@
import org.xmeta.Thing;

import xworker.lang.util.XWorkerUtils;

def thing = world.getThing("_local.xworker.db.XWorkerAppDataSource");
if(thing == null){
    thing = new Thing("xworker.lang.db.jdbc.DataSource");
    thing.put("name", "XWorkerAppDataSource");
    thing.put("type", "c3p0");
    thing.put("dbType", "derby");
    thing.put("drivers", "14");
    thing.put("driver_class", "org.apache.derby.jdbc.EmbeddedDriver");
    thing.put("url", "jdbc:derby:xworkerapp");
    thing.put("userName", "xworkerapp");
    thing.put("password", "xworkerapp");   
    
    thing.saveAs("_local", "_local.xworker.db.XWorkerAppDataSource");
}

XWorkerUtils.ideOpenThing(thing);
#$@text#$@
        sinterpretationType
        Action
        screateLocalVarScope
        false
        ssaveReturn
        false
        sdebugLog
        false
        sdescriptors
        xworker.lang.actions.Actions/@GroovyAction
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        init
        @/@thing/@editAppDb/@actions/@finish
        sname
        finish
        sisSynchronized
        false
        sthrowException
        true
        suseOtherAction
        false
        svarScope
        Local
        sdisableGlobalContext
        false
        Scode
#$@text#$@
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;

def thing = world.getThing("_local.xworker.db.XWorkerAppDataSource");
try{
    def con = thing.doAction("getConnection", actionContext);
    if(con == null){
        def box = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
        box.setText("测试数据库连接");
        box.setMessage("获取数据库连接失败, 不能获取连接。");
        box.open();
        
        return false;
    }else{
        return true;
    }
}catch(Exception e){
    def box = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
    box.setText("测试数据库连接");
    box.setMessage("获取数据库连接失败, " + e.getMessage());
    box.open();
    
    return false;
}
#$@text#$@
        sinterpretationType
        Action
        screateLocalVarScope
        false
        ssaveReturn
        false
        sdebugLog
        false
        sdescriptors
        xworker.lang.actions.Actions/@GroovyAction
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        finish
