use of org.pentaho.di.ui.core.widget.LabelTextVar in project pentaho-kettle by pentaho.
the class SalesforceInsertDialog method open.
@Override
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() {
@Override
public void modifyText(ModifyEvent e) {
input.setChanged();
}
};
ModifyListener lsTableMod = new ModifyListener() {
@Override
public void modifyText(ModifyEvent arg0) {
input.setChanged();
setModuleFieldCombo();
}
};
SelectionAdapter lsSelection = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
input.setChanged();
setModuleFieldCombo();
}
};
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, "SalesforceInsertDialog.DialogTitle"));
int middle = props.getMiddlePct();
int margin = Const.MARGIN;
// 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.top = new FormAttachment(0, margin);
fdlStepname.right = new FormAttachment(middle, -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);
wTabFolder = new CTabFolder(shell, SWT.BORDER);
props.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
// ////////////////////////
// START OF FILE TAB ///
// ////////////////////////
wGeneralTab = new CTabItem(wTabFolder, SWT.NONE);
wGeneralTab.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.General.Tab"));
wGeneralComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wGeneralComp);
FormLayout generalLayout = new FormLayout();
generalLayout.marginWidth = 3;
generalLayout.marginHeight = 3;
wGeneralComp.setLayout(generalLayout);
// ///////////////////////////////
// START OF Connection GROUP //
// ///////////////////////////////
wConnectionGroup = new Group(wGeneralComp, SWT.SHADOW_NONE);
props.setLook(wConnectionGroup);
wConnectionGroup.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.ConnectionGroup.Label"));
FormLayout connectionGroupLayout = new FormLayout();
connectionGroupLayout.marginWidth = 10;
connectionGroupLayout.marginHeight = 10;
wConnectionGroup.setLayout(connectionGroupLayout);
// Webservice URL
wURL = new LabelTextVar(transMeta, wConnectionGroup, BaseMessages.getString(PKG, "SalesforceInsertDialog.URL.Label"), BaseMessages.getString(PKG, "SalesforceInsertDialog.URL.Tooltip"));
props.setLook(wURL);
wURL.addModifyListener(lsMod);
fdURL = new FormData();
fdURL.left = new FormAttachment(0, 0);
fdURL.top = new FormAttachment(wStepname, margin);
fdURL.right = new FormAttachment(100, 0);
wURL.setLayoutData(fdURL);
// UserName line
wUserName = new LabelTextVar(transMeta, wConnectionGroup, BaseMessages.getString(PKG, "SalesforceInsertDialog.User.Label"), BaseMessages.getString(PKG, "SalesforceInsertDialog.User.Tooltip"));
props.setLook(wUserName);
wUserName.addModifyListener(lsMod);
fdUserName = new FormData();
fdUserName.left = new FormAttachment(0, 0);
fdUserName.top = new FormAttachment(wURL, margin);
fdUserName.right = new FormAttachment(100, 0);
wUserName.setLayoutData(fdUserName);
// Password line
wPassword = new LabelTextVar(transMeta, wConnectionGroup, BaseMessages.getString(PKG, "SalesforceInsertDialog.Password.Label"), BaseMessages.getString(PKG, "SalesforceInsertDialog.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);
// Test Salesforce connection button
wTest = new Button(wConnectionGroup, SWT.PUSH);
wTest.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.TestConnection.Label"));
props.setLook(wTest);
fdTest = new FormData();
wTest.setToolTipText(BaseMessages.getString(PKG, "SalesforceInsertDialog.TestConnection.Tooltip"));
// fdTest.left = new FormAttachment(middle, 0);
fdTest.top = new FormAttachment(wPassword, margin);
fdTest.right = new FormAttachment(100, 0);
wTest.setLayoutData(fdTest);
fdConnectionGroup = new FormData();
fdConnectionGroup.left = new FormAttachment(0, margin);
fdConnectionGroup.top = new FormAttachment(wStepname, margin);
fdConnectionGroup.right = new FormAttachment(100, -margin);
wConnectionGroup.setLayoutData(fdConnectionGroup);
// ///////////////////////////////
// END OF Connection GROUP //
// ///////////////////////////////
// ///////////////////////////////
// START OF Settings GROUP //
// ///////////////////////////////
wSettingsGroup = new Group(wGeneralComp, SWT.SHADOW_NONE);
props.setLook(wSettingsGroup);
wSettingsGroup.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.SettingsGroup.Label"));
FormLayout settingGroupLayout = new FormLayout();
settingGroupLayout.marginWidth = 10;
settingGroupLayout.marginHeight = 10;
wSettingsGroup.setLayout(settingGroupLayout);
// Timeout
wlTimeOut = new Label(wSettingsGroup, SWT.RIGHT);
wlTimeOut.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.TimeOut.Label"));
props.setLook(wlTimeOut);
fdlTimeOut = new FormData();
fdlTimeOut.left = new FormAttachment(0, 0);
fdlTimeOut.top = new FormAttachment(wSettingsGroup, margin);
fdlTimeOut.right = new FormAttachment(middle, -margin);
wlTimeOut.setLayoutData(fdlTimeOut);
wTimeOut = new TextVar(transMeta, wSettingsGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wTimeOut);
wTimeOut.addModifyListener(lsMod);
fdTimeOut = new FormData();
fdTimeOut.left = new FormAttachment(middle, 0);
fdTimeOut.top = new FormAttachment(wSettingsGroup, margin);
fdTimeOut.right = new FormAttachment(100, 0);
wTimeOut.setLayoutData(fdTimeOut);
// Use compression?
wlUseCompression = new Label(wSettingsGroup, SWT.RIGHT);
wlUseCompression.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.UseCompression.Label"));
props.setLook(wlUseCompression);
fdlUseCompression = new FormData();
fdlUseCompression.left = new FormAttachment(0, 0);
fdlUseCompression.top = new FormAttachment(wTimeOut, margin);
fdlUseCompression.right = new FormAttachment(middle, -margin);
wlUseCompression.setLayoutData(fdlUseCompression);
wUseCompression = new Button(wSettingsGroup, SWT.CHECK);
props.setLook(wUseCompression);
wUseCompression.setToolTipText(BaseMessages.getString(PKG, "SalesforceInsertDialog.UseCompression.Tooltip"));
fdUseCompression = new FormData();
fdUseCompression.left = new FormAttachment(middle, 0);
fdUseCompression.top = new FormAttachment(wTimeOut, margin);
wUseCompression.setLayoutData(fdUseCompression);
wUseCompression.addSelectionListener(new ComponentSelectionListener(input));
// Rollback all changes on error?
wlRollbackAllChangesOnError = new Label(wSettingsGroup, SWT.RIGHT);
wlRollbackAllChangesOnError.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.RollbackAllChangesOnError.Label"));
props.setLook(wlRollbackAllChangesOnError);
fdlRollbackAllChangesOnError = new FormData();
fdlRollbackAllChangesOnError.left = new FormAttachment(0, 0);
fdlRollbackAllChangesOnError.top = new FormAttachment(wUseCompression, margin);
fdlRollbackAllChangesOnError.right = new FormAttachment(middle, -margin);
wlRollbackAllChangesOnError.setLayoutData(fdlRollbackAllChangesOnError);
wRollbackAllChangesOnError = new Button(wSettingsGroup, SWT.CHECK);
wRollbackAllChangesOnError.addSelectionListener(new ComponentSelectionListener(input));
props.setLook(wRollbackAllChangesOnError);
wRollbackAllChangesOnError.setToolTipText(BaseMessages.getString(PKG, "SalesforceInsertDialog.RollbackAllChangesOnError.Tooltip"));
fdRollbackAllChangesOnError = new FormData();
fdRollbackAllChangesOnError.left = new FormAttachment(middle, 0);
fdRollbackAllChangesOnError.top = new FormAttachment(wUseCompression, margin);
wRollbackAllChangesOnError.setLayoutData(fdRollbackAllChangesOnError);
// BatchSize value
wlBatchSize = new Label(wSettingsGroup, SWT.RIGHT);
wlBatchSize.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.Limit.Label"));
props.setLook(wlBatchSize);
fdlBatchSize = new FormData();
fdlBatchSize.left = new FormAttachment(0, 0);
fdlBatchSize.top = new FormAttachment(wRollbackAllChangesOnError, margin);
fdlBatchSize.right = new FormAttachment(middle, -margin);
wlBatchSize.setLayoutData(fdlBatchSize);
wBatchSize = new TextVar(transMeta, wSettingsGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wBatchSize);
wBatchSize.addModifyListener(lsMod);
fdBatchSize = new FormData();
fdBatchSize.left = new FormAttachment(middle, 0);
fdBatchSize.top = new FormAttachment(wRollbackAllChangesOnError, margin);
fdBatchSize.right = new FormAttachment(100, 0);
wBatchSize.setLayoutData(fdBatchSize);
// Module
wlModule = new Label(wSettingsGroup, SWT.RIGHT);
wlModule.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.Module.Label"));
props.setLook(wlModule);
fdlModule = new FormData();
fdlModule.left = new FormAttachment(0, 0);
fdlModule.top = new FormAttachment(wBatchSize, margin);
fdlModule.right = new FormAttachment(middle, -margin);
wlModule.setLayoutData(fdlModule);
wModule = new ComboVar(transMeta, wSettingsGroup, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wModule.setEditable(true);
props.setLook(wModule);
wModule.addModifyListener(lsTableMod);
wModule.addSelectionListener(lsSelection);
fdModule = new FormData();
fdModule.left = new FormAttachment(middle, 0);
fdModule.top = new FormAttachment(wBatchSize, margin);
fdModule.right = new FormAttachment(100, -margin);
wModule.setLayoutData(fdModule);
wModule.addFocusListener(new FocusListener() {
@Override
public void focusLost(org.eclipse.swt.events.FocusEvent e) {
getModulesListError = false;
}
@Override
public void focusGained(org.eclipse.swt.events.FocusEvent e) {
// check if the URL and login credentials passed and not just had error
if (Utils.isEmpty(wURL.getText()) || Utils.isEmpty(wUserName.getText()) || Utils.isEmpty(wPassword.getText()) || (getModulesListError)) {
return;
}
Cursor busy = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
shell.setCursor(busy);
getModulesList();
shell.setCursor(null);
busy.dispose();
}
});
fdSettingsGroup = new FormData();
fdSettingsGroup.left = new FormAttachment(0, margin);
fdSettingsGroup.top = new FormAttachment(wConnectionGroup, margin);
fdSettingsGroup.right = new FormAttachment(100, -margin);
wSettingsGroup.setLayoutData(fdSettingsGroup);
// ///////////////////////////////
// END OF Settings GROUP //
// ///////////////////////////////
// ///////////////////////////////
// START OF OutFields GROUP //
// ///////////////////////////////
wOutFieldsGroup = new Group(wGeneralComp, SWT.SHADOW_NONE);
props.setLook(wOutFieldsGroup);
wOutFieldsGroup.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.OutFieldsGroup.Label"));
FormLayout OutFieldsGroupLayout = new FormLayout();
OutFieldsGroupLayout.marginWidth = 10;
OutFieldsGroupLayout.marginHeight = 10;
wOutFieldsGroup.setLayout(OutFieldsGroupLayout);
// SalesforceIDFieldName
wlSalesforceIDFieldName = new Label(wOutFieldsGroup, SWT.RIGHT);
wlSalesforceIDFieldName.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.SalesforceIDFieldName.Label"));
props.setLook(wlSalesforceIDFieldName);
fdlSalesforceIDFieldName = new FormData();
fdlSalesforceIDFieldName.left = new FormAttachment(0, 0);
fdlSalesforceIDFieldName.top = new FormAttachment(wSettingsGroup, margin);
fdlSalesforceIDFieldName.right = new FormAttachment(middle, -margin);
wlSalesforceIDFieldName.setLayoutData(fdlSalesforceIDFieldName);
wSalesforceIDFieldName = new TextVar(transMeta, wOutFieldsGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wSalesforceIDFieldName);
wSalesforceIDFieldName.setToolTipText(BaseMessages.getString(PKG, "SalesforceInsertDialog.SalesforceIDFieldName.Tooltip"));
wSalesforceIDFieldName.addModifyListener(lsMod);
fdSalesforceIDFieldName = new FormData();
fdSalesforceIDFieldName.left = new FormAttachment(middle, 0);
fdSalesforceIDFieldName.top = new FormAttachment(wSettingsGroup, margin);
fdSalesforceIDFieldName.right = new FormAttachment(100, 0);
wSalesforceIDFieldName.setLayoutData(fdSalesforceIDFieldName);
fdOutFieldsGroup = new FormData();
fdOutFieldsGroup.left = new FormAttachment(0, margin);
fdOutFieldsGroup.top = new FormAttachment(wSettingsGroup, margin);
fdOutFieldsGroup.right = new FormAttachment(100, -margin);
wOutFieldsGroup.setLayoutData(fdOutFieldsGroup);
// ///////////////////////////////
// END OF OutFields GROUP //
// ///////////////////////////////
// THE UPDATE/INSERT TABLE
wlReturn = new Label(wGeneralComp, SWT.NONE);
wlReturn.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.UpdateFields.Label"));
props.setLook(wlReturn);
fdlReturn = new FormData();
fdlReturn.left = new FormAttachment(0, 0);
fdlReturn.top = new FormAttachment(wOutFieldsGroup, margin);
wlReturn.setLayoutData(fdlReturn);
int UpInsCols = 3;
int UpInsRows = (input.getUpdateLookup() != null ? input.getUpdateLookup().length : 1);
ciReturn = new ColumnInfo[UpInsCols];
ciReturn[0] = new ColumnInfo(BaseMessages.getString(PKG, "SalesforceInsertDialog.ColumnInfo.TableField"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false);
ciReturn[1] = new ColumnInfo(BaseMessages.getString(PKG, "SalesforceInsertDialog.ColumnInfo.StreamField"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false);
ciReturn[2] = new ColumnInfo(BaseMessages.getString(PKG, "SalesforceInsertDialog.ColumnInfo.UseExternalId"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "Y", "N" });
ciReturn[2].setToolTip(BaseMessages.getString(PKG, "SalesforceInsertDialog.ColumnInfo.UseExternalId.Tooltip"));
tableFieldColumns.add(ciReturn[0]);
wReturn = new TableView(transMeta, wGeneralComp, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL, ciReturn, UpInsRows, lsMod, props);
wGetLU = new Button(wGeneralComp, SWT.PUSH);
wGetLU.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.GetAndUpdateFields.Label"));
fdGetLU = new FormData();
fdGetLU.top = new FormAttachment(wlReturn, margin);
fdGetLU.right = new FormAttachment(100, 0);
wGetLU.setLayoutData(fdGetLU);
wDoMapping = new Button(wGeneralComp, SWT.PUSH);
wDoMapping.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.EditMapping.Label"));
fdDoMapping = new FormData();
fdDoMapping.top = new FormAttachment(wGetLU, margin);
fdDoMapping.right = new FormAttachment(100, 0);
wDoMapping.setLayoutData(fdDoMapping);
wDoMapping.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event arg0) {
generateMappings();
}
});
fdReturn = new FormData();
fdReturn.left = new FormAttachment(0, 0);
fdReturn.top = new FormAttachment(wlReturn, margin);
fdReturn.right = new FormAttachment(wGetLU, -5 * margin);
fdReturn.bottom = new FormAttachment(100, -2 * margin);
wReturn.setLayoutData(fdReturn);
//
// Search the fields in the background
//
final Runnable runnable = new Runnable() {
@Override
public void run() {
StepMeta stepMeta = transMeta.findStep(stepname);
if (stepMeta != null) {
try {
RowMetaInterface row = transMeta.getPrevStepFields(stepMeta);
// Remember these fields...
for (int i = 0; i < row.size(); i++) {
inputFields.put(row.getValueMeta(i).getName(), Integer.valueOf(i));
}
setComboBoxes();
// Dislay in red missing field names
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
if (!wReturn.isDisposed()) {
for (int i = 0; i < wReturn.table.getItemCount(); i++) {
TableItem it = wReturn.table.getItem(i);
if (!Utils.isEmpty(it.getText(2))) {
if (!inputFields.containsKey(it.getText(2))) {
it.setBackground(GUIResource.getInstance().getColorRed());
}
}
}
}
}
});
} catch (KettleException e) {
logError(BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"));
}
}
}
};
new Thread(runnable).start();
fdGeneralComp = new FormData();
fdGeneralComp.left = new FormAttachment(0, 0);
fdGeneralComp.top = new FormAttachment(wStepname, margin);
fdGeneralComp.right = new FormAttachment(100, 0);
fdGeneralComp.bottom = new FormAttachment(100, 0);
wGeneralComp.setLayoutData(fdGeneralComp);
wGeneralComp.layout();
wGeneralTab.setControl(wGeneralComp);
// THE 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, null);
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(wOK, -margin);
wTabFolder.setLayoutData(fdTabFolder);
// Add listeners
lsOK = new Listener() {
@Override
public void handleEvent(Event e) {
ok();
}
};
lsTest = new Listener() {
@Override
public void handleEvent(Event e) {
test();
}
};
lsGetLU = new Listener() {
@Override
public void handleEvent(Event e) {
getUpdate();
}
};
lsCancel = new Listener() {
@Override
public void handleEvent(Event e) {
cancel();
}
};
wOK.addListener(SWT.Selection, lsOK);
wGetLU.addListener(SWT.Selection, lsGetLU);
wTest.addListener(SWT.Selection, lsTest);
wCancel.addListener(SWT.Selection, lsCancel);
lsDef = new SelectionAdapter() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
ok();
}
};
wStepname.addSelectionListener(lsDef);
// Detect X or ALT-F4 or something that kills this window...
shell.addShellListener(new ShellAdapter() {
@Override
public void shellClosed(ShellEvent e) {
cancel();
}
});
wTabFolder.setSelection(0);
// Set the shell size, based upon previous time...
setSize();
getData(input);
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 ElasticSearchBulkDialog method fillIndexGroup.
private void fillIndexGroup(Composite parentTab) {
wIndexGroup = new Group(parentTab, SWT.SHADOW_NONE);
props.setLook(wIndexGroup);
wIndexGroup.setText(BaseMessages.getString(PKG, "ElasticSearchBulkDialog.IndexGroup.Label"));
FormLayout indexGroupLayout = new FormLayout();
indexGroupLayout.marginWidth = 10;
indexGroupLayout.marginHeight = 10;
wIndexGroup.setLayout(indexGroupLayout);
// Index
wIndex = new LabelTextVar(transMeta, wIndexGroup, BaseMessages.getString(PKG, "ElasticSearchBulkDialog.Index" + ".Label"), BaseMessages.getString(PKG, "ElasticSearchBulkDialog.Index.Tooltip"));
wIndex.addModifyListener(lsMod);
// Type
wType = new LabelTextVar(transMeta, wIndexGroup, BaseMessages.getString(PKG, "ElasticSearchBulkDialog.Type" + ".Label"), BaseMessages.getString(PKG, "ElasticSearchBulkDialog.Type.Tooltip"));
wType.addModifyListener(lsMod);
// Test button
wTest = new Button(wIndexGroup, SWT.PUSH);
wTest.setText(BaseMessages.getString(PKG, "ElasticSearchBulkDialog.TestIndex.Label"));
wTest.setToolTipText(BaseMessages.getString(PKG, "ElasticSearchBulkDialog.TestIndex.Tooltip"));
wTest.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event arg0) {
test(TestType.INDEX);
}
});
Control[] connectionControls = new Control[] { wIndex, wType };
placeControls(wIndexGroup, connectionControls);
BaseStepDialog.positionBottomButtons(wIndexGroup, new Button[] { wTest }, Const.MARGIN, wType);
fdIndexGroup = new FormData();
fdIndexGroup.left = new FormAttachment(0, Const.MARGIN);
fdIndexGroup.top = new FormAttachment(wStepname, Const.MARGIN);
fdIndexGroup.right = new FormAttachment(100, -Const.MARGIN);
wIndexGroup.setLayoutData(fdIndexGroup);
}
use of org.pentaho.di.ui.core.widget.LabelTextVar in project pentaho-kettle by pentaho.
the class ElasticSearchBulkDialog method fillOptionsGroup.
private void fillOptionsGroup(Composite parentTab) {
int margin = Const.MARGIN;
wSettingsGroup = new Group(parentTab, SWT.SHADOW_NONE);
props.setLook(wSettingsGroup);
wSettingsGroup.setText(BaseMessages.getString(PKG, "ElasticSearchBulkDialog.SettingsGroup.Label"));
FormLayout settingGroupLayout = new FormLayout();
settingGroupLayout.marginWidth = 10;
settingGroupLayout.marginHeight = 10;
wSettingsGroup.setLayout(settingGroupLayout);
// Timeout
wTimeOut = new LabelTimeComposite(wSettingsGroup, BaseMessages.getString(PKG, "ElasticSearchBulkDialog.TimeOut" + ".Label"), BaseMessages.getString(PKG, "ElasticSearchBulkDialog.TimeOut.Tooltip"));
props.setLook(wTimeOut);
wTimeOut.addModifyListener(lsMod);
// BatchSize
wlBatchSize = new Label(wSettingsGroup, SWT.RIGHT);
wlBatchSize.setText(BaseMessages.getString(PKG, "ElasticSearchBulkDialog.BatchSize.Label"));
props.setLook(wlBatchSize);
wBatchSize = new TextVar(transMeta, wSettingsGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wBatchSize);
wBatchSize.addModifyListener(lsMod);
// Stop on error
wlStopOnError = new Label(wSettingsGroup, SWT.RIGHT);
wlStopOnError.setText(BaseMessages.getString(PKG, "ElasticSearchBulkDialog.StopOnError.Label"));
wStopOnError = new Button(wSettingsGroup, SWT.CHECK | SWT.RIGHT);
wStopOnError.setToolTipText(BaseMessages.getString(PKG, "ElasticSearchBulkDialog.StopOnError.Tooltip"));
wStopOnError.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent arg0) {
widgetSelected(arg0);
}
public void widgetSelected(SelectionEvent arg0) {
model.setChanged();
}
});
// ID input
wIdInField = new LabelComboVar(transMeta, wSettingsGroup, BaseMessages.getString(PKG, "ElasticSearchBulkDialog.IdField.Label"), BaseMessages.getString(PKG, "ElasticSearchBulkDialog.IdField.Tooltip"));
props.setLook(wIdInField);
wIdInField.getComboWidget().setEditable(true);
wIdInField.addModifyListener(lsMod);
wIdInField.addFocusListener(new FocusListener() {
public void focusLost(org.eclipse.swt.events.FocusEvent e) {
}
public void focusGained(org.eclipse.swt.events.FocusEvent e) {
getPreviousFields(wIdInField);
}
});
getPreviousFields(wIdInField);
wlIsOverwrite = new Label(wSettingsGroup, SWT.RIGHT);
wlIsOverwrite.setText(BaseMessages.getString(PKG, "ElasticSearchBulkDialog.Overwrite.Label"));
wIsOverwrite = new Button(wSettingsGroup, SWT.CHECK | SWT.RIGHT);
wIsOverwrite.setToolTipText(BaseMessages.getString(PKG, "ElasticSearchBulkDialog.Overwrite.Tooltip"));
wIsOverwrite.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent arg0) {
widgetSelected(arg0);
}
public void widgetSelected(SelectionEvent arg0) {
model.setChanged();
}
});
// Output rows
wlUseOutput = new Label(wSettingsGroup, SWT.RIGHT);
wlUseOutput.setText(BaseMessages.getString(PKG, "ElasticSearchBulkDialog.UseOutput.Label"));
wUseOutput = new Button(wSettingsGroup, SWT.CHECK | SWT.RIGHT);
wUseOutput.setToolTipText(BaseMessages.getString(PKG, "ElasticSearchBulkDialog.UseOutput.Tooltip"));
wUseOutput.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent arg0) {
widgetSelected(arg0);
}
public void widgetSelected(SelectionEvent arg0) {
wIdOutField.setEnabled(wUseOutput.getSelection());
model.setChanged();
}
});
// ID out field
wIdOutField = new LabelTextVar(transMeta, wSettingsGroup, BaseMessages.getString(PKG, "ElasticSearchBulkDialog.IdOutField.Label"), BaseMessages.getString(PKG, "ElasticSearchBulkDialog.IdOutField.Tooltip"));
props.setLook(wIdOutField);
wIdOutField.setEnabled(wUseOutput.getSelection());
wIdOutField.addModifyListener(lsMod);
// use json
wlIsJson = new Label(wSettingsGroup, SWT.RIGHT);
wlIsJson.setText(BaseMessages.getString(PKG, "ElasticSearchBulkDialog.IsJson.Label"));
wIsJson = new Button(wSettingsGroup, SWT.CHECK | SWT.RIGHT);
wIsJson.setToolTipText(BaseMessages.getString(PKG, "ElasticSearchBulkDialog.IsJson.Tooltip"));
wIsJson.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent arg0) {
widgetSelected(arg0);
}
public void widgetSelected(SelectionEvent arg0) {
wJsonField.setEnabled(wIsJson.getSelection());
wFields.setEnabled(!wIsJson.getSelection());
wFields.setVisible(!wIsJson.getSelection());
wGet.setEnabled(!wIsJson.getSelection());
model.setChanged();
}
});
// Json field
wJsonField = new LabelComboVar(transMeta, wSettingsGroup, BaseMessages.getString(PKG, "ElasticSearchBulkDialog.JsonField.Label"), BaseMessages.getString(PKG, "ElasticSearchBulkDialog.JsonField.Tooltip"));
wJsonField.getComboWidget().setEditable(true);
props.setLook(wJsonField);
wJsonField.addModifyListener(lsMod);
wJsonField.addFocusListener(new FocusListener() {
public void focusLost(org.eclipse.swt.events.FocusEvent e) {
}
public void focusGained(org.eclipse.swt.events.FocusEvent e) {
getPreviousFields(wJsonField);
}
});
getPreviousFields(wJsonField);
wJsonField.setEnabled(wIsJson.getSelection());
Control[] settingsControls = new Control[] { wlBatchSize, wBatchSize, wlStopOnError, wStopOnError, wTimeOut, wIdInField, wlIsOverwrite, wIsOverwrite, wlUseOutput, wUseOutput, wIdOutField, wlIsJson, wIsJson, wJsonField };
placeControls(wSettingsGroup, settingsControls);
fdSettingsGroup = new FormData();
fdSettingsGroup.left = new FormAttachment(0, margin);
fdSettingsGroup.top = new FormAttachment(wIndexGroup, margin);
fdSettingsGroup.right = new FormAttachment(100, -margin);
wSettingsGroup.setLayoutData(fdSettingsGroup);
}
use of org.pentaho.di.ui.core.widget.LabelTextVar in project pentaho-kettle by pentaho.
the class DelayDialog 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, "DelayDialog.Shell.Title"));
int middle = props.getMiddlePct();
int margin = Const.MARGIN;
// Stepname line
wlStepname = new Label(shell, SWT.RIGHT);
wlStepname.setText(BaseMessages.getString(PKG, "DelayDialog.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);
// Timeout line
wTimeout = new LabelTextVar(transMeta, shell, BaseMessages.getString(PKG, "DelayDialog.Timeout.Label"), BaseMessages.getString(PKG, "DelayDialog.Timeout.Tooltip"));
props.setLook(wTimeout);
wTimeout.addModifyListener(lsMod);
fdTimeout = new FormData();
fdTimeout.left = new FormAttachment(0, -margin);
fdTimeout.top = new FormAttachment(wStepname, margin);
fdTimeout.right = new FormAttachment(100, -margin);
wTimeout.setLayoutData(fdTimeout);
// Whenever something changes, set the tooltip to the expanded version:
wTimeout.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
wTimeout.setToolTipText(transMeta.environmentSubstitute(wTimeout.getText()));
}
});
wScaleTime = new CCombo(shell, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wScaleTime.add(BaseMessages.getString(PKG, "DelayDialog.MSScaleTime.Label"));
wScaleTime.add(BaseMessages.getString(PKG, "DelayDialog.SScaleTime.Label"));
wScaleTime.add(BaseMessages.getString(PKG, "DelayDialog.MnScaleTime.Label"));
wScaleTime.add(BaseMessages.getString(PKG, "DelayDialog.HrScaleTime.Label"));
// +1: starts at -1
wScaleTime.select(0);
props.setLook(wScaleTime);
fdScaleTime = new FormData();
fdScaleTime.left = new FormAttachment(middle, 0);
fdScaleTime.top = new FormAttachment(wTimeout, margin);
fdScaleTime.right = new FormAttachment(100, 0);
wScaleTime.setLayoutData(fdScaleTime);
wScaleTime.addModifyListener(lsMod);
// 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, wScaleTime);
// 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 JobEntrySSH2PUTDialog 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) {
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, "JobSSH2PUT.Title"));
int middle = props.getMiddlePct();
int margin = Const.MARGIN;
// Job entry name line
wName = new LabelText(shell, BaseMessages.getString(PKG, "JobSSH2PUT.Name.Label"), BaseMessages.getString(PKG, "JobSSH2PUT.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, "JobSSH2PUT.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 Host GROUP
// ////////////////////////
wHost = new Group(wGeneralComp, SWT.SHADOW_NONE);
props.setLook(wHost);
wHost.setText(BaseMessages.getString(PKG, "JobMail.Group.Host.Label"));
FormLayout HostLayout = new FormLayout();
HostLayout.marginWidth = 10;
HostLayout.marginHeight = 10;
wHost.setLayout(HostLayout);
// ServerName line
wServerName = new LabelTextVar(jobMeta, wHost, BaseMessages.getString(PKG, "JobSSH2PUT.Server.Label"), BaseMessages.getString(PKG, "JobSSH2PUT.Server.Tooltip"));
props.setLook(wServerName);
wServerName.addModifyListener(lsMod);
fdServerName = new FormData();
fdServerName.left = new FormAttachment(0, 0);
fdServerName.top = new FormAttachment(wName, margin);
fdServerName.right = new FormAttachment(100, 0);
wServerName.setLayoutData(fdServerName);
// ServerPort line
wlServerPort = new Label(wHost, SWT.RIGHT);
wlServerPort.setText(BaseMessages.getString(PKG, "JobSSH2PUT.Port.Label"));
props.setLook(wlServerPort);
fdlServerPort = new FormData();
fdlServerPort.left = new FormAttachment(0, 0);
fdlServerPort.top = new FormAttachment(wServerName, margin);
fdlServerPort.right = new FormAttachment(middle, -margin);
wlServerPort.setLayoutData(fdlServerPort);
wServerPort = new TextVar(jobMeta, wHost, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wServerPort);
wServerPort.setToolTipText(BaseMessages.getString(PKG, "JobSSH2PUT.Port.Tooltip"));
wServerPort.addModifyListener(lsMod);
fdServerPort = new FormData();
fdServerPort.left = new FormAttachment(middle, margin);
fdServerPort.top = new FormAttachment(wServerName, margin);
fdServerPort.right = new FormAttachment(100, 0);
wServerPort.setLayoutData(fdServerPort);
// cacheHostKey
wlcacheHostKey = new Label(wHost, SWT.RIGHT);
wlcacheHostKey.setText(BaseMessages.getString(PKG, "JobSSH2PUT.cacheHostKeyFiles.Label"));
props.setLook(wlcacheHostKey);
fdlcacheHostKey = new FormData();
fdlcacheHostKey.left = new FormAttachment(0, 0);
fdlcacheHostKey.top = new FormAttachment(wServerPort, margin);
fdlcacheHostKey.right = new FormAttachment(middle, 0);
wlcacheHostKey.setLayoutData(fdlcacheHostKey);
wcacheHostKey = new Button(wHost, SWT.CHECK);
wcacheHostKey.setToolTipText(BaseMessages.getString(PKG, "JobSSH2PUT.cacheHostKeyFiles.Tooltip"));
props.setLook(wcacheHostKey);
fdcacheHostKey = new FormData();
fdcacheHostKey.left = new FormAttachment(middle, margin);
fdcacheHostKey.top = new FormAttachment(wServerPort, margin);
fdcacheHostKey.right = new FormAttachment(100, 0);
wcacheHostKey.setLayoutData(fdcacheHostKey);
wcacheHostKey.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
jobEntry.setChanged();
}
});
// UserName line
wUserName = new LabelTextVar(jobMeta, wHost, BaseMessages.getString(PKG, "JobSSH2PUT.User.Label"), BaseMessages.getString(PKG, "JobSSH2PUT.User.Tooltip"));
props.setLook(wUserName);
wUserName.addModifyListener(lsMod);
fdUserName = new FormData();
fdUserName.left = new FormAttachment(0, 0);
fdUserName.top = new FormAttachment(wcacheHostKey, margin);
fdUserName.right = new FormAttachment(100, 0);
wUserName.setLayoutData(fdUserName);
// Password line
wPassword = new LabelTextVar(jobMeta, wHost, BaseMessages.getString(PKG, "JobSSH2PUT.Password.Label"), BaseMessages.getString(PKG, "JobSSH2PUT.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);
// Timeout line
wTimeout = new LabelTextVar(jobMeta, wHost, BaseMessages.getString(PKG, "JobSSH2PUT.Timeout.Label"), BaseMessages.getString(PKG, "JobSSH2PUT.Timeout.Tooltip"));
props.setLook(wTimeout);
wTimeout.addModifyListener(lsMod);
fdTimeout = new FormData();
fdTimeout.left = new FormAttachment(0, 0);
fdTimeout.top = new FormAttachment(wPassword, margin);
fdTimeout.right = new FormAttachment(100, 0);
wTimeout.setLayoutData(fdTimeout);
// Test connection button
wTest = new Button(wHost, SWT.PUSH);
wTest.setText(BaseMessages.getString(PKG, "JobSSH2PUT.TestConnection.Label"));
props.setLook(wTest);
fdTest = new FormData();
wTest.setToolTipText(BaseMessages.getString(PKG, "JobSSH2PUT.TestConnection.Tooltip"));
// fdTest.left = new FormAttachment(middle, 0);
fdTest.top = new FormAttachment(wTimeout, margin);
fdTest.right = new FormAttachment(100, 0);
wTest.setLayoutData(fdTest);
fdHost = new FormData();
fdHost.left = new FormAttachment(0, margin);
fdHost.top = new FormAttachment(wName, margin);
fdHost.right = new FormAttachment(100, -margin);
wHost.setLayoutData(fdHost);
// ///////////////////////////////////////////////////////////
// / END OF Host GROUP
// /////////////////////////////////////////////////////////
// ////////////////////////
// START OF HTTPProxy GROUP
// ////////////////////////
wHTTPProxyGroup = new Group(wGeneralComp, SWT.SHADOW_NONE);
props.setLook(wHTTPProxyGroup);
wHTTPProxyGroup.setText(BaseMessages.getString(PKG, "JobSSH2PUT.Group.HTTPProxyGroup.Label"));
FormLayout HTTPProxyGroupLayout = new FormLayout();
HTTPProxyGroupLayout.marginWidth = 10;
HTTPProxyGroupLayout.marginHeight = 10;
wHTTPProxyGroup.setLayout(HTTPProxyGroupLayout);
// useHTTPProxy
wluseHTTPProxy = new Label(wHTTPProxyGroup, SWT.RIGHT);
wluseHTTPProxy.setText(BaseMessages.getString(PKG, "JobSSH2PUT.useHTTPProxyFiles.Label"));
props.setLook(wluseHTTPProxy);
fdluseHTTPProxy = new FormData();
fdluseHTTPProxy.left = new FormAttachment(0, 0);
fdluseHTTPProxy.top = new FormAttachment(wHost, margin);
fdluseHTTPProxy.right = new FormAttachment(middle, 0);
wluseHTTPProxy.setLayoutData(fdluseHTTPProxy);
wuseHTTPProxy = new Button(wHTTPProxyGroup, SWT.CHECK);
wuseHTTPProxy.setToolTipText(BaseMessages.getString(PKG, "JobSSH2PUT.useHTTPProxyFiles.Tooltip"));
props.setLook(wuseHTTPProxy);
fduseHTTPProxy = new FormData();
fduseHTTPProxy.left = new FormAttachment(middle, margin);
fduseHTTPProxy.top = new FormAttachment(wHost, margin);
fduseHTTPProxy.right = new FormAttachment(100, 0);
wuseHTTPProxy.setLayoutData(fduseHTTPProxy);
wuseHTTPProxy.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
activeUseHttpProxy();
jobEntry.setChanged();
}
});
// ProxyHost line
wHTTPProxyHost = new LabelTextVar(jobMeta, wHTTPProxyGroup, BaseMessages.getString(PKG, "JobSSH2PUT.ProxyHost.Label"), BaseMessages.getString(PKG, "JobSSH2PUT.Server.Tooltip"));
props.setLook(wHTTPProxyHost);
wHTTPProxyHost.addModifyListener(lsMod);
fdHTTPProxyHost = new FormData();
fdHTTPProxyHost.left = new FormAttachment(0, 0);
fdHTTPProxyHost.top = new FormAttachment(wuseHTTPProxy, margin);
fdHTTPProxyHost.right = new FormAttachment(100, 0);
wHTTPProxyHost.setLayoutData(fdHTTPProxyHost);
// ProxyPort line
wlHTTPProxyPort = new Label(wHTTPProxyGroup, SWT.RIGHT);
wlHTTPProxyPort.setText(BaseMessages.getString(PKG, "JobSSH2PUT.ProxyPort.Label"));
props.setLook(wlHTTPProxyPort);
fdlProxyPort = new FormData();
fdlProxyPort.left = new FormAttachment(0, 0);
fdlProxyPort.top = new FormAttachment(wHTTPProxyHost, margin);
fdlProxyPort.right = new FormAttachment(middle, -margin);
wlHTTPProxyPort.setLayoutData(fdlProxyPort);
wHTTPProxyPort = new TextVar(jobMeta, wHTTPProxyGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wHTTPProxyPort);
wHTTPProxyPort.setToolTipText(BaseMessages.getString(PKG, "JobSSH2PUT.ProxyPort.Tooltip"));
wHTTPProxyPort.addModifyListener(lsMod);
fdProxyPort = new FormData();
fdProxyPort.left = new FormAttachment(middle, margin);
fdProxyPort.top = new FormAttachment(wHTTPProxyHost, margin);
fdProxyPort.right = new FormAttachment(100, 0);
wHTTPProxyPort.setLayoutData(fdProxyPort);
// useBasicAutentication
wluseBasicAuthentication = new Label(wHTTPProxyGroup, SWT.RIGHT);
wluseBasicAuthentication.setText(BaseMessages.getString(PKG, "JobSSH2PUT.useBasicAuthentication.Label"));
props.setLook(wluseBasicAuthentication);
fdluseBasicAuthentication = new FormData();
fdluseBasicAuthentication.left = new FormAttachment(0, 0);
fdluseBasicAuthentication.top = new FormAttachment(wHTTPProxyPort, margin);
fdluseBasicAuthentication.right = new FormAttachment(middle, 0);
wluseBasicAuthentication.setLayoutData(fdluseBasicAuthentication);
wuseBasicAuthentication = new Button(wHTTPProxyGroup, SWT.CHECK);
wuseBasicAuthentication.setToolTipText(BaseMessages.getString(PKG, "JobSSH2PUT.useBasicAuthentication.Tooltip"));
props.setLook(wuseBasicAuthentication);
fduseBasicAuthentication = new FormData();
fduseBasicAuthentication.left = new FormAttachment(middle, margin);
fduseBasicAuthentication.top = new FormAttachment(wHTTPProxyPort, margin);
fduseBasicAuthentication.right = new FormAttachment(100, 0);
wuseBasicAuthentication.setLayoutData(fduseBasicAuthentication);
wuseBasicAuthentication.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
activeuseBasicAutentication();
jobEntry.setChanged();
}
});
// ProxyUsername line
wHTTPProxyUsername = new LabelTextVar(jobMeta, wHTTPProxyGroup, BaseMessages.getString(PKG, "JobSSH2PUT.HttpProxyUsername.Label"), BaseMessages.getString(PKG, "JobSSH2PUT.HttpProxyUsername.Tooltip"));
props.setLook(wHTTPProxyUsername);
wHTTPProxyUsername.addModifyListener(lsMod);
fdHTTPProxyUsername = new FormData();
fdHTTPProxyUsername.left = new FormAttachment(0, 0);
fdHTTPProxyUsername.top = new FormAttachment(wuseBasicAuthentication, margin);
fdHTTPProxyUsername.right = new FormAttachment(100, 0);
wHTTPProxyUsername.setLayoutData(fdHTTPProxyUsername);
// HttpProxyPassword line
wHTTPProxyPassword = new LabelTextVar(jobMeta, wHTTPProxyGroup, BaseMessages.getString(PKG, "JobSSH2PUT.HttpProxyPassword.Label"), BaseMessages.getString(PKG, "JobSSH2PUT.HttpProxyPassword.Tooltip"), true);
props.setLook(wHTTPProxyPassword);
wHTTPProxyPassword.addModifyListener(lsMod);
fdHTTPProxyPassword = new FormData();
fdHTTPProxyPassword.left = new FormAttachment(0, 0);
fdHTTPProxyPassword.top = new FormAttachment(wHTTPProxyUsername, margin);
fdHTTPProxyPassword.right = new FormAttachment(100, 0);
wHTTPProxyPassword.setLayoutData(fdHTTPProxyPassword);
fdHTTPProxyGroup = new FormData();
fdHTTPProxyGroup.left = new FormAttachment(0, margin);
fdHTTPProxyGroup.top = new FormAttachment(wHost, margin);
fdHTTPProxyGroup.right = new FormAttachment(100, -margin);
wHTTPProxyGroup.setLayoutData(fdHTTPProxyGroup);
// ///////////////////////////////////////////////////////////
// / END OF HTTPProxy GROUP
// /////////////////////////////////////////////////////////
// ////////////////////////
// START OF PublicKey GROUP
// ////////////////////////
wPublicKey = new Group(wGeneralComp, SWT.SHADOW_NONE);
props.setLook(wPublicKey);
wPublicKey.setText(BaseMessages.getString(PKG, "JobSSH2PUT.Group.PublicKey.Label"));
FormLayout PublicKeyLayout = new FormLayout();
PublicKeyLayout.marginWidth = 10;
PublicKeyLayout.marginHeight = 10;
wPublicKey.setLayout(PublicKeyLayout);
// usePublicKey
wlusePublicKey = new Label(wPublicKey, SWT.RIGHT);
wlusePublicKey.setText(BaseMessages.getString(PKG, "JobSSH2PUT.usePublicKeyFiles.Label"));
props.setLook(wlusePublicKey);
fdlusePublicKey = new FormData();
fdlusePublicKey.left = new FormAttachment(0, 0);
fdlusePublicKey.top = new FormAttachment(wHTTPProxyGroup, margin);
fdlusePublicKey.right = new FormAttachment(middle, 0);
wlusePublicKey.setLayoutData(fdlusePublicKey);
wusePublicKey = new Button(wPublicKey, SWT.CHECK);
wusePublicKey.setToolTipText(BaseMessages.getString(PKG, "JobSSH2PUT.usePublicKeyFiles.Tooltip"));
props.setLook(wusePublicKey);
fdusePublicKey = new FormData();
fdusePublicKey.left = new FormAttachment(middle, margin);
fdusePublicKey.top = new FormAttachment(wHTTPProxyGroup, 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(wPublicKey, SWT.RIGHT);
wlKeyFilename.setText(BaseMessages.getString(PKG, "JobSSH2PUT.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(wPublicKey, 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, wPublicKey, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wKeyFilename.setToolTipText(BaseMessages.getString(PKG, "JobSSH2PUT.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, wPublicKey, BaseMessages.getString(PKG, "JobSSH2PUT.keyfilePass.Label"), BaseMessages.getString(PKG, "JobSSH2PUT.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);
fdPublicKey = new FormData();
fdPublicKey.left = new FormAttachment(0, margin);
fdPublicKey.top = new FormAttachment(wHTTPProxyGroup, margin);
fdPublicKey.right = new FormAttachment(100, -margin);
wPublicKey.setLayoutData(fdPublicKey);
// ///////////////////////////////////////////////////////////
// / END OF PublicKey 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(500, -margin);
wGeneralComp.setLayoutData(fdGeneralComp);
wGeneralComp.layout();
wGeneralTab.setControl(wGeneralComp);
props.setLook(wGeneralComp);
// ///////////////////////////////////////////////////////////
// / END OF GENERAL TAB
// ///////////////////////////////////////////////////////////
// ////////////////////////
// START OF FILES TAB ///
// ////////////////////////
wFilesTab = new CTabItem(wTabFolder, SWT.NONE);
wFilesTab.setText(BaseMessages.getString(PKG, "JobSSH2PUT.Tab.Files.Label"));
wFilesComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wFilesComp);
FormLayout FilesTabLayout = new FormLayout();
FilesTabLayout.marginWidth = 3;
FilesTabLayout.marginHeight = 3;
wFilesComp.setLayout(FilesTabLayout);
// ////////////////////////
// START OF Files GROUP
// ////////////////////////
wFiles = new Group(wFilesComp, SWT.SHADOW_NONE);
props.setLook(wFiles);
wFiles.setText(BaseMessages.getString(PKG, "JobSSH2PUT.Group.Files.Label"));
FormLayout FilesLayout = new FormLayout();
FilesLayout.marginWidth = 10;
FilesLayout.marginHeight = 10;
wFiles.setLayout(FilesLayout);
wlLocalDirectory = new Label(wFiles, SWT.RIGHT);
wlLocalDirectory.setText(BaseMessages.getString(PKG, "JobSSH2PUT.LocalDir.Label"));
props.setLook(wlLocalDirectory);
fdlLocalDirectory = new FormData();
fdlLocalDirectory.left = new FormAttachment(0, 0);
fdlLocalDirectory.top = new FormAttachment(wFilesComp, 2 * margin);
fdlLocalDirectory.right = new FormAttachment(middle, -margin);
wlLocalDirectory.setLayoutData(fdlLocalDirectory);
// Browse Local folders button ...
wbLocalDirectory = new Button(wFiles, SWT.PUSH | SWT.CENTER);
props.setLook(wbLocalDirectory);
wbLocalDirectory.setText(BaseMessages.getString(PKG, "JobSSH2PUT.BrowseFolders.Label"));
fdbLocalDirectory = new FormData();
fdbLocalDirectory.right = new FormAttachment(100, -margin);
fdbLocalDirectory.top = new FormAttachment(0, margin);
wbLocalDirectory.setLayoutData(fdbLocalDirectory);
// LocalDirectory line
wLocalDirectory = new TextVar(jobMeta, wFiles, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wLocalDirectory);
wLocalDirectory.addModifyListener(lsMod);
fdLocalDirectory = new FormData();
fdLocalDirectory.left = new FormAttachment(middle, margin);
fdLocalDirectory.top = new FormAttachment(wFilesComp, 2 * margin);
fdLocalDirectory.right = new FormAttachment(wbLocalDirectory, 0);
wLocalDirectory.setLayoutData(fdLocalDirectory);
// Whenever something changes, set the tooltip to the expanded version:
wLocalDirectory.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
wLocalDirectory.setToolTipText(jobMeta.environmentSubstitute(wLocalDirectory.getText()));
}
});
wbLocalDirectory.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
DirectoryDialog ddialog = new DirectoryDialog(shell, SWT.OPEN);
if (wLocalDirectory.getText() != null) {
ddialog.setFilterPath(jobMeta.environmentSubstitute(wLocalDirectory.getText()));
}
// Calling open() will open and run the dialog.
// It will return the selected directory, or
// null if user cancels
String dir = ddialog.open();
if (dir != null) {
// Set the text box to the new selection
wLocalDirectory.setText(dir);
}
}
});
// Wildcard line
wWildcard = new LabelTextVar(jobMeta, wFiles, BaseMessages.getString(PKG, "JobSSH2PUT.Wildcard.Label"), BaseMessages.getString(PKG, "JobSSH2PUT.Wildcard.Tooltip"));
props.setLook(wWildcard);
wWildcard.addModifyListener(lsMod);
fdWildcard = new FormData();
fdWildcard.left = new FormAttachment(0, 0);
fdWildcard.top = new FormAttachment(wLocalDirectory, margin);
fdWildcard.right = new FormAttachment(100, 0);
wWildcard.setLayoutData(fdWildcard);
// FTP directory
wlFtpDirectory = new Label(wFiles, SWT.RIGHT);
wlFtpDirectory.setText(BaseMessages.getString(PKG, "JobSSH2PUT.RemoteDir.Label"));
props.setLook(wlFtpDirectory);
fdlFtpDirectory = new FormData();
fdlFtpDirectory.left = new FormAttachment(0, 0);
fdlFtpDirectory.top = new FormAttachment(wWildcard, 2 * margin);
fdlFtpDirectory.right = new FormAttachment(middle, 0);
wlFtpDirectory.setLayoutData(fdlFtpDirectory);
// Test remote folder button ...
wbTestChangeFolderExists = new Button(wFiles, SWT.PUSH | SWT.CENTER);
props.setLook(wbTestChangeFolderExists);
wbTestChangeFolderExists.setText(BaseMessages.getString(PKG, "JobSSH2PUT.TestFolderExists.Label"));
fdbTestChangeFolderExists = new FormData();
fdbTestChangeFolderExists.right = new FormAttachment(100, 0);
fdbTestChangeFolderExists.top = new FormAttachment(wWildcard, 2 * margin);
wbTestChangeFolderExists.setLayoutData(fdbTestChangeFolderExists);
// FtpDirectory line
wFtpDirectory = new TextVar(jobMeta, wFiles, SWT.SINGLE | SWT.LEFT | SWT.BORDER, BaseMessages.getString(PKG, "JobSSH2PUT.RemoteDir.Label"));
props.setLook(wFtpDirectory);
wFtpDirectory.setToolTipText(BaseMessages.getString(PKG, "JobSSH2PUT.RemoteDir.Tooltip"));
wFtpDirectory.addModifyListener(lsMod);
fdFtpDirectory = new FormData();
fdFtpDirectory.left = new FormAttachment(middle, margin);
fdFtpDirectory.top = new FormAttachment(wWildcard, 2 * margin);
fdFtpDirectory.right = new FormAttachment(wbTestChangeFolderExists, -margin);
wFtpDirectory.setLayoutData(fdFtpDirectory);
// Whenever something changes, set the tooltip to the expanded version:
wFtpDirectory.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
wFtpDirectory.setToolTipText(jobMeta.environmentSubstitute(wFtpDirectory.getText()));
}
});
// Create remote folder if necessary ...
wlCreateFolder = new Label(wFiles, SWT.RIGHT);
wlCreateFolder.setText(BaseMessages.getString(PKG, "JobSSH2PUT.CreateFolder.Label"));
props.setLook(wlCreateFolder);
fdlCreateFolder = new FormData();
fdlCreateFolder.left = new FormAttachment(0, 0);
fdlCreateFolder.top = new FormAttachment(wFtpDirectory, margin);
fdlCreateFolder.right = new FormAttachment(middle, 0);
wlCreateFolder.setLayoutData(fdlCreateFolder);
wCreateFolder = new Button(wFiles, SWT.CHECK);
wCreateFolder.setToolTipText(BaseMessages.getString(PKG, "JobSSH2PUT.CreateFolder.Tooltip"));
props.setLook(wCreateFolder);
fdCreateFolder = new FormData();
fdCreateFolder.left = new FormAttachment(middle, margin);
fdCreateFolder.top = new FormAttachment(wFtpDirectory, margin);
fdCreateFolder.right = new FormAttachment(100, 0);
wCreateFolder.setLayoutData(fdCreateFolder);
// OnlyNew files after retrieval...
wlOnlyNew = new Label(wFiles, SWT.RIGHT);
wlOnlyNew.setText(BaseMessages.getString(PKG, "JobSSH2PUT.DontOverwrite.Label"));
props.setLook(wlOnlyNew);
fdlOnlyNew = new FormData();
fdlOnlyNew.left = new FormAttachment(0, 0);
fdlOnlyNew.top = new FormAttachment(wCreateFolder, margin);
fdlOnlyNew.right = new FormAttachment(middle, 0);
wlOnlyNew.setLayoutData(fdlOnlyNew);
wOnlyNew = new Button(wFiles, SWT.CHECK);
wOnlyNew.setToolTipText(BaseMessages.getString(PKG, "JobSSH2PUT.DontOverwrite.Tooltip"));
props.setLook(wOnlyNew);
fdOnlyNew = new FormData();
fdOnlyNew.left = new FormAttachment(middle, margin);
fdOnlyNew.top = new FormAttachment(wCreateFolder, margin);
fdOnlyNew.right = new FormAttachment(100, 0);
wOnlyNew.setLayoutData(fdOnlyNew);
// After FTP Put
wlAfterFTPPut = new Label(wFiles, SWT.RIGHT);
wlAfterFTPPut.setText(BaseMessages.getString(PKG, "JobSSH2PUT.AfterFTPPut.Label"));
props.setLook(wlAfterFTPPut);
fdlAfterFTPPut = new FormData();
fdlAfterFTPPut.left = new FormAttachment(0, 0);
fdlAfterFTPPut.right = new FormAttachment(middle, 0);
fdlAfterFTPPut.top = new FormAttachment(wOnlyNew, 2 * margin);
wlAfterFTPPut.setLayoutData(fdlAfterFTPPut);
wAfterFTPPut = new CCombo(wFiles, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wAfterFTPPut.add(BaseMessages.getString(PKG, "JobSSH2PUT.Do_Nothing_AfterFTPPut.Label"));
wAfterFTPPut.add(BaseMessages.getString(PKG, "JobSSH2PUT.Delete_Files_AfterFTPPut.Label"));
wAfterFTPPut.add(BaseMessages.getString(PKG, "JobSSH2PUT.Move_Files_AfterFTPPut.Label"));
// +1: starts at -1
wAfterFTPPut.select(0);
props.setLook(wAfterFTPPut);
fdAfterFTPPut = new FormData();
fdAfterFTPPut.left = new FormAttachment(middle, 0);
fdAfterFTPPut.top = new FormAttachment(wOnlyNew, 2 * margin);
fdAfterFTPPut.right = new FormAttachment(100, 0);
wAfterFTPPut.setLayoutData(fdAfterFTPPut);
fdAfterFTPPut = new FormData();
fdAfterFTPPut.left = new FormAttachment(middle, margin);
fdAfterFTPPut.top = new FormAttachment(wOnlyNew, 2 * margin);
fdAfterFTPPut.right = new FormAttachment(100, 0);
wAfterFTPPut.setLayoutData(fdAfterFTPPut);
wAfterFTPPut.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
AfterFTPPutActivate();
}
});
// moveTo Directory
wlDestinationFolder = new Label(wFiles, SWT.RIGHT);
wlDestinationFolder.setText(BaseMessages.getString(PKG, "JobSSH2PUT.DestinationFolder.Label"));
props.setLook(wlDestinationFolder);
fdlDestinationFolder = new FormData();
fdlDestinationFolder.left = new FormAttachment(0, 0);
fdlDestinationFolder.top = new FormAttachment(wAfterFTPPut, margin);
fdlDestinationFolder.right = new FormAttachment(middle, -margin);
wlDestinationFolder.setLayoutData(fdlDestinationFolder);
// Browse folders button ...
wbMovetoDirectory = new Button(wFiles, SWT.PUSH | SWT.CENTER);
props.setLook(wbMovetoDirectory);
wbMovetoDirectory.setText(BaseMessages.getString(PKG, "JobSSH2PUT.BrowseFolders.Label"));
fdbMovetoDirectory = new FormData();
fdbMovetoDirectory.right = new FormAttachment(100, 0);
fdbMovetoDirectory.top = new FormAttachment(wAfterFTPPut, margin);
wbMovetoDirectory.setLayoutData(fdbMovetoDirectory);
wbMovetoDirectory.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
DirectoryDialog ddialog = new DirectoryDialog(shell, SWT.OPEN);
if (wDestinationFolder.getText() != null) {
ddialog.setFilterPath(jobMeta.environmentSubstitute(wDestinationFolder.getText()));
}
// Calling open() will open and run the dialog.
// It will return the selected directory, or
// null if user cancels
String dir = ddialog.open();
if (dir != null) {
// Set the text box to the new selection
wDestinationFolder.setText(dir);
}
}
});
wDestinationFolder = new TextVar(jobMeta, wFiles, SWT.SINGLE | SWT.LEFT | SWT.BORDER, BaseMessages.getString(PKG, "JobSSH2PUT.DestinationFolder.Tooltip"));
props.setLook(wDestinationFolder);
wDestinationFolder.addModifyListener(lsMod);
fdDestinationFolder = new FormData();
fdDestinationFolder.left = new FormAttachment(middle, margin);
fdDestinationFolder.top = new FormAttachment(wAfterFTPPut, margin);
fdDestinationFolder.right = new FormAttachment(wbMovetoDirectory, -margin);
wDestinationFolder.setLayoutData(fdDestinationFolder);
// Whenever something changes, set the tooltip to the expanded version:
wDestinationFolder.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
wDestinationFolder.setToolTipText(jobMeta.environmentSubstitute(wDestinationFolder.getText()));
}
});
// Create destination folder if necessary ...
wlCreateDestinationFolder = new Label(wFiles, SWT.RIGHT);
wlCreateDestinationFolder.setText(BaseMessages.getString(PKG, "JobSSH2PUT.CreateDestinationFolder.Label"));
props.setLook(wlCreateDestinationFolder);
fdlCreateDestinationFolder = new FormData();
fdlCreateDestinationFolder.left = new FormAttachment(0, 0);
fdlCreateDestinationFolder.top = new FormAttachment(wDestinationFolder, margin);
fdlCreateDestinationFolder.right = new FormAttachment(middle, 0);
wlCreateDestinationFolder.setLayoutData(fdlCreateDestinationFolder);
wCreateDestinationFolder = new Button(wFiles, SWT.CHECK);
wCreateDestinationFolder.setToolTipText(BaseMessages.getString(PKG, "JobSSH2PUT.CreateDestinationFolder.Tooltip"));
props.setLook(wCreateDestinationFolder);
fdCreateDestinationFolder = new FormData();
fdCreateDestinationFolder.left = new FormAttachment(middle, margin);
fdCreateDestinationFolder.top = new FormAttachment(wDestinationFolder, margin);
fdCreateDestinationFolder.right = new FormAttachment(100, 0);
wCreateDestinationFolder.setLayoutData(fdCreateDestinationFolder);
fdFiles = new FormData();
fdFiles.left = new FormAttachment(0, margin);
fdFiles.top = new FormAttachment(0, margin);
fdFiles.right = new FormAttachment(100, -margin);
wFiles.setLayoutData(fdFiles);
// ///////////////////////////////////////////////////////////
// / END OF Files 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(500, -margin);
wFilesComp.setLayoutData(fdFilesComp);
// ///////////////////////////////////////////////////////////
// / END OF GENERAL TAB
// ///////////////////////////////////////////////////////////
wFilesComp.layout();
wFilesTab.setControl(wFilesComp);
props.setLook(wFilesComp);
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);
wLocalDirectory.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();
activeUseHttpProxy();
AfterFTPPutActivate();
activeUsePublicKey();
BaseStepDialog.setSize(shell);
shell.open();
props.setDialogSize(shell, "JobFTPDialogSize");
wTabFolder.setSelection(0);
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
return jobEntry;
}
Aggregations