^1381885372662
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog
sname
ThingRefactorDialog
slabel
ThingRefactorDialog
sid
ThingRefactorDialog
sdescriptors
xworker.swt.widgets.Display
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell
sname
shell
stext
重构
sstyle
APPLICATION_MODAL
sNO_TRIM
false
sCLOSE
true
sTITLE
true
sMIN
false
sMAX
false
sBORDER
false
sRESIZE
true
sON_TOP
false
sTOOL
false
sNO_FOCUS
false
swidth
640
sheight
480
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
scapture
false
senabled
true
sredraw
true
svisible
true
sxw_cl_global
false
sid
shell
sdescriptors
xworker.swt.widgets.Display/@Shell
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@shellGridLayout
sname
shellGridLayout
snumColumns
2
smakeColumnsEqualWidth
false
smarginWidth
5
smarginHeight
5
smarginLeft
0
smarginTop
0
smarginRight
0
smarginBottom
0
shorizontalSpacing
5
sverticalSpacing
5
sid
shellGridLayout
slabel
shellGridLayout
sdescriptors
xworker.swt.Layouts/@GridLayout
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@srcPathLabel
sname
srcPathLabel
stext
原路径：
stype
HORIZONTAL
sshadow
SHADOW_OUT
sBORDER
false
salignment
LEFT
scapture
false
senabled
true
sredraw
true
svisible
true
sxw_cl_global
false
sid
srcPathLabel
slabel
srcPathLabel
sdescriptors
xworker.swt.Widgets/@Label
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@srcPath
sname
srcPathText
sH_SCROLL
false
sV_SCROLL
false
sWRAP
false
sREAD_ONLY
true
sPASSWORD
false
sSEARCH
false
sCANCEL
false
sBORDER
true
salign
LEFT
scapture
false
senabled
true
sredraw
true
svisible
true
sxw_cl_global
false
sid
srcPath
slabel
srcPathText
sdescriptors
xworker.swt.Widgets/@Text
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@srcPath/@srcPathGridData
sname
srcPathGridData
sstyle
FILL_HORIZONTAL
shorizontalIndent
0
swidth
-1
sheight
-1
shorizontalAlignment
BEGINNING
sverticalAlignment
CENTER
shorizontalSpan
1
sverticalSpan
1
sgrabExcessHorizontalSpace
false
sgrabExcessVerticalSpace
false
sxw_cl_global
false
sid
srcPathGridData
slabel
srcPathGridData
sdescriptors
xworker.swt.layout.LayoutDatas/@GridData
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@targPathLabel
sname
targPathLabel
stext
新路径：
stype
HORIZONTAL
sshadow
SHADOW_OUT
sBORDER
false
salignment
LEFT
scapture
false
senabled
true
sredraw
true
svisible
true
sxw_cl_global
false
sid
targPathLabel
slabel
targPathLabel
sdescriptors
xworker.swt.Widgets/@Label
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@targPath
sname
targPathText
sH_SCROLL
false
sV_SCROLL
false
sWRAP
false
sREAD_ONLY
false
sPASSWORD
false
sSEARCH
false
sCANCEL
false
sBORDER
true
salign
LEFT
scapture
false
senabled
true
sredraw
true
svisible
true
sxw_cl_global
false
sid
targPath
slabel
targPathText
sdescriptors
xworker.swt.Widgets/@Text
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@targPath/@targPathGridData
sname
targPathGridData
sstyle
FILL_HORIZONTAL
shorizontalIndent
0
swidth
-1
sheight
-1
shorizontalAlignment
BEGINNING
sverticalAlignment
CENTER
shorizontalSpan
1
sverticalSpan
1
sgrabExcessHorizontalSpace
false
sgrabExcessVerticalSpace
false
sxw_cl_global
false
sid
targPathGridData
slabel
targPathGridData
sdescriptors
xworker.swt.layout.LayoutDatas/@GridData
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@progressBar
sname
progressBar
sstyle
HORIZONTAL
sSMOOTH
false
sINDETERMINATE
false
sBORDER
false
scapture
false
senabled
true
sredraw
true
svisible
true
sxw_cl_global
false
sid
progressBar
slabel
progressBar
sdescriptors
xworker.swt.Widgets/@ProgressBar
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@progressBar/@progressBarGridData
sname
progressBarGridData
sstyle
FILL_HORIZONTAL
shorizontalIndent
0
swidth
-1
sheight
-1
shorizontalAlignment
BEGINNING
sverticalAlignment
CENTER
shorizontalSpan
2
sverticalSpan
1
sgrabExcessHorizontalSpace
false
sgrabExcessVerticalSpace
false
sxw_cl_global
false
sid
progressBarGridData
slabel
progressBarGridData
sdescriptors
xworker.swt.layout.LayoutDatas/@GridData
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@logLabel
sname
logLabel
stext
日志：
stype
HORIZONTAL
sshadow
SHADOW_OUT
sBORDER
false
salignment
LEFT
scapture
false
senabled
true
sredraw
true
svisible
true
sxw_cl_global
false
sid
logLabel
slabel
logLabel
sdescriptors
xworker.swt.Widgets/@Label
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@logLabel/@logLabelGridData
sname
logLabelGridData
sstyle
FILL_HORIZONTAL
shorizontalIndent
0
swidth
-1
sheight
-1
shorizontalAlignment
BEGINNING
sverticalAlignment
CENTER
shorizontalSpan
2
sverticalSpan
1
sgrabExcessHorizontalSpace
false
sgrabExcessVerticalSpace
false
sxw_cl_global
false
sid
logLabelGridData
slabel
logLabelGridData
sdescriptors
xworker.swt.layout.LayoutDatas/@GridData
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@logText
sname
logText
sstyle
MULTI
sFULL_SELECTION
false
sREAD_ONLY
true
sWRAP
false
sH_SCROLL
true
sV_SCROLL
true
sBORDER
true
salign
LEFT
sid
logText
sdescriptors
xworker.swt.Widgets/@StyledText
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@logText/@logTextGridData
sname
logTextGridData
sstyle
FILL_BOTH
shorizontalIndent
0
swidth
-1
sheight
-1
shorizontalAlignment
BEGINNING
sverticalAlignment
CENTER
shorizontalSpan
2
sverticalSpan
1
sgrabExcessHorizontalSpace
false
sgrabExcessVerticalSpace
false
sxw_cl_global
false
sid
logTextGridData
slabel
logTextGridData
sdescriptors
xworker.swt.Commons/@GridData
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@1154
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
sid
1154
sdescriptors
xworker.swt.Widgets/@Composite
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@1154/@1155
sname
buttonCompositeGridData
sstyle
FILL_HORIZONTAL
shorizontalIndent
0
swidth
-1
sheight
-1
shorizontalAlignment
END
sverticalAlignment
CENTER
shorizontalSpan
2
sverticalSpan
1
sgrabExcessHorizontalSpace
false
sgrabExcessVerticalSpace
false
sxw_cl_global
false
sid
1155
slabel
buttonCompositeGridData
sdescriptors
xworker.swt.layout.LayoutDatas/@GridData
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@1154/@1156
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
sid
1156
slabel
buttonCompositeRowLayout
sdescriptors
xworker.swt.Layouts/@RowLayout
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@1154/@1158
sname
okButton
stext
确定
stype
SWT.PUSH
sflat
false
sborder
false
sselected
false
scapture
false
senabled
true
sredraw
true
svisible
true
sxw_cl_global
false
sid
1158
slabel
okButton
sdescriptors
xworker.swt.Widgets/@Button
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@1154/@1158/@1159
sname
RowData
sexclude
false
swidth
80
sheight
-1
sid
1159
slabel
RowData
sdescriptors
xworker.swt.layout.LayoutDatas/@RowData
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@1154/@1158/@133
sname
Listeners
sid
133
slabel
Listeners
sdescriptors
xworker.swt.widgets.Widget/@Listeners
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@1154/@1158/@133/@134
sname
okButtonSelection
stype
Selection
sid
134
slabel
okButtonSelection
sdescriptors
xworker.swt.events.Listeners/@listeners/@Listener
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@1154/@1158/@133/@134/@135
sname
okButtonAction
sisSynchronized
false
sthrowException
true
suseOtherAction
false
svarScope
Global
sdisableGlobalContext
false
Scode
#$@text#$@
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;

import org.xmeta.Category;
import org.xmeta.util.RefactorUtil;
import org.xmeta.util.RefactorListener;

RefactorUtil refactorUtil = RefactorUtil.getInstance();
//源地址
def srcPath = srcPathText.getText();
//目标地址
def targPath = targPathText.getText();

/*
def srcObj = world.get(srcPath);
if(srcObj == null){
    def box = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);    
    box.setText("错误");
    box.setMessage("'" + srcPath + "'不存在！");
    box.open();
    return;
}*/

okButton.setEnabled(false);
cancelButton.setEnabled(false);

logText.setText("");
def ac = actionContext;
def log = actionContext.get("log");
def sourceTreeItem = sourceTreeItem;
def display = shell.display;
def listener = [
    onStart:{
       count->
       display.asyncExec({
           progressBar.setMaximum(count);
           logText.append("start...\r\n");
           logText.setTopIndex(logText.getLineCount() - 1); 
       });
    },
    
    onCopy:{
        sourcePath,targetPath->
        display.asyncExec({
            progressBar.setSelection(progressBar.selection + 1);
            logText.append("Copy " + sourcePath + " to " + targetPath + "\r\n");
            logText.setTopIndex(logText.getLineCount() - 1); 
        });
    },
    
    onDelete:{
        sourcePath->
        display.asyncExec({
            progressBar.setSelection(progressBar.selection + 1);
            logText.append("Delete " + sourcePath + "\r\n");
            logText.setTopIndex(logText.getLineCount() - 1); 
        });
    },
    
    onUpdated:{
        path->
        display.asyncExec({
            progressBar.setSelection(progressBar.selection + 1);
            logText.append("update " + path + "\r\n");
            logText.setTopIndex(logText.getLineCount() - 1); 
        });
    },
    
    notMidify:{
        path->
        display.asyncExec({
            progressBar.setSelection(progressBar.selection + 1);
            //logText.append("Not Modify " + path + "\r\n");
        });
    },
    
    finish:{
        display.asyncExec({
            cancelButton.setText("关闭");
            cancelButton.setEnabled(true);      
            //sourceTreeItem.dispose();
            logText.append("end\r\n");      
            logText.setTopIndex(logText.getLineCount() - 1);     
        });
    },
    
    toString:{
        return this.getClass().getName();
    }
] as RefactorListener;

new Thread({
     try{
        refactorUtil.refactor(srcPath, targPath, listener);
    }catch(Exception ee){         
        log.info("refactory error", ee);
        //logText.getShell().getDisplay().asyncExec({
        //    logText.append(ee.message);
        //});        
    }
}).start();

ac.put("executed", "true");
#$@text#$@
sinitBreakPoint
false
ssuccessBreakPoint
false
sexceptionBreakPoint
false
seditBreakPoint
false
sinterpretationType
Action
screateLocalVarScope
false
ssaveReturn
false
sid
135
sdescriptors
xworker.lang.actions.Actions/@GroovyAction
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@1154/@1160
sname
cancelButton
stext
取消
stype
SWT.PUSH
sflat
false
sborder
false
sselected
false
scapture
false
senabled
true
sredraw
true
svisible
true
sxw_cl_global
false
sid
1160
slabel
cancelButton
sdescriptors
xworker.swt.Widgets/@Button
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@1154/@1160/@1161
sname
RowData
sexclude
false
swidth
80
sheight
-1
sid
1161
slabel
RowData
sdescriptors
xworker.swt.layout.LayoutDatas/@RowData
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@1154/@1160/@1454
sname
Listeners
sid
1454
slabel
Listeners
sdescriptors
xworker.swt.widgets.Widget/@Listeners
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@1154/@1160/@1454/@1455
sname
Selection
stype
Selection
sid
1455
slabel
Selection
sdescriptors
xworker.swt.events.Listeners/@listeners/@Listener
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@1154/@1160/@1454/@1455/@1456
sname
run
sisSynchronized
false
sthrowException
true
suseOtherAction
false
svarScope
Global
sdisableGlobalContext
false
scode
shell.dispose();
sid
1456
sdescriptors
xworker.lang.actions.Actions/@GroovyAction
@xworker.swt.ide.worldexplorer.swt.dialogs.ThingRefactorDialog/@shell/@init
sname
init
sisSynchronized
false
sthrowException
true
suseOtherAction
false
svarScope
Global
sdisableGlobalContext
false
Scode
#$@text#$@
import org.xmeta.util.RefactorUtil;

def srcPath = actionContext.get("srcPath");
def targPath = actionContext.get("targPath");
boolean ok = true;
if(srcPath == null || "" == srcPath){
    ok = false;
    srcPath = "未设置原路径";
}
if(targPath == null || "" == targPath){
    ok = false;
    targPath = "未设置新路径";
}
srcPathText.setText(srcPath);
targPathText.setText(targPath);
if(ok){
    okButton.setEnabled(true);
}
#$@text#$@
sid
init
sdescriptors
xworker.swt.Widgets/@Code
