use of org.pentaho.di.ui.core.widget.LabelTextVar in project pentaho-kettle by pentaho.
the class HL7MLLPAcknowledgeDialog method open.
public JobEntryInterface open() {
Shell parent = getParent();
Display display = parent.getDisplay();
shell = new Shell(parent, props.getJobsDialogStyle());
props.setLook(shell);
JobDialog.setShellImage(shell, jobEntry);
ModifyListener lsMod = new ModifyListener() {
public void modifyText(ModifyEvent e) {
jobEntry.setChanged();
}
};
changed = jobEntry.hasChanged();
FormLayout formLayout = new FormLayout();
formLayout.marginWidth = Const.FORM_MARGIN;
formLayout.marginHeight = Const.FORM_MARGIN;
shell.setLayout(formLayout);
shell.setText(BaseMessages.getString(PKG, "HL7MLLPAcknowledgeDialog.Title"));
int margin = Const.MARGIN;
// Job entry name line
wName = new LabelText(shell, BaseMessages.getString(PKG, "HL7MLLPAcknowledgeDialog.Name.Label"), BaseMessages.getString(PKG, "HL7MLLPAcknowledgeDialog.Name.Tooltip"));
wName.addModifyListener(lsMod);
FormData fdName = new FormData();
fdName.top = new FormAttachment(0, 0);
fdName.left = new FormAttachment(0, 0);
fdName.right = new FormAttachment(100, 0);
wName.setLayoutData(fdName);
Control lastControl = wName;
// the server
//
wServer = new LabelTextVar(jobMeta, shell, BaseMessages.getString(PKG, "HL7MLLPAcknowledgeDialog.Server.Label"), BaseMessages.getString(PKG, "HL7MLLPAcknowledgeDialog.Server.Tooltip"));
props.setLook(wServer);
wServer.addModifyListener(lsMod);
FormData fdBatchIdSchema = new FormData();
fdBatchIdSchema.left = new FormAttachment(0, 0);
fdBatchIdSchema.top = new FormAttachment(lastControl, margin);
fdBatchIdSchema.right = new FormAttachment(100, 0);
wServer.setLayoutData(fdBatchIdSchema);
lastControl = wServer;
// the port
//
wPort = new LabelTextVar(jobMeta, shell, BaseMessages.getString(PKG, "HL7MLLPAcknowledgeDialog.Port.Label"), BaseMessages.getString(PKG, "HL7MLLPAcknowledgeDialog.Port.Tooltip"));
props.setLook(wPort);
wPort.addModifyListener(lsMod);
FormData fdPort = new FormData();
fdPort.left = new FormAttachment(0, 0);
fdPort.top = new FormAttachment(lastControl, margin);
fdPort.right = new FormAttachment(100, 0);
wPort.setLayoutData(fdPort);
lastControl = wPort;
// the variable
//
wVariable = new LabelTextVar(jobMeta, shell, BaseMessages.getString(PKG, "HL7MLLPAcknowledgeDialog.Variable.Label"), BaseMessages.getString(PKG, "HL7MLLPAcknowledgeDialog.Variable.Tooltip"));
props.setLook(wVariable);
wVariable.addModifyListener(lsMod);
FormData fdVariable = new FormData();
fdVariable.left = new FormAttachment(0, 0);
fdVariable.top = new FormAttachment(lastControl, margin);
fdVariable.right = new FormAttachment(100, 0);
wVariable.setLayoutData(fdVariable);
lastControl = wVariable;
wOK = new Button(shell, SWT.PUSH);
wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
wCancel = new Button(shell, SWT.PUSH);
wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
BaseStepDialog.positionBottomButtons(shell, new Button[] { wOK, wCancel }, margin, lastControl);
// Add listeners
//
wCancel.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
cancel();
}
});
wOK.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
ok();
}
});
lsDef = new SelectionAdapter() {
public void widgetDefaultSelected(SelectionEvent e) {
ok();
}
};
wName.addSelectionListener(lsDef);
wServer.addSelectionListener(lsDef);
wPort.addSelectionListener(lsDef);
wVariable.addSelectionListener(lsDef);
// Detect X or ALT-F4 or something that kills this window...
shell.addShellListener(new ShellAdapter() {
public void shellClosed(ShellEvent e) {
cancel();
}
});
getData();
BaseStepDialog.setSize(shell);
shell.open();
props.setDialogSize(shell, "HL7MLLPAcknowledgeDialog.DialogSize");
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
return jobEntry;
}
use of org.pentaho.di.ui.core.widget.LabelTextVar in project pentaho-kettle by pentaho.
the class AutoDocDialog method open.
public String open() {
Shell parent = getParent();
Display display = parent.getDisplay();
shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MIN | SWT.MAX);
props.setLook(shell);
setShellImage(shell, inputMeta);
ModifyListener lsMod = new ModifyListener() {
public void modifyText(ModifyEvent e) {
inputMeta.setChanged();
}
};
changed = inputMeta.hasChanged();
FormLayout formLayout = new FormLayout();
formLayout.marginWidth = Const.FORM_MARGIN;
formLayout.marginHeight = Const.FORM_MARGIN;
shell.setLayout(formLayout);
shell.setText(BaseMessages.getString(PKG, "AutoDoc.Step.Name"));
int middle = props.getMiddlePct();
int margin = Const.MARGIN;
// Step name line
//
wlStepname = new Label(shell, SWT.RIGHT);
wlStepname.setText(BaseMessages.getString(PKG, "AutoDocDialog.Stepname.Label"));
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);
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);
Control lastControl = wStepname;
RowMetaInterface previousFields;
try {
previousFields = transMeta.getPrevStepFields(stepMeta);
} catch (KettleStepException e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "AutoDocDialog.ErrorDialog.UnableToGetInputFields.Title"), BaseMessages.getString(PKG, "AutoDocDialog.ErrorDialog.UnableToGetInputFields.Message"), e);
previousFields = new RowMeta();
}
// The filename field ...
//
wFilenameField = new LabelComboVar(transMeta, shell, BaseMessages.getString(PKG, "AutoDocDialog.FilenameField.Label"), BaseMessages.getString(PKG, "AutoDocDialog.FilenameField.Tooltip"));
wFilenameField.setItems(previousFields.getFieldNames());
props.setLook(wFilenameField);
wFilenameField.addModifyListener(lsMod);
FormData fdFilenameField = new FormData();
fdFilenameField.top = new FormAttachment(lastControl, margin);
fdFilenameField.left = new FormAttachment(0, 0);
fdFilenameField.right = new FormAttachment(100, 0);
wFilenameField.setLayoutData(fdFilenameField);
lastControl = wFilenameField;
// The FileType field ...
//
wFileTypeField = new LabelComboVar(transMeta, shell, BaseMessages.getString(PKG, "AutoDocDialog.FileTypeField.Label"), BaseMessages.getString(PKG, "AutoDocDialog.FileTypeField.Tooltip"));
wFileTypeField.setItems(previousFields.getFieldNames());
props.setLook(wFileTypeField);
wFileTypeField.addModifyListener(lsMod);
FormData fdFileTypeField = new FormData();
fdFileTypeField.top = new FormAttachment(lastControl, margin);
fdFileTypeField.left = new FormAttachment(0, 0);
fdFileTypeField.right = new FormAttachment(100, 0);
wFileTypeField.setLayoutData(fdFileTypeField);
lastControl = wFileTypeField;
// The target filename ...
//
wTargetFilename = new LabelTextVar(transMeta, shell, BaseMessages.getString(PKG, "AutoDocDialog.TargetFilename.Label"), BaseMessages.getString(PKG, "AutoDocDialog.TargetFilename.Tooltip"));
props.setLook(wTargetFilename);
wTargetFilename.addModifyListener(lsMod);
FormData fdTargetFilename = new FormData();
fdTargetFilename.top = new FormAttachment(lastControl, margin);
fdTargetFilename.left = new FormAttachment(0, 0);
fdTargetFilename.right = new FormAttachment(100, 0);
wTargetFilename.setLayoutData(fdTargetFilename);
lastControl = wTargetFilename;
// The output type ...
//
wOutputType = new LabelComboVar(transMeta, shell, BaseMessages.getString(PKG, "AutoDocDialog.OutputType.Label"), BaseMessages.getString(PKG, "AutoDocDialog.OutputType.Tooltip"));
OutputType[] outputTypes = KettleReportBuilder.OutputType.values();
String[] items = new String[outputTypes.length];
for (int i = 0; i < outputTypes.length; i++) {
items[i] = outputTypes[i].name();
}
wOutputType.setItems(items);
props.setLook(wOutputType);
wOutputType.addModifyListener(lsMod);
wOutputType.getComboWidget().setEditable(false);
FormData fdOutputType = new FormData();
fdOutputType.top = new FormAttachment(lastControl, margin);
fdOutputType.left = new FormAttachment(0, 0);
fdOutputType.right = new FormAttachment(100, 0);
wOutputType.setLayoutData(fdOutputType);
wOutputType.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
setFlags();
}
});
lastControl = wOutputType;
// Include name check-box
//
Label wlInclName = new Label(shell, SWT.RIGHT);
wlInclName.setText(BaseMessages.getString(PKG, "AutoDocDialog.InclName.Label"));
props.setLook(wlInclName);
FormData fdlInclName = new FormData();
fdlInclName.left = new FormAttachment(0, 0);
fdlInclName.right = new FormAttachment(middle, -margin);
fdlInclName.top = new FormAttachment(lastControl, margin);
wlInclName.setLayoutData(fdlInclName);
wInclName = new Button(shell, SWT.CHECK | SWT.LEFT);
props.setLook(wInclName);
FormData fdInclName = new FormData();
fdInclName.left = new FormAttachment(middle, 0);
fdInclName.right = new FormAttachment(100, 0);
fdInclName.top = new FormAttachment(lastControl, margin);
wInclName.setLayoutData(fdInclName);
lastControl = wInclName;
// Include description check-box
//
Label wlInclDesc = new Label(shell, SWT.RIGHT);
wlInclDesc.setText(BaseMessages.getString(PKG, "AutoDocDialog.InclDesc.Label"));
props.setLook(wlInclDesc);
FormData fdlInclDesc = new FormData();
fdlInclDesc.left = new FormAttachment(0, 0);
fdlInclDesc.right = new FormAttachment(middle, -margin);
fdlInclDesc.top = new FormAttachment(lastControl, margin);
wlInclDesc.setLayoutData(fdlInclDesc);
wInclDesc = new Button(shell, SWT.CHECK | SWT.LEFT);
props.setLook(wInclDesc);
FormData fdInclDesc = new FormData();
fdInclDesc.left = new FormAttachment(middle, 0);
fdInclDesc.right = new FormAttachment(100, 0);
fdInclDesc.top = new FormAttachment(lastControl, margin);
wInclDesc.setLayoutData(fdInclDesc);
lastControl = wInclDesc;
// Include extended description check-box
//
Label wlInclExtDesc = new Label(shell, SWT.RIGHT);
wlInclExtDesc.setText(BaseMessages.getString(PKG, "AutoDocDialog.InclExtDesc.Label"));
props.setLook(wlInclExtDesc);
FormData fdlInclExtDesc = new FormData();
fdlInclExtDesc.left = new FormAttachment(0, 0);
fdlInclExtDesc.right = new FormAttachment(middle, -margin);
fdlInclExtDesc.top = new FormAttachment(lastControl, margin);
wlInclExtDesc.setLayoutData(fdlInclExtDesc);
wInclExtDesc = new Button(shell, SWT.CHECK | SWT.LEFT);
props.setLook(wInclExtDesc);
FormData fdInclExtDesc = new FormData();
fdInclExtDesc.left = new FormAttachment(middle, 0);
fdInclExtDesc.right = new FormAttachment(100, 0);
fdInclExtDesc.top = new FormAttachment(lastControl, margin);
wInclExtDesc.setLayoutData(fdInclExtDesc);
lastControl = wInclExtDesc;
// Include creation information (user/date) check-box
//
Label wlInclCreated = new Label(shell, SWT.RIGHT);
wlInclCreated.setText(BaseMessages.getString(PKG, "AutoDocDialog.InclCreated.Label"));
props.setLook(wlInclCreated);
FormData fdlInclCreated = new FormData();
fdlInclCreated.left = new FormAttachment(0, 0);
fdlInclCreated.right = new FormAttachment(middle, -margin);
fdlInclCreated.top = new FormAttachment(lastControl, margin);
wlInclCreated.setLayoutData(fdlInclCreated);
wInclCreated = new Button(shell, SWT.CHECK | SWT.LEFT);
props.setLook(wInclCreated);
FormData fdInclCreated = new FormData();
fdInclCreated.left = new FormAttachment(middle, 0);
fdInclCreated.right = new FormAttachment(100, 0);
fdInclCreated.top = new FormAttachment(lastControl, margin);
wInclCreated.setLayoutData(fdInclCreated);
lastControl = wInclCreated;
// Include modified information (user/date) check-box
//
Label wlInclModified = new Label(shell, SWT.RIGHT);
wlInclModified.setText(BaseMessages.getString(PKG, "AutoDocDialog.InclModified.Label"));
props.setLook(wlInclModified);
FormData fdlInclModified = new FormData();
fdlInclModified.left = new FormAttachment(0, 0);
fdlInclModified.right = new FormAttachment(middle, -margin);
fdlInclModified.top = new FormAttachment(lastControl, margin);
wlInclModified.setLayoutData(fdlInclModified);
wInclModified = new Button(shell, SWT.CHECK | SWT.LEFT);
props.setLook(wInclModified);
FormData fdInclModified = new FormData();
fdInclModified.left = new FormAttachment(middle, 0);
fdInclModified.right = new FormAttachment(100, 0);
fdInclModified.top = new FormAttachment(lastControl, margin);
wInclModified.setLayoutData(fdInclModified);
lastControl = wInclModified;
// Include image check-box
//
Label wlInclImage = new Label(shell, SWT.RIGHT);
wlInclImage.setText(BaseMessages.getString(PKG, "AutoDocDialog.InclImage.Label"));
props.setLook(wlInclImage);
FormData fdlInclImage = new FormData();
fdlInclImage.left = new FormAttachment(0, 0);
fdlInclImage.right = new FormAttachment(middle, -margin);
fdlInclImage.top = new FormAttachment(lastControl, margin);
wlInclImage.setLayoutData(fdlInclImage);
wInclImage = new Button(shell, SWT.CHECK | SWT.LEFT);
props.setLook(wInclImage);
FormData fdInclImage = new FormData();
fdInclImage.left = new FormAttachment(middle, 0);
fdInclImage.right = new FormAttachment(100, 0);
fdInclImage.top = new FormAttachment(lastControl, margin);
wInclImage.setLayoutData(fdInclImage);
lastControl = wInclImage;
// Include logging check-box
//
Label wlInclLogging = new Label(shell, SWT.RIGHT);
wlInclLogging.setText(BaseMessages.getString(PKG, "AutoDocDialog.InclLogging.Label"));
props.setLook(wlInclLogging);
FormData fdlInclLogging = new FormData();
fdlInclLogging.left = new FormAttachment(0, 0);
fdlInclLogging.right = new FormAttachment(middle, -margin);
fdlInclLogging.top = new FormAttachment(lastControl, margin);
wlInclLogging.setLayoutData(fdlInclLogging);
wInclLogging = new Button(shell, SWT.CHECK | SWT.LEFT);
props.setLook(wInclLogging);
FormData fdInclLogging = new FormData();
fdInclLogging.left = new FormAttachment(middle, 0);
fdInclLogging.right = new FormAttachment(100, 0);
fdInclLogging.top = new FormAttachment(lastControl, margin);
wInclLogging.setLayoutData(fdInclLogging);
lastControl = wInclLogging;
// Include last execution date check-box
//
Label wlInclLastExecResult = new Label(shell, SWT.RIGHT);
wlInclLastExecResult.setText(BaseMessages.getString(PKG, "AutoDocDialog.InclLastExecResult.Label"));
props.setLook(wlInclLastExecResult);
FormData fdlInclLastExecResult = new FormData();
fdlInclLastExecResult.left = new FormAttachment(0, 0);
fdlInclLastExecResult.right = new FormAttachment(middle, -margin);
fdlInclLastExecResult.top = new FormAttachment(lastControl, margin);
wlInclLastExecResult.setLayoutData(fdlInclLastExecResult);
wInclLastExecResult = new Button(shell, SWT.CHECK | SWT.LEFT);
props.setLook(wInclLastExecResult);
FormData fdInclLastExecResult = new FormData();
fdInclLastExecResult.left = new FormAttachment(middle, 0);
fdInclLastExecResult.right = new FormAttachment(100, 0);
fdInclLastExecResult.top = new FormAttachment(lastControl, margin);
wInclLastExecResult.setLayoutData(fdInclLastExecResult);
lastControl = wInclLastExecResult;
// Some buttons first, so that the dialog scales nicely...
//
wOK = new Button(shell, SWT.PUSH);
wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
wCancel = new Button(shell, SWT.PUSH);
wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
setButtonPositions(new Button[] { wOK, wCancel }, margin, lastControl);
// Add listeners
lsCancel = new Listener() {
public void handleEvent(Event e) {
cancel();
}
};
lsOK = new Listener() {
public void handleEvent(Event e) {
ok();
}
};
wCancel.addListener(SWT.Selection, lsCancel);
wOK.addListener(SWT.Selection, lsOK);
lsDef = new SelectionAdapter() {
public void widgetDefaultSelected(SelectionEvent e) {
ok();
}
};
wStepname.addSelectionListener(lsDef);
wFilenameField.addSelectionListener(lsDef);
// Detect X or ALT-F4 or something that kills this window...
shell.addShellListener(new ShellAdapter() {
public void shellClosed(ShellEvent e) {
cancel();
}
});
// Set the shell size, based upon previous time...
setSize();
getData();
inputMeta.setChanged(changed);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
return stepname;
}
use of org.pentaho.di.ui.core.widget.LabelTextVar in project pentaho-kettle by pentaho.
the class SampleRowsDialog method open.
public String open() {
Shell parent = getParent();
Display display = parent.getDisplay();
shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MIN | SWT.MAX);
props.setLook(shell);
setShellImage(shell, input);
ModifyListener lsMod = new ModifyListener() {
public void modifyText(ModifyEvent e) {
input.setChanged();
}
};
changed = input.hasChanged();
FormLayout formLayout = new FormLayout();
formLayout.marginWidth = Const.FORM_MARGIN;
formLayout.marginHeight = Const.FORM_MARGIN;
shell.setLayout(formLayout);
shell.setText(BaseMessages.getString(PKG, "SampleRowsDialog.Shell.Title"));
int middle = props.getMiddlePct();
int margin = Const.MARGIN;
// Stepname line
wlStepname = new Label(shell, SWT.RIGHT);
wlStepname.setText(BaseMessages.getString(PKG, "SampleRowsDialog.Stepname.Label"));
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);
// Lines ragne
wLinesRange = new LabelTextVar(transMeta, shell, BaseMessages.getString(PKG, "SampleRowsDialog.LinesRange.Label"), BaseMessages.getString(PKG, "SampleRowsDialog.LinesRange.Tooltip"));
props.setLook(wLinesRange);
wLinesRange.addModifyListener(lsMod);
fdLinesRange = new FormData();
fdLinesRange.left = new FormAttachment(0, -margin);
fdLinesRange.top = new FormAttachment(wStepname, 2 * margin);
fdLinesRange.right = new FormAttachment(100, -margin);
wLinesRange.setLayoutData(fdLinesRange);
// Add line number to output?
wLineNumberField = new LabelTextVar(transMeta, shell, BaseMessages.getString(PKG, "SampleRowsDialog.LineNumberField.Label"), BaseMessages.getString(PKG, "SampleRowsDialog.LineNumberField.Tooltip"));
props.setLook(wLinesRange);
wLineNumberField.addModifyListener(lsMod);
fdLineNumberField = new FormData();
fdLineNumberField.left = new FormAttachment(0, -margin);
fdLineNumberField.top = new FormAttachment(wLinesRange, 2 * margin);
fdLineNumberField.right = new FormAttachment(100, -margin);
wLineNumberField.setLayoutData(fdLineNumberField);
// Some buttons
wOK = new Button(shell, SWT.PUSH);
wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
wCancel = new Button(shell, SWT.PUSH);
wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
setButtonPositions(new Button[] { wOK, wCancel }, margin, wLineNumberField);
// Add listeners
lsCancel = new Listener() {
public void handleEvent(Event e) {
cancel();
}
};
lsOK = new Listener() {
public void handleEvent(Event e) {
ok();
}
};
wCancel.addListener(SWT.Selection, lsCancel);
wOK.addListener(SWT.Selection, lsOK);
lsDef = new SelectionAdapter() {
public void widgetDefaultSelected(SelectionEvent e) {
ok();
}
};
wStepname.addSelectionListener(lsDef);
// Detect X or ALT-F4 or something that kills this window...
shell.addShellListener(new ShellAdapter() {
public void shellClosed(ShellEvent e) {
cancel();
}
});
// Set the shell size, based upon previous time...
setSize();
getData();
input.setChanged(changed);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
return stepname;
}
use of org.pentaho.di.ui.core.widget.LabelTextVar in project pentaho-kettle by pentaho.
the class RegexEvalDialog method open.
public String open() {
Shell parent = getParent();
Display display = parent.getDisplay();
shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN);
props.setLook(shell);
setShellImage(shell, input);
ModifyListener lsMod = new ModifyListener() {
public void modifyText(ModifyEvent e) {
input.setChanged();
}
};
SelectionListener lsSel = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
input.setChanged();
}
};
changed = input.hasChanged();
FormLayout formLayout = new FormLayout();
formLayout.marginWidth = Const.FORM_MARGIN;
formLayout.marginHeight = Const.FORM_MARGIN;
shell.setLayout(formLayout);
shell.setText(BaseMessages.getString(PKG, "RegexEvalDialog.Shell.Title"));
int middle = props.getMiddlePct();
int margin = Const.MARGIN;
// Filename line
wlStepname = new Label(shell, SWT.RIGHT);
wlStepname.setText(BaseMessages.getString(PKG, "RegexEvalDialog.Stepname.Label"));
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);
wSash = new SashForm(shell, SWT.VERTICAL);
wTabFolder = new CTabFolder(wSash, SWT.BORDER);
props.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
// ////////////////////////
// START OF GENERAL TAB ///
// ////////////////////////
wGeneralTab = new CTabItem(wTabFolder, SWT.NONE);
wGeneralTab.setText(BaseMessages.getString(PKG, "RegexEvalDialog.GeneralTab.TabTitle"));
wGeneralComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wGeneralComp);
FormLayout generalLayout = new FormLayout();
generalLayout.marginWidth = 3;
generalLayout.marginHeight = 3;
wGeneralComp.setLayout(generalLayout);
// Step Settings grouping?
// ////////////////////////
// START OF Step Settings GROUP
//
wStepSettings = new Group(wGeneralComp, SWT.SHADOW_NONE);
props.setLook(wStepSettings);
wStepSettings.setText(BaseMessages.getString(PKG, "RegexEvalDialog.Group.StepSettings.Label"));
FormLayout groupLayout = new FormLayout();
groupLayout.marginWidth = 10;
groupLayout.marginHeight = 10;
wStepSettings.setLayout(groupLayout);
// fieldevaluate
wlfieldevaluate = new Label(wStepSettings, SWT.RIGHT);
wlfieldevaluate.setText(BaseMessages.getString(PKG, "RegexEvalDialog.Matcher.Label"));
props.setLook(wlfieldevaluate);
fdlfieldevaluate = new FormData();
fdlfieldevaluate.left = new FormAttachment(0, 0);
fdlfieldevaluate.top = new FormAttachment(wStepname, margin);
fdlfieldevaluate.right = new FormAttachment(middle, -margin);
wlfieldevaluate.setLayoutData(fdlfieldevaluate);
wfieldevaluate = new CCombo(wStepSettings, SWT.BORDER | SWT.READ_ONLY);
wfieldevaluate.setEditable(true);
props.setLook(wfieldevaluate);
wfieldevaluate.addModifyListener(lsMod);
fdfieldevaluate = new FormData();
fdfieldevaluate.left = new FormAttachment(middle, margin);
fdfieldevaluate.top = new FormAttachment(wStepname, margin);
fdfieldevaluate.right = new FormAttachment(100, -margin);
wfieldevaluate.setLayoutData(fdfieldevaluate);
wfieldevaluate.addSelectionListener(lsSel);
wfieldevaluate.addFocusListener(new FocusListener() {
public void focusLost(org.eclipse.swt.events.FocusEvent e) {
}
public void focusGained(org.eclipse.swt.events.FocusEvent e) {
Cursor busy = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
shell.setCursor(busy);
getPreviousFields();
shell.setCursor(null);
busy.dispose();
}
});
// Output Fieldame
wResultField = new LabelTextVar(transMeta, wStepSettings, BaseMessages.getString(PKG, "RegexEvalDialog.ResultField.Label"), BaseMessages.getString(PKG, "RegexEvalDialog.ResultField.Tooltip"));
props.setLook(wResultField);
wResultField.addModifyListener(lsMod);
fdResultField = new FormData();
fdResultField.left = new FormAttachment(0, 0);
fdResultField.top = new FormAttachment(wfieldevaluate, margin);
fdResultField.right = new FormAttachment(100, 0);
wResultField.setLayoutData(fdResultField);
// Allow capture groups?
wlAllowCaptureGroups = new Label(wStepSettings, SWT.RIGHT);
wlAllowCaptureGroups.setText(BaseMessages.getString(PKG, "RegexEvalDialog.AllowCaptureGroups.Label"));
props.setLook(wlAllowCaptureGroups);
FormData fdlAllowCaptureGroups = new FormData();
fdlAllowCaptureGroups.left = new FormAttachment(0, 0);
fdlAllowCaptureGroups.top = new FormAttachment(wResultField, margin);
fdlAllowCaptureGroups.right = new FormAttachment(middle, -margin);
wlAllowCaptureGroups.setLayoutData(fdlAllowCaptureGroups);
wAllowCaptureGroups = new Button(wStepSettings, SWT.CHECK);
wAllowCaptureGroups.setToolTipText(BaseMessages.getString(PKG, "RegexEvalDialog.AllowCaptureGroups.Tooltip"));
props.setLook(wAllowCaptureGroups);
FormData fdAllowCaptureGroups = new FormData();
fdAllowCaptureGroups.left = new FormAttachment(middle, margin);
fdAllowCaptureGroups.top = new FormAttachment(wResultField, margin);
fdAllowCaptureGroups.right = new FormAttachment(100, 0);
wAllowCaptureGroups.setLayoutData(fdAllowCaptureGroups);
wAllowCaptureGroups.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
setFieldsEnabledStatus();
input.setChanged();
}
});
// Replace fields?
wlReplaceFields = new Label(wStepSettings, SWT.RIGHT);
wlReplaceFields.setText(BaseMessages.getString(PKG, "RegexEvalDialog.ReplaceFields.Label"));
props.setLook(wlReplaceFields);
FormData fdlReplaceFields = new FormData();
fdlReplaceFields.left = new FormAttachment(0, 0);
fdlReplaceFields.top = new FormAttachment(wAllowCaptureGroups, margin);
fdlReplaceFields.right = new FormAttachment(middle, -margin);
wlReplaceFields.setLayoutData(fdlReplaceFields);
wReplaceFields = new Button(wStepSettings, SWT.CHECK);
wReplaceFields.setToolTipText(BaseMessages.getString(PKG, "RegexEvalDialog.ReplaceFields.Tooltip"));
props.setLook(wReplaceFields);
FormData fdReplaceFields = new FormData();
fdReplaceFields.left = new FormAttachment(middle, margin);
fdReplaceFields.top = new FormAttachment(wAllowCaptureGroups, margin);
fdReplaceFields.right = new FormAttachment(100, 0);
wReplaceFields.setLayoutData(fdReplaceFields);
wReplaceFields.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
input.setChanged();
}
});
// settings layout
fdStepSettings = new FormData();
fdStepSettings.left = new FormAttachment(0, margin);
fdStepSettings.top = new FormAttachment(wStepname, margin);
fdStepSettings.right = new FormAttachment(100, -margin);
wStepSettings.setLayoutData(fdStepSettings);
// ///////////////////////////////////////////////////////////
// / END OF STEP SETTINGS GROUP
// ///////////////////////////////////////////////////////////
// Script line
wlScript = new Label(wGeneralComp, SWT.NONE);
wlScript.setText(BaseMessages.getString(PKG, "RegexEvalDialog.Javascript.Label"));
props.setLook(wlScript);
fdlScript = new FormData();
fdlScript.left = new FormAttachment(0, 0);
fdlScript.top = new FormAttachment(wStepSettings, margin);
wlScript.setLayoutData(fdlScript);
wbTestRegExScript = new Button(wGeneralComp, SWT.PUSH | SWT.CENTER);
props.setLook(wbTestRegExScript);
wbTestRegExScript.setText(BaseMessages.getString(PKG, "RegexEvalDialog.TestScript.Label"));
fdbTestRegExScript = new FormData();
fdbTestRegExScript.right = new FormAttachment(100, -margin);
fdbTestRegExScript.top = new FormAttachment(wStepSettings, margin);
wbTestRegExScript.setLayoutData(fdbTestRegExScript);
wScript = new StyledTextComp(transMeta, wGeneralComp, SWT.MULTI | SWT.LEFT | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL, "");
wScript.setText(BaseMessages.getString(PKG, "RegexEvalDialog.Script.Label"));
props.setLook(wScript, Props.WIDGET_STYLE_FIXED);
wScript.addModifyListener(lsMod);
fdScript = new FormData();
fdScript.left = new FormAttachment(0, 0);
fdScript.top = new FormAttachment(wbTestRegExScript, margin);
fdScript.right = new FormAttachment(100, -10);
fdScript.bottom = new FormAttachment(100, -25);
wScript.setLayoutData(fdScript);
// SelectionAdapter lsVar = VariableButtonListenerFactory.getSelectionAdapter(shell, wScript);
// wScript.addKeyListener(TextVar.getControlSpaceKeyListener(wScript, lsVar));
// Variable substitution?
wlUseVar = new Label(wGeneralComp, SWT.NONE);
wlUseVar.setText(BaseMessages.getString(PKG, "RegexEvalDialog.UseVar.Label"));
props.setLook(wlUseVar);
FormData fdlUseVar = new FormData();
fdlUseVar.left = new FormAttachment(0, margin);
fdlUseVar.top = new FormAttachment(wScript, margin);
wlUseVar.setLayoutData(fdlUseVar);
wUseVar = new Button(wGeneralComp, SWT.CHECK);
wUseVar.setToolTipText(BaseMessages.getString(PKG, "RegexEvalDialog.UseVar.Tooltip"));
props.setLook(wUseVar);
FormData fdUseVar = new FormData();
fdUseVar.left = new FormAttachment(wlUseVar, margin);
fdUseVar.top = new FormAttachment(wScript, margin);
wUseVar.setLayoutData(fdUseVar);
wUseVar.addSelectionListener(lsSel);
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);
wSeparator = new Label(wBottom, SWT.SEPARATOR | SWT.HORIZONTAL);
fdSeparator = new FormData();
fdSeparator.left = new FormAttachment(0, 0);
fdSeparator.right = new FormAttachment(100, 0);
fdSeparator.top = new FormAttachment(0, -margin + 2);
wSeparator.setLayoutData(fdSeparator);
wlFields = new Label(wBottom, SWT.NONE);
wlFields.setText(BaseMessages.getString(PKG, "RegexEvalDialog.Fields.Label"));
wlFields.setToolTipText(BaseMessages.getString(PKG, "RegexEvalDialog.Fields.Tooltip"));
props.setLook(wlFields);
fdlFields = new FormData();
fdlFields.left = new FormAttachment(0, 0);
fdlFields.top = new FormAttachment(wSeparator, 0);
wlFields.setLayoutData(fdlFields);
final int fieldsRows = input.getFieldName().length;
ColumnInfo[] columnInfo = new ColumnInfo[] { new ColumnInfo(BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.NewField"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.Type"), ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaFactory.getValueMetaNames()), new ColumnInfo(BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.Length"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.Precision"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.Format"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.Group"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.Decimal"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.Currency"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.Nullif"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.IfNull"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.TrimType"), ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaString.trimTypeDesc, true) };
wFields = new TableView(transMeta, wBottom, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI, columnInfo, fieldsRows, lsMod, props);
fdFields = new FormData();
fdFields.left = new FormAttachment(0, 0);
fdFields.top = new FormAttachment(wlFields, margin);
fdFields.right = new FormAttachment(100, 0);
fdFields.bottom = new FormAttachment(100, 0);
wFields.setLayoutData(fdFields);
fdGeneralComp = new FormData();
fdGeneralComp.left = new FormAttachment(0, 0);
fdGeneralComp.top = new FormAttachment(0, 0);
fdGeneralComp.right = new FormAttachment(100, 0);
fdGeneralComp.bottom = new FormAttachment(100, 0);
wGeneralComp.setLayoutData(fdGeneralComp);
wGeneralComp.layout();
wGeneralTab.setControl(wGeneralComp);
props.setLook(wGeneralComp);
// ///////////////////////////////////////////////////////////
// / END OF GENERAL TAB
// ///////////////////////////////////////////////////////////
// ////////////////////////
// START OF CONTENT TAB///
// /
wContentTab = new CTabItem(wTabFolder, SWT.NONE);
wContentTab.setText(BaseMessages.getString(PKG, "RegexEvalDialog.ContentTab.TabTitle"));
FormLayout contentLayout = new FormLayout();
contentLayout.marginWidth = 3;
contentLayout.marginHeight = 3;
wContentComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wContentComp);
wContentComp.setLayout(contentLayout);
// Step RegexSettings grouping?
// ////////////////////////
// START OF RegexSettings GROUP
//
wRegexSettings = new Group(wContentComp, SWT.SHADOW_NONE);
props.setLook(wRegexSettings);
wRegexSettings.setText("Regex Settings");
FormLayout regexLayout = new FormLayout();
regexLayout.marginWidth = 10;
regexLayout.marginHeight = 10;
wRegexSettings.setLayout(regexLayout);
// Canon_Eq?
wlCanonEq = new Label(wRegexSettings, SWT.RIGHT);
wlCanonEq.setText(BaseMessages.getString(PKG, "RegexEvalDialog.CanonEq.Label"));
props.setLook(wlCanonEq);
FormData fdlCanonEq = new FormData();
fdlCanonEq.left = new FormAttachment(0, 0);
fdlCanonEq.top = new FormAttachment(wStepSettings, margin);
fdlCanonEq.right = new FormAttachment(middle, -margin);
wlCanonEq.setLayoutData(fdlCanonEq);
wCanonEq = new Button(wRegexSettings, SWT.CHECK);
wCanonEq.setToolTipText(BaseMessages.getString(PKG, "RegexEvalDialog.CanonEq.Tooltip"));
props.setLook(wCanonEq);
FormData fdCanonEq = new FormData();
fdCanonEq.left = new FormAttachment(middle, 0);
fdCanonEq.top = new FormAttachment(wStepSettings, margin);
fdCanonEq.right = new FormAttachment(100, 0);
wCanonEq.setLayoutData(fdCanonEq);
wCanonEq.addSelectionListener(lsSel);
// CASE_INSENSITIVE?
wlCaseInsensitive = new Label(wRegexSettings, SWT.RIGHT);
wlCaseInsensitive.setText(BaseMessages.getString(PKG, "RegexEvalDialog.CaseInsensitive.Label"));
props.setLook(wlCaseInsensitive);
FormData fdlCaseInsensitive = new FormData();
fdlCaseInsensitive.left = new FormAttachment(0, 0);
fdlCaseInsensitive.top = new FormAttachment(wCanonEq, margin);
fdlCaseInsensitive.right = new FormAttachment(middle, -margin);
wlCaseInsensitive.setLayoutData(fdlCaseInsensitive);
wCaseInsensitive = new Button(wRegexSettings, SWT.CHECK);
wCaseInsensitive.setToolTipText(BaseMessages.getString(PKG, "RegexEvalDialog.CaseInsensitive.Tooltip"));
props.setLook(wCaseInsensitive);
FormData fdCaseInsensitive = new FormData();
fdCaseInsensitive.left = new FormAttachment(middle, 0);
fdCaseInsensitive.top = new FormAttachment(wCanonEq, margin);
fdCaseInsensitive.right = new FormAttachment(100, 0);
wCaseInsensitive.setLayoutData(fdCaseInsensitive);
wCaseInsensitive.addSelectionListener(lsSel);
// COMMENT?
wlComment = new Label(wRegexSettings, SWT.RIGHT);
wlComment.setText(BaseMessages.getString(PKG, "RegexEvalDialog.Comment.Label"));
props.setLook(wlComment);
FormData fdlComment = new FormData();
fdlComment.left = new FormAttachment(0, 0);
fdlComment.top = new FormAttachment(wCaseInsensitive, margin);
fdlComment.right = new FormAttachment(middle, -margin);
wlComment.setLayoutData(fdlComment);
wComment = new Button(wRegexSettings, SWT.CHECK);
wComment.setToolTipText(BaseMessages.getString(PKG, "RegexEvalDialog.Comment.Tooltip"));
props.setLook(wComment);
FormData fdComment = new FormData();
fdComment.left = new FormAttachment(middle, 0);
fdComment.top = new FormAttachment(wCaseInsensitive, margin);
fdComment.right = new FormAttachment(100, 0);
wComment.setLayoutData(fdComment);
wComment.addSelectionListener(lsSel);
// DOTALL?
wlDotAll = new Label(wRegexSettings, SWT.RIGHT);
wlDotAll.setText(BaseMessages.getString(PKG, "RegexEvalDialog.DotAll.Label"));
props.setLook(wlDotAll);
FormData fdlDotAll = new FormData();
fdlDotAll.left = new FormAttachment(0, 0);
fdlDotAll.top = new FormAttachment(wComment, margin);
fdlDotAll.right = new FormAttachment(middle, -margin);
wlDotAll.setLayoutData(fdlDotAll);
wDotAll = new Button(wRegexSettings, SWT.CHECK);
wDotAll.setToolTipText(BaseMessages.getString(PKG, "RegexEvalDialog.DotAll.Tooltip"));
props.setLook(wDotAll);
FormData fdDotAll = new FormData();
fdDotAll.left = new FormAttachment(middle, 0);
fdDotAll.top = new FormAttachment(wComment, margin);
fdDotAll.right = new FormAttachment(100, 0);
wDotAll.setLayoutData(fdDotAll);
wDotAll.addSelectionListener(lsSel);
// MULTILINE?
wlMultiline = new Label(wRegexSettings, SWT.RIGHT);
wlMultiline.setText(BaseMessages.getString(PKG, "RegexEvalDialog.Multiline.Label"));
props.setLook(wlMultiline);
FormData fdlMultiline = new FormData();
fdlMultiline.left = new FormAttachment(0, 0);
fdlMultiline.top = new FormAttachment(wDotAll, margin);
fdlMultiline.right = new FormAttachment(middle, -margin);
wlMultiline.setLayoutData(fdlMultiline);
wMultiline = new Button(wRegexSettings, SWT.CHECK);
wMultiline.setToolTipText(BaseMessages.getString(PKG, "RegexEvalDialog.Multiline.Tooltip"));
props.setLook(wMultiline);
FormData fdMultiline = new FormData();
fdMultiline.left = new FormAttachment(middle, 0);
fdMultiline.top = new FormAttachment(wDotAll, margin);
fdMultiline.right = new FormAttachment(100, 0);
wMultiline.setLayoutData(fdMultiline);
wMultiline.addSelectionListener(lsSel);
// UNICODE?
wlUnicode = new Label(wRegexSettings, SWT.RIGHT);
wlUnicode.setText(BaseMessages.getString(PKG, "RegexEvalDialog.Unicode.Label"));
props.setLook(wlUnicode);
FormData fdlUnicode = new FormData();
fdlUnicode.left = new FormAttachment(0, 0);
fdlUnicode.top = new FormAttachment(wMultiline, margin);
fdlUnicode.right = new FormAttachment(middle, -margin);
wlUnicode.setLayoutData(fdlUnicode);
wUnicode = new Button(wRegexSettings, SWT.CHECK);
wUnicode.setToolTipText(BaseMessages.getString(PKG, "RegexEvalDialog.Unicode.Tooltip"));
props.setLook(wUnicode);
FormData fdUnicode = new FormData();
fdUnicode.left = new FormAttachment(middle, 0);
fdUnicode.top = new FormAttachment(wMultiline, margin);
fdUnicode.right = new FormAttachment(100, 0);
wUnicode.setLayoutData(fdUnicode);
wUnicode.addSelectionListener(lsSel);
// UNIX?
wlUnix = new Label(wRegexSettings, SWT.RIGHT);
wlUnix.setText(BaseMessages.getString(PKG, "RegexEvalDialog.Unix.Label"));
props.setLook(wlUnix);
FormData fdlUnix = new FormData();
fdlUnix.left = new FormAttachment(0, 0);
fdlUnix.top = new FormAttachment(wUnicode, margin);
fdlUnix.right = new FormAttachment(middle, -margin);
wlUnix.setLayoutData(fdlUnix);
wUnix = new Button(wRegexSettings, SWT.CHECK);
wUnix.setToolTipText(BaseMessages.getString(PKG, "RegexEvalDialog.Unix.Tooltip"));
props.setLook(wUnix);
FormData fdUnix = new FormData();
fdUnix.left = new FormAttachment(middle, 0);
fdUnix.top = new FormAttachment(wUnicode, margin);
fdUnix.right = new FormAttachment(100, 0);
wUnix.setLayoutData(fdUnix);
wUnix.addSelectionListener(lsSel);
fdRegexSettings = new FormData();
fdRegexSettings.left = new FormAttachment(0, margin);
fdRegexSettings.top = new FormAttachment(wStepSettings, margin);
fdRegexSettings.right = new FormAttachment(100, -margin);
wRegexSettings.setLayoutData(fdRegexSettings);
// ///////////////////////////////////////////////////////////
// / END OF RegexSettings GROUP
// ///////////////////////////////////////////////////////////
fdContentComp = new FormData();
fdContentComp.left = new FormAttachment(0, 0);
fdContentComp.top = new FormAttachment(0, 0);
fdContentComp.right = new FormAttachment(100, 0);
fdContentComp.bottom = new FormAttachment(100, 0);
wContentComp.setLayoutData(wContentComp);
wContentComp.layout();
wContentTab.setControl(wContentComp);
// ///////////////////////////////////////////////////////////
// / END OF CONTENT TAB
// ///////////////////////////////////////////////////////////
fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
fdTabFolder.top = new FormAttachment(wStepname, margin);
fdTabFolder.right = new FormAttachment(100, 0);
fdTabFolder.bottom = new FormAttachment(100, -50);
wTabFolder.setLayoutData(fdTabFolder);
fdBottom = new FormData();
fdBottom.left = new FormAttachment(0, 0);
fdBottom.top = new FormAttachment(0, 0);
fdBottom.right = new FormAttachment(100, 0);
fdBottom.bottom = new FormAttachment(100, 0);
wBottom.setLayoutData(fdBottom);
fdSash = new FormData();
fdSash.left = new FormAttachment(0, 0);
fdSash.top = new FormAttachment(wStepname, 0);
fdSash.right = new FormAttachment(100, 0);
fdSash.bottom = new FormAttachment(100, -50);
wSash.setLayoutData(fdSash);
wSash.setWeights(new int[] { 60, 40 });
wOK = new Button(shell, SWT.PUSH);
wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
wCancel = new Button(shell, SWT.PUSH);
wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
lsbTestRegExScript = new Listener() {
public void handleEvent(Event e) {
testRegExScript();
}
};
wbTestRegExScript.addListener(SWT.Selection, lsbTestRegExScript);
setButtonPositions(new Button[] { wOK, wCancel }, margin, null);
// Add listeners
lsCancel = new Listener() {
public void handleEvent(Event e) {
cancel();
}
};
lsOK = new Listener() {
public void handleEvent(Event e) {
ok();
}
};
wCancel.addListener(SWT.Selection, lsCancel);
wOK.addListener(SWT.Selection, lsOK);
lsDef = new SelectionAdapter() {
public void widgetDefaultSelected(SelectionEvent e) {
ok();
}
};
wStepname.addSelectionListener(lsDef);
wTabFolder.setSelection(0);
// Set the shell size, based upon previous time...
setSize();
getData();
setFieldsEnabledStatus();
input.setChanged(changed);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
return stepname;
}
use of org.pentaho.di.ui.core.widget.LabelTextVar in project pentaho-kettle by pentaho.
the class JobEntryFTPDeleteDialog method open.
public JobEntryInterface open() {
Shell parent = getParent();
Display display = parent.getDisplay();
shell = new Shell(parent, props.getJobsDialogStyle());
props.setLook(shell);
JobDialog.setShellImage(shell, jobEntry);
ModifyListener lsMod = new ModifyListener() {
public void modifyText(ModifyEvent e) {
pwdFolder = null;
ftpclient = null;
ftpsclient = null;
sftpclient = null;
conn = null;
jobEntry.setChanged();
}
};
changed = jobEntry.hasChanged();
FormLayout formLayout = new FormLayout();
formLayout.marginWidth = Const.FORM_MARGIN;
formLayout.marginHeight = Const.FORM_MARGIN;
shell.setLayout(formLayout);
shell.setText(BaseMessages.getString(PKG, "JobFTPDelete.Title"));
int middle = props.getMiddlePct();
int margin = Const.MARGIN;
// Job entry name line
wName = new LabelText(shell, BaseMessages.getString(PKG, "JobFTPDelete.Name.Label"), BaseMessages.getString(PKG, "JobFTPDelete.Name.Tooltip"));
wName.addModifyListener(lsMod);
fdName = new FormData();
fdName.top = new FormAttachment(0, 0);
fdName.left = new FormAttachment(0, 0);
fdName.right = new FormAttachment(100, 0);
wName.setLayoutData(fdName);
wTabFolder = new CTabFolder(shell, SWT.BORDER);
props.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
// ////////////////////////
// START OF GENERAL TAB ///
// ////////////////////////
wGeneralTab = new CTabItem(wTabFolder, SWT.NONE);
wGeneralTab.setText(BaseMessages.getString(PKG, "JobFTPDelete.Tab.General.Label"));
wGeneralComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wGeneralComp);
FormLayout generalLayout = new FormLayout();
generalLayout.marginWidth = 3;
generalLayout.marginHeight = 3;
wGeneralComp.setLayout(generalLayout);
// ////////////////////////
// START OF SERVER SETTINGS GROUP///
// /
wServerSettings = new Group(wGeneralComp, SWT.SHADOW_NONE);
props.setLook(wServerSettings);
wServerSettings.setText(BaseMessages.getString(PKG, "JobFTPDelete.ServerSettings.Group.Label"));
FormLayout ServerSettingsgroupLayout = new FormLayout();
ServerSettingsgroupLayout.marginWidth = 10;
ServerSettingsgroupLayout.marginHeight = 10;
wServerSettings.setLayout(ServerSettingsgroupLayout);
// Protocol
wlProtocol = new Label(wServerSettings, SWT.RIGHT);
wlProtocol.setText(BaseMessages.getString(PKG, "JobFTPDelete.Protocol.Label"));
props.setLook(wlProtocol);
fdlProtocol = new FormData();
fdlProtocol.left = new FormAttachment(0, 0);
fdlProtocol.top = new FormAttachment(wName, margin);
fdlProtocol.right = new FormAttachment(middle, 0);
wlProtocol.setLayoutData(fdlProtocol);
wProtocol = new Combo(wServerSettings, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wProtocol.setToolTipText(BaseMessages.getString(PKG, "JobFTPDelete.Protocol.Tooltip"));
wProtocol.add(JobEntryFTPDelete.PROTOCOL_FTP);
wProtocol.add(JobEntryFTPDelete.PROTOCOL_FTPS);
wProtocol.add(JobEntryFTPDelete.PROTOCOL_SFTP);
wProtocol.add(JobEntryFTPDelete.PROTOCOL_SSH);
props.setLook(wProtocol);
fdProtocol = new FormData();
fdProtocol.left = new FormAttachment(middle, margin);
fdProtocol.top = new FormAttachment(wName, margin);
fdProtocol.right = new FormAttachment(100, 0);
wProtocol.setLayoutData(fdProtocol);
wProtocol.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
activeFTPProtocol();
jobEntry.setChanged();
}
});
// ServerName line
wServerName = new LabelTextVar(jobMeta, wServerSettings, BaseMessages.getString(PKG, "JobFTPDelete.Server.Label"), BaseMessages.getString(PKG, "JobFTPDelete.Server.Tooltip"));
props.setLook(wServerName);
wServerName.addModifyListener(lsMod);
fdServerName = new FormData();
fdServerName.left = new FormAttachment(0, 0);
fdServerName.top = new FormAttachment(wProtocol, margin);
fdServerName.right = new FormAttachment(100, 0);
wServerName.setLayoutData(fdServerName);
// Proxy port line
wPort = new LabelTextVar(jobMeta, wServerSettings, BaseMessages.getString(PKG, "JobFTPDelete.Port.Label"), BaseMessages.getString(PKG, "JobFTPDelete.Port.Tooltip"));
props.setLook(wPort);
wPort.addModifyListener(lsMod);
fdPort = new FormData();
fdPort.left = new FormAttachment(0, 0);
fdPort.top = new FormAttachment(wServerName, margin);
fdPort.right = new FormAttachment(100, 0);
wPort.setLayoutData(fdPort);
// UserName line
wUserName = new LabelTextVar(jobMeta, wServerSettings, BaseMessages.getString(PKG, "JobFTPDelete.User.Label"), BaseMessages.getString(PKG, "JobFTPDelete.User.Tooltip"));
props.setLook(wUserName);
wUserName.addModifyListener(lsMod);
fdUserName = new FormData();
fdUserName.left = new FormAttachment(0, 0);
fdUserName.top = new FormAttachment(wPort, margin);
fdUserName.right = new FormAttachment(100, 0);
wUserName.setLayoutData(fdUserName);
// Password line
wPassword = new LabelTextVar(jobMeta, wServerSettings, BaseMessages.getString(PKG, "JobFTPDelete.Password.Label"), BaseMessages.getString(PKG, "JobFTPDelete.Password.Tooltip"), true);
props.setLook(wPassword);
wPassword.addModifyListener(lsMod);
fdPassword = new FormData();
fdPassword.left = new FormAttachment(0, 0);
fdPassword.top = new FormAttachment(wUserName, margin);
fdPassword.right = new FormAttachment(100, 0);
wPassword.setLayoutData(fdPassword);
wlConnectionType = new Label(wServerSettings, SWT.RIGHT);
wlConnectionType.setText(BaseMessages.getString(PKG, "JobFTPDelete.ConnectionType.Label"));
props.setLook(wlConnectionType);
fdlConnectionType = new FormData();
fdlConnectionType.left = new FormAttachment(0, 0);
fdlConnectionType.right = new FormAttachment(middle, 0);
fdlConnectionType.top = new FormAttachment(wPassword, 2 * margin);
wlConnectionType.setLayoutData(fdlConnectionType);
wConnectionType = new CCombo(wServerSettings, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wConnectionType.setItems(FTPSConnection.connection_type_Desc);
props.setLook(wConnectionType);
fdConnectionType = new FormData();
fdConnectionType.left = new FormAttachment(middle, margin);
fdConnectionType.top = new FormAttachment(wPassword, 2 * margin);
fdConnectionType.right = new FormAttachment(100, 0);
wConnectionType.setLayoutData(fdConnectionType);
wConnectionType.addModifyListener(lsMod);
// Use proxy...
wluseProxy = new Label(wServerSettings, SWT.RIGHT);
wluseProxy.setText(BaseMessages.getString(PKG, "JobFTPDelete.useProxy.Label"));
props.setLook(wluseProxy);
fdluseProxy = new FormData();
fdluseProxy.left = new FormAttachment(0, 0);
fdluseProxy.top = new FormAttachment(wConnectionType, margin);
fdluseProxy.right = new FormAttachment(middle, 0);
wluseProxy.setLayoutData(fdluseProxy);
wuseProxy = new Button(wServerSettings, SWT.CHECK);
props.setLook(wuseProxy);
wuseProxy.setToolTipText(BaseMessages.getString(PKG, "JobFTPDelete.useProxy.Tooltip"));
fduseProxy = new FormData();
fduseProxy.left = new FormAttachment(middle, margin);
fduseProxy.top = new FormAttachment(wConnectionType, margin);
fduseProxy.right = new FormAttachment(100, 0);
wuseProxy.setLayoutData(fduseProxy);
wuseProxy.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
activeProxy();
jobEntry.setChanged();
}
});
// Proxy host line
wProxyHost = new LabelTextVar(jobMeta, wServerSettings, BaseMessages.getString(PKG, "JobFTPDelete.ProxyHost.Label"), BaseMessages.getString(PKG, "JobFTPDelete.ProxyHost.Tooltip"));
props.setLook(wProxyHost);
wProxyHost.addModifyListener(lsMod);
fdProxyHost = new FormData();
fdProxyHost.left = new FormAttachment(0, 0);
fdProxyHost.top = new FormAttachment(wuseProxy, margin);
fdProxyHost.right = new FormAttachment(100, 0);
wProxyHost.setLayoutData(fdProxyHost);
// Proxy port line
wProxyPort = new LabelTextVar(jobMeta, wServerSettings, BaseMessages.getString(PKG, "JobFTPDelete.ProxyPort.Label"), BaseMessages.getString(PKG, "JobFTPDelete.ProxyPort.Tooltip"));
props.setLook(wProxyPort);
wProxyPort.addModifyListener(lsMod);
fdProxyPort = new FormData();
fdProxyPort.left = new FormAttachment(0, 0);
fdProxyPort.top = new FormAttachment(wProxyHost, margin);
fdProxyPort.right = new FormAttachment(100, 0);
wProxyPort.setLayoutData(fdProxyPort);
// Proxy username line
wProxyUsername = new LabelTextVar(jobMeta, wServerSettings, BaseMessages.getString(PKG, "JobFTPDelete.ProxyUsername.Label"), BaseMessages.getString(PKG, "JobFTPDelete.ProxyUsername.Tooltip"));
props.setLook(wProxyUsername);
wProxyUsername.addModifyListener(lsMod);
fdProxyUsername = new FormData();
fdProxyUsername.left = new FormAttachment(0, 0);
fdProxyUsername.top = new FormAttachment(wProxyPort, margin);
fdProxyUsername.right = new FormAttachment(100, 0);
wProxyUsername.setLayoutData(fdProxyUsername);
// Proxy password line
wProxyPassword = new LabelTextVar(jobMeta, wServerSettings, BaseMessages.getString(PKG, "JobFTPDelete.ProxyPassword.Label"), BaseMessages.getString(PKG, "JobFTPDelete.ProxyPassword.Tooltip"), true);
props.setLook(wProxyPassword);
wProxyPassword.addModifyListener(lsMod);
fdProxyPasswd = new FormData();
fdProxyPasswd.left = new FormAttachment(0, 0);
fdProxyPasswd.top = new FormAttachment(wProxyUsername, margin);
fdProxyPasswd.right = new FormAttachment(100, 0);
wProxyPassword.setLayoutData(fdProxyPasswd);
// usePublicKey
wlusePublicKey = new Label(wServerSettings, SWT.RIGHT);
wlusePublicKey.setText(BaseMessages.getString(PKG, "JobFTPDelete.usePublicKeyFiles.Label"));
props.setLook(wlusePublicKey);
fdlusePublicKey = new FormData();
fdlusePublicKey.left = new FormAttachment(0, 0);
fdlusePublicKey.top = new FormAttachment(wProxyPassword, margin);
fdlusePublicKey.right = new FormAttachment(middle, 0);
wlusePublicKey.setLayoutData(fdlusePublicKey);
wusePublicKey = new Button(wServerSettings, SWT.CHECK);
wusePublicKey.setToolTipText(BaseMessages.getString(PKG, "JobFTPDelete.usePublicKeyFiles.Tooltip"));
props.setLook(wusePublicKey);
fdusePublicKey = new FormData();
fdusePublicKey.left = new FormAttachment(middle, margin);
fdusePublicKey.top = new FormAttachment(wProxyPassword, margin);
fdusePublicKey.right = new FormAttachment(100, 0);
wusePublicKey.setLayoutData(fdusePublicKey);
wusePublicKey.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
activeUsePublicKey();
jobEntry.setChanged();
}
});
// Key File
wlKeyFilename = new Label(wServerSettings, SWT.RIGHT);
wlKeyFilename.setText(BaseMessages.getString(PKG, "JobFTPDelete.KeyFilename.Label"));
props.setLook(wlKeyFilename);
fdlKeyFilename = new FormData();
fdlKeyFilename.left = new FormAttachment(0, 0);
fdlKeyFilename.top = new FormAttachment(wusePublicKey, margin);
fdlKeyFilename.right = new FormAttachment(middle, -margin);
wlKeyFilename.setLayoutData(fdlKeyFilename);
wbKeyFilename = new Button(wServerSettings, SWT.PUSH | SWT.CENTER);
props.setLook(wbKeyFilename);
wbKeyFilename.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
fdbKeyFilename = new FormData();
fdbKeyFilename.right = new FormAttachment(100, 0);
fdbKeyFilename.top = new FormAttachment(wusePublicKey, 0);
// fdbKeyFilename.height = 22;
wbKeyFilename.setLayoutData(fdbKeyFilename);
wKeyFilename = new TextVar(jobMeta, wServerSettings, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wKeyFilename.setToolTipText(BaseMessages.getString(PKG, "JobFTPDelete.KeyFilename.Tooltip"));
props.setLook(wKeyFilename);
wKeyFilename.addModifyListener(lsMod);
fdKeyFilename = new FormData();
fdKeyFilename.left = new FormAttachment(middle, margin);
fdKeyFilename.top = new FormAttachment(wusePublicKey, margin);
fdKeyFilename.right = new FormAttachment(wbKeyFilename, -margin);
wKeyFilename.setLayoutData(fdKeyFilename);
// Whenever something changes, set the tooltip to the expanded version:
wKeyFilename.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
wKeyFilename.setToolTipText(jobMeta.environmentSubstitute(wKeyFilename.getText()));
}
});
wbKeyFilename.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
FileDialog dialog = new FileDialog(shell, SWT.OPEN);
dialog.setFilterExtensions(new String[] { "*.pem", "*" });
if (wKeyFilename.getText() != null) {
dialog.setFileName(jobMeta.environmentSubstitute(wKeyFilename.getText()));
}
dialog.setFilterNames(FILETYPES);
if (dialog.open() != null) {
wKeyFilename.setText(dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName());
}
}
});
// keyfilePass line
wkeyfilePass = new LabelTextVar(jobMeta, wServerSettings, BaseMessages.getString(PKG, "JobFTPDelete.keyfilePass.Label"), BaseMessages.getString(PKG, "JobFTPDelete.keyfilePass.Tooltip"), true);
props.setLook(wkeyfilePass);
wkeyfilePass.addModifyListener(lsMod);
fdkeyfilePass = new FormData();
fdkeyfilePass.left = new FormAttachment(0, 0);
fdkeyfilePass.top = new FormAttachment(wKeyFilename, margin);
fdkeyfilePass.right = new FormAttachment(100, 0);
wkeyfilePass.setLayoutData(fdkeyfilePass);
// Test connection button
wTest = new Button(wServerSettings, SWT.PUSH);
wTest.setText(BaseMessages.getString(PKG, "JobFTPDelete.TestConnection.Label"));
props.setLook(wTest);
fdTest = new FormData();
wTest.setToolTipText(BaseMessages.getString(PKG, "JobFTPDelete.TestConnection.Tooltip"));
// fdTest.left = new FormAttachment(middle, 0);
fdTest.top = new FormAttachment(wkeyfilePass, margin);
fdTest.right = new FormAttachment(100, 0);
wTest.setLayoutData(fdTest);
fdServerSettings = new FormData();
fdServerSettings.left = new FormAttachment(0, margin);
fdServerSettings.top = new FormAttachment(wName, margin);
fdServerSettings.right = new FormAttachment(100, -margin);
wServerSettings.setLayoutData(fdServerSettings);
// ///////////////////////////////////////////////////////////
// / END OF SERVER SETTINGS GROUP
// ///////////////////////////////////////////////////////////
fdGeneralComp = new FormData();
fdGeneralComp.left = new FormAttachment(0, 0);
fdGeneralComp.top = new FormAttachment(0, 0);
fdGeneralComp.right = new FormAttachment(100, 0);
fdGeneralComp.bottom = new FormAttachment(100, 0);
wGeneralComp.setLayoutData(fdGeneralComp);
wGeneralComp.layout();
wGeneralTab.setControl(wGeneralComp);
props.setLook(wGeneralComp);
// ///////////////////////////////////////////////////////////
// / END OF GENERAL TAB
// ///////////////////////////////////////////////////////////
// ////////////////////////
// START OF Advanced TAB ///
// ////////////////////////
wFilesTab = new CTabItem(wTabFolder, SWT.NONE);
wFilesTab.setText(BaseMessages.getString(PKG, "JobFTPDelete.Tab.Files.Label"));
wFilesComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wFilesComp);
FormLayout AdvancedLayout = new FormLayout();
AdvancedLayout.marginWidth = 3;
AdvancedLayout.marginHeight = 3;
wFilesComp.setLayout(AdvancedLayout);
// ////////////////////////
// START OF Advanced SETTINGS GROUP///
// /
wAdvancedSettings = new Group(wFilesComp, SWT.SHADOW_NONE);
props.setLook(wAdvancedSettings);
wAdvancedSettings.setText(BaseMessages.getString(PKG, "JobFTPDelete.AdvancedSettings.Group.Label"));
FormLayout AdvancedSettingsgroupLayout = new FormLayout();
AdvancedSettingsgroupLayout.marginWidth = 10;
AdvancedSettingsgroupLayout.marginHeight = 10;
wAdvancedSettings.setLayout(AdvancedSettingsgroupLayout);
// Timeout line
wTimeout = new LabelTextVar(jobMeta, wAdvancedSettings, BaseMessages.getString(PKG, "JobFTPDelete.Timeout.Label"), BaseMessages.getString(PKG, "JobFTPDelete.Timeout.Tooltip"));
props.setLook(wTimeout);
wTimeout.addModifyListener(lsMod);
fdTimeout = new FormData();
fdTimeout.left = new FormAttachment(0, 0);
fdTimeout.top = new FormAttachment(wActive, margin);
fdTimeout.right = new FormAttachment(100, 0);
wTimeout.setLayoutData(fdTimeout);
// active connection?
wlActive = new Label(wAdvancedSettings, SWT.RIGHT);
wlActive.setText(BaseMessages.getString(PKG, "JobFTPDelete.ActiveConns.Label"));
props.setLook(wlActive);
fdlActive = new FormData();
fdlActive.left = new FormAttachment(0, 0);
fdlActive.top = new FormAttachment(wTimeout, margin);
fdlActive.right = new FormAttachment(middle, 0);
wlActive.setLayoutData(fdlActive);
wActive = new Button(wAdvancedSettings, SWT.CHECK);
wActive.setToolTipText(BaseMessages.getString(PKG, "JobFTPDelete.ActiveConns.Tooltip"));
props.setLook(wActive);
fdActive = new FormData();
fdActive.left = new FormAttachment(middle, margin);
fdActive.top = new FormAttachment(wTimeout, margin);
fdActive.right = new FormAttachment(100, 0);
wActive.setLayoutData(fdActive);
fdAdvancedSettings = new FormData();
fdAdvancedSettings.left = new FormAttachment(0, margin);
fdAdvancedSettings.top = new FormAttachment(0, margin);
fdAdvancedSettings.right = new FormAttachment(100, -margin);
wAdvancedSettings.setLayoutData(fdAdvancedSettings);
// ///////////////////////////////////////////////////////////
// / END OF Advanced SETTINGS GROUP
// ///////////////////////////////////////////////////////////
// ////////////////////////
// START OF Remote SETTINGS GROUP///
// /
wRemoteSettings = new Group(wFilesComp, SWT.SHADOW_NONE);
props.setLook(wRemoteSettings);
wRemoteSettings.setText(BaseMessages.getString(PKG, "JobFTPDelete.RemoteSettings.Group.Label"));
FormLayout RemoteSettinsgroupLayout = new FormLayout();
RemoteSettinsgroupLayout.marginWidth = 10;
RemoteSettinsgroupLayout.marginHeight = 10;
wRemoteSettings.setLayout(RemoteSettinsgroupLayout);
// Get arguments from previous result...
wlgetPrevious = new Label(wRemoteSettings, SWT.RIGHT);
wlgetPrevious.setText(BaseMessages.getString(PKG, "JobFTPDelete.getPrevious.Label"));
props.setLook(wlgetPrevious);
fdlgetPrevious = new FormData();
fdlgetPrevious.left = new FormAttachment(0, 0);
fdlgetPrevious.top = new FormAttachment(wAdvancedSettings, margin);
fdlgetPrevious.right = new FormAttachment(middle, 0);
wlgetPrevious.setLayoutData(fdlgetPrevious);
wgetPrevious = new Button(wRemoteSettings, SWT.CHECK);
props.setLook(wgetPrevious);
wgetPrevious.setToolTipText(BaseMessages.getString(PKG, "JobFTPDelete.getPrevious.Tooltip"));
fdgetPrevious = new FormData();
fdgetPrevious.left = new FormAttachment(middle, margin);
fdgetPrevious.top = new FormAttachment(wAdvancedSettings, margin);
fdgetPrevious.right = new FormAttachment(100, 0);
wgetPrevious.setLayoutData(fdgetPrevious);
wgetPrevious.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
activeCopyFromPrevious();
jobEntry.setChanged();
}
});
// FTP directory
wlFtpDirectory = new Label(wRemoteSettings, SWT.RIGHT);
wlFtpDirectory.setText(BaseMessages.getString(PKG, "JobFTPDelete.RemoteDir.Label"));
props.setLook(wlFtpDirectory);
fdlFtpDirectory = new FormData();
fdlFtpDirectory.left = new FormAttachment(0, 0);
fdlFtpDirectory.top = new FormAttachment(wgetPrevious, margin);
fdlFtpDirectory.right = new FormAttachment(middle, 0);
wlFtpDirectory.setLayoutData(fdlFtpDirectory);
// Test remote folder button ...
wbTestChangeFolderExists = new Button(wRemoteSettings, SWT.PUSH | SWT.CENTER);
props.setLook(wbTestChangeFolderExists);
wbTestChangeFolderExists.setText(BaseMessages.getString(PKG, "JobFTPDelete.TestFolderExists.Label"));
fdbTestChangeFolderExists = new FormData();
fdbTestChangeFolderExists.right = new FormAttachment(100, 0);
fdbTestChangeFolderExists.top = new FormAttachment(wgetPrevious, margin);
wbTestChangeFolderExists.setLayoutData(fdbTestChangeFolderExists);
wFtpDirectory = new TextVar(jobMeta, wRemoteSettings, SWT.SINGLE | SWT.LEFT | SWT.BORDER, BaseMessages.getString(PKG, "JobFTPDelete.RemoteDir.Tooltip"));
props.setLook(wFtpDirectory);
wFtpDirectory.addModifyListener(lsMod);
fdFtpDirectory = new FormData();
fdFtpDirectory.left = new FormAttachment(middle, margin);
fdFtpDirectory.top = new FormAttachment(wgetPrevious, margin);
fdFtpDirectory.right = new FormAttachment(wbTestChangeFolderExists, -margin);
wFtpDirectory.setLayoutData(fdFtpDirectory);
// Wildcard line
wWildcard = new LabelTextVar(jobMeta, wRemoteSettings, BaseMessages.getString(PKG, "JobFTPDelete.Wildcard.Label"), BaseMessages.getString(PKG, "JobFTPDelete.Wildcard.Tooltip"));
props.setLook(wWildcard);
wWildcard.addModifyListener(lsMod);
fdWildcard = new FormData();
fdWildcard.left = new FormAttachment(0, 0);
fdWildcard.top = new FormAttachment(wFtpDirectory, margin);
fdWildcard.right = new FormAttachment(100, 0);
wWildcard.setLayoutData(fdWildcard);
fdRemoteSettings = new FormData();
fdRemoteSettings.left = new FormAttachment(0, margin);
fdRemoteSettings.top = new FormAttachment(wAdvancedSettings, margin);
fdRemoteSettings.right = new FormAttachment(100, -margin);
wRemoteSettings.setLayoutData(fdRemoteSettings);
// ///////////////////////////////////////////////////////////
// / END OF Remote SETTINGSGROUP
// ///////////////////////////////////////////////////////////
// SuccessOngrouping?
// ////////////////////////
// START OF SUCCESS ON GROUP///
// /
wSuccessOn = new Group(wFilesComp, SWT.SHADOW_NONE);
props.setLook(wSuccessOn);
wSuccessOn.setText(BaseMessages.getString(PKG, "JobFTPDelete.SuccessOn.Group.Label"));
FormLayout successongroupLayout = new FormLayout();
successongroupLayout.marginWidth = 10;
successongroupLayout.marginHeight = 10;
wSuccessOn.setLayout(successongroupLayout);
// Success Condition
wlSuccessCondition = new Label(wSuccessOn, SWT.RIGHT);
wlSuccessCondition.setText(BaseMessages.getString(PKG, "JobFTPDelete.SuccessCondition.Label") + " ");
props.setLook(wlSuccessCondition);
fdlSuccessCondition = new FormData();
fdlSuccessCondition.left = new FormAttachment(0, 0);
fdlSuccessCondition.right = new FormAttachment(middle, 0);
fdlSuccessCondition.top = new FormAttachment(wRemoteSettings, margin);
wlSuccessCondition.setLayoutData(fdlSuccessCondition);
wSuccessCondition = new CCombo(wSuccessOn, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wSuccessCondition.add(BaseMessages.getString(PKG, "JobFTPDelete.SuccessWhenAllWorksFine.Label"));
wSuccessCondition.add(BaseMessages.getString(PKG, "JobFTPDelete.SuccessWhenAtLeat.Label"));
wSuccessCondition.add(BaseMessages.getString(PKG, "JobFTPDelete.SuccessWhenNrErrorsLessThan.Label"));
// +1: starts at -1
wSuccessCondition.select(0);
props.setLook(wSuccessCondition);
fdSuccessCondition = new FormData();
fdSuccessCondition.left = new FormAttachment(middle, 0);
fdSuccessCondition.top = new FormAttachment(wRemoteSettings, margin);
fdSuccessCondition.right = new FormAttachment(100, 0);
wSuccessCondition.setLayoutData(fdSuccessCondition);
wSuccessCondition.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
activeSuccessCondition();
}
});
// Success when number of errors less than
wlNrErrorsLessThan = new Label(wSuccessOn, SWT.RIGHT);
wlNrErrorsLessThan.setText(BaseMessages.getString(PKG, "JobFTPDelete.NrBadFormedLessThan.Label") + " ");
props.setLook(wlNrErrorsLessThan);
fdlNrErrorsLessThan = new FormData();
fdlNrErrorsLessThan.left = new FormAttachment(0, 0);
fdlNrErrorsLessThan.top = new FormAttachment(wSuccessCondition, margin);
fdlNrErrorsLessThan.right = new FormAttachment(middle, -margin);
wlNrErrorsLessThan.setLayoutData(fdlNrErrorsLessThan);
wNrErrorsLessThan = new TextVar(jobMeta, wSuccessOn, SWT.SINGLE | SWT.LEFT | SWT.BORDER, BaseMessages.getString(PKG, "JobFTPDelete.NrBadFormedLessThan.Tooltip"));
props.setLook(wNrErrorsLessThan);
wNrErrorsLessThan.addModifyListener(lsMod);
fdNrErrorsLessThan = new FormData();
fdNrErrorsLessThan.left = new FormAttachment(middle, 0);
fdNrErrorsLessThan.top = new FormAttachment(wSuccessCondition, margin);
fdNrErrorsLessThan.right = new FormAttachment(100, -margin);
wNrErrorsLessThan.setLayoutData(fdNrErrorsLessThan);
fdSuccessOn = new FormData();
fdSuccessOn.left = new FormAttachment(0, margin);
fdSuccessOn.top = new FormAttachment(wRemoteSettings, margin);
fdSuccessOn.right = new FormAttachment(100, -margin);
wSuccessOn.setLayoutData(fdSuccessOn);
// ///////////////////////////////////////////////////////////
// / END OF Success ON GROUP
// ///////////////////////////////////////////////////////////
fdFilesComp = new FormData();
fdFilesComp.left = new FormAttachment(0, 0);
fdFilesComp.top = new FormAttachment(0, 0);
fdFilesComp.right = new FormAttachment(100, 0);
fdFilesComp.bottom = new FormAttachment(100, 0);
wFilesComp.setLayoutData(fdFilesComp);
wFilesComp.layout();
wFilesTab.setControl(wFilesComp);
props.setLook(wFilesComp);
// ///////////////////////////////////////////////////////////
// / END OF Advanced TAB
// ///////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////////
// Start of Socks Proxy Tab
// ///////////////////////////////////////////////////////////
wSocksProxyTab = new CTabItem(wTabFolder, SWT.NONE);
wSocksProxyTab.setText(BaseMessages.getString(PKG, "JobFTPDelete.Tab.Socks.Label"));
wSocksProxyComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wSocksProxyComp);
FormLayout SoxProxyLayout = new FormLayout();
SoxProxyLayout.marginWidth = 3;
SoxProxyLayout.marginHeight = 3;
wSocksProxyComp.setLayout(SoxProxyLayout);
// ////////////////////////////////////////////////////////
// Start of Proxy Group
// ////////////////////////////////////////////////////////
wSocksProxy = new Group(wSocksProxyComp, SWT.SHADOW_NONE);
props.setLook(wSocksProxy);
wSocksProxy.setText(BaseMessages.getString(PKG, "JobFTPDelete.SocksProxy.Group.Label"));
FormLayout SocksProxyGroupLayout = new FormLayout();
SocksProxyGroupLayout.marginWidth = 10;
SocksProxyGroupLayout.marginHeight = 10;
wSocksProxy.setLayout(SocksProxyGroupLayout);
// host line
wSocksProxyHost = new LabelTextVar(jobMeta, wSocksProxy, BaseMessages.getString(PKG, "JobFTPDelete.SocksProxyHost.Label"), BaseMessages.getString(PKG, "JobFTPDelete.SocksProxyHost.Tooltip"));
props.setLook(wSocksProxyHost);
wSocksProxyHost.addModifyListener(lsMod);
fdSocksProxyHost = new FormData();
fdSocksProxyHost.left = new FormAttachment(0, 0);
fdSocksProxyHost.top = new FormAttachment(wName, margin);
fdSocksProxyHost.right = new FormAttachment(100, margin);
wSocksProxyHost.setLayoutData(fdSocksProxyHost);
// port line
wSocksProxyPort = new LabelTextVar(jobMeta, wSocksProxy, BaseMessages.getString(PKG, "JobFTPDelete.SocksProxyPort.Label"), BaseMessages.getString(PKG, "JobFTPDelete.SocksProxyPort.Tooltip"));
props.setLook(wSocksProxyPort);
wSocksProxyPort.addModifyListener(lsMod);
fdSocksProxyPort = new FormData();
fdSocksProxyPort.left = new FormAttachment(0, 0);
fdSocksProxyPort.top = new FormAttachment(wSocksProxyHost, margin);
fdSocksProxyPort.right = new FormAttachment(100, margin);
wSocksProxyPort.setLayoutData(fdSocksProxyPort);
// username line
wSocksProxyUsername = new LabelTextVar(jobMeta, wSocksProxy, BaseMessages.getString(PKG, "JobFTPDelete.SocksProxyUsername.Label"), BaseMessages.getString(PKG, "JobFTPDelete.SocksProxyPassword.Tooltip"));
props.setLook(wSocksProxyUsername);
wSocksProxyUsername.addModifyListener(lsMod);
fdSocksProxyUsername = new FormData();
fdSocksProxyUsername.left = new FormAttachment(0, 0);
fdSocksProxyUsername.top = new FormAttachment(wSocksProxyPort, margin);
fdSocksProxyUsername.right = new FormAttachment(100, margin);
wSocksProxyUsername.setLayoutData(fdSocksProxyUsername);
// password line
wSocksProxyPassword = new LabelTextVar(jobMeta, wSocksProxy, BaseMessages.getString(PKG, "JobFTPDelete.SocksProxyPassword.Label"), BaseMessages.getString(PKG, "JobFTPDelete.SocksProxyPassword.Tooltip"), true);
props.setLook(wSocksProxyPort);
wSocksProxyPassword.addModifyListener(lsMod);
fdSocksProxyPassword = new FormData();
fdSocksProxyPassword.left = new FormAttachment(0, 0);
fdSocksProxyPassword.top = new FormAttachment(wSocksProxyUsername, margin);
fdSocksProxyPassword.right = new FormAttachment(100, margin);
wSocksProxyPassword.setLayoutData(fdSocksProxyPassword);
// ///////////////////////////////////////////////////////////////
// End of socks proxy group
// ///////////////////////////////////////////////////////////////
fdSocksProxyComp = new FormData();
fdSocksProxyComp.left = new FormAttachment(0, margin);
fdSocksProxyComp.top = new FormAttachment(0, margin);
fdSocksProxyComp.right = new FormAttachment(100, -margin);
wSocksProxy.setLayoutData(fdSocksProxyComp);
wSocksProxyComp.layout();
wSocksProxyTab.setControl(wSocksProxyComp);
props.setLook(wSocksProxyComp);
// ////////////////////////////////////////////////////////
// End of Socks Proxy Tab
// ////////////////////////////////////////////////////////
fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
fdTabFolder.top = new FormAttachment(wName, margin);
fdTabFolder.right = new FormAttachment(100, 0);
fdTabFolder.bottom = new FormAttachment(100, -50);
wTabFolder.setLayoutData(fdTabFolder);
fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
fdTabFolder.top = new FormAttachment(wName, margin);
fdTabFolder.right = new FormAttachment(100, 0);
fdTabFolder.bottom = new FormAttachment(100, -50);
wTabFolder.setLayoutData(fdTabFolder);
wOK = new Button(shell, SWT.PUSH);
wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
wCancel = new Button(shell, SWT.PUSH);
wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
BaseStepDialog.positionBottomButtons(shell, new Button[] { wOK, wCancel }, margin, wTabFolder);
// Add listeners
lsCancel = new Listener() {
public void handleEvent(Event e) {
cancel();
}
};
lsOK = new Listener() {
public void handleEvent(Event e) {
ok();
}
};
lsTest = new Listener() {
public void handleEvent(Event e) {
test();
}
};
lsCheckFolder = new Listener() {
public void handleEvent(Event e) {
checkFTPFolder();
}
};
wCancel.addListener(SWT.Selection, lsCancel);
wOK.addListener(SWT.Selection, lsOK);
wTest.addListener(SWT.Selection, lsTest);
wbTestChangeFolderExists.addListener(SWT.Selection, lsCheckFolder);
lsDef = new SelectionAdapter() {
public void widgetDefaultSelected(SelectionEvent e) {
ok();
}
};
wName.addSelectionListener(lsDef);
wServerName.addSelectionListener(lsDef);
wUserName.addSelectionListener(lsDef);
wPassword.addSelectionListener(lsDef);
wFtpDirectory.addSelectionListener(lsDef);
wFtpDirectory.addSelectionListener(lsDef);
wWildcard.addSelectionListener(lsDef);
wTimeout.addSelectionListener(lsDef);
// Detect X or ALT-F4 or something that kills this window...
shell.addShellListener(new ShellAdapter() {
public void shellClosed(ShellEvent e) {
cancel();
}
});
getData();
activeSuccessCondition();
activeUsePublicKey();
activeProxy();
activeFTPProtocol();
activeCopyFromPrevious();
wTabFolder.setSelection(0);
BaseStepDialog.setSize(shell);
shell.open();
props.setDialogSize(shell, "JobFTPDeleteDialogSize");
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
return jobEntry;
}
Aggregations