input.setChanged();
changedInDialog = true;
}
};
FormLayout formLayout = new FormLayout();
formLayout.marginWidth = Const.FORM_MARGIN;
formLayout.marginHeight = Const.FORM_MARGIN;
shell.setLayout(formLayout);
shell.setText(BaseMessages.getString(PKG, "RubyStep.Shell.Title"));
middle = props.getMiddlePct();
// load images
if (!guiResource.getImageMap().containsKey("TypeExitRubyStep:empty16x16")) {
guiResource.getImageMap().put("TypeExitRubyStep:empty16x16", new Image(display, 16, 16));
}
String pluginBaseDir = PluginRegistry.getInstance().findPluginWithId(StepPluginType.class, "TypeExitRubyStep").getPluginDirectory().toString();
String pluginImageDir = pluginBaseDir + Const.FILE_SEPARATOR + "images" + Const.FILE_SEPARATOR;
URL pluginBaseURL = PluginRegistry.getInstance().findPluginWithId(StepPluginType.class, "TypeExitRubyStep").getPluginDirectory();
try {
pluginBaseFile = new File(pluginBaseURL.toURI());
} catch (URISyntaxException e) {
pluginBaseFile = new File(pluginBaseURL.getPath());
}
try {
scriptImage = guiResource.getImage(pluginImageDir + ("libScript.png"));
checkImage = guiResource.getImage(pluginImageDir + ("check.png"));
rubyImage = guiResource.getImage(pluginImageDir + ("ruby_16.png"));
addImage = guiResource.getImage(pluginImageDir + ("addSmall.png"));
renameImage = guiResource.getImage(pluginImageDir + ("edit.png"));
rowScriptImage = rubyImage;
initScriptImage = guiResource.getImage(pluginImageDir + ("startScript.png"));
disposeScriptImage = guiResource.getImage(pluginImageDir + ("endScript.png"));
libScriptImage = scriptImage;
infoStepImage = guiResource.getImage(pluginImageDir + ("info_step.png"));
targetStepImage = guiResource.getImage(pluginImageDir + ("target_step.png"));
inputImage = guiResource.getImage(pluginImageDir + ("input.png"));
outputImage = guiResource.getImage(pluginImageDir + ("output.png"));
fieldImage = guiResource.getImage(pluginImageDir + ("field.png"));
fieldChangedImage = guiResource.getImage(pluginImageDir + ("field_changed.png"));
folderImage = guiResource.getImage(pluginImageDir + ("folder.png"));
errorOutputImage = guiResource.getImage(pluginImageDir + ("error_output.png"));
fieldErrorImage = guiResource.getImage(pluginImageDir + ("field_error.png"));
transformationImage = guiResource.getImage(pluginImageDir + ("transformation.png"));
webDocumentImage = guiResource.getImage(pluginImageDir + ("web.png"));
} catch (Exception e) {
Image empty = guiResource.getImage("TypeExitRubyStep:empty16x16");
scriptImage = empty;
checkImage = empty;
rubyImage = empty;
addImage = empty;
renameImage = empty;
rowScriptImage = empty;
initScriptImage = empty;
disposeScriptImage = empty;
libScriptImage = empty;
infoStepImage = empty;
targetStepImage = empty;
inputImage = empty;
outputImage = empty;
fieldImage = empty;
fieldChangedImage = empty;
fieldErrorImage = empty;
folderImage = empty;
errorOutputImage = empty;
transformationImage = empty;
webDocumentImage = empty;
}
samplesHelper = new RubyStepSamplesHelper();
samplesHelper.setFolderImage(folderImage);
samplesHelper.setSampleImage(fieldImage);
samplesHelper.setScriptImage(libScriptImage);
samplesHelper.setTransformationImage(transformationImage);
samplesHelper.setWebDocumentImage(webDocumentImage);
// start construction
// Stepname line
wlStepname = new Label(shell, SWT.RIGHT);
wlStepname.setText(BaseMessages.getString(PKG, "System.Label.StepName"));
props.setLook(wlStepname);
fdlStepname = new FormData();
fdlStepname.left = new FormAttachment(0, 0);
fdlStepname.right = new FormAttachment(middle, -margin);
fdlStepname.top = new FormAttachment(0, margin);
wlStepname.setLayoutData(fdlStepname);
wStepname = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wStepname.setText(stepname);
props.setLook(wStepname);
wStepname.addModifyListener(lsMod);
fdStepname = new FormData();
fdStepname.left = new FormAttachment(middle, 0);
fdStepname.top = new FormAttachment(0, margin);
fdStepname.right = new FormAttachment(100, 0);
wStepname.setLayoutData(fdStepname);
SashForm wSash = new SashForm(shell, SWT.VERTICAL);
props.setLook(wSash);
/*------------------------------------------------------------------------------------------------------------------------------------------------
* Upper part of form
------------------------------------------------------------------------------------------------------------------------------------------------*/
// top part
wTop = new SashForm(wSash, SWT.HORIZONTAL);
FormLayout topLayout = new FormLayout();
topLayout.marginWidth = Const.FORM_MARGIN;
topLayout.marginHeight = Const.FORM_MARGIN;
wTop.setLayout(topLayout);
props.setLook(wTop);
addLeftArea();
addScriptArea();
FormData fdTop = new FormData();
fdTop.left = new FormAttachment(0, 0);
fdTop.top = new FormAttachment(0, 0);
fdTop.right = new FormAttachment(100, 0);
fdTop.bottom = new FormAttachment(100, 0);
wTop.setLayoutData(fdTop);
wTop.SASH_WIDTH = margin;
wTop.setWeights(new int[] { 32, 68 });
/*------------------------------------------------------------------------------------------------------------------------------------------------
* Bottom part of form
------------------------------------------------------------------------------------------------------------------------------------------------*/
Composite wBottom = new Composite(wSash, SWT.NONE);
props.setLook(wBottom);
FormLayout bottomLayout = new FormLayout();
bottomLayout.marginWidth = Const.FORM_MARGIN;
bottomLayout.marginHeight = Const.FORM_MARGIN;
wBottom.setLayout(bottomLayout);
// separator