Search in sources :

Example 11 with SelectionAdapterOptions

use of org.pentaho.di.ui.core.events.dialog.SelectionAdapterOptions 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 SelectionAdapterFileDialogTextVar(log, wFilename, transMeta, new SelectionAdapterOptions(SelectionOperation.FILE, new FilterType[] { FilterType.XML, FilterType.ALL }, FilterType.XML, new ProviderFilterType[] { ProviderFilterType.LOCAL })));
    }
    // 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;
}
Also used : KettleStepException(org.pentaho.di.core.exception.KettleStepException) Listener(org.eclipse.swt.widgets.Listener) ModifyListener(org.eclipse.swt.events.ModifyListener) ModifyListener(org.eclipse.swt.events.ModifyListener) RowMeta(org.pentaho.di.core.row.RowMeta) Label(org.eclipse.swt.widgets.Label) SelectionAdapterOptions(org.pentaho.di.ui.core.events.dialog.SelectionAdapterOptions) ShellEvent(org.eclipse.swt.events.ShellEvent) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) Shell(org.eclipse.swt.widgets.Shell) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Control(org.eclipse.swt.widgets.Control) Button(org.eclipse.swt.widgets.Button) SelectionEvent(org.eclipse.swt.events.SelectionEvent) SelectionAdapterFileDialogTextVar(org.pentaho.di.ui.core.events.dialog.SelectionAdapterFileDialogTextVar) FormAttachment(org.eclipse.swt.layout.FormAttachment) FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) ShellAdapter(org.eclipse.swt.events.ShellAdapter) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) Text(org.eclipse.swt.widgets.Text) TextVar(org.pentaho.di.ui.core.widget.TextVar) SelectionAdapterFileDialogTextVar(org.pentaho.di.ui.core.events.dialog.SelectionAdapterFileDialogTextVar) CCombo(org.eclipse.swt.custom.CCombo) Event(org.eclipse.swt.widgets.Event) ModifyEvent(org.eclipse.swt.events.ModifyEvent) ShellEvent(org.eclipse.swt.events.ShellEvent) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Display(org.eclipse.swt.widgets.Display)

Example 12 with SelectionAdapterOptions

use of org.pentaho.di.ui.core.events.dialog.SelectionAdapterOptions in project pentaho-kettle by pentaho.

the class GaInputStepDialog method open.

// builds and shows the dialog
@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, getInput());
    lsMod = new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            getInput().setChanged();
        }
    };
    backupChanged = getInput().hasChanged();
    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = Const.FORM_MARGIN;
    formLayout.marginHeight = Const.FORM_MARGIN;
    shell.setLayout(formLayout);
    shell.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Shell.Title"));
    middle = props.getMiddlePct();
    margin = Const.MARGIN;
    /**
     ***********************************************
     * // STEP NAME ENTRY
     ************************************************
     */
    // Stepname line
    wlStepname = new Label(shell, SWT.RIGHT);
    wlStepname.setText(BaseMessages.getString(PKG, "System.Label.StepName"));
    props.setLook(wlStepname);
    fdlStepname = new FormData();
    fdlStepname.left = new FormAttachment(0, 0);
    fdlStepname.right = new FormAttachment(middle, -margin);
    fdlStepname.top = new FormAttachment(0, margin);
    wlStepname.setLayoutData(fdlStepname);
    wStepname = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wStepname.setText(stepname);
    props.setLook(wStepname);
    wStepname.addModifyListener(lsMod);
    fdStepname = new FormData();
    fdStepname.left = new FormAttachment(middle, 0);
    fdStepname.top = new FormAttachment(0, margin);
    fdStepname.right = new FormAttachment(100, 0);
    wStepname.setLayoutData(fdStepname);
    /**
     ***********************************************
     * // GOOGLE ANALYTICS CONNECTION GROUP
     ************************************************
     */
    gConnect = new Group(shell, SWT.SHADOW_ETCHED_IN);
    gConnect.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.ConnectGroup.Label"));
    FormLayout gConnectLayout = new FormLayout();
    gConnectLayout.marginWidth = 3;
    gConnectLayout.marginHeight = 3;
    gConnect.setLayout(gConnectLayout);
    props.setLook(gConnect);
    FormData fdConnect = new FormData();
    fdConnect.left = new FormAttachment(0, 0);
    fdConnect.right = new FormAttachment(100, 0);
    fdConnect.top = new FormAttachment(wStepname, margin);
    gConnect.setLayoutData(fdConnect);
    // Google Analytics app name
    wlGaAppName = new Label(gConnect, SWT.RIGHT);
    wlGaAppName.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.AppName.Label"));
    props.setLook(wlGaAppName);
    FormData fdlGaAppName = new FormData();
    fdlGaAppName.top = new FormAttachment(0, margin);
    fdlGaAppName.left = new FormAttachment(0, 0);
    fdlGaAppName.right = new FormAttachment(middle, -margin);
    wlGaAppName.setLayoutData(fdlGaAppName);
    wGaAppName = new TextVar(transMeta, gConnect, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wGaAppName.addModifyListener(lsMod);
    wGaAppName.setToolTipText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.AppName.Tooltip"));
    props.setLook(wGaAppName);
    FormData fdGaAppName = new FormData();
    fdGaAppName.top = new FormAttachment(wStepname, margin);
    fdGaAppName.left = new FormAttachment(middle, 0);
    fdGaAppName.right = new FormAttachment(100, 0);
    wGaAppName.setLayoutData(fdGaAppName);
    createOauthServiceCredentialsControls();
    // custom profile definition
    wlGaCustomProfile = new Label(gConnect, SWT.RIGHT);
    wlGaCustomProfile.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Profile.CustomProfileEnabled.Label"));
    props.setLook(wlGaCustomProfile);
    FormData fdlGaCustomProfile = new FormData();
    fdlGaCustomProfile.top = new FormAttachment(keyFilename, margin);
    fdlGaCustomProfile.left = new FormAttachment(0, 0);
    fdlGaCustomProfile.right = new FormAttachment(middle, -margin);
    wlGaCustomProfile.setLayoutData(fdlGaCustomProfile);
    wCustomProfileEnabled = new Button(gConnect, SWT.CHECK);
    wCustomProfileEnabled.setToolTipText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Profile.CustomProfileEnabled.Tooltip"));
    props.setLook(wCustomProfileEnabled);
    wCustomProfileEnabled.pack(true);
    FormData fdCustomProfileEnabled = new FormData();
    fdCustomProfileEnabled.left = new FormAttachment(middle, 0);
    fdCustomProfileEnabled.top = new FormAttachment(keyFilename, margin);
    wCustomProfileEnabled.setLayoutData(fdCustomProfileEnabled);
    wCustomProfileEnabled.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            getInput().setChanged();
            setActive();
            if (wCustomProfileEnabled.getSelection()) {
                wGaCustomProfile.setFocus();
            } else {
                wGaProfile.setFocus();
            }
        }
    });
    wGaCustomProfile = new TextVar(transMeta, gConnect, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wGaCustomProfile.addModifyListener(lsMod);
    wGaCustomProfile.setToolTipText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Profile.CustomProfile.Tooltip"));
    props.setLook(wGaCustomProfile);
    wGaCustomProfileReference = new Link(gConnect, SWT.SINGLE);
    wGaCustomProfileReference.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Reference.Label"));
    props.setLook(wGaCustomProfileReference);
    wGaCustomProfileReference.addListener(SWT.Selection, new Listener() {

        @Override
        public void handleEvent(Event ev) {
            BareBonesBrowserLaunch.openURL(REFERENCE_TABLE_ID_URI);
        }
    });
    wGaCustomProfileReference.pack(true);
    FormData fdGaCustomProfile = new FormData();
    fdGaCustomProfile.top = new FormAttachment(keyFilename, margin);
    fdGaCustomProfile.left = new FormAttachment(wCustomProfileEnabled, margin);
    fdGaCustomProfile.right = new FormAttachment(100, -wGaCustomProfileReference.getBounds().width - margin);
    wGaCustomProfile.setLayoutData(fdGaCustomProfile);
    FormData fdGaCustomProfileReference = new FormData();
    fdGaCustomProfileReference.top = new FormAttachment(keyFilename, margin);
    fdGaCustomProfileReference.left = new FormAttachment(wGaCustomProfile, 0);
    fdGaCustomProfileReference.right = new FormAttachment(100, 0);
    wGaCustomProfileReference.setLayoutData(fdGaCustomProfileReference);
    // Google analytics profile
    wlGaProfile = new Label(gConnect, SWT.RIGHT);
    wlGaProfile.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Profile.Label"));
    props.setLook(wlGaProfile);
    FormData fdlGaProfile = new FormData();
    fdlGaProfile.top = new FormAttachment(wGaCustomProfile, margin);
    fdlGaProfile.left = new FormAttachment(0, 0);
    fdlGaProfile.right = new FormAttachment(middle, -margin);
    wlGaProfile.setLayoutData(fdlGaProfile);
    wGaProfile = new CCombo(gConnect, SWT.LEFT | SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
    props.setLook(wGaProfile);
    wGaProfile.addModifyListener(lsMod);
    wGaProfile.setToolTipText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Profile.Tooltip"));
    wGetProfiles = new Button(gConnect, SWT.PUSH);
    wGetProfiles.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Profile.GetProfilesButton.Label"));
    wGetProfiles.setToolTipText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Profile.GetProfilesButton.Tooltip"));
    props.setLook(wGetProfiles);
    wGetProfiles.addListener(SWT.Selection, new Listener() {

        @Override
        public void handleEvent(Event ev) {
            shell.getDisplay().asyncExec(new Runnable() {

                @Override
                public void run() {
                    readGaProfiles();
                }
            });
        }
    });
    wGetProfiles.pack(true);
    FormData fdGaProfile = new FormData();
    fdGaProfile.left = new FormAttachment(middle, 0);
    fdGaProfile.top = new FormAttachment(wGaCustomProfile, margin);
    fdGaProfile.right = new FormAttachment(100, -wGetProfiles.getBounds().width - margin);
    wGaProfile.setLayoutData(fdGaProfile);
    FormData fdGetProfiles = new FormData();
    fdGetProfiles.left = new FormAttachment(wGaProfile, 0);
    fdGetProfiles.top = new FormAttachment(wGaCustomProfile, margin);
    fdGetProfiles.right = new FormAttachment(100, 0);
    wGetProfiles.setLayoutData(fdGetProfiles);
    /**
     ***********************************************
     * // GOOGLE ANALYTICS QUERY GROUP
     ************************************************
     */
    Group gQuery = new Group(shell, SWT.SHADOW_ETCHED_IN);
    gQuery.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.QueryGroup.Label"));
    FormLayout gQueryLayout = new FormLayout();
    gQueryLayout.marginWidth = 3;
    gQueryLayout.marginHeight = 3;
    gQuery.setLayout(gQueryLayout);
    props.setLook(gQuery);
    // query start date
    wlQuStartDate = new Label(gQuery, SWT.RIGHT);
    wlQuStartDate.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.StartDate.Label"));
    props.setLook(wlQuStartDate);
    FormData fdlQuStartDate = new FormData();
    fdlQuStartDate.top = new FormAttachment(0, margin);
    fdlQuStartDate.left = new FormAttachment(0, 0);
    fdlQuStartDate.right = new FormAttachment(middle, -margin);
    wlQuStartDate.setLayoutData(fdlQuStartDate);
    wQuStartDate = new TextVar(transMeta, gQuery, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wQuStartDate.addModifyListener(lsMod);
    wQuStartDate.setToolTipText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.StartDate.Tooltip"));
    props.setLook(wQuStartDate);
    FormData fdQuStartDate = new FormData();
    fdQuStartDate.top = new FormAttachment(0, margin);
    fdQuStartDate.left = new FormAttachment(middle, 0);
    fdQuStartDate.right = new FormAttachment(100, 0);
    wQuStartDate.setLayoutData(fdQuStartDate);
    // query end date
    wlQuEndDate = new Label(gQuery, SWT.RIGHT);
    wlQuEndDate.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.EndDate.Label"));
    props.setLook(wlQuEndDate);
    FormData fdlQuEndDate = new FormData();
    fdlQuEndDate.top = new FormAttachment(wQuStartDate, margin);
    fdlQuEndDate.left = new FormAttachment(0, 0);
    fdlQuEndDate.right = new FormAttachment(middle, -margin);
    wlQuEndDate.setLayoutData(fdlQuEndDate);
    wQuEndDate = new TextVar(transMeta, gQuery, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wQuEndDate.addModifyListener(lsMod);
    wQuEndDate.setToolTipText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.EndDate.Tooltip"));
    props.setLook(wQuEndDate);
    FormData fdQuEndDate = new FormData();
    fdQuEndDate.top = new FormAttachment(wQuStartDate, margin);
    fdQuEndDate.left = new FormAttachment(middle, 0);
    fdQuEndDate.right = new FormAttachment(100, 0);
    wQuEndDate.setLayoutData(fdQuEndDate);
    // query dimensions
    wlQuDimensions = new Label(gQuery, SWT.RIGHT);
    wlQuDimensions.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Dimensions.Label"));
    props.setLook(wlQuDimensions);
    FormData fdlQuDimensions = new FormData();
    fdlQuDimensions.top = new FormAttachment(wQuEndDate, margin);
    fdlQuDimensions.left = new FormAttachment(0, 0);
    fdlQuDimensions.right = new FormAttachment(middle, -margin);
    wlQuDimensions.setLayoutData(fdlQuDimensions);
    wQuDimensions = new TextVar(transMeta, gQuery, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wQuDimensions.addModifyListener(lsMod);
    wQuDimensions.setToolTipText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Dimensions.Tooltip"));
    props.setLook(wQuDimensions);
    wQuDimensionsReference = new Link(gQuery, SWT.SINGLE);
    wQuDimensionsReference.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Reference.Label"));
    props.setLook(wQuDimensionsReference);
    wQuDimensionsReference.addListener(SWT.Selection, new Listener() {

        @Override
        public void handleEvent(Event ev) {
            BareBonesBrowserLaunch.openURL(REFERENCE_DIMENSIONS_URI);
        }
    });
    wQuDimensionsReference.pack(true);
    FormData fdQuDimensions = new FormData();
    fdQuDimensions.top = new FormAttachment(wQuEndDate, margin);
    fdQuDimensions.left = new FormAttachment(middle, 0);
    fdQuDimensions.right = new FormAttachment(100, -wQuDimensionsReference.getBounds().width - margin);
    wQuDimensions.setLayoutData(fdQuDimensions);
    FormData fdQuDimensionsReference = new FormData();
    fdQuDimensionsReference.top = new FormAttachment(wQuEndDate, margin);
    fdQuDimensionsReference.left = new FormAttachment(wQuDimensions, 0);
    fdQuDimensionsReference.right = new FormAttachment(100, 0);
    wQuDimensionsReference.setLayoutData(fdQuDimensionsReference);
    // query Metrics
    wlQuMetrics = new Label(gQuery, SWT.RIGHT);
    wlQuMetrics.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Metrics.Label"));
    props.setLook(wlQuMetrics);
    FormData fdlQuMetrics = new FormData();
    fdlQuMetrics.top = new FormAttachment(wQuDimensions, margin);
    fdlQuMetrics.left = new FormAttachment(0, 0);
    fdlQuMetrics.right = new FormAttachment(middle, -margin);
    wlQuMetrics.setLayoutData(fdlQuMetrics);
    wQuMetrics = new TextVar(transMeta, gQuery, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wQuMetrics.addModifyListener(lsMod);
    wQuMetrics.setToolTipText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Metrics.Tooltip"));
    props.setLook(wQuMetrics);
    wQuMetricsReference = new Link(gQuery, SWT.SINGLE);
    wQuMetricsReference.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Reference.Label"));
    props.setLook(wQuMetricsReference);
    wQuMetricsReference.addListener(SWT.Selection, new Listener() {

        @Override
        public void handleEvent(Event ev) {
            BareBonesBrowserLaunch.openURL(REFERENCE_METRICS_URI);
        }
    });
    wQuMetricsReference.pack(true);
    FormData fdQuMetrics = new FormData();
    fdQuMetrics.top = new FormAttachment(wQuDimensions, margin);
    fdQuMetrics.left = new FormAttachment(middle, 0);
    fdQuMetrics.right = new FormAttachment(100, -wQuMetricsReference.getBounds().width - margin);
    wQuMetrics.setLayoutData(fdQuMetrics);
    FormData fdQuMetricsReference = new FormData();
    fdQuMetricsReference.top = new FormAttachment(wQuDimensions, margin);
    fdQuMetricsReference.left = new FormAttachment(wQuMetrics, 0);
    fdQuMetricsReference.right = new FormAttachment(100, 0);
    wQuMetricsReference.setLayoutData(fdQuMetricsReference);
    // query filters
    wlQuFilters = new Label(gQuery, SWT.RIGHT);
    wlQuFilters.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Filters.Label"));
    props.setLook(wlQuFilters);
    FormData fdlQuFilters = new FormData();
    fdlQuFilters.top = new FormAttachment(wQuMetrics, margin);
    fdlQuFilters.left = new FormAttachment(0, 0);
    fdlQuFilters.right = new FormAttachment(middle, -margin);
    wlQuFilters.setLayoutData(fdlQuFilters);
    wQuFilters = new TextVar(transMeta, gQuery, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wQuFilters.addModifyListener(lsMod);
    wQuFilters.setToolTipText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Filters.Tooltip"));
    props.setLook(wQuFilters);
    wQuFiltersReference = new Link(gQuery, SWT.SINGLE);
    wQuFiltersReference.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Reference.Label"));
    props.setLook(wQuFiltersReference);
    wQuFiltersReference.addListener(SWT.Selection, new Listener() {

        @Override
        public void handleEvent(Event ev) {
            BareBonesBrowserLaunch.openURL(REFERENCE_FILTERS_URI);
        }
    });
    wQuFiltersReference.pack(true);
    FormData fdQuFilters = new FormData();
    fdQuFilters.top = new FormAttachment(wQuMetrics, margin);
    fdQuFilters.left = new FormAttachment(middle, 0);
    fdQuFilters.right = new FormAttachment(100, -wQuFiltersReference.getBounds().width - margin);
    wQuFilters.setLayoutData(fdQuFilters);
    FormData fdQuFiltersReference = new FormData();
    fdQuFiltersReference.top = new FormAttachment(wQuMetrics, margin);
    fdQuFiltersReference.left = new FormAttachment(wQuFilters, 0);
    fdQuFiltersReference.right = new FormAttachment(100, 0);
    wQuFiltersReference.setLayoutData(fdQuFiltersReference);
    // query Sort
    wlQuSort = new Label(gQuery, SWT.RIGHT);
    wlQuSort.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Sort.Label"));
    props.setLook(wlQuSort);
    FormData fdlQuSort = new FormData();
    fdlQuSort.top = new FormAttachment(wQuFilters, margin);
    fdlQuSort.left = new FormAttachment(0, 0);
    fdlQuSort.right = new FormAttachment(middle, -margin);
    wlQuSort.setLayoutData(fdlQuSort);
    wQuSort = new TextVar(transMeta, gQuery, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wQuSort.addModifyListener(lsMod);
    wQuSort.setToolTipText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Sort.Tooltip"));
    props.setLook(wQuSort);
    wQuSortReference = new Link(gQuery, SWT.SINGLE);
    wQuSortReference.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Reference.Label"));
    props.setLook(wQuSortReference);
    wQuSortReference.addListener(SWT.Selection, new Listener() {

        @Override
        public void handleEvent(Event ev) {
            BareBonesBrowserLaunch.openURL(REFERENCE_SORT_URI);
        }
    });
    wQuSortReference.pack(true);
    FormData fdQuSort = new FormData();
    fdQuSort.top = new FormAttachment(wQuFilters, margin);
    fdQuSort.left = new FormAttachment(middle, 0);
    fdQuSort.right = new FormAttachment(100, -wQuSortReference.getBounds().width - margin);
    wQuSort.setLayoutData(fdQuSort);
    FormData fdQuSortReference = new FormData();
    fdQuSortReference.top = new FormAttachment(wQuFilters, margin);
    fdQuSortReference.left = new FormAttachment(wQuSort, 0);
    fdQuSortReference.right = new FormAttachment(100, 0);
    wQuSortReference.setLayoutData(fdQuSortReference);
    // custom segment definition
    wlQuUseSegment = new Label(gQuery, SWT.RIGHT);
    wlQuUseSegment.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.UseSegment.Label"));
    props.setLook(wlQuUseSegment);
    FormData fdlQuUseSegment = new FormData();
    fdlQuUseSegment.top = new FormAttachment(wQuSort, margin);
    fdlQuUseSegment.left = new FormAttachment(0, 0);
    fdlQuUseSegment.right = new FormAttachment(middle, -margin);
    wlQuUseSegment.setLayoutData(fdlQuUseSegment);
    wUseSegmentEnabled = new Button(gQuery, SWT.CHECK);
    props.setLook(wUseSegmentEnabled);
    wUseSegmentEnabled.pack(true);
    FormData fdUseSegmentEnabled = new FormData();
    fdUseSegmentEnabled.left = new FormAttachment(middle, 0);
    fdUseSegmentEnabled.top = new FormAttachment(wQuSort, margin);
    wUseSegmentEnabled.setLayoutData(fdUseSegmentEnabled);
    wUseSegmentEnabled.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            getInput().setChanged();
            setActive();
            if (wUseSegmentEnabled.getSelection()) {
                if (wCustomSegmentEnabled.getSelection()) {
                    wQuCustomSegment.setFocus();
                } else {
                    wQuSegment.setFocus();
                }
            }
        }
    });
    // custom segment definition
    wlQuCustomSegment = new Label(gQuery, SWT.RIGHT);
    wlQuCustomSegment.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.CustomSegment.Label"));
    props.setLook(wlQuCustomSegment);
    FormData fdlQuCustomSegment = new FormData();
    fdlQuCustomSegment.top = new FormAttachment(wUseSegmentEnabled, margin);
    fdlQuCustomSegment.left = new FormAttachment(0, 0);
    fdlQuCustomSegment.right = new FormAttachment(middle, -margin);
    wlQuCustomSegment.setLayoutData(fdlQuCustomSegment);
    wCustomSegmentEnabled = new Button(gQuery, SWT.CHECK);
    props.setLook(wCustomSegmentEnabled);
    wCustomSegmentEnabled.pack(true);
    FormData fdCustomSegmentEnabled = new FormData();
    fdCustomSegmentEnabled.left = new FormAttachment(middle, 0);
    fdCustomSegmentEnabled.top = new FormAttachment(wUseSegmentEnabled, margin);
    wCustomSegmentEnabled.setLayoutData(fdCustomSegmentEnabled);
    wCustomSegmentEnabled.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            getInput().setChanged();
            setActive();
            if (wCustomSegmentEnabled.getSelection()) {
                wQuCustomSegment.setFocus();
            } else {
                wQuSegment.setFocus();
            }
        }
    });
    wQuCustomSegment = new TextVar(transMeta, gQuery, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wQuCustomSegment.addModifyListener(lsMod);
    wQuCustomSegment.setToolTipText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.CustomSegment.Tooltip"));
    props.setLook(wQuCustomSegment);
    wQuCustomSegmentReference = new Link(gQuery, SWT.SINGLE);
    wQuCustomSegmentReference.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Reference.Label"));
    props.setLook(wQuCustomSegmentReference);
    wQuCustomSegmentReference.addListener(SWT.Selection, new Listener() {

        @Override
        public void handleEvent(Event ev) {
            BareBonesBrowserLaunch.openURL(REFERENCE_SEGMENT_URI);
        }
    });
    wQuCustomSegmentReference.pack(true);
    FormData fdQuCustomSegment = new FormData();
    fdQuCustomSegment.top = new FormAttachment(wUseSegmentEnabled, margin);
    fdQuCustomSegment.left = new FormAttachment(wCustomSegmentEnabled, margin);
    fdQuCustomSegment.right = new FormAttachment(100, -wQuCustomSegmentReference.getBounds().width - margin);
    wQuCustomSegment.setLayoutData(fdQuCustomSegment);
    FormData fdQuCustomSegmentReference = new FormData();
    fdQuCustomSegmentReference.top = new FormAttachment(wUseSegmentEnabled, margin);
    fdQuCustomSegmentReference.left = new FormAttachment(wQuCustomSegment, 0);
    fdQuCustomSegmentReference.right = new FormAttachment(100, 0);
    wQuCustomSegmentReference.setLayoutData(fdQuCustomSegmentReference);
    // segment selection
    wlQuSegment = new Label(gQuery, SWT.RIGHT);
    wlQuSegment.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Segment.Label"));
    props.setLook(wlQuSegment);
    FormData fdlQuSegment = new FormData();
    fdlQuSegment.top = new FormAttachment(wQuCustomSegment, margin);
    fdlQuSegment.left = new FormAttachment(0, 0);
    fdlQuSegment.right = new FormAttachment(middle, -margin);
    wlQuSegment.setLayoutData(fdlQuSegment);
    wQuSegment = new CCombo(gQuery, SWT.LEFT | SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
    props.setLook(wQuSegment);
    wQuSegment.addModifyListener(lsMod);
    wQuSegment.setToolTipText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Segment.Tooltip"));
    wGetSegments = new Button(gQuery, SWT.PUSH);
    wGetSegments.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.GetSegmentsButton.Label"));
    wGetSegments.setToolTipText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.GetSegmentsButton.Tooltip"));
    props.setLook(wGetSegments);
    wGetSegments.addListener(SWT.Selection, new Listener() {

        @Override
        public void handleEvent(Event ev) {
            shell.getDisplay().asyncExec(new Runnable() {

                @Override
                public void run() {
                    readGaSegments();
                }
            });
        }
    });
    wGetSegments.pack(true);
    FormData fdQuSegment = new FormData();
    fdQuSegment.left = new FormAttachment(middle, 0);
    fdQuSegment.top = new FormAttachment(wQuCustomSegment, margin);
    fdQuSegment.right = new FormAttachment(100, -wGetSegments.getBounds().width - margin);
    wQuSegment.setLayoutData(fdQuSegment);
    FormData fdGetSegments = new FormData();
    fdGetSegments.left = new FormAttachment(wQuSegment, 0);
    fdGetSegments.top = new FormAttachment(wQuCustomSegment, margin);
    fdGetSegments.right = new FormAttachment(100, 0);
    wGetSegments.setLayoutData(fdGetSegments);
    // samplingLevel selection
    wlQuSamplingLevel = new Label(gQuery, SWT.RIGHT);
    wlQuSamplingLevel.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.SamplingLevel.Label"));
    props.setLook(wlQuSamplingLevel);
    FormData fdlQuSamplingLevel = new FormData();
    fdlQuSamplingLevel.top = new FormAttachment(wQuSegment, margin);
    fdlQuSamplingLevel.left = new FormAttachment(0, 0);
    fdlQuSamplingLevel.right = new FormAttachment(middle, -margin);
    wlQuSamplingLevel.setLayoutData(fdlQuSamplingLevel);
    wQuSamplingLevel = new CCombo(gQuery, SWT.BORDER | SWT.READ_ONLY);
    props.setLook(wQuSamplingLevel);
    wQuSamplingLevelReference = new Link(gQuery, SWT.SINGLE);
    wQuSamplingLevelReference.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.Reference.Label"));
    props.setLook(wQuSamplingLevelReference);
    wQuSamplingLevelReference.addListener(SWT.Selection, new Listener() {

        @Override
        public void handleEvent(Event ev) {
            BareBonesBrowserLaunch.openURL(REFERENCE_SAMPLING_LEVEL_URI);
        }
    });
    wQuSamplingLevelReference.pack(true);
    wQuSamplingLevel.addModifyListener(lsMod);
    wQuSamplingLevel.setToolTipText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Query.SamplingLevel.Tooltip"));
    FormData fdQuSamplingLevel = new FormData();
    fdQuSamplingLevel.left = new FormAttachment(middle, 0);
    fdQuSamplingLevel.top = new FormAttachment(wQuSegment, margin);
    fdQuSamplingLevel.right = new FormAttachment(100, -wQuSamplingLevelReference.getBounds().width - margin);
    FormData fdQuSamplingLevelReference = new FormData();
    fdQuSamplingLevelReference.top = new FormAttachment(wQuSegment, margin);
    fdQuSamplingLevelReference.left = new FormAttachment(wQuDimensions, 0);
    fdQuSamplingLevelReference.right = new FormAttachment(100, 0);
    wQuSamplingLevelReference.setLayoutData(fdQuSamplingLevelReference);
    wQuSamplingLevel.setLayoutData(fdQuSamplingLevel);
    wQuSamplingLevel.setItems(GaInputStepMeta.TYPE_SAMPLING_LEVEL_CODE);
    wQuSamplingLevel.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            getInput().setChanged();
        }
    });
    FormData fdQueryGroup = new FormData();
    fdQueryGroup.left = new FormAttachment(0, 0);
    fdQueryGroup.right = new FormAttachment(100, 0);
    fdQueryGroup.top = new FormAttachment(gConnect, margin);
    gQuery.setLayoutData(fdQueryGroup);
    gQuery.setTabList(new Control[] { wQuStartDate, wQuEndDate, wQuDimensions, wQuMetrics, wQuFilters, wQuSort, wUseSegmentEnabled, wCustomSegmentEnabled, wQuCustomSegment, wQuSegment, wGetSegments });
    // Limit input ...
    wlLimit = new Label(shell, SWT.RIGHT);
    wlLimit.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.LimitSize.Label"));
    props.setLook(wlLimit);
    FormData fdlLimit = new FormData();
    fdlLimit.left = new FormAttachment(0, 0);
    fdlLimit.right = new FormAttachment(middle, -margin);
    fdlLimit.bottom = new FormAttachment(100, -50);
    wlLimit.setLayoutData(fdlLimit);
    wLimit = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wLimit.setToolTipText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.LimitSize.Tooltip"));
    props.setLook(wLimit);
    wLimit.addModifyListener(lsMod);
    FormData fdLimit = new FormData();
    fdLimit.left = new FormAttachment(middle, 0);
    fdLimit.right = new FormAttachment(100, 0);
    fdLimit.bottom = new FormAttachment(100, -50);
    wLimit.setLayoutData(fdLimit);
    /**
     ***********************************************
     * // KEY / LOOKUP TABLE
     ************************************************
     */
    wlFields = new Link(shell, SWT.NONE);
    wlFields.setText(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.Return.Label"));
    props.setLook(wlFields);
    wlFields.addListener(SWT.Selection, new Listener() {

        @Override
        public void handleEvent(Event ev) {
            BareBonesBrowserLaunch.openURL(REFERENCE_DIMENSION_AND_METRIC_URI);
        }
    });
    FormData fdlReturn = new FormData();
    fdlReturn.left = new FormAttachment(0, 0);
    fdlReturn.top = new FormAttachment(gQuery, margin);
    wlFields.setLayoutData(fdlReturn);
    int fieldWidgetCols = 5;
    int fieldWidgetRows = (getInput().getFeedField() != null ? getInput().getFeedField().length : 1);
    ColumnInfo[] ciKeys = new ColumnInfo[fieldWidgetCols];
    ciKeys[0] = new ColumnInfo(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.ColumnInfo.FeedFieldType"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { GaInputStepMeta.FIELD_TYPE_DIMENSION, GaInputStepMeta.FIELD_TYPE_METRIC, GaInputStepMeta.FIELD_TYPE_DATA_SOURCE_PROPERTY, GaInputStepMeta.FIELD_TYPE_DATA_SOURCE_FIELD }, true);
    ciKeys[1] = new ColumnInfo(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.ColumnInfo.FeedField"), ColumnInfo.COLUMN_TYPE_TEXT, false, false);
    ciKeys[1].setUsingVariables(true);
    ciKeys[2] = new ColumnInfo(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.ColumnInfo.RenameTo"), ColumnInfo.COLUMN_TYPE_TEXT, false, false);
    ciKeys[3] = new ColumnInfo(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.ColumnInfo.Type"), ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaBase.getTypes());
    ciKeys[4] = new ColumnInfo(BaseMessages.getString(PKG, "GoogleAnalyticsDialog.ColumnInfo.Format"), ColumnInfo.COLUMN_TYPE_FORMAT, 4);
    setTableView(new TableView(transMeta, shell, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL, ciKeys, fieldWidgetRows, lsMod, props));
    FormData fdReturn = new FormData();
    fdReturn.left = new FormAttachment(0, 0);
    fdReturn.top = new FormAttachment(wlFields, margin);
    fdReturn.right = new FormAttachment(100, 0);
    fdReturn.bottom = new FormAttachment(wLimit, -margin);
    getTableView().setLayoutData(fdReturn);
    /**
     ***********************************************
     * // OK AND CANCEL 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"));
    wGet = new Button(shell, SWT.PUSH);
    wGet.setText(BaseMessages.getString(PKG, "System.Button.GetFields"));
    wGet.addListener(SWT.Selection, new Listener() {

        @Override
        public void handleEvent(Event e) {
            getFields();
        }
    });
    wPreview = new Button(shell, SWT.PUSH);
    wPreview.setText(BaseMessages.getString(PKG, "System.Button.Preview"));
    wPreview.addListener(SWT.Selection, new Listener() {

        @Override
        public void handleEvent(Event ev) {
            preview();
        }
    });
    BaseStepDialog.positionBottomButtons(shell, new Button[] { wOK, wGet, wPreview, wCancel }, margin, wLimit);
    // Add listeners
    lsCancel = new Listener() {

        @Override
        public void handleEvent(Event e) {
            cancel();
        }
    };
    lsOK = new Listener() {

        @Override
        public void handleEvent(Event e) {
            ok();
        }
    };
    wCancel.addListener(SWT.Selection, lsCancel);
    wOK.addListener(SWT.Selection, lsOK);
    /**
     ***********************************************
     * // DEFAULT ACTION LISTENERS
     ************************************************
     */
    lsDef = new SelectionAdapter() {

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            ok();
        }
    };
    wStepname.addSelectionListener(lsDef);
    wGaCustomProfile.addSelectionListener(lsDef);
    wQuStartDate.addSelectionListener(lsDef);
    wQuEndDate.addSelectionListener(lsDef);
    wQuDimensions.addSelectionListener(lsDef);
    wQuMetrics.addSelectionListener(lsDef);
    wQuFilters.addSelectionListener(lsDef);
    wQuSort.addSelectionListener(lsDef);
    wQuCustomSegment.addSelectionListener(lsDef);
    wQuSamplingLevel.addSelectionListener(lsDef);
    // Detect X or ALT-F4 or something that kills this window...
    shell.addShellListener(new ShellAdapter() {

        @Override
        public void shellClosed(ShellEvent e) {
            cancel();
        }
    });
    fileChooser.addSelectionListener(new SelectionAdapterFileDialogTextVar(log, keyFilename, transMeta, new SelectionAdapterOptions(SelectionOperation.FILE, new FilterType[] { FilterType.P12, FilterType.ALL }, FilterType.P12, new ProviderFilterType[] { ProviderFilterType.LOCAL })));
    // Set the shell size, based upon previous time...
    setSize();
    /**
     ***********************************************
     * // POPULATE AND OPEN DIALOG
     ************************************************
     */
    getData();
    getInput().setChanged(backupChanged);
    wStepname.setFocus();
    shell.setTabList(new Control[] { wStepname, gConnect, gQuery, getTableView() });
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
    return stepname;
}
Also used : Group(org.eclipse.swt.widgets.Group) Listener(org.eclipse.swt.widgets.Listener) ModifyListener(org.eclipse.swt.events.ModifyListener) ModifyListener(org.eclipse.swt.events.ModifyListener) Label(org.eclipse.swt.widgets.Label) ColumnInfo(org.pentaho.di.ui.core.widget.ColumnInfo) ShellEvent(org.eclipse.swt.events.ShellEvent) SelectionAdapterOptions(org.pentaho.di.ui.core.events.dialog.SelectionAdapterOptions) Shell(org.eclipse.swt.widgets.Shell) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Button(org.eclipse.swt.widgets.Button) SelectionEvent(org.eclipse.swt.events.SelectionEvent) SelectionAdapterFileDialogTextVar(org.pentaho.di.ui.core.events.dialog.SelectionAdapterFileDialogTextVar) FormAttachment(org.eclipse.swt.layout.FormAttachment) TableView(org.pentaho.di.ui.core.widget.TableView) FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) ShellAdapter(org.eclipse.swt.events.ShellAdapter) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Text(org.eclipse.swt.widgets.Text) TextVar(org.pentaho.di.ui.core.widget.TextVar) SelectionAdapterFileDialogTextVar(org.pentaho.di.ui.core.events.dialog.SelectionAdapterFileDialogTextVar) CCombo(org.eclipse.swt.custom.CCombo) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Event(org.eclipse.swt.widgets.Event) ShellEvent(org.eclipse.swt.events.ShellEvent) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Link(org.eclipse.swt.widgets.Link) Display(org.eclipse.swt.widgets.Display)

Example 13 with SelectionAdapterOptions

use of org.pentaho.di.ui.core.events.dialog.SelectionAdapterOptions in project pentaho-kettle by pentaho.

the class JobEntryTransDialog method selectTransformation.

private void selectTransformation(ProviderFilterType providerFilterType) {
    SelectionAdapterFileDialogTextVar selectionAdapterFileDialogTextVar = new SelectionAdapterFileDialogTextVar(log, wPath, jobMeta, new SelectionAdapterOptions(SelectionOperation.FILE, new FilterType[] { FilterType.KTR, FilterType.XML, FilterType.ALL }, FilterType.KTR, new ProviderFilterType[] { providerFilterType }));
    selectionAdapterFileDialogTextVar.widgetSelected(null);
    if (wPath.getText() != null && Const.isWindows()) {
        wPath.setText(wPath.getText().replace('\\', '/'));
    }
}
Also used : FilterType(org.pentaho.di.ui.core.events.dialog.FilterType) ProviderFilterType(org.pentaho.di.ui.core.events.dialog.ProviderFilterType) ProviderFilterType(org.pentaho.di.ui.core.events.dialog.ProviderFilterType) SelectionAdapterOptions(org.pentaho.di.ui.core.events.dialog.SelectionAdapterOptions) SelectionAdapterFileDialogTextVar(org.pentaho.di.ui.core.events.dialog.SelectionAdapterFileDialogTextVar)

Example 14 with SelectionAdapterOptions

use of org.pentaho.di.ui.core.events.dialog.SelectionAdapterOptions in project pentaho-kettle by pentaho.

the class ExcelWriterStepDialog 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);
    SelectionAdapter lsSel = new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
        }
    };
    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, "ExcelWriterDialog.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);
    ScrolledComposite sc = new ScrolledComposite(shell, SWT.H_SCROLL | SWT.V_SCROLL);
    wTabFolder = new CTabFolder(sc, SWT.BORDER);
    props.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
    // ////////////////////////
    // START OF FILE TAB///
    // /
    wFileTab = new CTabItem(wTabFolder, SWT.NONE);
    wFileTab.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.FileTab.TabTitle"));
    Composite wFileComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wFileComp);
    FormLayout fileLayout = new FormLayout();
    fileLayout.marginWidth = 3;
    fileLayout.marginHeight = 3;
    wFileComp.setLayout(fileLayout);
    Group fileGroup = new Group(wFileComp, SWT.SHADOW_NONE);
    props.setLook(fileGroup);
    fileGroup.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.fileGroup.Label"));
    FormLayout fileGroupgroupLayout = new FormLayout();
    fileGroupgroupLayout.marginWidth = 10;
    fileGroupgroupLayout.marginHeight = 10;
    fileGroup.setLayout(fileGroupgroupLayout);
    // Filename line
    wlFilename = new Label(fileGroup, SWT.RIGHT);
    wlFilename.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.Filename.Label"));
    props.setLook(wlFilename);
    fdlFilename = new FormData();
    fdlFilename.left = new FormAttachment(0, 0);
    fdlFilename.top = new FormAttachment(0, margin);
    fdlFilename.right = new FormAttachment(middle, -margin);
    wlFilename.setLayoutData(fdlFilename);
    wbFilename = new Button(fileGroup, SWT.PUSH | SWT.CENTER);
    props.setLook(wbFilename);
    wbFilename.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
    fdbFilename = new FormData();
    fdbFilename.right = new FormAttachment(100, 0);
    fdbFilename.top = new FormAttachment(0, 0);
    wbFilename.setLayoutData(fdbFilename);
    wFilename = new TextVar(transMeta, fileGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wFilename);
    wFilename.addModifyListener(lsMod);
    wFilename.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.Filename.Tooltip"));
    fdFilename = new FormData();
    fdFilename.left = new FormAttachment(middle, 0);
    fdFilename.top = new FormAttachment(0, margin);
    fdFilename.right = new FormAttachment(wbFilename, -margin);
    wFilename.setLayoutData(fdFilename);
    // Extension line
    wlExtension = new Label(fileGroup, SWT.RIGHT);
    wlExtension.setText(BaseMessages.getString(PKG, "System.Label.Extension"));
    props.setLook(wlExtension);
    fdlExtension = new FormData();
    fdlExtension.left = new FormAttachment(0, 0);
    fdlExtension.top = new FormAttachment(wFilename, margin);
    fdlExtension.right = new FormAttachment(middle, -margin);
    wlExtension.setLayoutData(fdlExtension);
    wExtension = new CCombo(fileGroup, SWT.LEFT | SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
    String xlsLabel = BaseMessages.getString(PKG, "ExcelWriterDialog.FormatXLS.Label");
    String xlsxLabel = BaseMessages.getString(PKG, "ExcelWriterDialog.FormatXLSX.Label");
    wExtension.setItems(new String[] { xlsLabel, xlsxLabel });
    wExtension.setData(xlsLabel, "xls");
    wExtension.setData(xlsxLabel, "xlsx");
    props.setLook(wExtension);
    wExtension.addModifyListener(lsMod);
    wExtension.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
            enableExtension();
        }
    });
    wExtension.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.Extension.Tooltip"));
    fdExtension = new FormData();
    fdExtension.left = new FormAttachment(middle, 0);
    fdExtension.top = new FormAttachment(wFilename, margin);
    fdExtension.right = new FormAttachment(wbFilename, -margin);
    wExtension.setLayoutData(fdExtension);
    wlStreamData = new Label(fileGroup, SWT.RIGHT);
    wlStreamData.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.StreamData.Label"));
    props.setLook(wlStreamData);
    fdlStreamData = new FormData();
    fdlStreamData.left = new FormAttachment(0, 0);
    fdlStreamData.top = new FormAttachment(wExtension, margin);
    fdlStreamData.right = new FormAttachment(middle, -margin);
    wlStreamData.setLayoutData(fdlStreamData);
    wStreamData = new Button(fileGroup, SWT.CHECK);
    props.setLook(wStreamData);
    fdStreamData = new FormData();
    fdStreamData.left = new FormAttachment(middle, 0);
    fdStreamData.top = new FormAttachment(wExtension, margin);
    fdStreamData.right = new FormAttachment(100, 0);
    wStreamData.setLayoutData(fdStreamData);
    wStreamData.addSelectionListener(lsSel);
    // split every x rows
    wlSplitEvery = new Label(fileGroup, SWT.RIGHT);
    wlSplitEvery.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.SplitEvery.Label"));
    props.setLook(wlSplitEvery);
    fdlSplitEvery = new FormData();
    fdlSplitEvery.left = new FormAttachment(0, 0);
    fdlSplitEvery.top = new FormAttachment(wStreamData, margin);
    fdlSplitEvery.right = new FormAttachment(middle, -margin);
    wlSplitEvery.setLayoutData(fdlSplitEvery);
    wSplitEvery = new Text(fileGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wSplitEvery);
    wSplitEvery.addModifyListener(lsMod);
    wSplitEvery.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.SplitEvery.Tooltip"));
    fdSplitEvery = new FormData();
    fdSplitEvery.left = new FormAttachment(middle, 0);
    fdSplitEvery.top = new FormAttachment(wStreamData, margin);
    fdSplitEvery.right = new FormAttachment(100, 0);
    wSplitEvery.setLayoutData(fdSplitEvery);
    // Create multi-part file?
    wlAddStepnr = new Label(fileGroup, SWT.RIGHT);
    wlAddStepnr.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.AddStepnr.Label"));
    props.setLook(wlAddStepnr);
    fdlAddStepnr = new FormData();
    fdlAddStepnr.left = new FormAttachment(0, 0);
    fdlAddStepnr.top = new FormAttachment(wSplitEvery, margin);
    fdlAddStepnr.right = new FormAttachment(middle, -margin);
    wlAddStepnr.setLayoutData(fdlAddStepnr);
    wAddStepnr = new Button(fileGroup, SWT.CHECK);
    props.setLook(wAddStepnr);
    fdAddStepnr = new FormData();
    fdAddStepnr.left = new FormAttachment(middle, 0);
    fdAddStepnr.top = new FormAttachment(wSplitEvery, margin);
    fdAddStepnr.right = new FormAttachment(100, 0);
    wAddStepnr.setLayoutData(fdAddStepnr);
    wAddStepnr.addSelectionListener(lsSel);
    // Create multi-part file?
    wlAddDate = new Label(fileGroup, SWT.RIGHT);
    wlAddDate.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.AddDate.Label"));
    props.setLook(wlAddDate);
    fdlAddDate = new FormData();
    fdlAddDate.left = new FormAttachment(0, 0);
    fdlAddDate.top = new FormAttachment(wAddStepnr, margin);
    fdlAddDate.right = new FormAttachment(middle, -margin);
    wlAddDate.setLayoutData(fdlAddDate);
    wAddDate = new Button(fileGroup, SWT.CHECK);
    props.setLook(wAddDate);
    fdAddDate = new FormData();
    fdAddDate.left = new FormAttachment(middle, 0);
    fdAddDate.top = new FormAttachment(wAddStepnr, margin);
    fdAddDate.right = new FormAttachment(100, 0);
    wAddDate.setLayoutData(fdAddDate);
    wAddDate.addSelectionListener(lsSel);
    // Create multi-part file?
    wlAddTime = new Label(fileGroup, SWT.RIGHT);
    wlAddTime.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.AddTime.Label"));
    props.setLook(wlAddTime);
    fdlAddTime = new FormData();
    fdlAddTime.left = new FormAttachment(0, 0);
    fdlAddTime.top = new FormAttachment(wAddDate, margin);
    fdlAddTime.right = new FormAttachment(middle, -margin);
    wlAddTime.setLayoutData(fdlAddTime);
    wAddTime = new Button(fileGroup, SWT.CHECK);
    props.setLook(wAddTime);
    fdAddTime = new FormData();
    fdAddTime.left = new FormAttachment(middle, 0);
    fdAddTime.top = new FormAttachment(wAddDate, margin);
    fdAddTime.right = new FormAttachment(100, 0);
    wAddTime.setLayoutData(fdAddTime);
    wAddTime.addSelectionListener(lsSel);
    // Specify date time format?
    wlSpecifyFormat = new Label(fileGroup, SWT.RIGHT);
    wlSpecifyFormat.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.SpecifyFormat.Label"));
    props.setLook(wlSpecifyFormat);
    fdlSpecifyFormat = new FormData();
    fdlSpecifyFormat.left = new FormAttachment(0, 0);
    fdlSpecifyFormat.top = new FormAttachment(wAddTime, margin);
    fdlSpecifyFormat.right = new FormAttachment(middle, -margin);
    wlSpecifyFormat.setLayoutData(fdlSpecifyFormat);
    wSpecifyFormat = new Button(fileGroup, SWT.CHECK);
    props.setLook(wSpecifyFormat);
    wSpecifyFormat.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.SpecifyFormat.Tooltip"));
    fdSpecifyFormat = new FormData();
    fdSpecifyFormat.left = new FormAttachment(middle, 0);
    fdSpecifyFormat.top = new FormAttachment(wAddTime, margin);
    fdSpecifyFormat.right = new FormAttachment(100, 0);
    wSpecifyFormat.setLayoutData(fdSpecifyFormat);
    wSpecifyFormat.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
            setDateTimeFormat();
        }
    });
    // Prepare a list of possible DateTimeFormats...
    String[] dats = Const.getDateFormats();
    // DateTimeFormat
    wlDateTimeFormat = new Label(fileGroup, SWT.RIGHT);
    wlDateTimeFormat.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.DateTimeFormat.Label"));
    props.setLook(wlDateTimeFormat);
    fdlDateTimeFormat = new FormData();
    fdlDateTimeFormat.left = new FormAttachment(0, 0);
    fdlDateTimeFormat.top = new FormAttachment(wSpecifyFormat, margin);
    fdlDateTimeFormat.right = new FormAttachment(middle, -margin);
    wlDateTimeFormat.setLayoutData(fdlDateTimeFormat);
    wDateTimeFormat = new CCombo(fileGroup, SWT.BORDER | SWT.READ_ONLY);
    wDateTimeFormat.setEditable(true);
    props.setLook(wDateTimeFormat);
    wDateTimeFormat.addModifyListener(lsMod);
    fdDateTimeFormat = new FormData();
    fdDateTimeFormat.left = new FormAttachment(middle, 0);
    fdDateTimeFormat.top = new FormAttachment(wSpecifyFormat, margin);
    fdDateTimeFormat.right = new FormAttachment(100, 0);
    wDateTimeFormat.setLayoutData(fdDateTimeFormat);
    for (int x = 0; x < dats.length; x++) {
        wDateTimeFormat.add(dats[x]);
    }
    wbShowFiles = new Button(fileGroup, SWT.PUSH | SWT.CENTER);
    props.setLook(wbShowFiles);
    wbShowFiles.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.ShowFiles.Button"));
    fdbShowFiles = new FormData();
    fdbShowFiles.left = new FormAttachment(middle, 0);
    fdbShowFiles.top = new FormAttachment(wDateTimeFormat, margin * 3);
    wbShowFiles.setLayoutData(fdbShowFiles);
    wbShowFiles.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            ExcelWriterStepMeta tfoi = new ExcelWriterStepMeta();
            getInfo(tfoi);
            String[] files = tfoi.getFiles(transMeta);
            if (files != null && files.length > 0) {
                EnterSelectionDialog esd = new EnterSelectionDialog(shell, files, BaseMessages.getString(PKG, "ExcelWriterDialog.SelectOutputFiles.DialogTitle"), BaseMessages.getString(PKG, "ExcelWriterDialog.SelectOutputFiles.DialogMessage"));
                esd.setViewOnly();
                esd.open();
            } else {
                MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
                mb.setMessage(BaseMessages.getString(PKG, "ExcelWriterDialog.NoFilesFound.DialogMessage"));
                mb.setText(BaseMessages.getString(PKG, "System.Dialog.Error.Title"));
                mb.open();
            }
        }
    });
    // If output file exists line
    wlIfFileExists = new Label(fileGroup, SWT.RIGHT);
    wlIfFileExists.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.IfFileExists.Label"));
    props.setLook(wlIfFileExists);
    fdlIfFileExists = new FormData();
    fdlIfFileExists.left = new FormAttachment(0, 0);
    fdlIfFileExists.top = new FormAttachment(wbShowFiles, 2 * margin, margin);
    fdlIfFileExists.right = new FormAttachment(middle, -margin);
    wlIfFileExists.setLayoutData(fdlIfFileExists);
    // wIfFileExists=new TextVar(transMeta,wFileComp, SWT.SINGLE | SWT.LEFT |
    // SWT.BORDER);
    wIfFileExists = new CCombo(fileGroup, SWT.LEFT | SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
    String createNewLabel = BaseMessages.getString(PKG, "ExcelWriterDialog.IfFileExists.CreateNew.Label");
    String reuseLabel = BaseMessages.getString(PKG, "ExcelWriterDialog.IfFileExists.Reuse.Label");
    wIfFileExists.setItems(new String[] { createNewLabel, reuseLabel });
    wIfFileExists.setData(createNewLabel, ExcelWriterStepMeta.IF_FILE_EXISTS_CREATE_NEW);
    wIfFileExists.setData(reuseLabel, ExcelWriterStepMeta.IF_FILE_EXISTS_REUSE);
    props.setLook(wIfFileExists);
    wIfFileExists.addModifyListener(lsMod);
    wIfFileExists.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.IfFileExists.Tooltip"));
    FormData fdIfFileExists = new FormData();
    fdIfFileExists.left = new FormAttachment(middle, 0);
    fdIfFileExists.top = new FormAttachment(wbShowFiles, 2 * margin, margin);
    fdIfFileExists.right = new FormAttachment(100, 0);
    wIfFileExists.setLayoutData(fdIfFileExists);
    // Open new File at Init
    wlDoNotOpenNewFileInit = new Label(fileGroup, SWT.RIGHT);
    wlDoNotOpenNewFileInit.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.DoNotOpenNewFileInit.Label"));
    props.setLook(wlDoNotOpenNewFileInit);
    fdlDoNotOpenNewFileInit = new FormData();
    fdlDoNotOpenNewFileInit.left = new FormAttachment(0, 0);
    fdlDoNotOpenNewFileInit.top = new FormAttachment(wIfFileExists, 2 * margin, margin);
    fdlDoNotOpenNewFileInit.right = new FormAttachment(middle, -margin);
    wlDoNotOpenNewFileInit.setLayoutData(fdlDoNotOpenNewFileInit);
    wDoNotOpenNewFileInit = new Button(fileGroup, SWT.CHECK);
    wDoNotOpenNewFileInit.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.DoNotOpenNewFileInit.Tooltip"));
    props.setLook(wDoNotOpenNewFileInit);
    fdDoNotOpenNewFileInit = new FormData();
    fdDoNotOpenNewFileInit.left = new FormAttachment(middle, 0);
    fdDoNotOpenNewFileInit.top = new FormAttachment(wIfFileExists, 2 * margin, margin);
    fdDoNotOpenNewFileInit.right = new FormAttachment(100, 0);
    wDoNotOpenNewFileInit.setLayoutData(fdDoNotOpenNewFileInit);
    wDoNotOpenNewFileInit.addSelectionListener(lsSel);
    // Add File to the result files name
    wlAddToResult = new Label(fileGroup, SWT.RIGHT);
    wlAddToResult.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.AddFileToResult.Label"));
    props.setLook(wlAddToResult);
    fdlAddToResult = new FormData();
    fdlAddToResult.left = new FormAttachment(0, 0);
    fdlAddToResult.top = new FormAttachment(wDoNotOpenNewFileInit);
    fdlAddToResult.right = new FormAttachment(middle, -margin);
    wlAddToResult.setLayoutData(fdlAddToResult);
    wAddToResult = new Button(fileGroup, SWT.CHECK);
    wAddToResult.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.AddFileToResult.Tooltip"));
    props.setLook(wAddToResult);
    fdAddToResult = new FormData();
    fdAddToResult.left = new FormAttachment(middle, 0);
    fdAddToResult.top = new FormAttachment(wDoNotOpenNewFileInit);
    fdAddToResult.right = new FormAttachment(100, 0);
    wAddToResult.setLayoutData(fdAddToResult);
    wAddToResult.addSelectionListener(lsSel);
    FormData fsFileGroup = new FormData();
    fsFileGroup.left = new FormAttachment(0, margin);
    fsFileGroup.top = new FormAttachment(0, margin);
    fsFileGroup.right = new FormAttachment(100, -margin);
    fileGroup.setLayoutData(fsFileGroup);
    // END OF FILE GROUP
    Group sheetGroup = new Group(wFileComp, SWT.SHADOW_NONE);
    props.setLook(sheetGroup);
    sheetGroup.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.sheetGroup.Label"));
    FormLayout sheetGroupLayout = new FormLayout();
    sheetGroupLayout.marginWidth = 10;
    sheetGroupLayout.marginHeight = 10;
    sheetGroup.setLayout(sheetGroupLayout);
    // Sheet name line
    wlSheetname = new Label(sheetGroup, SWT.RIGHT);
    wlSheetname.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.Sheetname.Label"));
    props.setLook(wlSheetname);
    fdlSheetname = new FormData();
    fdlSheetname.left = new FormAttachment(0, 0);
    fdlSheetname.top = new FormAttachment(0, margin);
    fdlSheetname.right = new FormAttachment(middle, -margin);
    wlSheetname.setLayoutData(fdlSheetname);
    wSheetname = new TextVar(transMeta, sheetGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wSheetname.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.Sheetname.Tooltip"));
    props.setLook(wSheetname);
    wSheetname.addModifyListener(lsMod);
    fdSheetname = new FormData();
    fdSheetname.left = new FormAttachment(middle, 0);
    fdSheetname.top = new FormAttachment(0, margin);
    fdSheetname.right = new FormAttachment(100, 0);
    wSheetname.setLayoutData(fdSheetname);
    // Make sheet active Sheet Line
    Label wlMakeActiveSheet = new Label(sheetGroup, SWT.RIGHT);
    wlMakeActiveSheet.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.MakeActiveSheet.Label"));
    props.setLook(wlMakeActiveSheet);
    FormData fdlMakeActiveSheet = new FormData();
    fdlMakeActiveSheet.left = new FormAttachment(0, 0);
    fdlMakeActiveSheet.top = new FormAttachment(wSheetname, margin);
    fdlMakeActiveSheet.right = new FormAttachment(middle, -margin);
    wlMakeActiveSheet.setLayoutData(fdlMakeActiveSheet);
    wMakeActiveSheet = new Button(sheetGroup, SWT.CHECK);
    wMakeActiveSheet.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.MakeActiveSheet.Tooltip"));
    props.setLook(wMakeActiveSheet);
    FormData fdMakeActiveSheet = new FormData();
    fdMakeActiveSheet.left = new FormAttachment(middle, 0);
    fdMakeActiveSheet.top = new FormAttachment(wSheetname, margin);
    fdMakeActiveSheet.right = new FormAttachment(100, 0);
    wMakeActiveSheet.setLayoutData(fdMakeActiveSheet);
    wMakeActiveSheet.addSelectionListener(lsSel);
    // If output sheet exists line
    wlIfSheetExists = new Label(sheetGroup, SWT.RIGHT);
    wlIfSheetExists.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.IfSheetExists.Label"));
    props.setLook(wlIfSheetExists);
    FormData fdlIfSheetExists = new FormData();
    fdlIfSheetExists.left = new FormAttachment(0, 0);
    fdlIfSheetExists.top = new FormAttachment(wMakeActiveSheet, margin);
    fdlIfSheetExists.right = new FormAttachment(middle, -margin);
    wlIfSheetExists.setLayoutData(fdlIfSheetExists);
    wIfSheetExists = new CCombo(sheetGroup, SWT.LEFT | SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
    String replaceSheetNewLabel = BaseMessages.getString(PKG, "ExcelWriterDialog.IfSheetExists.CreateNew.Label");
    String reuseSheetLabel = BaseMessages.getString(PKG, "ExcelWriterDialog.IfSheetExists.Reuse.Label");
    wIfSheetExists.setItems(new String[] { replaceSheetNewLabel, reuseSheetLabel });
    wIfSheetExists.setData(replaceSheetNewLabel, ExcelWriterStepMeta.IF_SHEET_EXISTS_CREATE_NEW);
    wIfSheetExists.setData(reuseSheetLabel, ExcelWriterStepMeta.IF_SHEET_EXISTS_REUSE);
    props.setLook(wIfSheetExists);
    wIfSheetExists.addModifyListener(lsMod);
    wIfSheetExists.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.IfSheetExists.Tooltip"));
    FormData fdIfSheetExists = new FormData();
    fdIfSheetExists.left = new FormAttachment(middle, 0);
    fdIfSheetExists.top = new FormAttachment(wMakeActiveSheet, margin);
    fdIfSheetExists.right = new FormAttachment(100, 0);
    wIfSheetExists.setLayoutData(fdIfSheetExists);
    // Protect Sheet?
    wlProtectSheet = new Label(sheetGroup, SWT.RIGHT);
    wlProtectSheet.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.ProtectSheet.Label"));
    props.setLook(wlProtectSheet);
    fdlProtectSheet = new FormData();
    fdlProtectSheet.left = new FormAttachment(0, 0);
    fdlProtectSheet.top = new FormAttachment(wIfSheetExists, margin);
    fdlProtectSheet.right = new FormAttachment(middle, -margin);
    wlProtectSheet.setLayoutData(fdlProtectSheet);
    wProtectSheet = new Button(sheetGroup, SWT.CHECK);
    wProtectSheet.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.ProtectSheet.Tooltip"));
    props.setLook(wProtectSheet);
    fdProtectSheet = new FormData();
    fdProtectSheet.left = new FormAttachment(middle, 0);
    fdProtectSheet.top = new FormAttachment(wIfSheetExists, margin);
    fdProtectSheet.right = new FormAttachment(100, 0);
    wProtectSheet.setLayoutData(fdProtectSheet);
    wProtectSheet.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
            enablePassword();
        }
    });
    // Protected by line
    Label wlProtectedBy = new Label(sheetGroup, SWT.RIGHT);
    wlProtectedBy.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.ProtectedBy.Label"));
    props.setLook(wlProtectedBy);
    FormData fdlProtectedBy = new FormData();
    fdlProtectedBy.left = new FormAttachment(0, 0);
    fdlProtectedBy.top = new FormAttachment(wProtectSheet, margin);
    fdlProtectedBy.right = new FormAttachment(middle, -margin);
    wlProtectedBy.setLayoutData(fdlProtectedBy);
    wProtectedBy = new TextVar(transMeta, sheetGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wProtectedBy.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.ProtectedBy.Tooltip"));
    props.setLook(wProtectedBy);
    wProtectedBy.addModifyListener(lsMod);
    FormData fdProtectedBy = new FormData();
    fdProtectedBy.left = new FormAttachment(middle, 0);
    fdProtectedBy.top = new FormAttachment(wProtectSheet, margin);
    fdProtectedBy.right = new FormAttachment(100, 0);
    wProtectedBy.setLayoutData(fdProtectedBy);
    // Password line
    wlPassword = new Label(sheetGroup, SWT.RIGHT);
    wlPassword.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.Password.Label"));
    props.setLook(wlPassword);
    fdlPassword = new FormData();
    fdlPassword.left = new FormAttachment(0, 0);
    fdlPassword.top = new FormAttachment(wProtectedBy, margin);
    fdlPassword.right = new FormAttachment(middle, -margin);
    wlPassword.setLayoutData(fdlPassword);
    wPassword = new PasswordTextVar(transMeta, sheetGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wPassword.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.Password.Tooltip"));
    props.setLook(wPassword);
    wPassword.addModifyListener(lsMod);
    fdPassword = new FormData();
    fdPassword.left = new FormAttachment(middle, 0);
    fdPassword.top = new FormAttachment(wProtectedBy, margin);
    fdPassword.right = new FormAttachment(100, 0);
    wPassword.setLayoutData(fdPassword);
    FormData fsSheetGroup = new FormData();
    fsSheetGroup.left = new FormAttachment(0, margin);
    fsSheetGroup.top = new FormAttachment(fileGroup, margin);
    fsSheetGroup.right = new FormAttachment(100, -margin);
    sheetGroup.setLayoutData(fsSheetGroup);
    // END OF SHEET GROUP
    // ///////////////////////////////
    // START OF Template Group GROUP //
    // ///////////////////////////////
    wTemplateGroup = new Group(wFileComp, SWT.SHADOW_NONE);
    props.setLook(wTemplateGroup);
    wTemplateGroup.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.TemplateGroup.Label"));
    FormLayout TemplateGroupgroupLayout = new FormLayout();
    TemplateGroupgroupLayout.marginWidth = 10;
    TemplateGroupgroupLayout.marginHeight = 10;
    wTemplateGroup.setLayout(TemplateGroupgroupLayout);
    // Use template
    wlTemplate = new Label(wTemplateGroup, SWT.RIGHT);
    wlTemplate.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.Template.Label"));
    props.setLook(wlTemplate);
    fdlTemplate = new FormData();
    fdlTemplate.left = new FormAttachment(0, 0);
    fdlTemplate.top = new FormAttachment(0, margin);
    fdlTemplate.right = new FormAttachment(middle, -margin);
    wlTemplate.setLayoutData(fdlTemplate);
    wTemplate = new Button(wTemplateGroup, SWT.CHECK);
    props.setLook(wTemplate);
    fdTemplate = new FormData();
    fdTemplate.left = new FormAttachment(middle, 0);
    fdTemplate.top = new FormAttachment(0, margin);
    fdTemplate.right = new FormAttachment(100, 0);
    wTemplate.setLayoutData(fdTemplate);
    wTemplate.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
            enableTemplate();
        }
    });
    wTemplate.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.Template.Tooltip"));
    // TemplateFilename line
    wlTemplateFilename = new Label(wTemplateGroup, SWT.RIGHT);
    wlTemplateFilename.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.TemplateFilename.Label"));
    props.setLook(wlTemplateFilename);
    fdlTemplateFilename = new FormData();
    fdlTemplateFilename.left = new FormAttachment(0, 0);
    fdlTemplateFilename.top = new FormAttachment(wTemplate, margin);
    fdlTemplateFilename.right = new FormAttachment(middle, -margin);
    wlTemplateFilename.setLayoutData(fdlTemplateFilename);
    wbTemplateFilename = new Button(wTemplateGroup, SWT.PUSH | SWT.CENTER);
    props.setLook(wbTemplateFilename);
    wbTemplateFilename.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
    fdbTemplateFilename = new FormData();
    fdbTemplateFilename.right = new FormAttachment(100, 0);
    fdbTemplateFilename.top = new FormAttachment(wTemplate, 0);
    wbTemplateFilename.setLayoutData(fdbTemplateFilename);
    wTemplateFilename = new TextVar(transMeta, wTemplateGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wTemplateFilename);
    wTemplateFilename.addModifyListener(lsMod);
    fdTemplateFilename = new FormData();
    fdTemplateFilename.left = new FormAttachment(middle, 0);
    fdTemplateFilename.top = new FormAttachment(wTemplate, margin);
    fdTemplateFilename.right = new FormAttachment(wbTemplateFilename, -margin);
    wTemplateFilename.setLayoutData(fdTemplateFilename);
    // Use template sheet
    wlTemplateSheet = new Label(wTemplateGroup, SWT.RIGHT);
    wlTemplateSheet.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.TemplateSheet.Label"));
    props.setLook(wlTemplateSheet);
    FormData fdlTemplateSheet = new FormData();
    fdlTemplateSheet.left = new FormAttachment(0, 0);
    fdlTemplateSheet.top = new FormAttachment(wTemplateFilename, margin);
    fdlTemplateSheet.right = new FormAttachment(middle, -margin);
    wlTemplateSheet.setLayoutData(fdlTemplateSheet);
    wTemplateSheet = new Button(wTemplateGroup, SWT.CHECK);
    wTemplateSheet.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.TemplateSheet.Tooltip"));
    props.setLook(wTemplateSheet);
    FormData fdTemplateSheet = new FormData();
    fdTemplateSheet.left = new FormAttachment(middle, 0);
    fdTemplateSheet.top = new FormAttachment(wTemplateFilename, margin);
    fdTemplateSheet.right = new FormAttachment(100, 0);
    wTemplateSheet.setLayoutData(fdTemplateSheet);
    wTemplateSheet.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
            enableTemplateSheet();
        }
    });
    // TemplateSheetname line
    wlTemplateSheetname = new Label(wTemplateGroup, SWT.RIGHT);
    wlTemplateSheetname.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.TemplateSheetname.Label"));
    props.setLook(wlTemplateSheetname);
    FormData fdlTemplateSheetname = new FormData();
    fdlTemplateSheetname.left = new FormAttachment(0, 0);
    fdlTemplateSheetname.top = new FormAttachment(wTemplateSheet, margin);
    fdlTemplateSheetname.right = new FormAttachment(middle, -margin);
    wlTemplateSheetname.setLayoutData(fdlTemplateSheetname);
    wTemplateSheetname = new TextVar(transMeta, wTemplateGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wTemplateSheetname);
    wTemplateSheetname.addModifyListener(lsMod);
    FormData fdTemplateSheetname = new FormData();
    fdTemplateSheetname.left = new FormAttachment(middle, 0);
    fdTemplateSheetname.top = new FormAttachment(wTemplateSheet, margin);
    fdTemplateSheetname.right = new FormAttachment(wbTemplateFilename, -margin);
    wTemplateSheetname.setLayoutData(fdTemplateSheetname);
    // Hide Template Sheet
    wlTemplateSheetHide = new Label(wTemplateGroup, SWT.RIGHT);
    wlTemplateSheetHide.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.TemplateSheetHide.Label"));
    props.setLook(wlTemplateSheetHide);
    FormData fdlTemplateSheetHide = new FormData();
    fdlTemplateSheetHide.left = new FormAttachment(0, 0);
    fdlTemplateSheetHide.top = new FormAttachment(wTemplateSheetname, margin);
    fdlTemplateSheetHide.right = new FormAttachment(middle, -margin);
    wlTemplateSheetHide.setLayoutData(fdlTemplateSheetHide);
    wTemplateSheetHide = new Button(wTemplateGroup, SWT.CHECK);
    wTemplateSheetHide.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.TemplateSheetHide.Tooltip"));
    props.setLook(wTemplateSheetHide);
    FormData fdTemplateSheetHide = new FormData();
    fdTemplateSheetHide.left = new FormAttachment(middle, 0);
    fdTemplateSheetHide.top = new FormAttachment(wTemplateSheetname, margin);
    fdTemplateSheetHide.right = new FormAttachment(100, 0);
    wTemplateSheetHide.setLayoutData(fdTemplateSheetHide);
    wTemplateSheetHide.addSelectionListener(lsSel);
    fdTemplateGroup = new FormData();
    fdTemplateGroup.left = new FormAttachment(0, margin);
    fdTemplateGroup.top = new FormAttachment(sheetGroup, margin);
    fdTemplateGroup.right = new FormAttachment(100, -margin);
    wTemplateGroup.setLayoutData(fdTemplateGroup);
    // ///////////////////////////////////////////////////////////
    // / END OF Write to existing Group GROUP
    // ///////////////////////////////////////////////////////////
    fdFileComp = new FormData();
    fdFileComp.left = new FormAttachment(0, 0);
    fdFileComp.top = new FormAttachment(0, 0);
    fdFileComp.right = new FormAttachment(100, 0);
    fdFileComp.bottom = new FormAttachment(100, 0);
    wFileComp.setLayoutData(fdFileComp);
    wFileComp.layout();
    wFileTab.setControl(wFileComp);
    // ///////////////////////////////////////////////////////////
    // / END OF FILE TAB
    // ///////////////////////////////////////////////////////////
    // ////////////////////////
    // START OF CONTENT TAB///
    // /
    wContentTab = new CTabItem(wTabFolder, SWT.NONE);
    wContentTab.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.ContentTab.TabTitle"));
    FormLayout contentLayout = new FormLayout();
    contentLayout.marginWidth = 3;
    contentLayout.marginHeight = 3;
    Composite wContentComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wContentComp);
    wContentComp.setLayout(contentLayout);
    Group wContentGroup = new Group(wContentComp, SWT.SHADOW_NONE);
    props.setLook(wContentGroup);
    wContentGroup.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.ContentGroup.Label"));
    FormLayout ContentGroupgroupLayout = new FormLayout();
    ContentGroupgroupLayout.marginWidth = 10;
    ContentGroupgroupLayout.marginHeight = 10;
    wContentGroup.setLayout(ContentGroupgroupLayout);
    // starting cell
    wlStartingCell = new Label(wContentGroup, SWT.RIGHT);
    wlStartingCell.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.StartingCell.Label"));
    props.setLook(wlStartingCell);
    FormData fdlStartingCell = new FormData();
    fdlStartingCell.left = new FormAttachment(0, 0);
    fdlStartingCell.top = new FormAttachment(wIfSheetExists, margin);
    fdlStartingCell.right = new FormAttachment(middle, -margin);
    wlStartingCell.setLayoutData(fdlStartingCell);
    wStartingCell = new TextVar(transMeta, wContentGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wStartingCell.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.StartingCell.Tooltip"));
    props.setLook(wStartingCell);
    wStartingCell.addModifyListener(lsMod);
    FormData fdStartingCell = new FormData();
    fdStartingCell.left = new FormAttachment(middle, 0);
    fdStartingCell.top = new FormAttachment(wIfSheetExists, margin);
    fdStartingCell.right = new FormAttachment(100, 0);
    wStartingCell.setLayoutData(fdStartingCell);
    // row writing method line
    wlRowWritingMethod = new Label(wContentGroup, SWT.RIGHT);
    wlRowWritingMethod.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.RowWritingMethod.Label"));
    props.setLook(wlRowWritingMethod);
    FormData fdlRowWritingMethod = new FormData();
    fdlRowWritingMethod.left = new FormAttachment(0, 0);
    fdlRowWritingMethod.top = new FormAttachment(wStartingCell, margin);
    fdlRowWritingMethod.right = new FormAttachment(middle, -margin);
    wlRowWritingMethod.setLayoutData(fdlRowWritingMethod);
    wRowWritingMethod = new CCombo(wContentGroup, SWT.LEFT | SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
    String overwriteLabel = BaseMessages.getString(PKG, "ExcelWriterDialog.RowWritingMethod.Overwrite.Label");
    String pushDownLabel = BaseMessages.getString(PKG, "ExcelWriterDialog.RowWritingMethod.PushDown.Label");
    wRowWritingMethod.setItems(new String[] { overwriteLabel, pushDownLabel });
    wRowWritingMethod.setData(overwriteLabel, ExcelWriterStepMeta.ROW_WRITE_OVERWRITE);
    wRowWritingMethod.setData(pushDownLabel, ExcelWriterStepMeta.ROW_WRITE_PUSH_DOWN);
    wRowWritingMethod.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.RowWritingMethod.Tooltip"));
    props.setLook(wRowWritingMethod);
    wRowWritingMethod.addModifyListener(lsMod);
    // wRowWritingMethod.addSelectionListener(new SelectionAdapter() {
    // public void widgetSelected(SelectionEvent e) {
    // input.setChanged();
    // EnableRowWritingMethod();
    // }
    // });
    FormData fdRowWritingMethod = new FormData();
    fdRowWritingMethod.left = new FormAttachment(middle, 0);
    fdRowWritingMethod.top = new FormAttachment(wStartingCell, margin);
    fdRowWritingMethod.right = new FormAttachment(100, 0);
    wRowWritingMethod.setLayoutData(fdRowWritingMethod);
    wlHeader = new Label(wContentGroup, SWT.RIGHT);
    wlHeader.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.Header.Label"));
    props.setLook(wlHeader);
    fdlHeader = new FormData();
    fdlHeader.left = new FormAttachment(0, 0);
    fdlHeader.top = new FormAttachment(wRowWritingMethod, margin);
    fdlHeader.right = new FormAttachment(middle, -margin);
    wlHeader.setLayoutData(fdlHeader);
    wHeader = new Button(wContentGroup, SWT.CHECK);
    props.setLook(wHeader);
    fdHeader = new FormData();
    fdHeader.left = new FormAttachment(middle, 0);
    fdHeader.top = new FormAttachment(wRowWritingMethod, margin);
    fdHeader.right = new FormAttachment(100, 0);
    wHeader.setLayoutData(fdHeader);
    wHeader.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.Header.Tooltip"));
    wHeader.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
            enableHeader();
        }
    });
    wlFooter = new Label(wContentGroup, SWT.RIGHT);
    wlFooter.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.Footer.Label"));
    props.setLook(wlFooter);
    fdlFooter = new FormData();
    fdlFooter.left = new FormAttachment(0, 0);
    fdlFooter.top = new FormAttachment(wHeader, margin);
    fdlFooter.right = new FormAttachment(middle, -margin);
    wlFooter.setLayoutData(fdlFooter);
    wFooter = new Button(wContentGroup, SWT.CHECK);
    props.setLook(wFooter);
    fdFooter = new FormData();
    fdFooter.left = new FormAttachment(middle, 0);
    fdFooter.top = new FormAttachment(wHeader, margin);
    fdFooter.right = new FormAttachment(100, 0);
    wFooter.setLayoutData(fdFooter);
    wFooter.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.Footer.Tooltip"));
    wFooter.addSelectionListener(lsSel);
    // auto size columns?
    wlAutoSize = new Label(wContentGroup, SWT.RIGHT);
    wlAutoSize.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.AutoSize.Label"));
    props.setLook(wlAutoSize);
    fdlAutoSize = new FormData();
    fdlAutoSize.left = new FormAttachment(0, 0);
    fdlAutoSize.top = new FormAttachment(wFooter, margin);
    fdlAutoSize.right = new FormAttachment(middle, -margin);
    wlAutoSize.setLayoutData(fdlAutoSize);
    wAutoSize = new Button(wContentGroup, SWT.CHECK);
    props.setLook(wAutoSize);
    wAutoSize.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.AutoSize.Tooltip"));
    fdAutoSize = new FormData();
    fdAutoSize.left = new FormAttachment(middle, 0);
    fdAutoSize.top = new FormAttachment(wFooter, margin);
    fdAutoSize.right = new FormAttachment(100, 0);
    wAutoSize.setLayoutData(fdAutoSize);
    wAutoSize.addSelectionListener(lsSel);
    // force formula recalculation?
    wlForceFormulaRecalculation = new Label(wContentGroup, SWT.RIGHT);
    wlForceFormulaRecalculation.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.ForceFormulaRecalculation.Label"));
    props.setLook(wlForceFormulaRecalculation);
    fdlForceFormulaRecalculation = new FormData();
    fdlForceFormulaRecalculation.left = new FormAttachment(0, 0);
    fdlForceFormulaRecalculation.top = new FormAttachment(wAutoSize, margin);
    fdlForceFormulaRecalculation.right = new FormAttachment(middle, -margin);
    wlForceFormulaRecalculation.setLayoutData(fdlForceFormulaRecalculation);
    wForceFormulaRecalculation = new Button(wContentGroup, SWT.CHECK);
    props.setLook(wForceFormulaRecalculation);
    wForceFormulaRecalculation.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.ForceFormulaRecalculation.Tooltip"));
    fdForceFormulaRecalculation = new FormData();
    fdForceFormulaRecalculation.left = new FormAttachment(middle, 0);
    fdForceFormulaRecalculation.top = new FormAttachment(wAutoSize, margin);
    fdForceFormulaRecalculation.right = new FormAttachment(100, 0);
    wForceFormulaRecalculation.setLayoutData(fdForceFormulaRecalculation);
    wForceFormulaRecalculation.addSelectionListener(lsSel);
    // leave existing styles alone?
    wlLeaveExistingStylesUnchanged = new Label(wContentGroup, SWT.RIGHT);
    wlLeaveExistingStylesUnchanged.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.LeaveExistingStylesUnchanged.Label"));
    props.setLook(wlLeaveExistingStylesUnchanged);
    fdlLeaveExistingStylesUnchanged = new FormData();
    fdlLeaveExistingStylesUnchanged.left = new FormAttachment(0, 0);
    fdlLeaveExistingStylesUnchanged.top = new FormAttachment(wForceFormulaRecalculation, margin);
    fdlLeaveExistingStylesUnchanged.right = new FormAttachment(middle, -margin);
    wlLeaveExistingStylesUnchanged.setLayoutData(fdlLeaveExistingStylesUnchanged);
    wLeaveExistingStylesUnchanged = new Button(wContentGroup, SWT.CHECK);
    props.setLook(wLeaveExistingStylesUnchanged);
    wLeaveExistingStylesUnchanged.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.LeaveExistingStylesUnchanged.Tooltip"));
    fdLeaveExistingStylesUnchanged = new FormData();
    fdLeaveExistingStylesUnchanged.left = new FormAttachment(middle, 0);
    fdLeaveExistingStylesUnchanged.top = new FormAttachment(wForceFormulaRecalculation, margin);
    fdLeaveExistingStylesUnchanged.right = new FormAttachment(100, 0);
    wLeaveExistingStylesUnchanged.setLayoutData(fdLeaveExistingStylesUnchanged);
    wLeaveExistingStylesUnchanged.addSelectionListener(lsSel);
    FormData fdContentGroup = new FormData();
    fdContentGroup.left = new FormAttachment(0, margin);
    fdContentGroup.top = new FormAttachment(0, margin);
    fdContentGroup.right = new FormAttachment(100, -margin);
    wContentGroup.setLayoutData(fdContentGroup);
    // / END OF CONTENT GROUP
    Group writeToExistingGroup = new Group(wContentComp, SWT.SHADOW_NONE);
    props.setLook(writeToExistingGroup);
    writeToExistingGroup.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.writeToExistingGroup.Label"));
    FormLayout writeToExistingGroupgroupLayout = new FormLayout();
    writeToExistingGroupgroupLayout.marginWidth = 10;
    writeToExistingGroupgroupLayout.marginHeight = 10;
    writeToExistingGroup.setLayout(writeToExistingGroupgroupLayout);
    // Use AppendLines
    Label wlAppendLines = new Label(writeToExistingGroup, SWT.RIGHT);
    wlAppendLines.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.AppendLines.Label"));
    props.setLook(wlAppendLines);
    FormData fdlAppendLines = new FormData();
    fdlAppendLines.left = new FormAttachment(0, 0);
    fdlAppendLines.top = new FormAttachment(0, margin);
    fdlAppendLines.right = new FormAttachment(middle, -margin);
    wlAppendLines.setLayoutData(fdlAppendLines);
    wAppendLines = new Button(writeToExistingGroup, SWT.CHECK);
    wAppendLines.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.AppendLines.Tooltip"));
    props.setLook(wAppendLines);
    FormData fdAppendLines = new FormData();
    fdAppendLines.left = new FormAttachment(middle, 0);
    fdAppendLines.top = new FormAttachment(0, margin);
    fdAppendLines.right = new FormAttachment(100, 0);
    wAppendLines.setLayoutData(fdAppendLines);
    // wAppendLines.addSelectionListener(lsMod);
    wAppendLines.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent arg0) {
            input.setChanged();
            enableAppend();
        }
    });
    // SkipRows line
    Label wlSkipRows = new Label(writeToExistingGroup, SWT.RIGHT);
    wlSkipRows.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.SkipRows.Label"));
    props.setLook(wlSkipRows);
    FormData fdlSkipRows = new FormData();
    fdlSkipRows.left = new FormAttachment(0, 0);
    fdlSkipRows.top = new FormAttachment(wAppendLines, margin);
    fdlSkipRows.right = new FormAttachment(middle, -margin);
    wlSkipRows.setLayoutData(fdlSkipRows);
    wSkipRows = new Text(writeToExistingGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wSkipRows.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.SkipRows.Tooltip"));
    props.setLook(wSkipRows);
    wSkipRows.addModifyListener(lsMod);
    FormData fdSkipRows = new FormData();
    fdSkipRows.left = new FormAttachment(middle, 0);
    fdSkipRows.top = new FormAttachment(wAppendLines, margin);
    fdSkipRows.right = new FormAttachment(100, 0);
    wSkipRows.setLayoutData(fdSkipRows);
    // EmptyRows line
    Label wlEmptyRows = new Label(writeToExistingGroup, SWT.RIGHT);
    wlEmptyRows.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.EmptyRows.Label"));
    props.setLook(wlEmptyRows);
    FormData fdlEmptyRows = new FormData();
    fdlEmptyRows.left = new FormAttachment(0, 0);
    fdlEmptyRows.top = new FormAttachment(wSkipRows, margin);
    fdlEmptyRows.right = new FormAttachment(middle, -margin);
    wlEmptyRows.setLayoutData(fdlEmptyRows);
    wEmptyRows = new Text(writeToExistingGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wEmptyRows.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.EmptyRows.Tooltip"));
    props.setLook(wEmptyRows);
    wEmptyRows.addModifyListener(lsMod);
    FormData fdEmptyRows = new FormData();
    fdEmptyRows.left = new FormAttachment(middle, 0);
    fdEmptyRows.top = new FormAttachment(wSkipRows, margin);
    fdEmptyRows.right = new FormAttachment(100, 0);
    wEmptyRows.setLayoutData(fdEmptyRows);
    // Use AppendLines
    Label wlOmitHeader = new Label(writeToExistingGroup, SWT.RIGHT);
    wlOmitHeader.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.OmitHeader.Label"));
    props.setLook(wlOmitHeader);
    FormData fdlOmitHeader = new FormData();
    fdlOmitHeader.left = new FormAttachment(0, 0);
    fdlOmitHeader.top = new FormAttachment(wEmptyRows, margin);
    fdlOmitHeader.right = new FormAttachment(middle, -margin);
    wlOmitHeader.setLayoutData(fdlOmitHeader);
    wOmitHeader = new Button(writeToExistingGroup, SWT.CHECK);
    wOmitHeader.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.OmitHeader.Tooltip"));
    props.setLook(wOmitHeader);
    FormData fdOmitHeader = new FormData();
    fdOmitHeader.left = new FormAttachment(middle, 0);
    fdOmitHeader.top = new FormAttachment(wEmptyRows, margin);
    fdOmitHeader.right = new FormAttachment(100, 0);
    wOmitHeader.setLayoutData(fdOmitHeader);
    wOmitHeader.addSelectionListener(lsSel);
    FormData fdWriteToExistingGroup = new FormData();
    fdWriteToExistingGroup.left = new FormAttachment(0, margin);
    fdWriteToExistingGroup.top = new FormAttachment(wContentGroup, margin);
    fdWriteToExistingGroup.right = new FormAttachment(100, -margin);
    writeToExistingGroup.setLayoutData(fdWriteToExistingGroup);
    // ///////////////////////////////////////////////////////////
    // / END OF Write to existing Group GROUP
    // ///////////////////////////////////////////////////////////
    Group fieldGroup = new Group(wContentComp, SWT.SHADOW_NONE);
    props.setLook(fieldGroup);
    fieldGroup.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.fieldGroup.Label"));
    FormLayout fieldGroupgroupLayout = new FormLayout();
    fieldGroupgroupLayout.marginWidth = 10;
    fieldGroupgroupLayout.marginHeight = 10;
    fieldGroup.setLayout(fieldGroupgroupLayout);
    wGet = new Button(fieldGroup, SWT.PUSH);
    wGet.setText(BaseMessages.getString(PKG, "System.Button.GetFields"));
    wGet.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.GetFields"));
    wMinWidth = new Button(fieldGroup, SWT.PUSH);
    wMinWidth.setText(BaseMessages.getString(PKG, "ExcelWriterDialog.MinWidth.Button"));
    wMinWidth.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.MinWidth.Tooltip"));
    setButtonPositions(new Button[] { wGet, wMinWidth }, margin, null);
    final int FieldsRows = input.getOutputFields().length;
    // Prepare a list of possible formats, filtering reserved internal formats away
    String[] formats = BuiltinFormats.getAll();
    List<String> allFormats = Arrays.asList(BuiltinFormats.getAll());
    List<String> nonReservedFormats = new ArrayList<String>(allFormats.size());
    for (String format : allFormats) {
        if (!format.startsWith("reserved")) {
            nonReservedFormats.add(format);
        }
    }
    Collections.sort(nonReservedFormats);
    formats = nonReservedFormats.toArray(new String[0]);
    colinf = new ColumnInfo[] { new ColumnInfo(BaseMessages.getString(PKG, "ExcelWriterDialog.NameColumn.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false), new ColumnInfo(BaseMessages.getString(PKG, "ExcelWriterDialog.TypeColumn.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaFactory.getValueMetaNames()), new ColumnInfo(BaseMessages.getString(PKG, "ExcelWriterDialog.FormatColumn.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, formats), new ColumnInfo(BaseMessages.getString(PKG, "ExcelWriterDialog.UseStyleCell.Column"), ColumnInfo.COLUMN_TYPE_TEXT), new ColumnInfo(BaseMessages.getString(PKG, "ExcelWriterDialog.TitleColumn.Column"), ColumnInfo.COLUMN_TYPE_TEXT), new ColumnInfo(BaseMessages.getString(PKG, "ExcelWriterDialog.UseTitleStyleCell.Column"), ColumnInfo.COLUMN_TYPE_TEXT), new ColumnInfo(BaseMessages.getString(PKG, "ExcelWriterDialog.FormulaField.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "N", "Y" }, true), new ColumnInfo(BaseMessages.getString(PKG, "ExcelWriterDialog.HyperLinkField.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false), new ColumnInfo(BaseMessages.getString(PKG, "ExcelWriterDialog.CommentField.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false), new ColumnInfo(BaseMessages.getString(PKG, "ExcelWriterDialog.CommentAuthor.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false) };
    wFields = new TableView(transMeta, fieldGroup, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI, colinf, FieldsRows, lsMod, props);
    fdFields = new FormData();
    fdFields.left = new FormAttachment(0, 0);
    fdFields.top = new FormAttachment(0, 0);
    fdFields.right = new FormAttachment(100, 0);
    fdFields.bottom = new FormAttachment(wGet, -margin);
    wFields.setLayoutData(fdFields);
    wFields.addModifyListener(lsMod);
    // 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();
                } catch (KettleException e) {
                    logError(BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"));
                }
            }
        }
    };
    new Thread(runnable).start();
    FormData fdFieldGroup = new FormData();
    fdFieldGroup.left = new FormAttachment(0, margin);
    fdFieldGroup.top = new FormAttachment(writeToExistingGroup, margin);
    fdFieldGroup.bottom = new FormAttachment(100, 0);
    fdFieldGroup.right = new FormAttachment(100, -margin);
    fieldGroup.setLayoutData(fdFieldGroup);
    fdContentComp = new FormData();
    fdContentComp.left = new FormAttachment(0, 0);
    fdContentComp.top = new FormAttachment(0, 0);
    fdContentComp.right = new FormAttachment(100, 0);
    fdContentComp.bottom = new FormAttachment(100, 0);
    wContentComp.setLayoutData(fdContentComp);
    wContentComp.layout();
    wContentTab.setControl(wContentComp);
    fdTabFolder = new FormData();
    fdTabFolder.left = new FormAttachment(0, 0);
    fdTabFolder.top = new FormAttachment(0, 0);
    fdTabFolder.right = new FormAttachment(100, 0);
    fdTabFolder.bottom = new FormAttachment(100, 0);
    wTabFolder.setLayoutData(fdTabFolder);
    FormData fdSc = new FormData();
    fdSc.left = new FormAttachment(0, 0);
    fdSc.top = new FormAttachment(wStepname, margin);
    fdSc.right = new FormAttachment(100, 0);
    fdSc.bottom = new FormAttachment(100, -50);
    sc.setLayoutData(fdSc);
    sc.setContent(wTabFolder);
    // ///////////////////////////////////////////////////////////
    // / END OF CONTENT TAB
    // ///////////////////////////////////////////////////////////
    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, sc);
    // Add listeners
    lsOK = new Listener() {

        @Override
        public void handleEvent(Event e) {
            ok();
        }
    };
    lsGet = new Listener() {

        @Override
        public void handleEvent(Event e) {
            get();
        }
    };
    lsMinWidth = new Listener() {

        @Override
        public void handleEvent(Event e) {
            setMinimalWidth();
        }
    };
    lsCancel = new Listener() {

        @Override
        public void handleEvent(Event e) {
            cancel();
        }
    };
    wOK.addListener(SWT.Selection, lsOK);
    wGet.addListener(SWT.Selection, lsGet);
    wMinWidth.addListener(SWT.Selection, lsMinWidth);
    wCancel.addListener(SWT.Selection, lsCancel);
    lsDef = new SelectionAdapter() {

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            ok();
        }
    };
    wStepname.addSelectionListener(lsDef);
    wFilename.addSelectionListener(lsDef);
    wTemplateFilename.addSelectionListener(lsDef);
    // Whenever something changes, set the tooltip to the expanded version:
    wFilename.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            wFilename.setToolTipText(transMeta.environmentSubstitute(wFilename.getText()) + "\n\n" + BaseMessages.getString(PKG, "ExcelWriterDialog.Filename.Tooltip"));
        }
    });
    wTemplateFilename.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            wTemplateFilename.setToolTipText(transMeta.environmentSubstitute(wTemplateFilename.getText()));
        }
    });
    wSheetname.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            wSheetname.setToolTipText(transMeta.environmentSubstitute(wSheetname.getText()) + "\n\n" + BaseMessages.getString(PKG, "ExcelWriterDialog.Sheetname.Tooltip"));
        }
    });
    wTemplateSheetname.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            wTemplateSheetname.setToolTipText(transMeta.environmentSubstitute(wTemplateSheetname.getText()));
        }
    });
    wStartingCell.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            wStartingCell.setToolTipText(transMeta.environmentSubstitute(wStartingCell.getText()) + "\n\n" + BaseMessages.getString(PKG, "ExcelWriterDialog.StartingCell.Tooltip"));
        }
    });
    wPassword.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            wPassword.setToolTipText(BaseMessages.getString(PKG, "ExcelWriterDialog.Password.Tooltip"));
        }
    });
    wProtectedBy.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            wProtectedBy.setToolTipText(transMeta.environmentSubstitute(wProtectedBy.getText()) + "\n\n" + BaseMessages.getString(PKG, "ExcelWriterDialog.ProtectedBy.Tooltip"));
        }
    });
    wbFilename.addSelectionListener(new SelectionAdapterFileDialogTextVar(log, wFilename, transMeta, new SelectionAdapterOptions(SelectionOperation.SAVE_TO, new FilterType[] { FilterType.XLS, FilterType.XLSX, FilterType.ALL }, FilterType.XLS, new ProviderFilterType[] { ProviderFilterType.DEFAULT })));
    wbTemplateFilename.addSelectionListener(new SelectionAdapterFileDialogTextVar(log, wTemplateFilename, transMeta, new SelectionAdapterOptions(SelectionOperation.FILE, new FilterType[] { FilterType.XLS, FilterType.XLSX, FilterType.ALL }, FilterType.XLS, new ProviderFilterType[] { ProviderFilterType.DEFAULT })));
    // 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);
    getData();
    setDateTimeFormat();
    enableExtension();
    enableAppend();
    enableHeader();
    enableTemplateSheet();
    input.setChanged(changed);
    // artificially reduce table size
    for (int t = 0; t < wFields.table.getColumnCount(); t++) {
        wFields.table.getColumn(t).setWidth(20);
    }
    wFields.layout();
    wFields.pack();
    // determine scrollable area
    sc.setMinSize(wTabFolder.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    sc.setExpandHorizontal(true);
    sc.setExpandVertical(true);
    // set window size
    setSize(shell, 600, 600, true);
    // restore optimal column widths
    wFields.optWidth(true);
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
    return stepname;
}
Also used : Group(org.eclipse.swt.widgets.Group) KettleException(org.pentaho.di.core.exception.KettleException) CTabFolder(org.eclipse.swt.custom.CTabFolder) TableItemInsertListener(org.pentaho.di.ui.trans.step.TableItemInsertListener) Listener(org.eclipse.swt.widgets.Listener) ModifyListener(org.eclipse.swt.events.ModifyListener) ModifyListener(org.eclipse.swt.events.ModifyListener) Label(org.eclipse.swt.widgets.Label) ArrayList(java.util.ArrayList) ColumnInfo(org.pentaho.di.ui.core.widget.ColumnInfo) SelectionAdapterOptions(org.pentaho.di.ui.core.events.dialog.SelectionAdapterOptions) ShellEvent(org.eclipse.swt.events.ShellEvent) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) CTabItem(org.eclipse.swt.custom.CTabItem) Shell(org.eclipse.swt.widgets.Shell) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Button(org.eclipse.swt.widgets.Button) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) SelectionAdapterFileDialogTextVar(org.pentaho.di.ui.core.events.dialog.SelectionAdapterFileDialogTextVar) FormAttachment(org.eclipse.swt.layout.FormAttachment) EnterSelectionDialog(org.pentaho.di.ui.core.dialog.EnterSelectionDialog) TableView(org.pentaho.di.ui.core.widget.TableView) FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) ShellAdapter(org.eclipse.swt.events.ShellAdapter) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Text(org.eclipse.swt.widgets.Text) StepMeta(org.pentaho.di.trans.step.StepMeta) BaseStepMeta(org.pentaho.di.trans.step.BaseStepMeta) ExcelWriterStepMeta(org.pentaho.di.trans.steps.excelwriter.ExcelWriterStepMeta) TextVar(org.pentaho.di.ui.core.widget.TextVar) PasswordTextVar(org.pentaho.di.ui.core.widget.PasswordTextVar) SelectionAdapterFileDialogTextVar(org.pentaho.di.ui.core.events.dialog.SelectionAdapterFileDialogTextVar) MessageBox(org.eclipse.swt.widgets.MessageBox) PasswordTextVar(org.pentaho.di.ui.core.widget.PasswordTextVar) CCombo(org.eclipse.swt.custom.CCombo) ExcelWriterStepMeta(org.pentaho.di.trans.steps.excelwriter.ExcelWriterStepMeta) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Event(org.eclipse.swt.widgets.Event) ShellEvent(org.eclipse.swt.events.ShellEvent) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Display(org.eclipse.swt.widgets.Display)

Example 15 with SelectionAdapterOptions

use of org.pentaho.di.ui.core.events.dialog.SelectionAdapterOptions in project pentaho-kettle by pentaho.

the class GetSubFoldersDialog method open.

public String open() {
    Shell parent = getParent();
    Display display = parent.getDisplay();
    shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN);
    props.setLook(shell);
    setShellImage(shell, input);
    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, "GetSubFoldersDialog.DialogTitle"));
    middle = props.getMiddlePct();
    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 ///
    // ////////////////////////
    wFolderTab = new CTabItem(wTabFolder, SWT.NONE);
    wFolderTab.setText(BaseMessages.getString(PKG, "GetSubFoldersDialog.FolderTab.TabTitle"));
    wFolderComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wFolderComp);
    FormLayout fileLayout = new FormLayout();
    fileLayout.marginWidth = 3;
    fileLayout.marginHeight = 3;
    wFolderComp.setLayout(fileLayout);
    // ///////////////////////////////
    // START OF Origin files GROUP //
    // ///////////////////////////////
    wOriginFolders = new Group(wFolderComp, SWT.SHADOW_NONE);
    props.setLook(wOriginFolders);
    wOriginFolders.setText(BaseMessages.getString(PKG, "GetSubFoldersDialog.wOriginFiles.Label"));
    FormLayout OriginFilesgroupLayout = new FormLayout();
    OriginFilesgroupLayout.marginWidth = 10;
    OriginFilesgroupLayout.marginHeight = 10;
    wOriginFolders.setLayout(OriginFilesgroupLayout);
    // Is Filename defined in a Field
    wlFileField = new Label(wOriginFolders, SWT.RIGHT);
    wlFileField.setText(BaseMessages.getString(PKG, "GetSubFoldersDialog.FolderField.Label"));
    props.setLook(wlFileField);
    fdlFileField = new FormData();
    fdlFileField.left = new FormAttachment(0, -margin);
    fdlFileField.top = new FormAttachment(0, margin);
    fdlFileField.right = new FormAttachment(middle, -2 * margin);
    wlFileField.setLayoutData(fdlFileField);
    wFolderField = new Button(wOriginFolders, SWT.CHECK);
    props.setLook(wFolderField);
    wFolderField.setToolTipText(BaseMessages.getString(PKG, "GetSubFoldersDialog.FileField.Tooltip"));
    fdFileField = new FormData();
    fdFileField.left = new FormAttachment(middle, -margin);
    fdFileField.top = new FormAttachment(0, margin);
    wFolderField.setLayoutData(fdFileField);
    SelectionAdapter lfilefield = new SelectionAdapter() {

        public void widgetSelected(SelectionEvent arg0) {
            ActiveFileField();
            input.setChanged();
        }
    };
    wFolderField.addSelectionListener(lfilefield);
    // Filename field
    wlFilenameField = new Label(wOriginFolders, SWT.RIGHT);
    wlFilenameField.setText(BaseMessages.getString(PKG, "GetSubFoldersDialog.wlFilenameField.Label"));
    props.setLook(wlFilenameField);
    fdlFoldernameField = new FormData();
    fdlFoldernameField.left = new FormAttachment(0, -margin);
    fdlFoldernameField.top = new FormAttachment(wFolderField, margin);
    fdlFoldernameField.right = new FormAttachment(middle, -2 * margin);
    wlFilenameField.setLayoutData(fdlFoldernameField);
    wFoldernameField = new ComboVar(transMeta, wOriginFolders, SWT.BORDER | SWT.READ_ONLY);
    wFoldernameField.setEditable(true);
    props.setLook(wFoldernameField);
    wFoldernameField.addModifyListener(lsMod);
    fdFoldernameField = new FormData();
    fdFoldernameField.left = new FormAttachment(middle, -margin);
    fdFoldernameField.top = new FormAttachment(wFolderField, margin);
    fdFoldernameField.right = new FormAttachment(100, -margin);
    wFoldernameField.setLayoutData(fdFoldernameField);
    wFoldernameField.setEnabled(false);
    wFoldernameField.addFocusListener(new FocusListener() {

        public void focusLost(org.eclipse.swt.events.FocusEvent e) {
        }

        public void focusGained(org.eclipse.swt.events.FocusEvent e) {
            Cursor busy = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
            shell.setCursor(busy);
            BaseStepDialog.getFieldsFromPrevious(wFoldernameField, transMeta, stepMeta);
            shell.setCursor(null);
            busy.dispose();
        }
    });
    fdOriginFolders = new FormData();
    fdOriginFolders.left = new FormAttachment(0, margin);
    fdOriginFolders.top = new FormAttachment(wFoldernameList, margin);
    fdOriginFolders.right = new FormAttachment(100, -margin);
    wOriginFolders.setLayoutData(fdOriginFolders);
    // ///////////////////////////////////////////////////////////
    // / END OF Origin files GROUP
    // ///////////////////////////////////////////////////////////
    // Foldername line
    wlFoldername = new Label(wFolderComp, SWT.RIGHT);
    wlFoldername.setText(BaseMessages.getString(PKG, "GetSubFoldersDialog.Filename.Label"));
    props.setLook(wlFoldername);
    fdlFoldername = new FormData();
    fdlFoldername.left = new FormAttachment(0, 0);
    fdlFoldername.top = new FormAttachment(wOriginFolders, margin);
    fdlFoldername.right = new FormAttachment(middle, -margin);
    wlFoldername.setLayoutData(fdlFoldername);
    wbbFoldername = new Button(wFolderComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbbFoldername);
    wbbFoldername.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
    wbbFoldername.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.BrowseForFileOrDirAndAdd"));
    fdbFoldername = new FormData();
    fdbFoldername.right = new FormAttachment(100, 0);
    fdbFoldername.top = new FormAttachment(wOriginFolders, margin);
    wbbFoldername.setLayoutData(fdbFoldername);
    wbaFoldername = new Button(wFolderComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbaFoldername);
    wbaFoldername.setText(BaseMessages.getString(PKG, "GetSubFoldersDialog.FoldernameAdd.Button"));
    wbaFoldername.setToolTipText(BaseMessages.getString(PKG, "GetSubFoldersDialog.FoldernameAdd.Tooltip"));
    fdbaFoldername = new FormData();
    fdbaFoldername.right = new FormAttachment(wbbFoldername, -margin);
    fdbaFoldername.top = new FormAttachment(wOriginFolders, margin);
    wbaFoldername.setLayoutData(fdbaFoldername);
    wFoldername = new TextVar(transMeta, wFolderComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wFoldername);
    wFoldername.addModifyListener(lsMod);
    fdFoldername = new FormData();
    fdFoldername.left = new FormAttachment(middle, 0);
    fdFoldername.right = new FormAttachment(wbaFoldername, -margin);
    fdFoldername.top = new FormAttachment(wOriginFolders, margin);
    wFoldername.setLayoutData(fdFoldername);
    // Filename list line
    wlFoldernameList = new Label(wFolderComp, SWT.RIGHT);
    wlFoldernameList.setText(BaseMessages.getString(PKG, "GetSubFoldersDialog.FoldernameList.Label"));
    props.setLook(wlFoldernameList);
    fdlFoldernameList = new FormData();
    fdlFoldernameList.left = new FormAttachment(0, 0);
    fdlFoldernameList.top = new FormAttachment(wFoldername, margin);
    fdlFoldernameList.right = new FormAttachment(middle, -margin);
    wlFoldernameList.setLayoutData(fdlFoldernameList);
    // Buttons to the right of the screen...
    wbdFoldername = new Button(wFolderComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbdFoldername);
    wbdFoldername.setText(BaseMessages.getString(PKG, "GetSubFoldersDialog.FoldernameDelete.Button"));
    wbdFoldername.setToolTipText(BaseMessages.getString(PKG, "GetSubFoldersDialog.FoldernameDelete.Tooltip"));
    fdbdFoldername = new FormData();
    fdbdFoldername.right = new FormAttachment(100, 0);
    fdbdFoldername.top = new FormAttachment(wFoldername, 40);
    wbdFoldername.setLayoutData(fdbdFoldername);
    wbeFoldername = new Button(wFolderComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbeFoldername);
    wbeFoldername.setText(BaseMessages.getString(PKG, "GetSubFoldersDialog.FilenameEdit.Button"));
    wbeFoldername.setToolTipText(BaseMessages.getString(PKG, "GetSubFoldersDialog.FilenameEdit.Tooltip"));
    fdbeFoldername = new FormData();
    fdbeFoldername.right = new FormAttachment(100, 0);
    fdbeFoldername.left = new FormAttachment(wbdFoldername, 0, SWT.LEFT);
    fdbeFoldername.top = new FormAttachment(wbdFoldername, margin);
    wbeFoldername.setLayoutData(fdbeFoldername);
    ColumnInfo[] colinfo = new ColumnInfo[2];
    colinfo[0] = new ColumnInfo(BaseMessages.getString(PKG, "GetSubFoldersDialog.FileDirColumn.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false);
    colinfo[0].setUsingVariables(true);
    colinfo[1] = new ColumnInfo(BaseMessages.getString(PKG, "GetSubFoldersDialog.Required.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, GetSubFoldersMeta.RequiredFoldersDesc);
    colinfo[1].setToolTip(BaseMessages.getString(PKG, "GetSubFoldersDialog.Required.Tooltip"));
    wFoldernameList = new TableView(transMeta, wFolderComp, SWT.FULL_SELECTION | SWT.SINGLE | SWT.BORDER, colinfo, colinfo.length, lsMod, props);
    props.setLook(wFoldernameList);
    fdFoldernameList = new FormData();
    fdFoldernameList.left = new FormAttachment(middle, 0);
    fdFoldernameList.right = new FormAttachment(wbdFoldername, -margin);
    fdFoldernameList.top = new FormAttachment(wFoldername, margin);
    fdFoldernameList.bottom = new FormAttachment(100, -margin);
    wFoldernameList.setLayoutData(fdFoldernameList);
    fdFolderComp = new FormData();
    fdFolderComp.left = new FormAttachment(0, 0);
    fdFolderComp.top = new FormAttachment(0, 0);
    fdFolderComp.right = new FormAttachment(100, 0);
    fdFolderComp.bottom = new FormAttachment(100, 0);
    wFolderComp.setLayoutData(fdFolderComp);
    wFolderComp.layout();
    wFolderTab.setControl(wFolderComp);
    // ///////////////////////////////////////////////////////////
    // / END OF FILE TAB
    // ///////////////////////////////////////////////////////////
    fdTabFolder = new FormData();
    fdTabFolder.left = new FormAttachment(0, 0);
    fdTabFolder.top = new FormAttachment(wStepname, margin);
    fdTabFolder.right = new FormAttachment(100, 0);
    fdTabFolder.bottom = new FormAttachment(100, -50);
    wTabFolder.setLayoutData(fdTabFolder);
    // ////////////////////////
    // START OF Filter TAB ///
    // ////////////////////////
    wSettingsTab = new CTabItem(wTabFolder, SWT.NONE);
    wSettingsTab.setText(BaseMessages.getString(PKG, "GetSubFoldersDialog.SettingsTab.TabTitle"));
    wSettingsComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wSettingsComp);
    FormLayout filesettingLayout = new FormLayout();
    filesettingLayout.marginWidth = 3;
    filesettingLayout.marginHeight = 3;
    wSettingsComp.setLayout(fileLayout);
    // /////////////////////////////////
    // START OF Additional Fields GROUP
    // /////////////////////////////////
    wAdditionalGroup = new Group(wSettingsComp, SWT.SHADOW_NONE);
    props.setLook(wAdditionalGroup);
    wAdditionalGroup.setText(BaseMessages.getString(PKG, "GetSubFoldersDialog.Group.AdditionalGroup.Label"));
    FormLayout additionalgroupLayout = new FormLayout();
    additionalgroupLayout.marginWidth = 10;
    additionalgroupLayout.marginHeight = 10;
    wAdditionalGroup.setLayout(additionalgroupLayout);
    wlInclRownum = new Label(wAdditionalGroup, SWT.RIGHT);
    wlInclRownum.setText(BaseMessages.getString(PKG, "GetSubFoldersDialog.InclRownum.Label"));
    props.setLook(wlInclRownum);
    fdlInclRownum = new FormData();
    fdlInclRownum.left = new FormAttachment(0, 0);
    fdlInclRownum.top = new FormAttachment(0, 2 * margin);
    fdlInclRownum.right = new FormAttachment(middle, -margin);
    wlInclRownum.setLayoutData(fdlInclRownum);
    wInclRownum = new Button(wAdditionalGroup, SWT.CHECK);
    props.setLook(wInclRownum);
    wInclRownum.setToolTipText(BaseMessages.getString(PKG, "GetSubFoldersDialog.InclRownum.Tooltip"));
    fdRownum = new FormData();
    fdRownum.left = new FormAttachment(middle, 0);
    fdRownum.top = new FormAttachment(0, 2 * margin);
    wInclRownum.setLayoutData(fdRownum);
    SelectionAdapter linclRownum = new SelectionAdapter() {

        public void widgetSelected(SelectionEvent arg0) {
            ActiveIncludeRowNum();
            input.setChanged();
        }
    };
    wInclRownum.addSelectionListener(linclRownum);
    wlInclRownumField = new Label(wAdditionalGroup, SWT.RIGHT);
    wlInclRownumField.setText(BaseMessages.getString(PKG, "GetSubFoldersDialog.InclRownumField.Label"));
    props.setLook(wlInclRownumField);
    fdlInclRownumField = new FormData();
    fdlInclRownumField.left = new FormAttachment(wInclRownum, margin);
    fdlInclRownumField.top = new FormAttachment(0, 2 * margin);
    wlInclRownumField.setLayoutData(fdlInclRownumField);
    wInclRownumField = new TextVar(transMeta, wAdditionalGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wInclRownumField);
    wInclRownumField.addModifyListener(lsMod);
    fdInclRownumField = new FormData();
    fdInclRownumField.left = new FormAttachment(wlInclRownumField, margin);
    fdInclRownumField.top = new FormAttachment(0, 2 * margin);
    fdInclRownumField.right = new FormAttachment(100, 0);
    wInclRownumField.setLayoutData(fdInclRownumField);
    fdAdditionalGroup = new FormData();
    fdAdditionalGroup.left = new FormAttachment(0, margin);
    fdAdditionalGroup.top = new FormAttachment(0, margin);
    fdAdditionalGroup.right = new FormAttachment(100, -margin);
    wAdditionalGroup.setLayoutData(fdAdditionalGroup);
    // ///////////////////////////////////////////////////////////
    // / END OF DESTINATION ADDRESS GROUP
    // ///////////////////////////////////////////////////////////
    wlLimit = new Label(wSettingsComp, SWT.RIGHT);
    wlLimit.setText(BaseMessages.getString(PKG, "GetSubFoldersDialog.Limit.Label"));
    props.setLook(wlLimit);
    fdlLimit = new FormData();
    fdlLimit.left = new FormAttachment(0, 0);
    fdlLimit.top = new FormAttachment(wAdditionalGroup, 2 * margin);
    fdlLimit.right = new FormAttachment(middle, -margin);
    wlLimit.setLayoutData(fdlLimit);
    wLimit = new Text(wSettingsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wLimit);
    wLimit.addModifyListener(lsMod);
    fdLimit = new FormData();
    fdLimit.left = new FormAttachment(middle, 0);
    fdLimit.top = new FormAttachment(wAdditionalGroup, 2 * margin);
    fdLimit.right = new FormAttachment(100, 0);
    wLimit.setLayoutData(fdLimit);
    fdSettingsComp = new FormData();
    fdSettingsComp.left = new FormAttachment(0, 0);
    fdSettingsComp.top = new FormAttachment(0, 0);
    fdSettingsComp.right = new FormAttachment(100, 0);
    fdSettingsComp.bottom = new FormAttachment(100, 0);
    wSettingsComp.setLayoutData(fdSettingsComp);
    wSettingsComp.layout();
    wSettingsTab.setControl(wSettingsComp);
    // ///////////////////////////////////////////////////////////
    // / END OF FILE Filter TAB
    // ///////////////////////////////////////////////////////////
    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, "GetSubFoldersDialog.Preview.Button"));
    wCancel = new Button(shell, SWT.PUSH);
    wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
    setButtonPositions(new Button[] { wOK, wPreview, wCancel }, margin, wTabFolder);
    // Add listeners
    lsOK = new Listener() {

        public void handleEvent(Event e) {
            ok();
        }
    };
    lsPreview = new Listener() {

        public void handleEvent(Event e) {
            preview();
        }
    };
    lsCancel = new Listener() {

        public void handleEvent(Event e) {
            cancel();
        }
    };
    wOK.addListener(SWT.Selection, lsOK);
    wPreview.addListener(SWT.Selection, lsPreview);
    wCancel.addListener(SWT.Selection, lsCancel);
    lsDef = new SelectionAdapter() {

        public void widgetDefaultSelected(SelectionEvent e) {
            ok();
        }
    };
    wStepname.addSelectionListener(lsDef);
    // Add the file to the list of files...
    SelectionAdapter selA = new SelectionAdapter() {

        public void widgetSelected(SelectionEvent arg0) {
            wFoldernameList.add(new String[] { wFoldername.getText() });
            wFoldername.setText("");
            wFoldernameList.removeEmptyRows();
            wFoldernameList.setRowNums();
            wFoldernameList.optWidth(true);
        }
    };
    wbaFoldername.addSelectionListener(selA);
    wFoldername.addSelectionListener(selA);
    // Delete files from the list of files...
    wbdFoldername.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent arg0) {
            int[] idx = wFoldernameList.getSelectionIndices();
            wFoldernameList.remove(idx);
            wFoldernameList.removeEmptyRows();
            wFoldernameList.setRowNums();
        }
    });
    // Edit the selected file & remove from the list...
    wbeFoldername.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent arg0) {
            int idx = wFoldernameList.getSelectionIndex();
            if (idx >= 0) {
                String[] string = wFoldernameList.getItem(idx);
                wFoldername.setText(string[0]);
                wFoldernameList.remove(idx);
            }
            wFoldernameList.removeEmptyRows();
            wFoldernameList.setRowNums();
        }
    });
    // Listen to the Browse... button
    wbbFoldername.addSelectionListener(new SelectionAdapterFileDialogTextVar(log, wFoldername, transMeta, new SelectionAdapterOptions(SelectionOperation.FOLDER)));
    // Detect X or ALT-F4 or something that kills this window...
    shell.addShellListener(new ShellAdapter() {

        public void shellClosed(ShellEvent e) {
            cancel();
        }
    });
    wTabFolder.setSelection(0);
    // Set the shell size, based upon previous time...
    getData(input);
    ActiveFileField();
    ActiveIncludeRowNum();
    setSize();
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
    return stepname;
}
Also used : Group(org.eclipse.swt.widgets.Group) ComboVar(org.pentaho.di.ui.core.widget.ComboVar) CTabFolder(org.eclipse.swt.custom.CTabFolder) FocusListener(org.eclipse.swt.events.FocusListener) Listener(org.eclipse.swt.widgets.Listener) ModifyListener(org.eclipse.swt.events.ModifyListener) ModifyListener(org.eclipse.swt.events.ModifyListener) Label(org.eclipse.swt.widgets.Label) ColumnInfo(org.pentaho.di.ui.core.widget.ColumnInfo) SelectionAdapterOptions(org.pentaho.di.ui.core.events.dialog.SelectionAdapterOptions) ShellEvent(org.eclipse.swt.events.ShellEvent) Cursor(org.eclipse.swt.graphics.Cursor) CTabItem(org.eclipse.swt.custom.CTabItem) Shell(org.eclipse.swt.widgets.Shell) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Button(org.eclipse.swt.widgets.Button) SelectionEvent(org.eclipse.swt.events.SelectionEvent) SelectionAdapterFileDialogTextVar(org.pentaho.di.ui.core.events.dialog.SelectionAdapterFileDialogTextVar) FormAttachment(org.eclipse.swt.layout.FormAttachment) TableView(org.pentaho.di.ui.core.widget.TableView) FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) ShellAdapter(org.eclipse.swt.events.ShellAdapter) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Text(org.eclipse.swt.widgets.Text) TextVar(org.pentaho.di.ui.core.widget.TextVar) SelectionAdapterFileDialogTextVar(org.pentaho.di.ui.core.events.dialog.SelectionAdapterFileDialogTextVar) Event(org.eclipse.swt.widgets.Event) ModifyEvent(org.eclipse.swt.events.ModifyEvent) ShellEvent(org.eclipse.swt.events.ShellEvent) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FocusListener(org.eclipse.swt.events.FocusListener) Display(org.eclipse.swt.widgets.Display)

Aggregations

SelectionAdapterFileDialogTextVar (org.pentaho.di.ui.core.events.dialog.SelectionAdapterFileDialogTextVar)22 SelectionAdapterOptions (org.pentaho.di.ui.core.events.dialog.SelectionAdapterOptions)22 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)20 SelectionEvent (org.eclipse.swt.events.SelectionEvent)20 ShellAdapter (org.eclipse.swt.events.ShellAdapter)20 ShellEvent (org.eclipse.swt.events.ShellEvent)20 FormAttachment (org.eclipse.swt.layout.FormAttachment)20 FormData (org.eclipse.swt.layout.FormData)20 FormLayout (org.eclipse.swt.layout.FormLayout)20 Button (org.eclipse.swt.widgets.Button)20 Display (org.eclipse.swt.widgets.Display)20 Label (org.eclipse.swt.widgets.Label)20 Shell (org.eclipse.swt.widgets.Shell)20 Text (org.eclipse.swt.widgets.Text)20 ModifyEvent (org.eclipse.swt.events.ModifyEvent)19 ModifyListener (org.eclipse.swt.events.ModifyListener)19 Event (org.eclipse.swt.widgets.Event)19 Listener (org.eclipse.swt.widgets.Listener)19 TextVar (org.pentaho.di.ui.core.widget.TextVar)18 CCombo (org.eclipse.swt.custom.CCombo)16