use of org.pentaho.di.core.exception.KettleStepException in project pentaho-kettle by pentaho.
the class SasInputDialog method ok.
private void ok() {
if (Utils.isEmpty(wStepname.getText())) {
return;
}
try {
// return value
stepname = wStepname.getText();
getInfo(input);
} catch (KettleStepException e) {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
mb.setMessage(e.toString());
mb.setText(BaseMessages.getString(PKG, "System.Warning"));
mb.open();
}
dispose();
}
use of org.pentaho.di.core.exception.KettleStepException in project pentaho-kettle by pentaho.
the class ExecProcessDialog 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();
}
};
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, "ExecProcessDialog.Shell.Title"));
int middle = props.getMiddlePct();
int margin = Const.MARGIN;
// Stepname line
wlStepname = new Label(shell, SWT.RIGHT);
wlStepname.setText(BaseMessages.getString(PKG, "ExecProcessDialog.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);
// The Tab Folders
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, "ExecProcessDialog.GeneralTab.TabItem"));
wGeneralComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wGeneralComp);
FormLayout generalLayout = new FormLayout();
generalLayout.marginWidth = margin;
generalLayout.marginHeight = margin;
wGeneralComp.setLayout(generalLayout);
// filename field
wlProcess = new Label(wGeneralComp, SWT.RIGHT);
wlProcess.setText(BaseMessages.getString(PKG, "ExecProcessDialog.Process.Label"));
props.setLook(wlProcess);
fdlProcess = new FormData();
fdlProcess.left = new FormAttachment(0, 0);
fdlProcess.right = new FormAttachment(middle, -margin);
fdlProcess.top = new FormAttachment(wStepname, margin);
wlProcess.setLayoutData(fdlProcess);
wProcess = new CCombo(wGeneralComp, SWT.BORDER | SWT.READ_ONLY);
wProcess.setEditable(true);
props.setLook(wProcess);
wProcess.addModifyListener(lsMod);
fdProcess = new FormData();
fdProcess.left = new FormAttachment(middle, 0);
fdProcess.top = new FormAttachment(wStepname, margin);
fdProcess.right = new FormAttachment(100, -margin);
wProcess.setLayoutData(fdProcess);
wProcess.addFocusListener(new FocusListener() {
@Override
public void focusLost(org.eclipse.swt.events.FocusEvent e) {
}
@Override
public void focusGained(org.eclipse.swt.events.FocusEvent e) {
Cursor busy = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
shell.setCursor(busy);
get();
shell.setCursor(null);
busy.dispose();
}
});
// Command Arguments are in separate fields
wlArgumentsInFields = new Label(wGeneralComp, SWT.RIGHT);
wlArgumentsInFields.setText(BaseMessages.getString(PKG, "ExecProcessDialog.ArgumentInFields.Label"));
props.setLook(wlArgumentsInFields);
fdlArgumentsInFields = new FormData();
fdlArgumentsInFields.left = new FormAttachment(0, 0);
fdlArgumentsInFields.top = new FormAttachment(wProcess, margin);
fdlArgumentsInFields.right = new FormAttachment(middle, -margin);
wlArgumentsInFields.setLayoutData(fdlArgumentsInFields);
wArgumentsInFields = new Button(wGeneralComp, SWT.CHECK);
wArgumentsInFields.setToolTipText(BaseMessages.getString(PKG, "ExecProcessDialog.ArgumentInFields.Tooltip"));
props.setLook(wArgumentsInFields);
fdArgumentsInFields = new FormData();
fdArgumentsInFields.left = new FormAttachment(middle, 0);
fdArgumentsInFields.top = new FormAttachment(wProcess, margin);
fdArgumentsInFields.right = new FormAttachment(100, 0);
wArgumentsInFields.setLayoutData(fdArgumentsInFields);
wArgumentsInFields.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
enableFields();
input.setChanged();
}
});
// Fail when status is different than 0
wlFailWhenNotSuccess = new Label(wGeneralComp, SWT.RIGHT);
wlFailWhenNotSuccess.setText(BaseMessages.getString(PKG, "ExecProcessDialog.FailWhenNotSuccess.Label"));
props.setLook(wlFailWhenNotSuccess);
fdlFailWhenNotSuccess = new FormData();
fdlFailWhenNotSuccess.left = new FormAttachment(0, 0);
fdlFailWhenNotSuccess.top = new FormAttachment(wArgumentsInFields, margin);
fdlFailWhenNotSuccess.right = new FormAttachment(middle, -margin);
wlFailWhenNotSuccess.setLayoutData(fdlFailWhenNotSuccess);
wFailWhenNotSuccess = new Button(wGeneralComp, SWT.CHECK);
wFailWhenNotSuccess.setToolTipText(BaseMessages.getString(PKG, "ExecProcessDialog.FailWhenNotSuccess.Tooltip"));
props.setLook(wFailWhenNotSuccess);
fdFailWhenNotSuccess = new FormData();
fdFailWhenNotSuccess.left = new FormAttachment(middle, 0);
fdFailWhenNotSuccess.top = new FormAttachment(wArgumentsInFields, margin);
fdFailWhenNotSuccess.right = new FormAttachment(100, 0);
wFailWhenNotSuccess.setLayoutData(fdFailWhenNotSuccess);
wFailWhenNotSuccess.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
input.setChanged();
}
});
// List of Argument Fields when ArgumentsInFields is enabled
wlArgumentFields = new Label(wGeneralComp, SWT.LEFT);
wlArgumentFields.setText(BaseMessages.getString(PKG, "ExecProcessDialog.ArgumentFields.Label"));
props.setLook(wlArgumentFields);
fdlArgumentFields = new FormData();
fdlArgumentFields.left = new FormAttachment(0, 0);
fdlArgumentFields.top = new FormAttachment(wFailWhenNotSuccess, margin);
fdlArgumentFields.right = new FormAttachment(middle, -margin);
wlArgumentFields.setLayoutData(fdlArgumentFields);
ColumnInfo[] colinf = new ColumnInfo[1];
colinf[0] = new ColumnInfo(BaseMessages.getString(PKG, "ExecProcessDialog.ArgumentField.Label"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false);
colinf[0].setToolTip(BaseMessages.getString(PKG, "ExecProcessDialog.ArgumentField.Tooltip"));
wArgumentFields = new TableView(null, wGeneralComp, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI, colinf, 1, lsMod, props);
fdArgumentFields = new FormData();
fdArgumentFields.left = new FormAttachment(0, 0);
fdArgumentFields.top = new FormAttachment(wlArgumentFields, margin);
fdArgumentFields.right = new FormAttachment(100, 0);
fdArgumentFields.bottom = new FormAttachment(100, -margin);
wArgumentFields.setLayoutData(fdArgumentFields);
FormData 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);
// /////////////////////
// END OF GENERAL TAB //
// /////////////////////
// //////////////////////
// START OF OUTPUT TAB //
// //////////////////////
wOutputTab = new CTabItem(wTabFolder, SWT.NONE);
wOutputTab.setText(BaseMessages.getString(PKG, "ExecProcessDialog.Output.TabItem"));
wOutputComp = new Composite(wTabFolder, SWT.NONE);
props.setLook(wOutputComp);
FormLayout fdOutputCompLayout = new FormLayout();
fdOutputCompLayout.marginWidth = margin;
fdOutputCompLayout.marginHeight = margin;
wOutputComp.setLayout(fdOutputCompLayout);
// Output Line Delimiter
wOutputDelim = new LabelTextVar(transMeta, wOutputComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER, BaseMessages.getString(PKG, "ExecProcessDialog.OutputDelimiterField.Label"), BaseMessages.getString(PKG, "ExecProcessDialog.OutputDelimiterField.Tooltip"));
wOutputDelim.addModifyListener(lsMod);
fdOutputDelim = new FormData();
fdOutputDelim.left = new FormAttachment(0, 0);
fdOutputDelim.top = new FormAttachment(0, margin);
fdOutputDelim.right = new FormAttachment(100, 0);
wOutputDelim.setLayoutData(fdOutputDelim);
// Result fieldname ...
wResult = new LabelTextVar(transMeta, wOutputComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER, BaseMessages.getString(PKG, "ExecProcessDialog.ResultField.Label"), BaseMessages.getString(PKG, "ExecProcessDialog.ResultField.Tooltip"));
wResult.addModifyListener(lsMod);
fdResult = new FormData();
fdResult.left = new FormAttachment(0, 0);
fdResult.top = new FormAttachment(wOutputDelim, margin);
fdResult.right = new FormAttachment(100, 0);
wResult.setLayoutData(fdResult);
// Error fieldname ...
wError = new LabelTextVar(transMeta, wOutputComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER, BaseMessages.getString(PKG, "ExecProcessDialog.ErrorField.Label"), BaseMessages.getString(PKG, "ExecProcessDialog.ErrorField.Tooltip"));
wError.addModifyListener(lsMod);
fdError = new FormData();
fdError.left = new FormAttachment(0, 0);
fdError.top = new FormAttachment(wResult, margin);
fdError.right = new FormAttachment(100, 0);
wError.setLayoutData(fdError);
// ExitValue fieldname ...
wExitValue = new LabelTextVar(transMeta, wOutputComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER, BaseMessages.getString(PKG, "ExecProcessDialog.ExitValueField.Label"), BaseMessages.getString(PKG, "ExecProcessDialog.ExitValueField.Tooltip"));
wExitValue.addModifyListener(lsMod);
fdExitValue = new FormData();
fdExitValue.left = new FormAttachment(0, 0);
fdExitValue.top = new FormAttachment(wError, margin);
fdExitValue.right = new FormAttachment(100, 0);
wExitValue.setLayoutData(fdExitValue);
FormData fdOutputComp = new FormData();
fdOutputComp.left = new FormAttachment(0, 0);
fdOutputComp.top = new FormAttachment(0, 0);
fdOutputComp.right = new FormAttachment(100, 0);
fdOutputComp.bottom = new FormAttachment(100, 0);
wOutputComp.setLayoutData(fdOutputComp);
wOutputComp.layout();
wOutputTab.setControl(wOutputComp);
// ////////////////////
// END OF OUTPUT TAB //
// ////////////////////
FormData 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);
wTabFolder.setSelection(0);
// ////////////////////
// END OF TAB FOLDER //
// ////////////////////
// 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, wTabFolder);
// Add listeners
lsOK = new Listener() {
@Override
public void handleEvent(Event e) {
ok();
}
};
lsCancel = new Listener() {
@Override
public void handleEvent(Event e) {
cancel();
}
};
wOK.addListener(SWT.Selection, lsOK);
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();
}
});
// Set the shell size, based upon previous time...
setSize();
RowMetaInterface r = null;
try {
r = transMeta.getPrevStepFields(stepname);
if (r != null) {
wArgumentFields.getColumns()[0].setComboValues(r.getFieldNames());
}
} catch (KettleStepException ignore) {
// Do nothing
}
getData();
enableFields();
input.setChanged(changed);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
return stepname;
}
use of org.pentaho.di.core.exception.KettleStepException in project pentaho-kettle by pentaho.
the class TransGraph method sniff.
public void sniff(final boolean input, final boolean output, final boolean error) {
StepMeta stepMeta = getCurrentStep();
if (stepMeta == null || trans == null) {
return;
}
final StepInterface runThread = trans.findRunThread(stepMeta.getName());
if (runThread != null) {
List<Object[]> rows = new ArrayList<>();
final PreviewRowsDialog dialog = new PreviewRowsDialog(shell, trans, SWT.NONE, stepMeta.getName(), null, rows);
dialog.setDynamic(true);
// Add a row listener that sends the rows over to the dialog...
//
final RowListener rowListener = new RowListener() {
@Override
public void rowReadEvent(RowMetaInterface rowMeta, Object[] row) throws KettleStepException {
if (input) {
try {
dialog.addDataRow(rowMeta, rowMeta.cloneRow(row));
} catch (KettleValueException e) {
throw new KettleStepException(e);
}
}
}
@Override
public void rowWrittenEvent(RowMetaInterface rowMeta, Object[] row) throws KettleStepException {
if (output) {
try {
dialog.addDataRow(rowMeta, rowMeta.cloneRow(row));
} catch (KettleValueException e) {
throw new KettleStepException(e);
}
}
}
@Override
public void errorRowWrittenEvent(RowMetaInterface rowMeta, Object[] row) throws KettleStepException {
if (error) {
try {
dialog.addDataRow(rowMeta, rowMeta.cloneRow(row));
} catch (KettleValueException e) {
throw new KettleStepException(e);
}
}
}
};
// When the dialog is closed, make sure to remove the listener!
//
dialog.addDialogClosedListener(new DialogClosedListener() {
@Override
public void dialogClosed() {
runThread.removeRowListener(rowListener);
}
});
// Open the dialog in a separate thread to make sure it doesn't block
//
getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
dialog.open();
}
});
runThread.addRowListener(rowListener);
}
}
use of org.pentaho.di.core.exception.KettleStepException in project pentaho-kettle by pentaho.
the class XmlJoinOmitNullValuesTest method doTest.
private void doTest(final String sourceXml, final String targetXml, final String expectedXml) throws KettleException {
XMLJoin spy = spy(new XMLJoin(smh.stepMeta, smh.stepDataInterface, 0, smh.transMeta, smh.trans));
doReturn(createSourceRowSet(sourceXml)).when(spy).findInputRowSet("source");
doReturn(createTargetRowSet(targetXml)).when(spy).findInputRowSet("target");
XMLJoinMeta stepMeta = smh.initStepMetaInterface;
when(stepMeta.getSourceXMLstep()).thenReturn("source");
when(stepMeta.getTargetXMLstep()).thenReturn("target");
when(stepMeta.getSourceXMLfield()).thenReturn("sourceField");
when(stepMeta.getTargetXMLfield()).thenReturn("targetField");
when(stepMeta.getValueXMLfield()).thenReturn("resultField");
when(stepMeta.getTargetXPath()).thenReturn("//root");
when(stepMeta.isOmitNullValues()).thenReturn(true);
spy.init(stepMeta, smh.initStepDataInterface);
spy.addRowListener(new RowAdapter() {
@Override
public void rowWrittenEvent(RowMetaInterface rowMeta, Object[] row) throws KettleStepException {
Assert.assertEquals(expectedXml, row[0]);
}
});
Assert.assertTrue(spy.processRow(stepMeta, smh.initStepDataInterface));
Assert.assertFalse(spy.processRow(stepMeta, smh.initStepDataInterface));
}
use of org.pentaho.di.core.exception.KettleStepException in project pentaho-kettle by pentaho.
the class XMLInputStreamDialog method open.
@Override
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() {
@Override
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, "XMLInputStreamDialog.Shell.Text"));
int middle = props.getMiddlePct();
int margin = Const.MARGIN;
// Step name line
//
wlStepname = new Label(shell, SWT.RIGHT);
wlStepname.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.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;
// split into tabs for better overview, later on:
// wTabFolder = new CTabFolder(shell, SWT.BORDER);
// props.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
//
//
// addFilesTab();
// addContentTab();
// addAdditionalFieldsTab();
//
// 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);
// See if the step receives input. If so, we don't ask for the filename, but
// for the filename field.
//
isReceivingInput = transMeta.findNrPrevSteps(stepMeta) > 0;
if (isReceivingInput) {
RowMetaInterface previousFields;
try {
previousFields = transMeta.getPrevStepFields(stepMeta);
} catch (KettleStepException e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "XMLInputStreamDialog.ErrorDialog.UnableToGetInputFields.Title"), BaseMessages.getString(PKG, "XMLInputStreamDialog.ErrorDialog.UnableToGetInputFields.Message"), e);
previousFields = new RowMeta();
}
// The field itself...
//
Label wlFilename = new Label(shell, SWT.RIGHT);
wlFilename.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Filename.Label"));
props.setLook(wlFilename);
FormData fdlFilename = new FormData();
fdlFilename.top = new FormAttachment(lastControl, margin);
fdlFilename.left = new FormAttachment(0, 0);
fdlFilename.right = new FormAttachment(middle, -margin);
wlFilename.setLayoutData(fdlFilename);
wFilenameCombo = new CCombo(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wFilenameCombo.setItems(previousFields.getFieldNames());
props.setLook(wFilenameCombo);
wFilenameCombo.addModifyListener(lsMod);
FormData fdFilename = new FormData();
fdFilename.top = new FormAttachment(lastControl, margin);
fdFilename.left = new FormAttachment(middle, 0);
fdFilename.right = new FormAttachment(100, -margin);
wFilenameCombo.setLayoutData(fdFilename);
lastControl = wFilenameCombo;
} else {
// Filename...
//
// The filename browse button
//
wbbFilename = new Button(shell, SWT.PUSH | SWT.CENTER);
props.setLook(wbbFilename);
wbbFilename.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
wbbFilename.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.BrowseForFileOrDirAndAdd"));
FormData fdbFilename = new FormData();
fdbFilename.top = new FormAttachment(lastControl, margin);
fdbFilename.right = new FormAttachment(100, 0);
wbbFilename.setLayoutData(fdbFilename);
// The field itself...
//
Label wlFilename = new Label(shell, SWT.RIGHT);
wlFilename.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Filename.Label"));
props.setLook(wlFilename);
FormData fdlFilename = new FormData();
fdlFilename.top = new FormAttachment(lastControl, margin);
fdlFilename.left = new FormAttachment(0, 0);
fdlFilename.right = new FormAttachment(middle, -margin);
wlFilename.setLayoutData(fdlFilename);
wFilename = new TextVar(transMeta, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wFilename);
wFilename.addModifyListener(lsMod);
FormData fdFilename = new FormData();
fdFilename.top = new FormAttachment(lastControl, margin);
fdFilename.left = new FormAttachment(middle, 0);
fdFilename.right = new FormAttachment(wbbFilename, -margin);
wFilename.setLayoutData(fdFilename);
lastControl = wFilename;
}
// data from previous step
Label lblAcceptingFilenames = new Label(shell, SWT.RIGHT);
lblAcceptingFilenames.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.SourceStreamField.Label"));
props.setLook(lblAcceptingFilenames);
FormData fdlAcceptingFilenames = new FormData();
fdlAcceptingFilenames.left = new FormAttachment(0, 0);
fdlAcceptingFilenames.top = new FormAttachment(lastControl, margin);
fdlAcceptingFilenames.right = new FormAttachment(middle, -margin);
lblAcceptingFilenames.setLayoutData(fdlAcceptingFilenames);
cbFromSource = new Button(shell, SWT.CHECK);
props.setLook(cbFromSource);
fdlAcceptingFilenames = new FormData();
fdlAcceptingFilenames.left = new FormAttachment(middle, 0);
fdlAcceptingFilenames.top = new FormAttachment(lastControl, margin);
cbFromSource.setLayoutData(fdlAcceptingFilenames);
lastControl = cbFromSource;
// field name
Label lblAcceptingField = new Label(shell, SWT.RIGHT);
lblAcceptingField.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.SourceField.Label"));
props.setLook(lblAcceptingField);
FormData fdlAcceptingField = new FormData();
fdlAcceptingField = new FormData();
fdlAcceptingField.left = new FormAttachment(0, 0);
fdlAcceptingField.top = new FormAttachment(lastControl, margin);
fdlAcceptingField.right = new FormAttachment(middle, -margin);
lblAcceptingField.setLayoutData(fdlAcceptingField);
cbSourceField = new CCombo(shell, SWT.BORDER | SWT.READ_ONLY);
props.setLook(cbSourceField);
cbSourceField.addModifyListener(lsMod);
fdlAcceptingField = new FormData();
fdlAcceptingField = new FormData();
fdlAcceptingField.left = new FormAttachment(middle, 0);
fdlAcceptingField.top = new FormAttachment(lastControl, margin);
fdlAcceptingField.right = new FormAttachment(100, 0);
cbSourceField.setLayoutData(fdlAcceptingField);
lastControl = cbSourceField;
setSourceStreamField();
// add filename to result?
//
Label wlAddResult = new Label(shell, SWT.RIGHT);
wlAddResult.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.AddResult.Label"));
props.setLook(wlAddResult);
FormData fdlAddResult = new FormData();
fdlAddResult.left = new FormAttachment(0, 0);
fdlAddResult.top = new FormAttachment(lastControl, margin);
fdlAddResult.right = new FormAttachment(middle, -margin);
wlAddResult.setLayoutData(fdlAddResult);
wAddResult = new Button(shell, SWT.CHECK);
props.setLook(wAddResult);
wAddResult.setToolTipText(BaseMessages.getString(PKG, "XMLInputStreamDialog.AddResult.Tooltip"));
FormData fdAddResult = new FormData();
fdAddResult.left = new FormAttachment(middle, 0);
fdAddResult.top = new FormAttachment(lastControl, margin);
wAddResult.setLayoutData(fdAddResult);
lastControl = wAddResult;
// RowsToSkip line
//
Label wlRowsToSkip = new Label(shell, SWT.RIGHT);
wlRowsToSkip.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.RowsToSkip.Label"));
props.setLook(wlRowsToSkip);
FormData fdlRowsToSkip = new FormData();
fdlRowsToSkip = new FormData();
fdlRowsToSkip.left = new FormAttachment(0, 0);
fdlRowsToSkip.top = new FormAttachment(lastControl, margin);
fdlRowsToSkip.right = new FormAttachment(middle, -margin);
wlRowsToSkip.setLayoutData(fdlRowsToSkip);
wRowsToSkip = new TextVar(transMeta, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wRowsToSkip);
wRowsToSkip.addModifyListener(lsMod);
FormData fdRowsToSkip = new FormData();
fdRowsToSkip = new FormData();
fdRowsToSkip.left = new FormAttachment(middle, 0);
fdRowsToSkip.top = new FormAttachment(lastControl, margin);
fdRowsToSkip.right = new FormAttachment(100, 0);
wRowsToSkip.setLayoutData(fdRowsToSkip);
lastControl = wRowsToSkip;
// Limit line
//
Label wlLimit = new Label(shell, SWT.RIGHT);
wlLimit.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Limit.Label"));
props.setLook(wlLimit);
FormData fdlLimit = new FormData();
fdlLimit = new FormData();
fdlLimit.left = new FormAttachment(0, 0);
fdlLimit.top = new FormAttachment(lastControl, margin);
fdlLimit.right = new FormAttachment(middle, -margin);
wlLimit.setLayoutData(fdlLimit);
wLimit = new TextVar(transMeta, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wLimit);
wLimit.addModifyListener(lsMod);
FormData fdLimit = new FormData();
fdLimit = new FormData();
fdLimit.left = new FormAttachment(middle, 0);
fdLimit.top = new FormAttachment(lastControl, margin);
fdLimit.right = new FormAttachment(100, 0);
wLimit.setLayoutData(fdLimit);
lastControl = wLimit;
// DefaultStringLen line
//
Label wlDefaultStringLen = new Label(shell, SWT.RIGHT);
wlDefaultStringLen.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.DefaultStringLen.Label"));
props.setLook(wlDefaultStringLen);
FormData fdlDefaultStringLen = new FormData();
fdlDefaultStringLen = new FormData();
fdlDefaultStringLen.left = new FormAttachment(0, 0);
fdlDefaultStringLen.top = new FormAttachment(lastControl, margin);
fdlDefaultStringLen.right = new FormAttachment(middle, -margin);
wlDefaultStringLen.setLayoutData(fdlDefaultStringLen);
wDefaultStringLen = new TextVar(transMeta, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wDefaultStringLen);
wDefaultStringLen.addModifyListener(lsMod);
FormData fdDefaultStringLen = new FormData();
fdDefaultStringLen = new FormData();
fdDefaultStringLen.left = new FormAttachment(middle, 0);
fdDefaultStringLen.top = new FormAttachment(lastControl, margin);
fdDefaultStringLen.right = new FormAttachment(100, 0);
wDefaultStringLen.setLayoutData(fdDefaultStringLen);
lastControl = wDefaultStringLen;
// Encoding line
//
Label wlEncoding = new Label(shell, SWT.RIGHT);
wlEncoding.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Encoding.Label"));
props.setLook(wlEncoding);
FormData fdlEncoding = new FormData();
fdlEncoding = new FormData();
fdlEncoding.left = new FormAttachment(0, 0);
fdlEncoding.top = new FormAttachment(lastControl, margin);
fdlEncoding.right = new FormAttachment(middle, -margin);
wlEncoding.setLayoutData(fdlEncoding);
wEncoding = new TextVar(transMeta, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wEncoding);
wEncoding.addModifyListener(lsMod);
FormData fdEncoding = new FormData();
fdEncoding = new FormData();
fdEncoding.left = new FormAttachment(middle, 0);
fdEncoding.top = new FormAttachment(lastControl, margin);
fdEncoding.right = new FormAttachment(100, 0);
wEncoding.setLayoutData(fdEncoding);
lastControl = wEncoding;
// EnableNamespaces?
//
Label wlEnableNamespaces = new Label(shell, SWT.RIGHT);
wlEnableNamespaces.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.EnableNamespaces.Label"));
props.setLook(wlEnableNamespaces);
FormData fdlEnableNamespaces = new FormData();
fdlEnableNamespaces.left = new FormAttachment(0, 0);
fdlEnableNamespaces.top = new FormAttachment(lastControl, margin);
fdlEnableNamespaces.right = new FormAttachment(middle, -margin);
wlEnableNamespaces.setLayoutData(fdlEnableNamespaces);
wEnableNamespaces = new Button(shell, SWT.CHECK);
props.setLook(wEnableNamespaces);
wEnableNamespaces.setToolTipText(BaseMessages.getString(PKG, "XMLInputStreamDialog.EnableNamespaces.Tooltip"));
FormData fdEnableNamespaces = new FormData();
fdEnableNamespaces.left = new FormAttachment(middle, 0);
fdEnableNamespaces.top = new FormAttachment(lastControl, margin);
wEnableNamespaces.setLayoutData(fdEnableNamespaces);
lastControl = wEnableNamespaces;
// EnableTrim?
//
Label wlEnableTrim = new Label(shell, SWT.RIGHT);
wlEnableTrim.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.EnableTrim.Label"));
props.setLook(wlEnableTrim);
FormData fdlEnableTrim = new FormData();
fdlEnableTrim.left = new FormAttachment(0, 0);
fdlEnableTrim.top = new FormAttachment(lastControl, margin);
fdlEnableTrim.right = new FormAttachment(middle, -margin);
wlEnableTrim.setLayoutData(fdlEnableTrim);
wEnableTrim = new Button(shell, SWT.CHECK);
props.setLook(wEnableTrim);
wEnableTrim.setToolTipText(BaseMessages.getString(PKG, "XMLInputStreamDialog.EnableTrim.Tooltip"));
FormData fdEnableTrim = new FormData();
fdEnableTrim.left = new FormAttachment(middle, 0);
fdEnableTrim.top = new FormAttachment(lastControl, margin);
wEnableTrim.setLayoutData(fdEnableTrim);
lastControl = wEnableTrim;
// IncludeFilename?
//
Label wlIncludeFilename = new Label(shell, SWT.RIGHT);
wlIncludeFilename.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.IncludeFilename.Label"));
props.setLook(wlIncludeFilename);
FormData fdlIncludeFilename = new FormData();
fdlIncludeFilename.top = new FormAttachment(lastControl, margin);
fdlIncludeFilename.left = new FormAttachment(0, 0);
fdlIncludeFilename.right = new FormAttachment(middle, -margin);
wlIncludeFilename.setLayoutData(fdlIncludeFilename);
wIncludeFilename = new Button(shell, SWT.CHECK);
props.setLook(wIncludeFilename);
FormData fdIncludeFilename = new FormData();
fdIncludeFilename.top = new FormAttachment(lastControl, margin);
fdIncludeFilename.left = new FormAttachment(middle, 0);
wIncludeFilename.setLayoutData(fdIncludeFilename);
// FilenameField line
//
Label wlFilenameField = new Label(shell, SWT.RIGHT);
wlFilenameField.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Fieldname.Label"));
props.setLook(wlFilenameField);
FormData fdlFilenameField = new FormData();
fdlFilenameField = new FormData();
fdlFilenameField.top = new FormAttachment(lastControl, margin);
fdlFilenameField.left = new FormAttachment(wIncludeFilename, margin);
wlFilenameField.setLayoutData(fdlFilenameField);
wFilenameField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wFilenameField);
wFilenameField.addModifyListener(lsMod);
FormData fdFilenameField = new FormData();
fdFilenameField = new FormData();
fdFilenameField.top = new FormAttachment(lastControl, margin);
fdFilenameField.left = new FormAttachment(wlFilenameField, margin);
fdFilenameField.right = new FormAttachment(100, 0);
wFilenameField.setLayoutData(fdFilenameField);
lastControl = wFilenameField;
// IncludeRowNumber?
//
Label wlIncludeRowNumber = new Label(shell, SWT.RIGHT);
wlIncludeRowNumber.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.IncludeRowNumber.Label"));
props.setLook(wlIncludeRowNumber);
FormData fdlIncludeRowNumber = new FormData();
fdlIncludeRowNumber.top = new FormAttachment(lastControl, margin);
fdlIncludeRowNumber.left = new FormAttachment(0, 0);
fdlIncludeRowNumber.right = new FormAttachment(middle, -margin);
wlIncludeRowNumber.setLayoutData(fdlIncludeRowNumber);
wIncludeRowNumber = new Button(shell, SWT.CHECK);
props.setLook(wIncludeRowNumber);
FormData fdIncludeRowNumber = new FormData();
fdIncludeRowNumber.top = new FormAttachment(lastControl, margin);
fdIncludeRowNumber.left = new FormAttachment(middle, 0);
wIncludeRowNumber.setLayoutData(fdIncludeRowNumber);
// RowNumberField line
//
Label wlRowNumberField = new Label(shell, SWT.RIGHT);
wlRowNumberField.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Fieldname.Label"));
props.setLook(wlRowNumberField);
FormData fdlRowNumberField = new FormData();
fdlRowNumberField = new FormData();
fdlRowNumberField.top = new FormAttachment(lastControl, margin);
fdlRowNumberField.left = new FormAttachment(wIncludeRowNumber, margin);
wlRowNumberField.setLayoutData(fdlRowNumberField);
wRowNumberField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wRowNumberField);
wRowNumberField.addModifyListener(lsMod);
FormData fdRowNumberField = new FormData();
fdRowNumberField = new FormData();
fdRowNumberField.top = new FormAttachment(lastControl, margin);
fdRowNumberField.left = new FormAttachment(wlRowNumberField, margin);
fdRowNumberField.right = new FormAttachment(100, 0);
wRowNumberField.setLayoutData(fdRowNumberField);
lastControl = wRowNumberField;
// IncludeXmlDataTypeNumeric?
//
Label wlIncludeXmlDataTypeNumeric = new Label(shell, SWT.RIGHT);
wlIncludeXmlDataTypeNumeric.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.IncludeXmlDataTypeNumeric.Label"));
props.setLook(wlIncludeXmlDataTypeNumeric);
FormData fdlIncludeXmlDataTypeNumeric = new FormData();
fdlIncludeXmlDataTypeNumeric.top = new FormAttachment(lastControl, margin);
fdlIncludeXmlDataTypeNumeric.left = new FormAttachment(0, 0);
fdlIncludeXmlDataTypeNumeric.right = new FormAttachment(middle, -margin);
wlIncludeXmlDataTypeNumeric.setLayoutData(fdlIncludeXmlDataTypeNumeric);
wIncludeXmlDataTypeNumeric = new Button(shell, SWT.CHECK);
props.setLook(wIncludeXmlDataTypeNumeric);
FormData fdIncludeXmlDataTypeNumeric = new FormData();
fdIncludeXmlDataTypeNumeric.top = new FormAttachment(lastControl, margin);
fdIncludeXmlDataTypeNumeric.left = new FormAttachment(middle, 0);
wIncludeXmlDataTypeNumeric.setLayoutData(fdIncludeXmlDataTypeNumeric);
// XmlDataTypeNumericField line
//
Label wlXmlDataTypeNumericField = new Label(shell, SWT.RIGHT);
wlXmlDataTypeNumericField.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Fieldname.Label"));
props.setLook(wlXmlDataTypeNumericField);
FormData fdlXmlDataTypeNumericField = new FormData();
fdlXmlDataTypeNumericField = new FormData();
fdlXmlDataTypeNumericField.top = new FormAttachment(lastControl, margin);
fdlXmlDataTypeNumericField.left = new FormAttachment(wIncludeXmlDataTypeNumeric, margin);
wlXmlDataTypeNumericField.setLayoutData(fdlXmlDataTypeNumericField);
wXmlDataTypeNumericField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wXmlDataTypeNumericField);
wXmlDataTypeNumericField.addModifyListener(lsMod);
FormData fdXmlDataTypeNumericField = new FormData();
fdXmlDataTypeNumericField = new FormData();
fdXmlDataTypeNumericField.top = new FormAttachment(lastControl, margin);
fdXmlDataTypeNumericField.left = new FormAttachment(wlXmlDataTypeNumericField, margin);
fdXmlDataTypeNumericField.right = new FormAttachment(100, 0);
wXmlDataTypeNumericField.setLayoutData(fdXmlDataTypeNumericField);
lastControl = wXmlDataTypeNumericField;
// IncludeXmlDataTypeDescription?
//
Label wlIncludeXmlDataTypeDescription = new Label(shell, SWT.RIGHT);
wlIncludeXmlDataTypeDescription.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.IncludeXmlDataTypeDescription.Label"));
props.setLook(wlIncludeXmlDataTypeDescription);
FormData fdlIncludeXmlDataTypeDescription = new FormData();
fdlIncludeXmlDataTypeDescription.top = new FormAttachment(lastControl, margin);
fdlIncludeXmlDataTypeDescription.left = new FormAttachment(0, 0);
fdlIncludeXmlDataTypeDescription.right = new FormAttachment(middle, -margin);
wlIncludeXmlDataTypeDescription.setLayoutData(fdlIncludeXmlDataTypeDescription);
wIncludeXmlDataTypeDescription = new Button(shell, SWT.CHECK);
props.setLook(wIncludeXmlDataTypeDescription);
FormData fdIncludeXmlDataTypeDescription = new FormData();
fdIncludeXmlDataTypeDescription.top = new FormAttachment(lastControl, margin);
fdIncludeXmlDataTypeDescription.left = new FormAttachment(middle, 0);
wIncludeXmlDataTypeDescription.setLayoutData(fdIncludeXmlDataTypeDescription);
// XmlDataTypeDescriptionField line
//
Label wlXmlDataTypeDescriptionField = new Label(shell, SWT.RIGHT);
wlXmlDataTypeDescriptionField.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Fieldname.Label"));
props.setLook(wlXmlDataTypeDescriptionField);
FormData fdlXmlDataTypeDescriptionField = new FormData();
fdlXmlDataTypeDescriptionField = new FormData();
fdlXmlDataTypeDescriptionField.top = new FormAttachment(lastControl, margin);
fdlXmlDataTypeDescriptionField.left = new FormAttachment(wIncludeXmlDataTypeDescription, margin);
wlXmlDataTypeDescriptionField.setLayoutData(fdlXmlDataTypeDescriptionField);
wXmlDataTypeDescriptionField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wXmlDataTypeDescriptionField);
wXmlDataTypeDescriptionField.addModifyListener(lsMod);
FormData fdXmlDataTypeDescriptionField = new FormData();
fdXmlDataTypeDescriptionField = new FormData();
fdXmlDataTypeDescriptionField.top = new FormAttachment(lastControl, margin);
fdXmlDataTypeDescriptionField.left = new FormAttachment(wlXmlDataTypeDescriptionField, margin);
fdXmlDataTypeDescriptionField.right = new FormAttachment(100, 0);
wXmlDataTypeDescriptionField.setLayoutData(fdXmlDataTypeDescriptionField);
lastControl = wXmlDataTypeDescriptionField;
// IncludeXmlLocationLine?
//
Label wlIncludeXmlLocationLine = new Label(shell, SWT.RIGHT);
wlIncludeXmlLocationLine.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.IncludeXmlLocationLine.Label"));
props.setLook(wlIncludeXmlLocationLine);
FormData fdlIncludeXmlLocationLine = new FormData();
fdlIncludeXmlLocationLine.top = new FormAttachment(lastControl, margin);
fdlIncludeXmlLocationLine.left = new FormAttachment(0, 0);
fdlIncludeXmlLocationLine.right = new FormAttachment(middle, -margin);
wlIncludeXmlLocationLine.setLayoutData(fdlIncludeXmlLocationLine);
wIncludeXmlLocationLine = new Button(shell, SWT.CHECK);
props.setLook(wIncludeXmlLocationLine);
FormData fdIncludeXmlLocationLine = new FormData();
fdIncludeXmlLocationLine.top = new FormAttachment(lastControl, margin);
fdIncludeXmlLocationLine.left = new FormAttachment(middle, 0);
wIncludeXmlLocationLine.setLayoutData(fdIncludeXmlLocationLine);
// XmlLocationLineField line
//
Label wlXmlLocationLineField = new Label(shell, SWT.RIGHT);
wlXmlLocationLineField.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Fieldname.Label"));
props.setLook(wlXmlLocationLineField);
FormData fdlXmlLocationLineField = new FormData();
fdlXmlLocationLineField = new FormData();
fdlXmlLocationLineField.top = new FormAttachment(lastControl, margin);
fdlXmlLocationLineField.left = new FormAttachment(wIncludeXmlLocationLine, margin);
wlXmlLocationLineField.setLayoutData(fdlXmlLocationLineField);
wXmlLocationLineField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wXmlLocationLineField);
wXmlLocationLineField.addModifyListener(lsMod);
FormData fdXmlLocationLineField = new FormData();
fdXmlLocationLineField = new FormData();
fdXmlLocationLineField.top = new FormAttachment(lastControl, margin);
fdXmlLocationLineField.left = new FormAttachment(wlXmlLocationLineField, margin);
fdXmlLocationLineField.right = new FormAttachment(100, 0);
wXmlLocationLineField.setLayoutData(fdXmlLocationLineField);
lastControl = wXmlLocationLineField;
// IncludeXmlLocationColumn?
//
Label wlIncludeXmlLocationColumn = new Label(shell, SWT.RIGHT);
wlIncludeXmlLocationColumn.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.IncludeXmlLocationColumn.Label"));
props.setLook(wlIncludeXmlLocationColumn);
FormData fdlIncludeXmlLocationColumn = new FormData();
fdlIncludeXmlLocationColumn.top = new FormAttachment(lastControl, margin);
fdlIncludeXmlLocationColumn.left = new FormAttachment(0, 0);
fdlIncludeXmlLocationColumn.right = new FormAttachment(middle, -margin);
wlIncludeXmlLocationColumn.setLayoutData(fdlIncludeXmlLocationColumn);
wIncludeXmlLocationColumn = new Button(shell, SWT.CHECK);
props.setLook(wIncludeXmlLocationColumn);
FormData fdIncludeXmlLocationColumn = new FormData();
fdIncludeXmlLocationColumn.top = new FormAttachment(lastControl, margin);
fdIncludeXmlLocationColumn.left = new FormAttachment(middle, 0);
wIncludeXmlLocationColumn.setLayoutData(fdIncludeXmlLocationColumn);
// XmlLocationColumnField line
//
Label wlXmlLocationColumnField = new Label(shell, SWT.RIGHT);
wlXmlLocationColumnField.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Fieldname.Label"));
props.setLook(wlXmlLocationColumnField);
FormData fdlXmlLocationColumnField = new FormData();
fdlXmlLocationColumnField = new FormData();
fdlXmlLocationColumnField.top = new FormAttachment(lastControl, margin);
fdlXmlLocationColumnField.left = new FormAttachment(wIncludeXmlLocationColumn, margin);
wlXmlLocationColumnField.setLayoutData(fdlXmlLocationColumnField);
wXmlLocationColumnField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wXmlLocationColumnField);
wXmlLocationColumnField.addModifyListener(lsMod);
FormData fdXmlLocationColumnField = new FormData();
fdXmlLocationColumnField = new FormData();
fdXmlLocationColumnField.top = new FormAttachment(lastControl, margin);
fdXmlLocationColumnField.left = new FormAttachment(wlXmlLocationColumnField, margin);
fdXmlLocationColumnField.right = new FormAttachment(100, 0);
wXmlLocationColumnField.setLayoutData(fdXmlLocationColumnField);
lastControl = wXmlLocationColumnField;
// IncludeXmlElementID?
//
Label wlIncludeXmlElementID = new Label(shell, SWT.RIGHT);
wlIncludeXmlElementID.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.IncludeXmlElementID.Label"));
props.setLook(wlIncludeXmlElementID);
FormData fdlIncludeXmlElementID = new FormData();
fdlIncludeXmlElementID.top = new FormAttachment(lastControl, margin);
fdlIncludeXmlElementID.left = new FormAttachment(0, 0);
fdlIncludeXmlElementID.right = new FormAttachment(middle, -margin);
wlIncludeXmlElementID.setLayoutData(fdlIncludeXmlElementID);
wIncludeXmlElementID = new Button(shell, SWT.CHECK);
props.setLook(wIncludeXmlElementID);
FormData fdIncludeXmlElementID = new FormData();
fdIncludeXmlElementID.top = new FormAttachment(lastControl, margin);
fdIncludeXmlElementID.left = new FormAttachment(middle, 0);
wIncludeXmlElementID.setLayoutData(fdIncludeXmlElementID);
// XmlElementIDField line
//
Label wlXmlElementIDField = new Label(shell, SWT.RIGHT);
wlXmlElementIDField.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Fieldname.Label"));
props.setLook(wlXmlElementIDField);
FormData fdlXmlElementIDField = new FormData();
fdlXmlElementIDField = new FormData();
fdlXmlElementIDField.top = new FormAttachment(lastControl, margin);
fdlXmlElementIDField.left = new FormAttachment(wIncludeXmlElementID, margin);
wlXmlElementIDField.setLayoutData(fdlXmlElementIDField);
wXmlElementIDField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wXmlElementIDField);
wXmlElementIDField.addModifyListener(lsMod);
FormData fdXmlElementIDField = new FormData();
fdXmlElementIDField = new FormData();
fdXmlElementIDField.top = new FormAttachment(lastControl, margin);
fdXmlElementIDField.left = new FormAttachment(wlXmlElementIDField, margin);
fdXmlElementIDField.right = new FormAttachment(100, 0);
wXmlElementIDField.setLayoutData(fdXmlElementIDField);
lastControl = wXmlElementIDField;
// IncludeXmlParentElementID?
//
Label wlIncludeXmlParentElementID = new Label(shell, SWT.RIGHT);
wlIncludeXmlParentElementID.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.IncludeXmlParentElementID.Label"));
props.setLook(wlIncludeXmlParentElementID);
FormData fdlIncludeXmlParentElementID = new FormData();
fdlIncludeXmlParentElementID.top = new FormAttachment(lastControl, margin);
fdlIncludeXmlParentElementID.left = new FormAttachment(0, 0);
fdlIncludeXmlParentElementID.right = new FormAttachment(middle, -margin);
wlIncludeXmlParentElementID.setLayoutData(fdlIncludeXmlParentElementID);
wIncludeXmlParentElementID = new Button(shell, SWT.CHECK);
props.setLook(wIncludeXmlParentElementID);
FormData fdIncludeXmlParentElementID = new FormData();
fdIncludeXmlParentElementID.top = new FormAttachment(lastControl, margin);
fdIncludeXmlParentElementID.left = new FormAttachment(middle, 0);
wIncludeXmlParentElementID.setLayoutData(fdIncludeXmlParentElementID);
// XmlParentElementIDField line
//
Label wlXmlParentElementIDField = new Label(shell, SWT.RIGHT);
wlXmlParentElementIDField.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Fieldname.Label"));
props.setLook(wlXmlParentElementIDField);
FormData fdlXmlParentElementIDField = new FormData();
fdlXmlParentElementIDField = new FormData();
fdlXmlParentElementIDField.top = new FormAttachment(lastControl, margin);
fdlXmlParentElementIDField.left = new FormAttachment(wIncludeXmlParentElementID, margin);
wlXmlParentElementIDField.setLayoutData(fdlXmlParentElementIDField);
wXmlParentElementIDField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wXmlParentElementIDField);
wXmlParentElementIDField.addModifyListener(lsMod);
FormData fdXmlParentElementIDField = new FormData();
fdXmlParentElementIDField = new FormData();
fdXmlParentElementIDField.top = new FormAttachment(lastControl, margin);
fdXmlParentElementIDField.left = new FormAttachment(wlXmlParentElementIDField, margin);
fdXmlParentElementIDField.right = new FormAttachment(100, 0);
wXmlParentElementIDField.setLayoutData(fdXmlParentElementIDField);
lastControl = wXmlParentElementIDField;
// IncludeXmlElementLevel?
//
Label wlIncludeXmlElementLevel = new Label(shell, SWT.RIGHT);
wlIncludeXmlElementLevel.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.IncludeXmlElementLevel.Label"));
props.setLook(wlIncludeXmlElementLevel);
FormData fdlIncludeXmlElementLevel = new FormData();
fdlIncludeXmlElementLevel.top = new FormAttachment(lastControl, margin);
fdlIncludeXmlElementLevel.left = new FormAttachment(0, 0);
fdlIncludeXmlElementLevel.right = new FormAttachment(middle, -margin);
wlIncludeXmlElementLevel.setLayoutData(fdlIncludeXmlElementLevel);
wIncludeXmlElementLevel = new Button(shell, SWT.CHECK);
props.setLook(wIncludeXmlElementLevel);
FormData fdIncludeXmlElementLevel = new FormData();
fdIncludeXmlElementLevel.top = new FormAttachment(lastControl, margin);
fdIncludeXmlElementLevel.left = new FormAttachment(middle, 0);
wIncludeXmlElementLevel.setLayoutData(fdIncludeXmlElementLevel);
// XmlElementLevelField line
//
Label wlXmlElementLevelField = new Label(shell, SWT.RIGHT);
wlXmlElementLevelField.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Fieldname.Label"));
props.setLook(wlXmlElementLevelField);
FormData fdlXmlElementLevelField = new FormData();
fdlXmlElementLevelField = new FormData();
fdlXmlElementLevelField.top = new FormAttachment(lastControl, margin);
fdlXmlElementLevelField.left = new FormAttachment(wIncludeXmlElementLevel, margin);
wlXmlElementLevelField.setLayoutData(fdlXmlElementLevelField);
wXmlElementLevelField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wXmlElementLevelField);
wXmlElementLevelField.addModifyListener(lsMod);
FormData fdXmlElementLevelField = new FormData();
fdXmlElementLevelField = new FormData();
fdXmlElementLevelField.top = new FormAttachment(lastControl, margin);
fdXmlElementLevelField.left = new FormAttachment(wlXmlElementLevelField, margin);
fdXmlElementLevelField.right = new FormAttachment(100, 0);
wXmlElementLevelField.setLayoutData(fdXmlElementLevelField);
lastControl = wXmlElementLevelField;
// IncludeXmlPath?
//
Label wlIncludeXmlPath = new Label(shell, SWT.RIGHT);
wlIncludeXmlPath.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.IncludeXmlPath.Label"));
props.setLook(wlIncludeXmlPath);
FormData fdlIncludeXmlPath = new FormData();
fdlIncludeXmlPath.top = new FormAttachment(lastControl, margin);
fdlIncludeXmlPath.left = new FormAttachment(0, 0);
fdlIncludeXmlPath.right = new FormAttachment(middle, -margin);
wlIncludeXmlPath.setLayoutData(fdlIncludeXmlPath);
wIncludeXmlPath = new Button(shell, SWT.CHECK);
props.setLook(wIncludeXmlPath);
FormData fdIncludeXmlPath = new FormData();
fdIncludeXmlPath.top = new FormAttachment(lastControl, margin);
fdIncludeXmlPath.left = new FormAttachment(middle, 0);
wIncludeXmlPath.setLayoutData(fdIncludeXmlPath);
// XmlPathField line
//
Label wlXmlPathField = new Label(shell, SWT.RIGHT);
wlXmlPathField.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Fieldname.Label"));
props.setLook(wlXmlPathField);
FormData fdlXmlPathField = new FormData();
fdlXmlPathField = new FormData();
fdlXmlPathField.top = new FormAttachment(lastControl, margin);
fdlXmlPathField.left = new FormAttachment(wIncludeXmlPath, margin);
wlXmlPathField.setLayoutData(fdlXmlPathField);
wXmlPathField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wXmlPathField);
wXmlPathField.addModifyListener(lsMod);
FormData fdXmlPathField = new FormData();
fdXmlPathField = new FormData();
fdXmlPathField.top = new FormAttachment(lastControl, margin);
fdXmlPathField.left = new FormAttachment(wlXmlPathField, margin);
fdXmlPathField.right = new FormAttachment(100, 0);
wXmlPathField.setLayoutData(fdXmlPathField);
lastControl = wXmlPathField;
// IncludeXmlParentPath?
//
Label wlIncludeXmlParentPath = new Label(shell, SWT.RIGHT);
wlIncludeXmlParentPath.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.IncludeXmlParentPath.Label"));
props.setLook(wlIncludeXmlParentPath);
FormData fdlIncludeXmlParentPath = new FormData();
fdlIncludeXmlParentPath.top = new FormAttachment(lastControl, margin);
fdlIncludeXmlParentPath.left = new FormAttachment(0, 0);
fdlIncludeXmlParentPath.right = new FormAttachment(middle, -margin);
wlIncludeXmlParentPath.setLayoutData(fdlIncludeXmlParentPath);
wIncludeXmlParentPath = new Button(shell, SWT.CHECK);
props.setLook(wIncludeXmlParentPath);
FormData fdIncludeXmlParentPath = new FormData();
fdIncludeXmlParentPath.top = new FormAttachment(lastControl, margin);
fdIncludeXmlParentPath.left = new FormAttachment(middle, 0);
wIncludeXmlParentPath.setLayoutData(fdIncludeXmlParentPath);
// XmlParentPathField line
//
Label wlXmlParentPathField = new Label(shell, SWT.RIGHT);
wlXmlParentPathField.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Fieldname.Label"));
props.setLook(wlXmlParentPathField);
FormData fdlXmlParentPathField = new FormData();
fdlXmlParentPathField = new FormData();
fdlXmlParentPathField.top = new FormAttachment(lastControl, margin);
fdlXmlParentPathField.left = new FormAttachment(wIncludeXmlParentPath, margin);
wlXmlParentPathField.setLayoutData(fdlXmlParentPathField);
wXmlParentPathField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wXmlParentPathField);
wXmlParentPathField.addModifyListener(lsMod);
FormData fdXmlParentPathField = new FormData();
fdXmlParentPathField = new FormData();
fdXmlParentPathField.top = new FormAttachment(lastControl, margin);
fdXmlParentPathField.left = new FormAttachment(wlXmlParentPathField, margin);
fdXmlParentPathField.right = new FormAttachment(100, 0);
wXmlParentPathField.setLayoutData(fdXmlParentPathField);
lastControl = wXmlParentPathField;
// IncludeXmlDataName?
//
Label wlIncludeXmlDataName = new Label(shell, SWT.RIGHT);
wlIncludeXmlDataName.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.IncludeXmlDataName.Label"));
props.setLook(wlIncludeXmlDataName);
FormData fdlIncludeXmlDataName = new FormData();
fdlIncludeXmlDataName.top = new FormAttachment(lastControl, margin);
fdlIncludeXmlDataName.left = new FormAttachment(0, 0);
fdlIncludeXmlDataName.right = new FormAttachment(middle, -margin);
wlIncludeXmlDataName.setLayoutData(fdlIncludeXmlDataName);
wIncludeXmlDataName = new Button(shell, SWT.CHECK);
props.setLook(wIncludeXmlDataName);
FormData fdIncludeXmlDataName = new FormData();
fdIncludeXmlDataName.top = new FormAttachment(lastControl, margin);
fdIncludeXmlDataName.left = new FormAttachment(middle, 0);
wIncludeXmlDataName.setLayoutData(fdIncludeXmlDataName);
// XmlDataNameField line
//
Label wlXmlDataNameField = new Label(shell, SWT.RIGHT);
wlXmlDataNameField.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Fieldname.Label"));
props.setLook(wlXmlDataNameField);
FormData fdlXmlDataNameField = new FormData();
fdlXmlDataNameField = new FormData();
fdlXmlDataNameField.top = new FormAttachment(lastControl, margin);
fdlXmlDataNameField.left = new FormAttachment(wIncludeXmlDataName, margin);
wlXmlDataNameField.setLayoutData(fdlXmlDataNameField);
wXmlDataNameField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wXmlDataNameField);
wXmlDataNameField.addModifyListener(lsMod);
FormData fdXmlDataNameField = new FormData();
fdXmlDataNameField = new FormData();
fdXmlDataNameField.top = new FormAttachment(lastControl, margin);
fdXmlDataNameField.left = new FormAttachment(wlXmlDataNameField, margin);
fdXmlDataNameField.right = new FormAttachment(100, 0);
wXmlDataNameField.setLayoutData(fdXmlDataNameField);
lastControl = wXmlDataNameField;
// IncludeXmlDataValue?
//
Label wlIncludeXmlDataValue = new Label(shell, SWT.RIGHT);
wlIncludeXmlDataValue.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.IncludeXmlDataValue.Label"));
props.setLook(wlIncludeXmlDataValue);
FormData fdlIncludeXmlDataValue = new FormData();
fdlIncludeXmlDataValue.top = new FormAttachment(lastControl, margin);
fdlIncludeXmlDataValue.left = new FormAttachment(0, 0);
fdlIncludeXmlDataValue.right = new FormAttachment(middle, -margin);
wlIncludeXmlDataValue.setLayoutData(fdlIncludeXmlDataValue);
wIncludeXmlDataValue = new Button(shell, SWT.CHECK);
props.setLook(wIncludeXmlDataValue);
FormData fdIncludeXmlDataValue = new FormData();
fdIncludeXmlDataValue.top = new FormAttachment(lastControl, margin);
fdIncludeXmlDataValue.left = new FormAttachment(middle, 0);
wIncludeXmlDataValue.setLayoutData(fdIncludeXmlDataValue);
// XmlDataValueField line
//
Label wlXmlDataValueField = new Label(shell, SWT.RIGHT);
wlXmlDataValueField.setText(BaseMessages.getString(PKG, "XMLInputStreamDialog.Fieldname.Label"));
props.setLook(wlXmlDataValueField);
FormData fdlXmlDataValueField = new FormData();
fdlXmlDataValueField = new FormData();
fdlXmlDataValueField.top = new FormAttachment(lastControl, margin);
fdlXmlDataValueField.left = new FormAttachment(wIncludeXmlDataValue, margin);
wlXmlDataValueField.setLayoutData(fdlXmlDataValueField);
wXmlDataValueField = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
props.setLook(wXmlDataValueField);
wXmlDataValueField.addModifyListener(lsMod);
FormData fdXmlDataValueField = new FormData();
fdXmlDataValueField = new FormData();
fdXmlDataValueField.top = new FormAttachment(lastControl, margin);
fdXmlDataValueField.left = new FormAttachment(wlXmlDataValueField, margin);
fdXmlDataValueField.right = new FormAttachment(100, 0);
wXmlDataValueField.setLayoutData(fdXmlDataValueField);
lastControl = wXmlDataValueField;
// Some buttons first, so that the dialog scales nicely...
//
wOK = new Button(shell, SWT.PUSH);
wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
wPreview = new Button(shell, SWT.PUSH);
wPreview.setText(BaseMessages.getString(PKG, "System.Button.Preview"));
wCancel = new Button(shell, SWT.PUSH);
wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
setButtonPositions(new Button[] { wOK, wPreview, wCancel }, margin, lastControl);
// Add listeners
lsCancel = new Listener() {
@Override
public void handleEvent(Event e) {
cancel();
}
};
lsOK = new Listener() {
@Override
public void handleEvent(Event e) {
ok();
}
};
lsPreview = new Listener() {
@Override
public void handleEvent(Event e) {
preview();
}
};
wCancel.addListener(SWT.Selection, lsCancel);
wOK.addListener(SWT.Selection, lsOK);
wPreview.addListener(SWT.Selection, lsPreview);
lsDef = new SelectionAdapter() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
ok();
}
};
wStepname.addSelectionListener(lsDef);
if (isReceivingInput) {
wFilenameCombo.addSelectionListener(lsDef);
} else {
wFilename.addSelectionListener(lsDef);
// Listen to the browse button next to the file name
wbbFilename.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
FileDialog dialog = new FileDialog(shell, SWT.OPEN);
dialog.setFilterExtensions(new String[] { "*.xml;*.XML", "*" });
if (wFilename.getText() != null) {
String fname = transMeta.environmentSubstitute(wFilename.getText());
dialog.setFileName(fname);
}
dialog.setFilterNames(new String[] { BaseMessages.getString(PKG, "System.FileType.XMLFiles"), BaseMessages.getString(PKG, "System.FileType.AllFiles") });
if (dialog.open() != null) {
String str = dialog.getFilterPath() + System.getProperty("file.separator") + dialog.getFileName();
wFilename.setText(str);
}
}
});
}
// Detect X or ALT-F4 or something that kills this window...
shell.addShellListener(new ShellAdapter() {
@Override
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;
}
Aggregations