Search in sources :

Example 71 with CTabItem

use of org.eclipse.swt.custom.CTabItem in project pentaho-kettle by pentaho.

the class LDIFInputDialog 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, "LDIFInputDialog.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 ///
    // ////////////////////////
    wFileTab = new CTabItem(wTabFolder, SWT.NONE);
    wFileTab.setText(BaseMessages.getString(PKG, "LDIFInputDialog.File.Tab"));
    wFileComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wFileComp);
    FormLayout fileLayout = new FormLayout();
    fileLayout.marginWidth = 3;
    fileLayout.marginHeight = 3;
    wFileComp.setLayout(fileLayout);
    // ///////////////////////////////
    // START OF Origin files GROUP //
    // ///////////////////////////////
    wOriginFiles = new Group(wFileComp, SWT.SHADOW_NONE);
    props.setLook(wOriginFiles);
    wOriginFiles.setText(BaseMessages.getString(PKG, "LDIFInputDialog.wOriginFiles.Label"));
    FormLayout OriginFilesgroupLayout = new FormLayout();
    OriginFilesgroupLayout.marginWidth = 10;
    OriginFilesgroupLayout.marginHeight = 10;
    wOriginFiles.setLayout(OriginFilesgroupLayout);
    // Is Filename defined in a Field
    wlFileField = new Label(wOriginFiles, SWT.RIGHT);
    wlFileField.setText(BaseMessages.getString(PKG, "LDIFInputDialog.FileField.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);
    wFileField = new Button(wOriginFiles, SWT.CHECK);
    props.setLook(wFileField);
    wFileField.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.FileField.Tooltip"));
    fdFileField = new FormData();
    fdFileField.left = new FormAttachment(middle, -margin);
    fdFileField.top = new FormAttachment(0, margin);
    wFileField.setLayoutData(fdFileField);
    SelectionAdapter lfilefield = new SelectionAdapter() {

        public void widgetSelected(SelectionEvent arg0) {
            ActiveFileField();
            input.setChanged();
        }
    };
    wFileField.addSelectionListener(lfilefield);
    // Filename field
    wlFilenameField = new Label(wOriginFiles, SWT.RIGHT);
    wlFilenameField.setText(BaseMessages.getString(PKG, "LDIFInputDialog.wlFilenameField.Label"));
    props.setLook(wlFilenameField);
    fdlFilenameField = new FormData();
    fdlFilenameField.left = new FormAttachment(0, -margin);
    fdlFilenameField.top = new FormAttachment(wFileField, margin);
    fdlFilenameField.right = new FormAttachment(middle, -2 * margin);
    wlFilenameField.setLayoutData(fdlFilenameField);
    wFilenameField = new CCombo(wOriginFiles, SWT.BORDER | SWT.READ_ONLY);
    wFilenameField.setEditable(true);
    props.setLook(wFilenameField);
    wFilenameField.addModifyListener(lsMod);
    fdFilenameField = new FormData();
    fdFilenameField.left = new FormAttachment(middle, -margin);
    fdFilenameField.top = new FormAttachment(wFileField, margin);
    fdFilenameField.right = new FormAttachment(100, -margin);
    wFilenameField.setLayoutData(fdFilenameField);
    wFilenameField.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);
            setFileField();
            shell.setCursor(null);
            busy.dispose();
        }
    });
    fdOriginFiles = new FormData();
    fdOriginFiles.left = new FormAttachment(0, margin);
    fdOriginFiles.top = new FormAttachment(wFilenameList, margin);
    fdOriginFiles.right = new FormAttachment(100, -margin);
    wOriginFiles.setLayoutData(fdOriginFiles);
    // ///////////////////////////////////////////////////////////
    // / END OF Origin files GROUP
    // ///////////////////////////////////////////////////////////
    // Filename line
    wlFilename = new Label(wFileComp, SWT.RIGHT);
    wlFilename.setText(BaseMessages.getString(PKG, "LDIFInputDialog.Filename.Label"));
    props.setLook(wlFilename);
    fdlFilename = new FormData();
    fdlFilename.left = new FormAttachment(0, 0);
    fdlFilename.top = new FormAttachment(wOriginFiles, margin);
    fdlFilename.right = new FormAttachment(middle, -margin);
    wlFilename.setLayoutData(fdlFilename);
    wbbFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbbFilename);
    wbbFilename.setText(BaseMessages.getString(PKG, "LDIFInputDialog.FilenameBrowse.Button"));
    wbbFilename.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.BrowseForFileOrDirAndAdd"));
    fdbFilename = new FormData();
    fdbFilename.right = new FormAttachment(100, 0);
    fdbFilename.top = new FormAttachment(wOriginFiles, margin);
    wbbFilename.setLayoutData(fdbFilename);
    wbaFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbaFilename);
    wbaFilename.setText(BaseMessages.getString(PKG, "LDIFInputDialog.FilenameAdd.Button"));
    wbaFilename.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.FilenameAdd.Tooltip"));
    fdbaFilename = new FormData();
    fdbaFilename.right = new FormAttachment(wbbFilename, -margin);
    fdbaFilename.top = new FormAttachment(wOriginFiles, margin);
    wbaFilename.setLayoutData(fdbaFilename);
    wFilename = new TextVar(transMeta, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wFilename);
    wFilename.addModifyListener(lsMod);
    fdFilename = new FormData();
    fdFilename.left = new FormAttachment(middle, 0);
    fdFilename.right = new FormAttachment(wbaFilename, -margin);
    fdFilename.top = new FormAttachment(wOriginFiles, margin);
    wFilename.setLayoutData(fdFilename);
    wlFilemask = new Label(wFileComp, SWT.RIGHT);
    wlFilemask.setText(BaseMessages.getString(PKG, "LDIFInputDialog.RegExp.Label"));
    props.setLook(wlFilemask);
    fdlFilemask = new FormData();
    fdlFilemask.left = new FormAttachment(0, 0);
    fdlFilemask.top = new FormAttachment(wFilename, margin);
    fdlFilemask.right = new FormAttachment(middle, -margin);
    wlFilemask.setLayoutData(fdlFilemask);
    wFilemask = new TextVar(transMeta, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wFilemask);
    wFilemask.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.RegExp.Tooltip"));
    wFilemask.addModifyListener(lsMod);
    fdFilemask = new FormData();
    fdFilemask.left = new FormAttachment(middle, 0);
    fdFilemask.top = new FormAttachment(wFilename, margin);
    fdFilemask.right = new FormAttachment(100, 0);
    wFilemask.setLayoutData(fdFilemask);
    wlExcludeFilemask = new Label(wFileComp, SWT.RIGHT);
    wlExcludeFilemask.setText(BaseMessages.getString(PKG, "LDIFInputDialog.ExcludeFilemask.Label"));
    props.setLook(wlExcludeFilemask);
    fdlExcludeFilemask = new FormData();
    fdlExcludeFilemask.left = new FormAttachment(0, 0);
    fdlExcludeFilemask.top = new FormAttachment(wFilemask, margin);
    fdlExcludeFilemask.right = new FormAttachment(middle, -margin);
    wlExcludeFilemask.setLayoutData(fdlExcludeFilemask);
    wExcludeFilemask = new TextVar(transMeta, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wExcludeFilemask);
    wExcludeFilemask.addModifyListener(lsMod);
    fdExcludeFilemask = new FormData();
    fdExcludeFilemask.left = new FormAttachment(middle, 0);
    fdExcludeFilemask.top = new FormAttachment(wFilemask, margin);
    fdExcludeFilemask.right = new FormAttachment(wFilename, 0, SWT.RIGHT);
    wExcludeFilemask.setLayoutData(fdExcludeFilemask);
    // Filename list line
    wlFilenameList = new Label(wFileComp, SWT.RIGHT);
    wlFilenameList.setText(BaseMessages.getString(PKG, "LDIFInputDialog.FilenameList.Label"));
    props.setLook(wlFilenameList);
    fdlFilenameList = new FormData();
    fdlFilenameList.left = new FormAttachment(0, 0);
    fdlFilenameList.top = new FormAttachment(wExcludeFilemask, margin);
    fdlFilenameList.right = new FormAttachment(middle, -margin);
    wlFilenameList.setLayoutData(fdlFilenameList);
    // Buttons to the right of the screen...
    wbdFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbdFilename);
    wbdFilename.setText(BaseMessages.getString(PKG, "LDIFInputDialog.FilenameRemove.Button"));
    wbdFilename.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.FilenameRemove.Tooltip"));
    fdbdFilename = new FormData();
    fdbdFilename.right = new FormAttachment(100, 0);
    fdbdFilename.top = new FormAttachment(wExcludeFilemask, 40);
    wbdFilename.setLayoutData(fdbdFilename);
    wbeFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbeFilename);
    wbeFilename.setText(BaseMessages.getString(PKG, "LDIFInputDialog.FilenameEdit.Button"));
    wbeFilename.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.FilenameEdit.Tooltip"));
    fdbeFilename = new FormData();
    fdbeFilename.right = new FormAttachment(100, 0);
    fdbeFilename.top = new FormAttachment(wbdFilename, margin);
    wbeFilename.setLayoutData(fdbeFilename);
    wbShowFiles = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbShowFiles);
    wbShowFiles.setText(BaseMessages.getString(PKG, "LDIFInputDialog.ShowFiles.Button"));
    fdbShowFiles = new FormData();
    fdbShowFiles.left = new FormAttachment(middle, 0);
    fdbShowFiles.bottom = new FormAttachment(100, 0);
    wbShowFiles.setLayoutData(fdbShowFiles);
    ColumnInfo[] colinfo = new ColumnInfo[5];
    colinfo[0] = new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.Files.Filename.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false);
    colinfo[1] = new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.Files.Wildcard.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false);
    colinfo[2] = new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.Files.ExcludeWildcard.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false);
    colinfo[3] = new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.Required.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, LDIFInputMeta.RequiredFilesDesc);
    colinfo[4] = new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.IncludeSubDirs.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, LDIFInputMeta.RequiredFilesDesc);
    colinfo[0].setUsingVariables(true);
    colinfo[1].setUsingVariables(true);
    colinfo[1].setToolTip(BaseMessages.getString(PKG, "LDIFInputDialog.Files.Wildcard.Tooltip"));
    colinfo[2].setToolTip(BaseMessages.getString(PKG, "LDIFInputDialog.Required.Tooltip"));
    colinfo[2].setUsingVariables(true);
    colinfo[2].setToolTip(BaseMessages.getString(PKG, "LDIFInputDialog.Files.ExcludeWildcard.Tooltip"));
    colinfo[4].setToolTip(BaseMessages.getString(PKG, "LDIFInputDialog.IncludeSubDirs.Tooltip"));
    wFilenameList = new TableView(transMeta, wFileComp, SWT.FULL_SELECTION | SWT.SINGLE | SWT.BORDER, colinfo, 2, lsMod, props);
    props.setLook(wFilenameList);
    fdFilenameList = new FormData();
    fdFilenameList.left = new FormAttachment(middle, 0);
    fdFilenameList.right = new FormAttachment(wbdFilename, -margin);
    fdFilenameList.top = new FormAttachment(wExcludeFilemask, margin);
    fdFilenameList.bottom = new FormAttachment(wbShowFiles, -margin);
    wFilenameList.setLayoutData(fdFilenameList);
    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, "LDIFInputDialog.Content.Tab"));
    FormLayout contentLayout = new FormLayout();
    contentLayout.marginWidth = 3;
    contentLayout.marginHeight = 3;
    wContentComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wContentComp);
    wContentComp.setLayout(contentLayout);
    wlInclFilename = new Label(wContentComp, SWT.RIGHT);
    wlInclFilename.setText(BaseMessages.getString(PKG, "LDIFInputDialog.InclFilename.Label"));
    props.setLook(wlInclFilename);
    fdlInclFilename = new FormData();
    fdlInclFilename.left = new FormAttachment(0, 0);
    fdlInclFilename.top = new FormAttachment(0, 2 * margin);
    fdlInclFilename.right = new FormAttachment(middle, -margin);
    wlInclFilename.setLayoutData(fdlInclFilename);
    wInclFilename = new Button(wContentComp, SWT.CHECK);
    props.setLook(wInclFilename);
    wInclFilename.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.InclFilename.Tooltip"));
    fdInclFilename = new FormData();
    fdInclFilename.left = new FormAttachment(middle, 0);
    fdInclFilename.top = new FormAttachment(0, 2 * margin);
    wInclFilename.setLayoutData(fdInclFilename);
    wlInclFilenameField = new Label(wContentComp, SWT.LEFT);
    wlInclFilenameField.setText(BaseMessages.getString(PKG, "LDIFInputDialog.InclFilenameField.Label"));
    props.setLook(wlInclFilenameField);
    fdlInclFilenameField = new FormData();
    fdlInclFilenameField.left = new FormAttachment(wInclFilename, margin);
    fdlInclFilenameField.top = new FormAttachment(0, 2 * margin);
    wlInclFilenameField.setLayoutData(fdlInclFilenameField);
    wInclFilenameField = new TextVar(transMeta, wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wInclFilenameField);
    wInclFilenameField.addModifyListener(lsMod);
    fdInclFilenameField = new FormData();
    fdInclFilenameField.left = new FormAttachment(wlInclFilenameField, margin);
    fdInclFilenameField.top = new FormAttachment(0, 2 * margin);
    fdInclFilenameField.right = new FormAttachment(100, 0);
    wInclFilenameField.setLayoutData(fdInclFilenameField);
    wlInclRownum = new Label(wContentComp, SWT.RIGHT);
    wlInclRownum.setText(BaseMessages.getString(PKG, "LDIFInputDialog.InclRownum.Label"));
    props.setLook(wlInclRownum);
    fdlInclRownum = new FormData();
    fdlInclRownum.left = new FormAttachment(0, 0);
    fdlInclRownum.top = new FormAttachment(wInclFilenameField, margin);
    fdlInclRownum.right = new FormAttachment(middle, -margin);
    wlInclRownum.setLayoutData(fdlInclRownum);
    wInclRownum = new Button(wContentComp, SWT.CHECK);
    props.setLook(wInclRownum);
    wInclRownum.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.InclRownum.Tooltip"));
    fdRownum = new FormData();
    fdRownum.left = new FormAttachment(middle, 0);
    fdRownum.top = new FormAttachment(wInclFilenameField, margin);
    wInclRownum.setLayoutData(fdRownum);
    wlInclRownumField = new Label(wContentComp, SWT.RIGHT);
    wlInclRownumField.setText(BaseMessages.getString(PKG, ("LDIFInputDialog.InclRownumField.Label")));
    props.setLook(wlInclRownumField);
    fdlInclRownumField = new FormData();
    fdlInclRownumField.left = new FormAttachment(wInclRownum, margin);
    fdlInclRownumField.top = new FormAttachment(wInclFilenameField, margin);
    wlInclRownumField.setLayoutData(fdlInclRownumField);
    wInclRownumField = new TextVar(transMeta, wContentComp, 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(wInclFilenameField, margin);
    fdInclRownumField.right = new FormAttachment(100, 0);
    wInclRownumField.setLayoutData(fdInclRownumField);
    // Add content type field?
    wlInclContentType = new Label(wContentComp, SWT.RIGHT);
    wlInclContentType.setText(BaseMessages.getString(PKG, "LDIFInputDialog.InclContentType.Label"));
    props.setLook(wlInclContentType);
    fdlInclContentType = new FormData();
    fdlInclContentType.left = new FormAttachment(0, 0);
    fdlInclContentType.top = new FormAttachment(wInclRownumField, margin);
    fdlInclContentType.right = new FormAttachment(middle, -margin);
    wlInclContentType.setLayoutData(fdlInclContentType);
    wInclContentType = new Button(wContentComp, SWT.CHECK);
    props.setLook(wInclContentType);
    wInclContentType.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.InclContentType.Tooltip"));
    fdInclContentType = new FormData();
    fdInclContentType.left = new FormAttachment(middle, 0);
    fdInclContentType.top = new FormAttachment(wInclRownumField, margin);
    wInclContentType.setLayoutData(fdInclContentType);
    // Content type field name
    wlInclContentTypeField = new Label(wContentComp, SWT.LEFT);
    wlInclContentTypeField.setText(BaseMessages.getString(PKG, "LDIFInputDialog.InclContentTypeField.Label"));
    props.setLook(wlInclContentTypeField);
    fdlInclContentTypeField = new FormData();
    fdlInclContentTypeField.left = new FormAttachment(wInclContentType, margin);
    fdlInclContentTypeField.top = new FormAttachment(wInclRownumField, margin);
    wlInclContentTypeField.setLayoutData(fdlInclContentTypeField);
    wInclContentTypeField = new TextVar(transMeta, wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wInclContentTypeField);
    wInclContentTypeField.addModifyListener(lsMod);
    fdInclContentTypeField = new FormData();
    fdInclContentTypeField.left = new FormAttachment(wlInclContentTypeField, margin);
    fdInclContentTypeField.top = new FormAttachment(wInclRownumField, margin);
    fdInclContentTypeField.right = new FormAttachment(100, 0);
    wInclContentTypeField.setLayoutData(fdInclContentTypeField);
    // Add content type field?
    wlInclDN = new Label(wContentComp, SWT.RIGHT);
    wlInclDN.setText(BaseMessages.getString(PKG, "LDIFInputDialog.InclDN.Label"));
    props.setLook(wlInclDN);
    fdlInclDN = new FormData();
    fdlInclDN.left = new FormAttachment(0, 0);
    fdlInclDN.top = new FormAttachment(wInclContentTypeField, margin);
    fdlInclDN.right = new FormAttachment(middle, -margin);
    wlInclDN.setLayoutData(fdlInclDN);
    wInclDN = new Button(wContentComp, SWT.CHECK);
    props.setLook(wInclDN);
    wInclDN.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.InclDN.Tooltip"));
    fdInclDN = new FormData();
    fdInclDN.left = new FormAttachment(middle, 0);
    fdInclDN.top = new FormAttachment(wInclContentTypeField, margin);
    wInclDN.setLayoutData(fdInclDN);
    // Content type field name
    wlInclDNField = new Label(wContentComp, SWT.LEFT);
    wlInclDNField.setText(BaseMessages.getString(PKG, "LDIFInputDialog.InclDNField.Label"));
    props.setLook(wlInclDNField);
    fdlInclDNField = new FormData();
    fdlInclDNField.left = new FormAttachment(wInclDN, margin);
    fdlInclDNField.top = new FormAttachment(wInclContentTypeField, margin);
    wlInclDNField.setLayoutData(fdlInclDNField);
    wInclDNField = new TextVar(transMeta, wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wInclDNField);
    wInclDNField.addModifyListener(lsMod);
    fdInclDNField = new FormData();
    fdInclDNField.left = new FormAttachment(wlInclDNField, margin);
    fdInclDNField.top = new FormAttachment(wInclContentTypeField, margin);
    fdInclDNField.right = new FormAttachment(100, 0);
    wInclDNField.setLayoutData(fdInclDNField);
    // Limit to preview
    wlLimit = new Label(wContentComp, SWT.RIGHT);
    wlLimit.setText(BaseMessages.getString(PKG, "LDIFInputDialog.Limit.Label"));
    props.setLook(wlLimit);
    fdlLimit = new FormData();
    fdlLimit.left = new FormAttachment(0, 0);
    fdlLimit.top = new FormAttachment(wInclDNField, margin);
    fdlLimit.right = new FormAttachment(middle, -margin);
    wlLimit.setLayoutData(fdlLimit);
    wLimit = new Text(wContentComp, 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(wInclDNField, margin);
    fdLimit.right = new FormAttachment(100, 0);
    wLimit.setLayoutData(fdLimit);
    // Multi valued field separator
    wlMultiValuedSeparator = new Label(wContentComp, SWT.RIGHT);
    wlMultiValuedSeparator.setText(BaseMessages.getString(PKG, "LDIFInputDialog.MultiValuedSeparator.Label"));
    props.setLook(wlMultiValuedSeparator);
    fdlMultiValuedSeparator = new FormData();
    fdlMultiValuedSeparator.left = new FormAttachment(0, 0);
    fdlMultiValuedSeparator.top = new FormAttachment(wLimit, margin);
    fdlMultiValuedSeparator.right = new FormAttachment(middle, -margin);
    wlMultiValuedSeparator.setLayoutData(fdlMultiValuedSeparator);
    wMultiValuedSeparator = new TextVar(transMeta, wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wMultiValuedSeparator);
    wMultiValuedSeparator.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.MultiValuedSeparator.Tooltip"));
    wMultiValuedSeparator.addModifyListener(lsMod);
    fdMultiValuedSeparator = new FormData();
    fdMultiValuedSeparator.left = new FormAttachment(middle, 0);
    fdMultiValuedSeparator.top = new FormAttachment(wLimit, margin);
    fdMultiValuedSeparator.right = new FormAttachment(100, 0);
    wMultiValuedSeparator.setLayoutData(fdMultiValuedSeparator);
    // ///////////////////////////////
    // START OF AddFileResult GROUP //
    // ///////////////////////////////
    wAddFileResult = new Group(wContentComp, SWT.SHADOW_NONE);
    props.setLook(wAddFileResult);
    wAddFileResult.setText(BaseMessages.getString(PKG, "LDIFInputDialog.wAddFileResult.Label"));
    FormLayout AddFileResultgroupLayout = new FormLayout();
    AddFileResultgroupLayout.marginWidth = 10;
    AddFileResultgroupLayout.marginHeight = 10;
    wAddFileResult.setLayout(AddFileResultgroupLayout);
    wlAddResult = new Label(wAddFileResult, SWT.RIGHT);
    wlAddResult.setText(BaseMessages.getString(PKG, "LDIFInputDialog.AddResult.Label"));
    props.setLook(wlAddResult);
    fdlAddResult = new FormData();
    fdlAddResult.left = new FormAttachment(0, 0);
    fdlAddResult.top = new FormAttachment(wMultiValuedSeparator, margin);
    fdlAddResult.right = new FormAttachment(middle, -margin);
    wlAddResult.setLayoutData(fdlAddResult);
    wAddResult = new Button(wAddFileResult, SWT.CHECK);
    props.setLook(wAddResult);
    wAddResult.setToolTipText(BaseMessages.getString(PKG, "LDIFInputDialog.AddResult.Tooltip"));
    fdAddResult = new FormData();
    fdAddResult.left = new FormAttachment(middle, 0);
    fdAddResult.top = new FormAttachment(wMultiValuedSeparator, margin);
    wAddResult.setLayoutData(fdAddResult);
    fdAddFileResult = new FormData();
    fdAddFileResult.left = new FormAttachment(0, margin);
    fdAddFileResult.top = new FormAttachment(wMultiValuedSeparator, margin);
    fdAddFileResult.right = new FormAttachment(100, -margin);
    wAddFileResult.setLayoutData(fdAddFileResult);
    // ///////////////////////////////////////////////////////////
    // / END OF AddFileResult GROUP
    // ///////////////////////////////////////////////////////////
    fdContentComp = new FormData();
    fdContentComp.left = new FormAttachment(0, 0);
    fdContentComp.top = new FormAttachment(0, 0);
    fdContentComp.right = new FormAttachment(100, 0);
    fdContentComp.bottom = new FormAttachment(100, 0);
    wContentComp.setLayoutData(fdContentComp);
    wContentComp.layout();
    wContentTab.setControl(wContentComp);
    // ///////////////////////////////////////////////////////////
    // / END OF CONTENT TAB
    // ///////////////////////////////////////////////////////////
    // Fields tab...
    // 
    wFieldsTab = new CTabItem(wTabFolder, SWT.NONE);
    wFieldsTab.setText(BaseMessages.getString(PKG, "LDIFInputDialog.Fields.Tab"));
    FormLayout fieldsLayout = new FormLayout();
    fieldsLayout.marginWidth = Const.FORM_MARGIN;
    fieldsLayout.marginHeight = Const.FORM_MARGIN;
    wFieldsComp = new Composite(wTabFolder, SWT.NONE);
    wFieldsComp.setLayout(fieldsLayout);
    props.setLook(wFieldsComp);
    wGet = new Button(wFieldsComp, SWT.PUSH);
    wGet.setText(BaseMessages.getString(PKG, "LDIFInputDialog.GetFields.Button"));
    fdGet = new FormData();
    fdGet.left = new FormAttachment(50, 0);
    fdGet.bottom = new FormAttachment(100, 0);
    wGet.setLayoutData(fdGet);
    final int FieldsRows = input.getInputFields().length;
    ColumnInfo[] colinf = new ColumnInfo[] { new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Name.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Attribut.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Type.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaFactory.getValueMetaNames(), true), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Format.Column"), ColumnInfo.COLUMN_TYPE_FORMAT, 3), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Length.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Precision.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Currency.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Decimal.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Group.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.TrimType.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, LDIFInputField.trimTypeDesc, true), new ColumnInfo(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Repeat.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { BaseMessages.getString(PKG, "System.Combo.Yes"), BaseMessages.getString(PKG, "System.Combo.No") }, true) };
    colinf[0].setUsingVariables(true);
    colinf[0].setToolTip(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Name.Column.Tooltip"));
    colinf[1].setUsingVariables(true);
    colinf[1].setToolTip(BaseMessages.getString(PKG, "LDIFInputDialog.FieldsTable.Attribut.Column.Tooltip"));
    wFields = new TableView(transMeta, wFieldsComp, 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);
    fdFieldsComp = new FormData();
    fdFieldsComp.left = new FormAttachment(0, 0);
    fdFieldsComp.top = new FormAttachment(0, 0);
    fdFieldsComp.right = new FormAttachment(100, 0);
    fdFieldsComp.bottom = new FormAttachment(100, 0);
    wFieldsComp.setLayoutData(fdFieldsComp);
    wFieldsComp.layout();
    wFieldsTab.setControl(wFieldsComp);
    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);
    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, "LDIFInputDialog.Button.PreviewRows"));
    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();
        }
    };
    lsGet = new Listener() {

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

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

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

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

        public void widgetSelected(SelectionEvent arg0) {
            wFilenameList.add(new String[] { wFilename.getText(), wFilemask.getText(), wExcludeFilemask.getText(), LDIFInputMeta.RequiredFilesCode[0], LDIFInputMeta.RequiredFilesCode[0] });
            wFilename.setText("");
            wFilemask.setText("");
            wExcludeFilemask.setText("");
            wFilenameList.removeEmptyRows();
            wFilenameList.setRowNums();
            wFilenameList.optWidth(true);
        }
    };
    wbaFilename.addSelectionListener(selA);
    wFilename.addSelectionListener(selA);
    // Delete files from the list of files...
    wbdFilename.addSelectionListener(new SelectionAdapter() {

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

        public void widgetSelected(SelectionEvent arg0) {
            int idx = wFilenameList.getSelectionIndex();
            if (idx >= 0) {
                String[] string = wFilenameList.getItem(idx);
                wFilename.setText(string[0]);
                wFilemask.setText(string[1]);
                wExcludeFilemask.setText(string[2]);
                wFilenameList.remove(idx);
            }
            wFilenameList.removeEmptyRows();
            wFilenameList.setRowNums();
        }
    });
    // Show the files that are selected at this time...
    wbShowFiles.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            try {
                LDIFInputMeta tfii = new LDIFInputMeta();
                getInfo(tfii);
                FileInputList fileInputList = tfii.getFiles(transMeta);
                String[] files = fileInputList.getFileStrings();
                if (files != null && files.length > 0) {
                    EnterSelectionDialog esd = new EnterSelectionDialog(shell, files, BaseMessages.getString(PKG, "LDIFInputDialog.FilesReadSelection.DialogTitle"), BaseMessages.getString(PKG, "LDIFInputDialog.FilesReadSelection.DialogMessage"));
                    esd.setViewOnly();
                    esd.open();
                } else {
                    MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
                    mb.setMessage(BaseMessages.getString(PKG, "LDIFInputDialog.NoFileFound.DialogMessage"));
                    mb.setText(BaseMessages.getString(PKG, "System.Dialog.Error.Title"));
                    mb.open();
                }
            } catch (KettleException ex) {
                new ErrorDialog(shell, BaseMessages.getString(PKG, "LDIFInputDialog.ErrorParsingData.DialogTitle"), BaseMessages.getString(PKG, "LDIFInputDialog.ErrorParsingData.DialogMessage"), ex);
            }
        }
    });
    // Enable/disable the right fields to allow a filename to be added to
    // each row...
    wInclFilename.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            setIncludeFilename();
        }
    });
    // Enable/disable the right fields to allow a row number to be added to
    // each row...
    wInclRownum.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            setIncludeRownum();
        }
    });
    // Enable/disable the right fields to allow a content type to be added to
    // each row...
    wInclContentType.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            setContenType();
        }
    });
    // Enable/disable the right fields to allow a content type to be added to
    // each row...
    wInclDN.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            setDN();
        }
    });
    // Whenever something changes, set the tooltip to the expanded version
    // of the filename:
    wFilename.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            wFilename.setToolTipText(transMeta.environmentSubstitute(wFilename.getText()));
        }
    });
    // Listen to the Browse... button
    wbbFilename.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (!Utils.isEmpty(wFilemask.getText()) || !Utils.isEmpty(wExcludeFilemask.getText())) {
                DirectoryDialog dialog = new DirectoryDialog(shell, SWT.OPEN);
                if (wFilename.getText() != null) {
                    String fpath = transMeta.environmentSubstitute(wFilename.getText());
                    dialog.setFilterPath(fpath);
                }
                if (dialog.open() != null) {
                    String str = dialog.getFilterPath();
                    wFilename.setText(str);
                }
            } else {
                FileDialog dialog = new FileDialog(shell, SWT.OPEN);
                dialog.setFilterExtensions(new String[] { "*ldif;*.LDIF", "*" });
                if (wFilename.getText() != null) {
                    String fname = transMeta.environmentSubstitute(wFilename.getText());
                    dialog.setFileName(fname);
                }
                dialog.setFilterNames(new String[] { BaseMessages.getString(PKG, "LDIFInputDialog.FileType"), BaseMessages.getString(PKG, "System.FileType.AllFiles") });
                if (dialog.open() != null) {
                    String str = dialog.getFilterPath() + System.getProperty("file.separator") + dialog.getFileName();
                    wFilename.setText(str);
                }
            }
        }
    });
    // Detect X or ALT-F4 or something that kills this window...
    shell.addShellListener(new ShellAdapter() {

        public void shellClosed(ShellEvent e) {
            cancel();
        }
    });
    wTabFolder.setSelection(0);
    // Set the shell size, based upon previous time...
    setSize();
    getData(input);
    ActiveFileField();
    setContenType();
    setDN();
    input.setChanged(changed);
    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) 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) 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) LDIFInputMeta(org.pentaho.di.trans.steps.ldifinput.LDIFInputMeta) Button(org.eclipse.swt.widgets.Button) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FormAttachment(org.eclipse.swt.layout.FormAttachment) FileInputList(org.pentaho.di.core.fileinput.FileInputList) EnterSelectionDialog(org.pentaho.di.ui.core.dialog.EnterSelectionDialog) TableView(org.pentaho.di.ui.core.widget.TableView) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog) 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) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) Text(org.eclipse.swt.widgets.Text) TextVar(org.pentaho.di.ui.core.widget.TextVar) MessageBox(org.eclipse.swt.widgets.MessageBox) 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) FocusListener(org.eclipse.swt.events.FocusListener) FileDialog(org.eclipse.swt.widgets.FileDialog) Display(org.eclipse.swt.widgets.Display)

Example 72 with CTabItem

use of org.eclipse.swt.custom.CTabItem in project pentaho-kettle by pentaho.

the class ExcelInputDialog method addErrorTab.

private void addErrorTab() {
    // 
    // START OF ERROR TAB /
    // /
    wErrorTab = new CTabItem(wTabFolder, SWT.NONE);
    wErrorTab.setText(BaseMessages.getString(PKG, "ExcelInputDialog.ErrorTab.TabTitle"));
    FormLayout errorLayout = new FormLayout();
    errorLayout.marginWidth = 3;
    errorLayout.marginHeight = 3;
    wErrorComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wErrorComp);
    wErrorComp.setLayout(errorLayout);
    // ERROR HANDLING...
    // ErrorIgnored?
    wlStrictTypes = new Label(wErrorComp, SWT.RIGHT);
    wlStrictTypes.setText(BaseMessages.getString(PKG, "ExcelInputDialog.StrictTypes.Label"));
    props.setLook(wlStrictTypes);
    fdlStrictTypes = new FormData();
    fdlStrictTypes.left = new FormAttachment(0, 0);
    fdlStrictTypes.top = new FormAttachment(0, margin);
    fdlStrictTypes.right = new FormAttachment(middle, -margin);
    wlStrictTypes.setLayoutData(fdlStrictTypes);
    wStrictTypes = new Button(wErrorComp, SWT.CHECK);
    props.setLook(wStrictTypes);
    wStrictTypes.setToolTipText(BaseMessages.getString(PKG, "ExcelInputDialog.StrictTypes.Tooltip"));
    fdStrictTypes = new FormData();
    fdStrictTypes.left = new FormAttachment(middle, 0);
    fdStrictTypes.top = new FormAttachment(0, margin);
    wStrictTypes.setLayoutData(fdStrictTypes);
    Control previous = wStrictTypes;
    wStrictTypes.addSelectionListener(new ComponentSelectionListener(input));
    // ErrorIgnored?
    wlErrorIgnored = new Label(wErrorComp, SWT.RIGHT);
    wlErrorIgnored.setText(BaseMessages.getString(PKG, "ExcelInputDialog.ErrorIgnored.Label"));
    props.setLook(wlErrorIgnored);
    fdlErrorIgnored = new FormData();
    fdlErrorIgnored.left = new FormAttachment(0, 0);
    fdlErrorIgnored.top = new FormAttachment(previous, margin);
    fdlErrorIgnored.right = new FormAttachment(middle, -margin);
    wlErrorIgnored.setLayoutData(fdlErrorIgnored);
    wErrorIgnored = new Button(wErrorComp, SWT.CHECK);
    props.setLook(wErrorIgnored);
    wErrorIgnored.setToolTipText(BaseMessages.getString(PKG, "ExcelInputDialog.ErrorIgnored.Tooltip"));
    fdErrorIgnored = new FormData();
    fdErrorIgnored.left = new FormAttachment(middle, 0);
    fdErrorIgnored.top = new FormAttachment(previous, margin);
    wErrorIgnored.setLayoutData(fdErrorIgnored);
    previous = wErrorIgnored;
    wErrorIgnored.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent arg0) {
            setFlags();
            input.setChanged();
        }
    });
    // Skip error lines?
    wlSkipErrorLines = new Label(wErrorComp, SWT.RIGHT);
    wlSkipErrorLines.setText(BaseMessages.getString(PKG, "ExcelInputDialog.SkipErrorLines.Label"));
    props.setLook(wlSkipErrorLines);
    fdlSkipErrorLines = new FormData();
    fdlSkipErrorLines.left = new FormAttachment(0, 0);
    fdlSkipErrorLines.top = new FormAttachment(previous, margin);
    fdlSkipErrorLines.right = new FormAttachment(middle, -margin);
    wlSkipErrorLines.setLayoutData(fdlSkipErrorLines);
    wSkipErrorLines = new Button(wErrorComp, SWT.CHECK);
    props.setLook(wSkipErrorLines);
    wSkipErrorLines.setToolTipText(BaseMessages.getString(PKG, "ExcelInputDialog.SkipErrorLines.Tooltip"));
    fdSkipErrorLines = new FormData();
    fdSkipErrorLines.left = new FormAttachment(middle, 0);
    fdSkipErrorLines.top = new FormAttachment(previous, margin);
    wSkipErrorLines.setLayoutData(fdSkipErrorLines);
    wSkipErrorLines.addSelectionListener(new ComponentSelectionListener(input));
    previous = wSkipErrorLines;
    // Bad lines files directory + extention
    // WarningDestDir line
    wlWarningDestDir = new Label(wErrorComp, SWT.RIGHT);
    wlWarningDestDir.setText(BaseMessages.getString(PKG, "ExcelInputDialog.WarningDestDir.Label"));
    props.setLook(wlWarningDestDir);
    fdlWarningDestDir = new FormData();
    fdlWarningDestDir.left = new FormAttachment(0, 0);
    fdlWarningDestDir.top = new FormAttachment(previous, margin * 4);
    fdlWarningDestDir.right = new FormAttachment(middle, -margin);
    wlWarningDestDir.setLayoutData(fdlWarningDestDir);
    wbbWarningDestDir = new Button(wErrorComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbbWarningDestDir);
    wbbWarningDestDir.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
    wbbWarningDestDir.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.BrowseForDir"));
    fdbWarningDestDir = new FormData();
    fdbWarningDestDir.right = new FormAttachment(100, 0);
    fdbWarningDestDir.top = new FormAttachment(previous, margin * 4);
    wbbWarningDestDir.setLayoutData(fdbWarningDestDir);
    wbvWarningDestDir = new Button(wErrorComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbvWarningDestDir);
    wbvWarningDestDir.setText(BaseMessages.getString(PKG, "System.Button.Variable"));
    wbvWarningDestDir.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.VariableToDir"));
    fdbvWarningDestDir = new FormData();
    fdbvWarningDestDir.right = new FormAttachment(wbbWarningDestDir, -margin);
    fdbvWarningDestDir.top = new FormAttachment(previous, margin * 4);
    wbvWarningDestDir.setLayoutData(fdbvWarningDestDir);
    wWarningExt = new Text(wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wWarningExt);
    wWarningExt.addModifyListener(lsMod);
    fdWarningDestExt = new FormData();
    fdWarningDestExt.left = new FormAttachment(wbvWarningDestDir, -150);
    fdWarningDestExt.right = new FormAttachment(wbvWarningDestDir, -margin);
    fdWarningDestExt.top = new FormAttachment(previous, margin * 4);
    wWarningExt.setLayoutData(fdWarningDestExt);
    wlWarningExt = new Label(wErrorComp, SWT.RIGHT);
    wlWarningExt.setText(BaseMessages.getString(PKG, "System.Label.Extension"));
    props.setLook(wlWarningExt);
    fdlWarningDestExt = new FormData();
    fdlWarningDestExt.top = new FormAttachment(previous, margin * 4);
    fdlWarningDestExt.right = new FormAttachment(wWarningExt, -margin);
    wlWarningExt.setLayoutData(fdlWarningDestExt);
    wWarningDestDir = new Text(wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wWarningDestDir);
    wWarningDestDir.addModifyListener(lsMod);
    fdWarningDestDir = new FormData();
    fdWarningDestDir.left = new FormAttachment(middle, 0);
    fdWarningDestDir.right = new FormAttachment(wlWarningExt, -margin);
    fdWarningDestDir.top = new FormAttachment(previous, margin * 4);
    wWarningDestDir.setLayoutData(fdWarningDestDir);
    // Listen to the Browse... button
    wbbWarningDestDir.addSelectionListener(DirectoryDialogButtonListenerFactory.getSelectionAdapter(shell, wWarningDestDir));
    // Listen to the Variable... button
    wbvWarningDestDir.addSelectionListener(VariableButtonListenerFactory.getSelectionAdapter(shell, wWarningDestDir, transMeta));
    // Whenever something changes, set the tooltip to the expanded version of the directory:
    wWarningDestDir.addModifyListener(getModifyListenerTooltipText(wWarningDestDir));
    // Error lines files directory + extention
    previous = wWarningDestDir;
    // ErrorDestDir line
    wlErrorDestDir = new Label(wErrorComp, SWT.RIGHT);
    wlErrorDestDir.setText(BaseMessages.getString(PKG, "ExcelInputDialog.ErrorDestDir.Label"));
    props.setLook(wlErrorDestDir);
    fdlErrorDestDir = new FormData();
    fdlErrorDestDir.left = new FormAttachment(0, 0);
    fdlErrorDestDir.top = new FormAttachment(previous, margin);
    fdlErrorDestDir.right = new FormAttachment(middle, -margin);
    wlErrorDestDir.setLayoutData(fdlErrorDestDir);
    wbbErrorDestDir = new Button(wErrorComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbbErrorDestDir);
    wbbErrorDestDir.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
    wbbErrorDestDir.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.BrowseForDir"));
    fdbErrorDestDir = new FormData();
    fdbErrorDestDir.right = new FormAttachment(100, 0);
    fdbErrorDestDir.top = new FormAttachment(previous, margin);
    wbbErrorDestDir.setLayoutData(fdbErrorDestDir);
    wbvErrorDestDir = new Button(wErrorComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbvErrorDestDir);
    wbvErrorDestDir.setText(BaseMessages.getString(PKG, "System.Button.Variable"));
    wbvErrorDestDir.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.VariableToDir"));
    fdbvErrorDestDir = new FormData();
    fdbvErrorDestDir.right = new FormAttachment(wbbErrorDestDir, -margin);
    fdbvErrorDestDir.top = new FormAttachment(previous, margin);
    wbvErrorDestDir.setLayoutData(fdbvErrorDestDir);
    wErrorExt = new Text(wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wErrorExt);
    wErrorExt.addModifyListener(lsMod);
    fdErrorDestExt = new FormData();
    fdErrorDestExt.left = new FormAttachment(wbvErrorDestDir, -150);
    fdErrorDestExt.right = new FormAttachment(wbvErrorDestDir, -margin);
    fdErrorDestExt.top = new FormAttachment(previous, margin);
    wErrorExt.setLayoutData(fdErrorDestExt);
    wlErrorExt = new Label(wErrorComp, SWT.RIGHT);
    wlErrorExt.setText(BaseMessages.getString(PKG, "System.Label.Extension"));
    props.setLook(wlErrorExt);
    fdlErrorDestExt = new FormData();
    fdlErrorDestExt.top = new FormAttachment(previous, margin);
    fdlErrorDestExt.right = new FormAttachment(wErrorExt, -margin);
    wlErrorExt.setLayoutData(fdlErrorDestExt);
    wErrorDestDir = new Text(wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wErrorDestDir);
    wErrorDestDir.addModifyListener(lsMod);
    fdErrorDestDir = new FormData();
    fdErrorDestDir.left = new FormAttachment(middle, 0);
    fdErrorDestDir.right = new FormAttachment(wlErrorExt, -margin);
    fdErrorDestDir.top = new FormAttachment(previous, margin);
    wErrorDestDir.setLayoutData(fdErrorDestDir);
    // Listen to the Browse... button
    wbbErrorDestDir.addSelectionListener(DirectoryDialogButtonListenerFactory.getSelectionAdapter(shell, wErrorDestDir));
    // Listen to the Variable... button
    wbvErrorDestDir.addSelectionListener(VariableButtonListenerFactory.getSelectionAdapter(shell, wErrorDestDir, transMeta));
    // Whenever something changes, set the tooltip to the expanded version of the directory:
    wErrorDestDir.addModifyListener(getModifyListenerTooltipText(wErrorDestDir));
    // Line numbers files directory + extention
    previous = wErrorDestDir;
    // LineNrDestDir line
    wlLineNrDestDir = new Label(wErrorComp, SWT.RIGHT);
    wlLineNrDestDir.setText(BaseMessages.getString(PKG, "ExcelInputDialog.LineNrDestDir.Label"));
    props.setLook(wlLineNrDestDir);
    fdlLineNrDestDir = new FormData();
    fdlLineNrDestDir.left = new FormAttachment(0, 0);
    fdlLineNrDestDir.top = new FormAttachment(previous, margin);
    fdlLineNrDestDir.right = new FormAttachment(middle, -margin);
    wlLineNrDestDir.setLayoutData(fdlLineNrDestDir);
    wbbLineNrDestDir = new Button(wErrorComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbbLineNrDestDir);
    wbbLineNrDestDir.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
    wbbLineNrDestDir.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.BrowseForDir"));
    fdbLineNrDestDir = new FormData();
    fdbLineNrDestDir.right = new FormAttachment(100, 0);
    fdbLineNrDestDir.top = new FormAttachment(previous, margin);
    wbbLineNrDestDir.setLayoutData(fdbLineNrDestDir);
    wbvLineNrDestDir = new Button(wErrorComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbvLineNrDestDir);
    wbvLineNrDestDir.setText(BaseMessages.getString(PKG, "System.Button.Variable"));
    wbvLineNrDestDir.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.VariableToDir"));
    fdbvLineNrDestDir = new FormData();
    fdbvLineNrDestDir.right = new FormAttachment(wbbLineNrDestDir, -margin);
    fdbvLineNrDestDir.top = new FormAttachment(previous, margin);
    wbvLineNrDestDir.setLayoutData(fdbvLineNrDestDir);
    wLineNrExt = new Text(wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wLineNrExt);
    wLineNrExt.addModifyListener(lsMod);
    fdLineNrDestExt = new FormData();
    fdLineNrDestExt.left = new FormAttachment(wbvLineNrDestDir, -150);
    fdLineNrDestExt.right = new FormAttachment(wbvLineNrDestDir, -margin);
    fdLineNrDestExt.top = new FormAttachment(previous, margin);
    wLineNrExt.setLayoutData(fdLineNrDestExt);
    wlLineNrExt = new Label(wErrorComp, SWT.RIGHT);
    wlLineNrExt.setText(BaseMessages.getString(PKG, "System.Label.Extension"));
    props.setLook(wlLineNrExt);
    fdlLineNrDestExt = new FormData();
    fdlLineNrDestExt.top = new FormAttachment(previous, margin);
    fdlLineNrDestExt.right = new FormAttachment(wLineNrExt, -margin);
    wlLineNrExt.setLayoutData(fdlLineNrDestExt);
    wLineNrDestDir = new Text(wErrorComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wLineNrDestDir);
    wLineNrDestDir.addModifyListener(lsMod);
    fdLineNrDestDir = new FormData();
    fdLineNrDestDir.left = new FormAttachment(middle, 0);
    fdLineNrDestDir.right = new FormAttachment(wlLineNrExt, -margin);
    fdLineNrDestDir.top = new FormAttachment(previous, margin);
    wLineNrDestDir.setLayoutData(fdLineNrDestDir);
    // Listen to the Browse... button
    wbbLineNrDestDir.addSelectionListener(DirectoryDialogButtonListenerFactory.getSelectionAdapter(shell, wLineNrDestDir));
    // Listen to the Variable... button
    wbvLineNrDestDir.addSelectionListener(VariableButtonListenerFactory.getSelectionAdapter(shell, wLineNrDestDir, transMeta));
    // Whenever something changes, set the tooltip to the expanded version of the directory:
    wLineNrDestDir.addModifyListener(getModifyListenerTooltipText(wLineNrDestDir));
    wErrorComp.layout();
    wErrorTab.setControl(wErrorComp);
// 
// / END OF CONTENT TAB
// 
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) CTabItem(org.eclipse.swt.custom.CTabItem) ComponentSelectionListener(org.pentaho.di.ui.trans.step.ComponentSelectionListener) Control(org.eclipse.swt.widgets.Control) Button(org.eclipse.swt.widgets.Button) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 73 with CTabItem

use of org.eclipse.swt.custom.CTabItem in project pentaho-kettle by pentaho.

the class ExcelOutputDialog method open.

@Override
public String open() {
    Shell parent = getParent();
    Display display = parent.getDisplay();
    shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN);
    props.setLook(shell);
    setShellImage(shell, input);
    ModifyListener lsMod = new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            input.setChanged();
        }
    };
    changed = input.hasChanged();
    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = Const.FORM_MARGIN;
    formLayout.marginHeight = Const.FORM_MARGIN;
    shell.setLayout(formLayout);
    shell.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.DialogTitle"));
    int middle = props.getMiddlePct();
    int margin = Const.MARGIN;
    // Stepname line
    wlStepname = new Label(shell, SWT.RIGHT);
    wlStepname.setText(BaseMessages.getString(PKG, "System.Label.StepName"));
    props.setLook(wlStepname);
    fdlStepname = new FormData();
    fdlStepname.left = new FormAttachment(0, 0);
    fdlStepname.top = new FormAttachment(0, margin);
    fdlStepname.right = new FormAttachment(middle, -margin);
    wlStepname.setLayoutData(fdlStepname);
    wStepname = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wStepname.setText(stepname);
    props.setLook(wStepname);
    wStepname.addModifyListener(lsMod);
    fdStepname = new FormData();
    fdStepname.left = new FormAttachment(middle, 0);
    fdStepname.top = new FormAttachment(0, margin);
    fdStepname.right = new FormAttachment(100, 0);
    wStepname.setLayoutData(fdStepname);
    wTabFolder = new CTabFolder(shell, SWT.BORDER);
    props.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
    // ////////////////////////
    // START OF FILE TAB///
    // /
    wFileTab = new CTabItem(wTabFolder, SWT.NONE);
    wFileTab.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.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);
    // Filename line
    wlFilename = new Label(wFileComp, SWT.RIGHT);
    wlFilename.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.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(wFileComp, 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, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wFilename);
    wFilename.addModifyListener(lsMod);
    fdFilename = new FormData();
    fdFilename.left = new FormAttachment(middle, 0);
    fdFilename.top = new FormAttachment(0, margin);
    fdFilename.right = new FormAttachment(wbFilename, -margin);
    wFilename.setLayoutData(fdFilename);
    // Create Parent Folder
    wlCreateParentFolder = new Label(wFileComp, SWT.RIGHT);
    wlCreateParentFolder.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.CreateParentFolder.Label"));
    props.setLook(wlCreateParentFolder);
    fdlCreateParentFolder = new FormData();
    fdlCreateParentFolder.left = new FormAttachment(0, 0);
    fdlCreateParentFolder.top = new FormAttachment(wFilename, margin);
    fdlCreateParentFolder.right = new FormAttachment(middle, -margin);
    wlCreateParentFolder.setLayoutData(fdlCreateParentFolder);
    wCreateParentFolder = new Button(wFileComp, SWT.CHECK);
    wCreateParentFolder.setToolTipText(BaseMessages.getString(PKG, "ExcelOutputDialog.CreateParentFolder.Tooltip"));
    props.setLook(wCreateParentFolder);
    fdCreateParentFolder = new FormData();
    fdCreateParentFolder.left = new FormAttachment(middle, 0);
    fdCreateParentFolder.top = new FormAttachment(wFilename, margin);
    fdCreateParentFolder.right = new FormAttachment(100, 0);
    wCreateParentFolder.setLayoutData(fdCreateParentFolder);
    wCreateParentFolder.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
        }
    });
    // Open new File at Init
    wlDoNotOpenNewFileInit = new Label(wFileComp, SWT.RIGHT);
    wlDoNotOpenNewFileInit.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.DoNotOpenNewFileInit.Label"));
    props.setLook(wlDoNotOpenNewFileInit);
    fdlDoNotOpenNewFileInit = new FormData();
    fdlDoNotOpenNewFileInit.left = new FormAttachment(0, 0);
    fdlDoNotOpenNewFileInit.top = new FormAttachment(wCreateParentFolder, margin);
    fdlDoNotOpenNewFileInit.right = new FormAttachment(middle, -margin);
    wlDoNotOpenNewFileInit.setLayoutData(fdlDoNotOpenNewFileInit);
    wDoNotOpenNewFileInit = new Button(wFileComp, SWT.CHECK);
    wDoNotOpenNewFileInit.setToolTipText(BaseMessages.getString(PKG, "ExcelOutputDialog.DoNotOpenNewFileInit.Tooltip"));
    props.setLook(wDoNotOpenNewFileInit);
    fdDoNotOpenNewFileInit = new FormData();
    fdDoNotOpenNewFileInit.left = new FormAttachment(middle, 0);
    fdDoNotOpenNewFileInit.top = new FormAttachment(wCreateParentFolder, margin);
    fdDoNotOpenNewFileInit.right = new FormAttachment(100, 0);
    wDoNotOpenNewFileInit.setLayoutData(fdDoNotOpenNewFileInit);
    wDoNotOpenNewFileInit.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
        }
    });
    // Extension line
    wlExtension = new Label(wFileComp, 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(wDoNotOpenNewFileInit, margin);
    fdlExtension.right = new FormAttachment(middle, -margin);
    wlExtension.setLayoutData(fdlExtension);
    wExtension = new TextVar(transMeta, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wExtension.setText("");
    props.setLook(wExtension);
    wExtension.addModifyListener(lsMod);
    fdExtension = new FormData();
    fdExtension.left = new FormAttachment(middle, 0);
    fdExtension.top = new FormAttachment(wDoNotOpenNewFileInit, margin);
    fdExtension.right = new FormAttachment(wbFilename, -margin);
    wExtension.setLayoutData(fdExtension);
    // Create multi-part file?
    wlAddStepnr = new Label(wFileComp, SWT.RIGHT);
    wlAddStepnr.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.AddStepnr.Label"));
    props.setLook(wlAddStepnr);
    fdlAddStepnr = new FormData();
    fdlAddStepnr.left = new FormAttachment(0, 0);
    fdlAddStepnr.top = new FormAttachment(wExtension, margin);
    fdlAddStepnr.right = new FormAttachment(middle, -margin);
    wlAddStepnr.setLayoutData(fdlAddStepnr);
    wAddStepnr = new Button(wFileComp, SWT.CHECK);
    props.setLook(wAddStepnr);
    fdAddStepnr = new FormData();
    fdAddStepnr.left = new FormAttachment(middle, 0);
    fdAddStepnr.top = new FormAttachment(wExtension, margin);
    fdAddStepnr.right = new FormAttachment(100, 0);
    wAddStepnr.setLayoutData(fdAddStepnr);
    wAddStepnr.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
        }
    });
    // Create multi-part file?
    wlAddDate = new Label(wFileComp, SWT.RIGHT);
    wlAddDate.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.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(wFileComp, 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(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
        // System.out.println("wAddDate.getSelection()="+wAddDate.getSelection());
        }
    });
    // Create multi-part file?
    wlAddTime = new Label(wFileComp, SWT.RIGHT);
    wlAddTime.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.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(wFileComp, 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(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
        }
    });
    // Specify date time format?
    wlSpecifyFormat = new Label(wFileComp, SWT.RIGHT);
    wlSpecifyFormat.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.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(wFileComp, SWT.CHECK);
    props.setLook(wSpecifyFormat);
    wSpecifyFormat.setToolTipText(BaseMessages.getString(PKG, "ExcelOutputDialog.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(wFileComp, SWT.RIGHT);
    wlDateTimeFormat.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.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(wFileComp, 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(wFileComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbShowFiles);
    wbShowFiles.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.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) {
            ExcelOutputMeta tfoi = new ExcelOutputMeta();
            getInfo(tfoi);
            String[] files = tfoi.getFiles(transMeta);
            if (files != null && files.length > 0) {
                EnterSelectionDialog esd = new EnterSelectionDialog(shell, files, BaseMessages.getString(PKG, "ExcelOutputDialog.SelectOutputFiles.DialogTitle"), BaseMessages.getString(PKG, "ExcelOutputDialog.SelectOutputFiles.DialogMessage"));
                esd.setViewOnly();
                esd.open();
            } else {
                MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
                mb.setMessage(BaseMessages.getString(PKG, "ExcelOutputDialog.NoFilesFound.DialogMessage"));
                mb.setText(BaseMessages.getString(PKG, "System.Dialog.Error.Title"));
                mb.open();
            }
        }
    });
    // Add File to the result files name
    wlAddToResult = new Label(wFileComp, SWT.RIGHT);
    wlAddToResult.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.AddFileToResult.Label"));
    props.setLook(wlAddToResult);
    fdlAddToResult = new FormData();
    fdlAddToResult.left = new FormAttachment(0, 0);
    fdlAddToResult.top = new FormAttachment(wbShowFiles, 2 * margin);
    fdlAddToResult.right = new FormAttachment(middle, -margin);
    wlAddToResult.setLayoutData(fdlAddToResult);
    wAddToResult = new Button(wFileComp, SWT.CHECK);
    wAddToResult.setToolTipText(BaseMessages.getString(PKG, "ExcelOutputDialog.AddFileToResult.Tooltip"));
    props.setLook(wAddToResult);
    fdAddToResult = new FormData();
    fdAddToResult.left = new FormAttachment(middle, 0);
    fdAddToResult.top = new FormAttachment(wbShowFiles, 2 * margin);
    fdAddToResult.right = new FormAttachment(100, 0);
    wAddToResult.setLayoutData(fdAddToResult);
    SelectionAdapter lsSelR = new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent arg0) {
            input.setChanged();
        }
    };
    wAddToResult.addSelectionListener(lsSelR);
    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, "ExcelOutputDialog.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);
    // Append checkbox
    wlAppend = new Label(wContentComp, SWT.RIGHT);
    wlAppend.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.Append.Label"));
    props.setLook(wlAppend);
    fdlAppend = new FormData();
    fdlAppend.left = new FormAttachment(0, 0);
    fdlAppend.top = new FormAttachment(0, 0);
    fdlAppend.right = new FormAttachment(middle, -margin);
    wlAppend.setLayoutData(fdlAppend);
    wAppend = new Button(wContentComp, SWT.CHECK);
    props.setLook(wAppend);
    wAppend.setToolTipText(BaseMessages.getString(PKG, "ExcelOutputDialog.Append.Tooltip"));
    fdAppend = new FormData();
    fdAppend.left = new FormAttachment(middle, 0);
    fdAppend.top = new FormAttachment(0, 0);
    fdAppend.right = new FormAttachment(100, 0);
    wAppend.setLayoutData(fdAppend);
    wAppend.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent arg0) {
            input.setChanged();
        }
    });
    wlHeader = new Label(wContentComp, SWT.RIGHT);
    wlHeader.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.Header.Label"));
    props.setLook(wlHeader);
    fdlHeader = new FormData();
    fdlHeader.left = new FormAttachment(0, 0);
    fdlHeader.top = new FormAttachment(wAppend, margin);
    fdlHeader.right = new FormAttachment(middle, -margin);
    wlHeader.setLayoutData(fdlHeader);
    wHeader = new Button(wContentComp, SWT.CHECK);
    props.setLook(wHeader);
    fdHeader = new FormData();
    fdHeader.left = new FormAttachment(middle, 0);
    fdHeader.top = new FormAttachment(wAppend, margin);
    fdHeader.right = new FormAttachment(100, 0);
    wHeader.setLayoutData(fdHeader);
    wHeader.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
        }
    });
    wlFooter = new Label(wContentComp, SWT.RIGHT);
    wlFooter.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.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(wContentComp, 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.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
        }
    });
    wlEncoding = new Label(wContentComp, SWT.RIGHT);
    wlEncoding.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.Encoding.Label"));
    props.setLook(wlEncoding);
    fdlEncoding = new FormData();
    fdlEncoding.left = new FormAttachment(0, 0);
    fdlEncoding.top = new FormAttachment(wFooter, margin);
    fdlEncoding.right = new FormAttachment(middle, -margin);
    wlEncoding.setLayoutData(fdlEncoding);
    wEncoding = new CCombo(wContentComp, SWT.BORDER | SWT.READ_ONLY);
    wEncoding.setEditable(true);
    props.setLook(wEncoding);
    wEncoding.addModifyListener(lsMod);
    fdEncoding = new FormData();
    fdEncoding.left = new FormAttachment(middle, 0);
    fdEncoding.top = new FormAttachment(wFooter, margin);
    fdEncoding.right = new FormAttachment(100, 0);
    wEncoding.setLayoutData(fdEncoding);
    wEncoding.addFocusListener(new FocusListener() {

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

        @Override
        public void focusGained(org.eclipse.swt.events.FocusEvent e) {
            Cursor busy = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
            shell.setCursor(busy);
            setEncodings();
            shell.setCursor(null);
            busy.dispose();
        }
    });
    wlSplitEvery = new Label(wContentComp, SWT.RIGHT);
    wlSplitEvery.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.SplitEvery.Label"));
    props.setLook(wlSplitEvery);
    fdlSplitEvery = new FormData();
    fdlSplitEvery.left = new FormAttachment(0, 0);
    fdlSplitEvery.top = new FormAttachment(wEncoding, margin);
    fdlSplitEvery.right = new FormAttachment(middle, -margin);
    wlSplitEvery.setLayoutData(fdlSplitEvery);
    wSplitEvery = new Text(wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wSplitEvery);
    wSplitEvery.addModifyListener(lsMod);
    fdSplitEvery = new FormData();
    fdSplitEvery.left = new FormAttachment(middle, 0);
    fdSplitEvery.top = new FormAttachment(wEncoding, margin);
    fdSplitEvery.right = new FormAttachment(100, 0);
    wSplitEvery.setLayoutData(fdSplitEvery);
    // Sheet name line
    wlSheetname = new Label(wContentComp, SWT.RIGHT);
    wlSheetname.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.Sheetname.Label"));
    props.setLook(wlSheetname);
    fdlSheetname = new FormData();
    fdlSheetname.left = new FormAttachment(0, 0);
    fdlSheetname.top = new FormAttachment(wSplitEvery, margin);
    fdlSheetname.right = new FormAttachment(middle, -margin);
    wlSheetname.setLayoutData(fdlSheetname);
    wSheetname = new TextVar(transMeta, wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wSheetname.setToolTipText(BaseMessages.getString(PKG, "ExcelOutputDialog.Sheetname.Tooltip"));
    props.setLook(wSheetname);
    wSheetname.addModifyListener(lsMod);
    fdSheetname = new FormData();
    fdSheetname.left = new FormAttachment(middle, 0);
    fdSheetname.top = new FormAttachment(wSplitEvery, margin);
    fdSheetname.right = new FormAttachment(100, 0);
    wSheetname.setLayoutData(fdSheetname);
    // Protect Sheet?
    wlProtectSheet = new Label(wContentComp, SWT.RIGHT);
    wlProtectSheet.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.ProtectSheet.Label"));
    props.setLook(wlProtectSheet);
    fdlProtectSheet = new FormData();
    fdlProtectSheet.left = new FormAttachment(0, 0);
    fdlProtectSheet.top = new FormAttachment(wSheetname, margin);
    fdlProtectSheet.right = new FormAttachment(middle, -margin);
    wlProtectSheet.setLayoutData(fdlProtectSheet);
    wProtectSheet = new Button(wContentComp, SWT.CHECK);
    props.setLook(wProtectSheet);
    fdProtectSheet = new FormData();
    fdProtectSheet.left = new FormAttachment(middle, 0);
    fdProtectSheet.top = new FormAttachment(wSheetname, margin);
    fdProtectSheet.right = new FormAttachment(100, 0);
    wProtectSheet.setLayoutData(fdProtectSheet);
    wProtectSheet.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            EnablePassword();
        }
    });
    // Password line
    wlPassword = new Label(wContentComp, SWT.RIGHT);
    wlPassword.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.Password.Label"));
    props.setLook(wlPassword);
    fdlPassword = new FormData();
    fdlPassword.left = new FormAttachment(0, 0);
    fdlPassword.top = new FormAttachment(wProtectSheet, margin);
    fdlPassword.right = new FormAttachment(middle, -margin);
    wlPassword.setLayoutData(fdlPassword);
    wPassword = new PasswordTextVar(transMeta, wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wPassword.setToolTipText(BaseMessages.getString(PKG, "ExcelOutputDialog.Password.Tooltip"));
    props.setLook(wPassword);
    wPassword.addModifyListener(lsMod);
    fdPassword = new FormData();
    fdPassword.left = new FormAttachment(middle, 0);
    fdPassword.top = new FormAttachment(wProtectSheet, margin);
    fdPassword.right = new FormAttachment(100, 0);
    wPassword.setLayoutData(fdPassword);
    // auto size columns?
    wlAutoSize = new Label(wContentComp, SWT.RIGHT);
    wlAutoSize.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.AutoSize.Label"));
    props.setLook(wlAutoSize);
    fdlAutoSize = new FormData();
    fdlAutoSize.left = new FormAttachment(0, 0);
    fdlAutoSize.top = new FormAttachment(wPassword, margin);
    fdlAutoSize.right = new FormAttachment(middle, -margin);
    wlAutoSize.setLayoutData(fdlAutoSize);
    wAutoSize = new Button(wContentComp, SWT.CHECK);
    props.setLook(wAutoSize);
    wAutoSize.setToolTipText(BaseMessages.getString(PKG, "ExcelOutputDialog.AutoSize.Tooltip"));
    fdAutoSize = new FormData();
    fdAutoSize.left = new FormAttachment(middle, 0);
    fdAutoSize.top = new FormAttachment(wPassword, margin);
    fdAutoSize.right = new FormAttachment(100, 0);
    wAutoSize.setLayoutData(fdAutoSize);
    wAutoSize.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            EnableAutoSize();
        }
    });
    // write null values as blank cells ?
    wlNullIsBlank = new Label(wContentComp, SWT.RIGHT);
    wlNullIsBlank.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.NullIsBlank.Label"));
    props.setLook(wlNullIsBlank);
    fdlNullIsBlank = new FormData();
    fdlNullIsBlank.left = new FormAttachment(0, 0);
    fdlNullIsBlank.top = new FormAttachment(wAutoSize, margin);
    fdlNullIsBlank.right = new FormAttachment(middle, -margin);
    wlNullIsBlank.setLayoutData(fdlNullIsBlank);
    wNullIsBlank = new Button(wContentComp, SWT.CHECK);
    props.setLook(wNullIsBlank);
    wNullIsBlank.setToolTipText(BaseMessages.getString(PKG, "ExcelOutputDialog.NullIsBlank.Tooltip"));
    fdNullIsBlank = new FormData();
    fdNullIsBlank.left = new FormAttachment(middle, 0);
    fdNullIsBlank.top = new FormAttachment(wAutoSize, margin);
    fdNullIsBlank.right = new FormAttachment(100, 0);
    wNullIsBlank.setLayoutData(fdNullIsBlank);
    // use temporary files?
    wluseTempFiles = new Label(wContentComp, SWT.RIGHT);
    wluseTempFiles.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.useTempFile.Label"));
    props.setLook(wluseTempFiles);
    fdluseTempFiles = new FormData();
    fdluseTempFiles.left = new FormAttachment(0, 0);
    fdluseTempFiles.top = new FormAttachment(wNullIsBlank, margin);
    fdluseTempFiles.right = new FormAttachment(middle, -margin);
    wluseTempFiles.setLayoutData(fdluseTempFiles);
    wuseTempFiles = new Button(wContentComp, SWT.CHECK);
    props.setLook(wuseTempFiles);
    wuseTempFiles.setToolTipText(BaseMessages.getString(PKG, "ExcelOutputDialog.useTempFile.Tooltip"));
    fduseTempFiles = new FormData();
    fduseTempFiles.left = new FormAttachment(middle, 0);
    fduseTempFiles.top = new FormAttachment(wNullIsBlank, margin);
    fduseTempFiles.right = new FormAttachment(100, 0);
    wuseTempFiles.setLayoutData(fduseTempFiles);
    wuseTempFiles.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
            useTempFile();
        }
    });
    // TempDirectory line
    wlTempDirectory = new Label(wContentComp, SWT.RIGHT);
    wlTempDirectory.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.TempDirectory.Label"));
    props.setLook(wlTempDirectory);
    fdlTempDirectory = new FormData();
    fdlTempDirectory.left = new FormAttachment(0, 0);
    fdlTempDirectory.top = new FormAttachment(wuseTempFiles, margin);
    fdlTempDirectory.right = new FormAttachment(middle, -margin);
    wlTempDirectory.setLayoutData(fdlTempDirectory);
    // Select TempDir
    wbTempDir = new Button(wContentComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbTempDir);
    wbTempDir.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
    fdbTempDir = new FormData();
    fdbTempDir.right = new FormAttachment(100, -margin);
    fdbTempDir.top = new FormAttachment(wuseTempFiles, margin);
    wbTempDir.setLayoutData(fdbTempDir);
    wTempDirectory = new TextVar(transMeta, wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wTempDirectory.setToolTipText(BaseMessages.getString(PKG, "ExcelOutputDialog.TempDirectory.Tooltip"));
    props.setLook(wTempDirectory);
    wTempDirectory.addModifyListener(lsMod);
    fdTempDirectory = new FormData();
    fdTempDirectory.left = new FormAttachment(middle, 0);
    fdTempDirectory.top = new FormAttachment(wuseTempFiles, margin);
    fdTempDirectory.right = new FormAttachment(wbTempDir, -margin);
    wTempDirectory.setLayoutData(fdTempDirectory);
    wTempDirectory.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            input.setChanged();
        }
    });
    // ///////////////////////////////
    // START OF Template Group GROUP //
    // ///////////////////////////////
    wTemplateGroup = new Group(wContentComp, SWT.SHADOW_NONE);
    props.setLook(wTemplateGroup);
    wTemplateGroup.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.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, "ExcelOutputDialog.Template.Label"));
    props.setLook(wlTemplate);
    fdlTemplate = new FormData();
    fdlTemplate.left = new FormAttachment(0, 0);
    fdlTemplate.top = new FormAttachment(wTempDirectory, 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(wTempDirectory, margin);
    fdTemplate.right = new FormAttachment(100, 0);
    wTemplate.setLayoutData(fdTemplate);
    wTemplate.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            EnableTemplate();
        }
    });
    // TemplateFilename line
    wlTemplateFilename = new Label(wTemplateGroup, SWT.RIGHT);
    wlTemplateFilename.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.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);
    // Template Append
    wlTemplateAppend = new Label(wTemplateGroup, SWT.RIGHT);
    wlTemplateAppend.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.TemplateAppend.Label"));
    props.setLook(wlTemplateAppend);
    fdlTemplateAppend = new FormData();
    fdlTemplateAppend.left = new FormAttachment(0, 0);
    fdlTemplateAppend.top = new FormAttachment(wTemplateFilename, margin);
    fdlTemplateAppend.right = new FormAttachment(middle, -margin);
    wlTemplateAppend.setLayoutData(fdlTemplateAppend);
    wTemplateAppend = new Button(wTemplateGroup, SWT.CHECK);
    props.setLook(wTemplateAppend);
    fdTemplateAppend = new FormData();
    fdTemplateAppend.left = new FormAttachment(middle, 0);
    fdTemplateAppend.top = new FormAttachment(wTemplateFilename, margin);
    fdTemplateAppend.right = new FormAttachment(100, 0);
    wTemplateAppend.setLayoutData(fdTemplateAppend);
    wTemplateAppend.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
        }
    });
    fdTemplateGroup = new FormData();
    fdTemplateGroup.left = new FormAttachment(0, margin);
    fdTemplateGroup.top = new FormAttachment(wTempDirectory, margin);
    fdTemplateGroup.right = new FormAttachment(100, -margin);
    wTemplateGroup.setLayoutData(fdTemplateGroup);
    // ///////////////////////////////////////////////////////////
    // / END OF Template Group GROUP
    // ///////////////////////////////////////////////////////////
    fdContentComp = new FormData();
    fdContentComp.left = new FormAttachment(0, 0);
    fdContentComp.top = new FormAttachment(0, 0);
    fdContentComp.right = new FormAttachment(100, 0);
    fdContentComp.bottom = new FormAttachment(100, 0);
    wContentComp.setLayoutData(fdContentComp);
    wContentComp.layout();
    wContentTab.setControl(wContentComp);
    // ///////////////////////////////////////////////////////////
    // / END OF CONTENT TAB
    // ///////////////////////////////////////////////////////////
    // Custom tab...
    // 
    wCustomTab = new CTabItem(wTabFolder, SWT.NONE);
    wCustomTab.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.CustomTab.TabTitle"));
    FormLayout CustomLayout = new FormLayout();
    CustomLayout.marginWidth = Const.FORM_MARGIN;
    CustomLayout.marginHeight = Const.FORM_MARGIN;
    Composite wCustomComp = new Composite(wTabFolder, SWT.NONE);
    wCustomComp.setLayout(CustomLayout);
    props.setLook(wCustomComp);
    // ///////////////////////////////
    // START OF Header Font GROUP //
    // ///////////////////////////////
    wFontHeaderGroup = new Group(wCustomComp, SWT.SHADOW_NONE);
    props.setLook(wFontHeaderGroup);
    wFontHeaderGroup.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.FontHeaderGroup.Label"));
    FormLayout FontHeadergroupLayout = new FormLayout();
    FontHeadergroupLayout.marginWidth = 10;
    FontHeadergroupLayout.marginHeight = 10;
    wFontHeaderGroup.setLayout(FontHeadergroupLayout);
    // Header font name
    wlHeaderFontName = new Label(wFontHeaderGroup, SWT.RIGHT);
    wlHeaderFontName.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.HeaderFontName.Label"));
    props.setLook(wlHeaderFontName);
    fdlHeaderFontName = new FormData();
    fdlHeaderFontName.left = new FormAttachment(0, 0);
    fdlHeaderFontName.top = new FormAttachment(0, margin);
    fdlHeaderFontName.right = new FormAttachment(middle, -margin);
    wlHeaderFontName.setLayoutData(fdlHeaderFontName);
    wHeaderFontName = new CCombo(wFontHeaderGroup, SWT.BORDER | SWT.READ_ONLY);
    wHeaderFontName.setItems(ExcelOutputMeta.font_name_desc);
    props.setLook(wHeaderFontName);
    wHeaderFontName.addModifyListener(lsMod);
    fdHeaderFontName = new FormData();
    fdHeaderFontName.left = new FormAttachment(middle, 0);
    fdHeaderFontName.top = new FormAttachment(0, margin);
    fdHeaderFontName.right = new FormAttachment(100, 0);
    wHeaderFontName.setLayoutData(fdHeaderFontName);
    // Header font size
    wlHeaderFontSize = new Label(wFontHeaderGroup, SWT.RIGHT);
    wlHeaderFontSize.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.HeaderFontSize.Label"));
    props.setLook(wlHeaderFontSize);
    fdlHeaderFontSize = new FormData();
    fdlHeaderFontSize.left = new FormAttachment(0, 0);
    fdlHeaderFontSize.top = new FormAttachment(wHeaderFontName, margin);
    fdlHeaderFontSize.right = new FormAttachment(middle, -margin);
    wlHeaderFontSize.setLayoutData(fdlHeaderFontSize);
    wHeaderFontSize = new TextVar(transMeta, wFontHeaderGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wHeaderFontSize.setToolTipText(BaseMessages.getString(PKG, "ExcelOutputDialog.HeaderFontSize.Tooltip"));
    props.setLook(wHeaderFontSize);
    wHeaderFontSize.addModifyListener(lsMod);
    fdHeaderFontSize = new FormData();
    fdHeaderFontSize.left = new FormAttachment(middle, 0);
    fdHeaderFontSize.top = new FormAttachment(wHeaderFontName, margin);
    fdHeaderFontSize.right = new FormAttachment(100, 0);
    wHeaderFontSize.setLayoutData(fdHeaderFontSize);
    // Header font bold?
    wlHeaderFontBold = new Label(wFontHeaderGroup, SWT.RIGHT);
    wlHeaderFontBold.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.HeaderFontBold.Label"));
    props.setLook(wlHeaderFontBold);
    fdlHeaderFontBold = new FormData();
    fdlHeaderFontBold.left = new FormAttachment(0, 0);
    fdlHeaderFontBold.top = new FormAttachment(wHeaderFontSize, margin);
    fdlHeaderFontBold.right = new FormAttachment(middle, -margin);
    wlHeaderFontBold.setLayoutData(fdlHeaderFontBold);
    wHeaderFontBold = new Button(wFontHeaderGroup, SWT.CHECK);
    props.setLook(wHeaderFontBold);
    fdHeaderFontBold = new FormData();
    fdHeaderFontBold.left = new FormAttachment(middle, 0);
    fdHeaderFontBold.top = new FormAttachment(wHeaderFontSize, margin);
    fdHeaderFontBold.right = new FormAttachment(100, 0);
    wHeaderFontBold.setLayoutData(fdHeaderFontBold);
    wHeaderFontBold.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
        }
    });
    // Header font bold?
    wlHeaderFontItalic = new Label(wFontHeaderGroup, SWT.RIGHT);
    wlHeaderFontItalic.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.HeaderFontItalic.Label"));
    props.setLook(wlHeaderFontItalic);
    fdlHeaderFontItalic = new FormData();
    fdlHeaderFontItalic.left = new FormAttachment(0, 0);
    fdlHeaderFontItalic.top = new FormAttachment(wHeaderFontBold, margin);
    fdlHeaderFontItalic.right = new FormAttachment(middle, -margin);
    wlHeaderFontItalic.setLayoutData(fdlHeaderFontItalic);
    wHeaderFontItalic = new Button(wFontHeaderGroup, SWT.CHECK);
    props.setLook(wHeaderFontItalic);
    fdHeaderFontItalic = new FormData();
    fdHeaderFontItalic.left = new FormAttachment(middle, 0);
    fdHeaderFontItalic.top = new FormAttachment(wHeaderFontBold, margin);
    fdHeaderFontItalic.right = new FormAttachment(100, 0);
    wHeaderFontItalic.setLayoutData(fdHeaderFontItalic);
    wHeaderFontItalic.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
        }
    });
    // Font header uderline?
    wlHeaderFontUnderline = new Label(wFontHeaderGroup, SWT.RIGHT);
    wlHeaderFontUnderline.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.HeaderFontUnderline.Label"));
    props.setLook(wlHeaderFontUnderline);
    fdlHeaderFontUnderline = new FormData();
    fdlHeaderFontUnderline.left = new FormAttachment(0, 0);
    fdlHeaderFontUnderline.top = new FormAttachment(wHeaderFontItalic, margin);
    fdlHeaderFontUnderline.right = new FormAttachment(middle, -margin);
    wlHeaderFontUnderline.setLayoutData(fdlHeaderFontUnderline);
    wHeaderFontUnderline = new CCombo(wFontHeaderGroup, SWT.BORDER | SWT.READ_ONLY);
    wHeaderFontUnderline.setItems(ExcelOutputMeta.font_underline_desc);
    props.setLook(wHeaderFontUnderline);
    wHeaderFontUnderline.addModifyListener(lsMod);
    fdHeaderFontUnderline = new FormData();
    fdHeaderFontUnderline.left = new FormAttachment(middle, 0);
    fdHeaderFontUnderline.top = new FormAttachment(wHeaderFontItalic, margin);
    fdHeaderFontUnderline.right = new FormAttachment(100, 0);
    wHeaderFontUnderline.setLayoutData(fdHeaderFontUnderline);
    // Font header orientation
    wlHeaderFontOrientation = new Label(wFontHeaderGroup, SWT.RIGHT);
    wlHeaderFontOrientation.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.HeaderFontOrientation.Label"));
    props.setLook(wlHeaderFontOrientation);
    fdlHeaderFontOrientation = new FormData();
    fdlHeaderFontOrientation.left = new FormAttachment(0, 0);
    fdlHeaderFontOrientation.top = new FormAttachment(wHeaderFontUnderline, margin);
    fdlHeaderFontOrientation.right = new FormAttachment(middle, -margin);
    wlHeaderFontOrientation.setLayoutData(fdlHeaderFontOrientation);
    wHeaderFontOrientation = new CCombo(wFontHeaderGroup, SWT.BORDER | SWT.READ_ONLY);
    wHeaderFontOrientation.setItems(ExcelOutputMeta.font_orientation_desc);
    props.setLook(wHeaderFontOrientation);
    wHeaderFontOrientation.addModifyListener(lsMod);
    fdHeaderFontOrientation = new FormData();
    fdHeaderFontOrientation.left = new FormAttachment(middle, 0);
    fdHeaderFontOrientation.top = new FormAttachment(wHeaderFontUnderline, margin);
    fdHeaderFontOrientation.right = new FormAttachment(100, 0);
    wHeaderFontOrientation.setLayoutData(fdHeaderFontOrientation);
    // Font header color
    wlHeaderFontColor = new Label(wFontHeaderGroup, SWT.RIGHT);
    wlHeaderFontColor.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.HeaderFontColor.Label"));
    props.setLook(wlHeaderFontColor);
    fdlHeaderFontColor = new FormData();
    fdlHeaderFontColor.left = new FormAttachment(0, 0);
    fdlHeaderFontColor.top = new FormAttachment(wHeaderFontOrientation, margin);
    fdlHeaderFontColor.right = new FormAttachment(middle, -margin);
    wlHeaderFontColor.setLayoutData(fdlHeaderFontColor);
    wHeaderFontColor = new CCombo(wFontHeaderGroup, SWT.BORDER | SWT.READ_ONLY);
    props.setLook(wHeaderFontColor);
    fdHeaderFontColor = new FormData();
    fdHeaderFontColor.left = new FormAttachment(middle, 0);
    fdHeaderFontColor.top = new FormAttachment(wHeaderFontOrientation, margin);
    fdHeaderFontColor.right = new FormAttachment(100, 0);
    wHeaderFontColor.setLayoutData(fdHeaderFontColor);
    wHeaderFontColor.setItems(ExcelOutputMeta.font_color_desc);
    // Font header background color
    wlHeaderBackGroundColor = new Label(wFontHeaderGroup, SWT.RIGHT);
    wlHeaderBackGroundColor.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.HeaderBackGroundColor.Label"));
    props.setLook(wlHeaderBackGroundColor);
    fdlHeaderBackGroundColor = new FormData();
    fdlHeaderBackGroundColor.left = new FormAttachment(0, 0);
    fdlHeaderBackGroundColor.top = new FormAttachment(wHeaderFontColor, margin);
    fdlHeaderBackGroundColor.right = new FormAttachment(middle, -margin);
    wlHeaderBackGroundColor.setLayoutData(fdlHeaderBackGroundColor);
    wHeaderBackGroundColor = new CCombo(wFontHeaderGroup, SWT.BORDER | SWT.READ_ONLY);
    props.setLook(wHeaderBackGroundColor);
    fdHeaderBackGroundColor = new FormData();
    fdHeaderBackGroundColor.left = new FormAttachment(middle, 0);
    fdHeaderBackGroundColor.top = new FormAttachment(wHeaderFontColor, margin);
    fdHeaderBackGroundColor.right = new FormAttachment(100, 0);
    wHeaderBackGroundColor.setLayoutData(fdHeaderBackGroundColor);
    wHeaderBackGroundColor.setItems(ExcelOutputMeta.font_color_desc);
    // Header font size
    wlHeaderRowHeight = new Label(wFontHeaderGroup, SWT.RIGHT);
    wlHeaderRowHeight.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.HeaderRowHeight.Label"));
    props.setLook(wlHeaderRowHeight);
    fdlHeaderRowHeight = new FormData();
    fdlHeaderRowHeight.left = new FormAttachment(0, 0);
    fdlHeaderRowHeight.top = new FormAttachment(wHeaderBackGroundColor, margin);
    fdlHeaderRowHeight.right = new FormAttachment(middle, -margin);
    wlHeaderRowHeight.setLayoutData(fdlHeaderRowHeight);
    wHeaderRowHeight = new TextVar(transMeta, wFontHeaderGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wHeaderRowHeight.setToolTipText(BaseMessages.getString(PKG, "ExcelOutputDialog.HeaderRowHeight.Tooltip"));
    props.setLook(wHeaderRowHeight);
    wHeaderRowHeight.addModifyListener(lsMod);
    fdHeaderRowHeight = new FormData();
    fdHeaderRowHeight.left = new FormAttachment(middle, 0);
    fdHeaderRowHeight.top = new FormAttachment(wHeaderBackGroundColor, margin);
    fdHeaderRowHeight.right = new FormAttachment(100, 0);
    wHeaderRowHeight.setLayoutData(fdHeaderRowHeight);
    // Header Alignment
    wlHeaderAlignment = new Label(wFontHeaderGroup, SWT.RIGHT);
    wlHeaderAlignment.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.HeaderAlignment.Label"));
    props.setLook(wlHeaderAlignment);
    fdlHeaderAlignment = new FormData();
    fdlHeaderAlignment.left = new FormAttachment(0, 0);
    fdlHeaderAlignment.top = new FormAttachment(wHeaderRowHeight, margin);
    fdlHeaderAlignment.right = new FormAttachment(middle, -margin);
    wlHeaderAlignment.setLayoutData(fdlHeaderAlignment);
    wHeaderAlignment = new CCombo(wFontHeaderGroup, SWT.BORDER | SWT.READ_ONLY);
    wHeaderAlignment.setItems(ExcelOutputMeta.font_alignment_desc);
    props.setLook(wHeaderAlignment);
    wHeaderAlignment.addModifyListener(lsMod);
    fdHeaderAlignment = new FormData();
    fdHeaderAlignment.left = new FormAttachment(middle, 0);
    fdHeaderAlignment.top = new FormAttachment(wHeaderRowHeight, margin);
    fdHeaderAlignment.right = new FormAttachment(100, 0);
    wHeaderAlignment.setLayoutData(fdHeaderAlignment);
    // Select Image
    wbImage = new Button(wFontHeaderGroup, SWT.PUSH | SWT.CENTER);
    props.setLook(wbImage);
    wbImage.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.AddImage"));
    fdbImage = new FormData();
    fdbImage.right = new FormAttachment(100, 0);
    fdbImage.top = new FormAttachment(wHeaderAlignment, margin);
    wbImage.setLayoutData(fdbImage);
    wbImage.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            FileDialog dialog = new FileDialog(shell, SWT.OPEN);
            dialog.setFilterExtensions(new String[] { "*.png", "*.*" });
            if (wImage.getText() != null) {
                dialog.setFileName(transMeta.environmentSubstitute(wImage.getText()));
            }
            dialog.setFilterNames(new String[] { BaseMessages.getString(PKG, "ExcelOutputDialog.FileType.PNGFiles"), BaseMessages.getString(PKG, "System.FileType.AllFiles") });
            if (dialog.open() != null) {
                wImage.setText(dialog.getFilterPath() + System.getProperty("file.separator") + dialog.getFileName());
            }
        }
    });
    // Image line
    wlImage = new Label(wFontHeaderGroup, SWT.RIGHT);
    wlImage.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.Image.Label"));
    props.setLook(wlImage);
    fdlImage = new FormData();
    fdlImage.left = new FormAttachment(0, 0);
    fdlImage.top = new FormAttachment(wHeaderAlignment, margin);
    fdlImage.right = new FormAttachment(middle, -margin);
    wlImage.setLayoutData(fdlImage);
    wImage = new TextVar(transMeta, wFontHeaderGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wImage);
    wImage.addModifyListener(lsMod);
    fdImage = new FormData();
    fdImage.left = new FormAttachment(middle, 0);
    fdImage.top = new FormAttachment(wHeaderAlignment, margin);
    fdImage.right = new FormAttachment(wbImage, -margin);
    wImage.setLayoutData(fdImage);
    fdFontHeaderGroup = new FormData();
    fdFontHeaderGroup.left = new FormAttachment(0, margin);
    fdFontHeaderGroup.top = new FormAttachment(0, margin);
    fdFontHeaderGroup.right = new FormAttachment(100, -margin);
    wFontHeaderGroup.setLayoutData(fdFontHeaderGroup);
    // ///////////////////////////////////////////////////////////
    // / END OF Font Group GROUP
    // ///////////////////////////////////////////////////////////
    // ///////////////////////////////
    // START OF Row Font GROUP //
    // ///////////////////////////////
    wFontRowGroup = new Group(wCustomComp, SWT.SHADOW_NONE);
    props.setLook(wFontRowGroup);
    wFontRowGroup.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.FontRowGroup.Label"));
    FormLayout FontRowGroupLayout = new FormLayout();
    FontRowGroupLayout.marginWidth = 10;
    FontRowGroupLayout.marginHeight = 10;
    wFontRowGroup.setLayout(FontRowGroupLayout);
    // Font Row name
    wlRowFontName = new Label(wFontRowGroup, SWT.RIGHT);
    wlRowFontName.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.RowFontName.Label"));
    props.setLook(wlRowFontName);
    fdlRowFontName = new FormData();
    fdlRowFontName.left = new FormAttachment(0, 0);
    fdlRowFontName.top = new FormAttachment(0, margin);
    fdlRowFontName.right = new FormAttachment(middle, -margin);
    wlRowFontName.setLayoutData(fdlRowFontName);
    wRowFontName = new CCombo(wFontRowGroup, SWT.BORDER | SWT.READ_ONLY);
    wRowFontName.setItems(ExcelOutputMeta.font_name_desc);
    props.setLook(wRowFontName);
    wRowFontName.addModifyListener(lsMod);
    fdRowFontName = new FormData();
    fdRowFontName.left = new FormAttachment(middle, 0);
    fdRowFontName.top = new FormAttachment(0, margin);
    fdRowFontName.right = new FormAttachment(100, 0);
    wRowFontName.setLayoutData(fdRowFontName);
    // Row font size
    wlRowFontSize = new Label(wFontRowGroup, SWT.RIGHT);
    wlRowFontSize.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.RowFontSize.Label"));
    props.setLook(wlRowFontSize);
    fdlRowFontSize = new FormData();
    fdlRowFontSize.left = new FormAttachment(0, 0);
    fdlRowFontSize.top = new FormAttachment(wRowFontName, margin);
    fdlRowFontSize.right = new FormAttachment(middle, -margin);
    wlRowFontSize.setLayoutData(fdlRowFontSize);
    wRowFontSize = new TextVar(transMeta, wFontRowGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wRowFontSize.setToolTipText(BaseMessages.getString(PKG, "ExcelOutputDialog.RowFontSize.Tooltip"));
    props.setLook(wRowFontSize);
    wRowFontSize.addModifyListener(lsMod);
    fdRowFontSize = new FormData();
    fdRowFontSize.left = new FormAttachment(middle, 0);
    fdRowFontSize.top = new FormAttachment(wRowFontName, margin);
    fdRowFontSize.right = new FormAttachment(100, 0);
    wRowFontSize.setLayoutData(fdRowFontSize);
    // Font Row color
    wlRowFontColor = new Label(wFontRowGroup, SWT.RIGHT);
    wlRowFontColor.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.RowFontColor.Label"));
    props.setLook(wlRowFontColor);
    fdlRowFontColor = new FormData();
    fdlRowFontColor.left = new FormAttachment(0, 0);
    fdlRowFontColor.top = new FormAttachment(wRowFontSize, margin);
    fdlRowFontColor.right = new FormAttachment(middle, -margin);
    wlRowFontColor.setLayoutData(fdlRowFontColor);
    wRowFontColor = new CCombo(wFontRowGroup, SWT.BORDER | SWT.READ_ONLY);
    props.setLook(wRowFontColor);
    fdRowFontColor = new FormData();
    fdRowFontColor.left = new FormAttachment(middle, 0);
    fdRowFontColor.top = new FormAttachment(wRowFontSize, margin);
    fdRowFontColor.right = new FormAttachment(100, 0);
    wRowFontColor.setLayoutData(fdRowFontColor);
    wRowFontColor.setItems(ExcelOutputMeta.font_color_desc);
    // Font Row background color
    wlRowBackGroundColor = new Label(wFontRowGroup, SWT.RIGHT);
    wlRowBackGroundColor.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.RowBackGroundColor.Label"));
    props.setLook(wlRowBackGroundColor);
    fdlRowBackGroundColor = new FormData();
    fdlRowBackGroundColor.left = new FormAttachment(0, 0);
    fdlRowBackGroundColor.top = new FormAttachment(wRowFontColor, margin);
    fdlRowBackGroundColor.right = new FormAttachment(middle, -margin);
    wlRowBackGroundColor.setLayoutData(fdlRowBackGroundColor);
    wRowBackGroundColor = new CCombo(wFontRowGroup, SWT.BORDER | SWT.READ_ONLY);
    props.setLook(wRowBackGroundColor);
    fdRowBackGroundColor = new FormData();
    fdRowBackGroundColor.left = new FormAttachment(middle, 0);
    fdRowBackGroundColor.top = new FormAttachment(wRowFontColor, margin);
    fdRowBackGroundColor.right = new FormAttachment(100, 0);
    wRowBackGroundColor.setLayoutData(fdRowBackGroundColor);
    wRowBackGroundColor.setItems(ExcelOutputMeta.font_color_desc);
    fdFontRowGroup = new FormData();
    fdFontRowGroup.left = new FormAttachment(0, margin);
    fdFontRowGroup.top = new FormAttachment(wFontHeaderGroup, margin);
    fdFontRowGroup.right = new FormAttachment(100, -margin);
    wFontRowGroup.setLayoutData(fdFontRowGroup);
    // ///////////////////////////////////////////////////////////
    // / END OF Row Font Group
    // ///////////////////////////////////////////////////////////
    fdCustomComp = new FormData();
    fdCustomComp.left = new FormAttachment(0, 0);
    fdCustomComp.top = new FormAttachment(0, 0);
    fdCustomComp.right = new FormAttachment(100, 0);
    fdCustomComp.bottom = new FormAttachment(100, 0);
    wCustomComp.setLayoutData(fdCustomComp);
    wCustomComp.layout();
    wCustomTab.setControl(wCustomComp);
    // ///////////////////////////////////////////////////////////
    // / END OF customer TAB
    // ///////////////////////////////////////////////////////////
    // Fields tab...
    // 
    wFieldsTab = new CTabItem(wTabFolder, SWT.NONE);
    wFieldsTab.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.FieldsTab.TabTitle"));
    FormLayout fieldsLayout = new FormLayout();
    fieldsLayout.marginWidth = Const.FORM_MARGIN;
    fieldsLayout.marginHeight = Const.FORM_MARGIN;
    Composite wFieldsComp = new Composite(wTabFolder, SWT.NONE);
    wFieldsComp.setLayout(fieldsLayout);
    props.setLook(wFieldsComp);
    wGet = new Button(wFieldsComp, SWT.PUSH);
    wGet.setText(BaseMessages.getString(PKG, "System.Button.GetFields"));
    wGet.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.GetFields"));
    wMinWidth = new Button(wFieldsComp, SWT.PUSH);
    wMinWidth.setText(BaseMessages.getString(PKG, "ExcelOutputDialog.MinWidth.Button"));
    wMinWidth.setToolTipText(BaseMessages.getString(PKG, "ExcelOutputDialog.MinWidth.Tooltip"));
    setButtonPositions(new Button[] { wGet, wMinWidth }, margin, null);
    final int FieldsRows = input.getOutputFields().length;
    // Prepare a list of possible formats...
    String[] formats = new String[] { // Numbers
    "#", "0", "0.00", "#,##0", "#,##0.00", "$#,##0;($#,##0)", "$#,##0;($#,##0)", "$#,##0;($#,##0)", "$#,##0;($#,##0)", "0%", "0.00%", "0.00E00", "#,##0;(#,##0)", "#,##0;(#,##0)", "#,##0.00;(#,##0.00)", "#,##0.00;(#,##0.00)", "#,##0;(#,##0)", "#,##0;(#,##0)", "#,##0.00;(#,##0.00)", "#,##0.00;(#,##0.00)", "#,##0.00;(#,##0.00)", "##0.0E0", // Forces text
    "@", // Dates
    "M/d/yy", "d-MMM-yy", "d-MMM", "MMM-yy", "h:mm a", "h:mm:ss a", "H:mm", "H:mm:ss", "M/d/yy H:mm", "mm:ss", "H:mm:ss", "H:mm:ss" };
    colinf = new ColumnInfo[] { new ColumnInfo(BaseMessages.getString(PKG, "ExcelOutputDialog.NameColumn.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false), new ColumnInfo(BaseMessages.getString(PKG, "ExcelOutputDialog.TypeColumn.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaFactory.getValueMetaNames()), new ColumnInfo(BaseMessages.getString(PKG, "ExcelOutputDialog.FormatColumn.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, formats) };
    wFields = new TableView(transMeta, wFieldsComp, 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);
    // 
    // 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();
    fdFieldsComp = new FormData();
    fdFieldsComp.left = new FormAttachment(0, 0);
    fdFieldsComp.top = new FormAttachment(0, 0);
    fdFieldsComp.right = new FormAttachment(100, 0);
    fdFieldsComp.bottom = new FormAttachment(100, 0);
    wFieldsComp.setLayoutData(fdFieldsComp);
    wFieldsComp.layout();
    wFieldsTab.setControl(wFieldsComp);
    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);
    wOK = new Button(shell, SWT.PUSH);
    wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
    wCancel = new Button(shell, SWT.PUSH);
    wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
    setButtonPositions(new Button[] { wOK, wCancel }, margin, wTabFolder);
    // Add listeners
    lsOK = new Listener() {

        @Override
        public void handleEvent(Event e) {
            ok();
        }
    };
    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()));
        }
    });
    wTemplateFilename.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            wTemplateFilename.setToolTipText(transMeta.environmentSubstitute(wTemplateFilename.getText()));
        }
    });
    wbFilename.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            FileDialog dialog = new FileDialog(shell, SWT.SAVE);
            dialog.setFilterExtensions(new String[] { "*.xls", "*.*" });
            if (wFilename.getText() != null) {
                dialog.setFileName(transMeta.environmentSubstitute(wFilename.getText()));
            }
            dialog.setFilterNames(new String[] { BaseMessages.getString(PKG, "System.FileType.ExcelFiles"), BaseMessages.getString(PKG, "System.FileType.AllFiles") });
            if (dialog.open() != null) {
                wFilename.setText(dialog.getFilterPath() + System.getProperty("file.separator") + dialog.getFileName());
            }
        }
    });
    wbTemplateFilename.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            FileDialog dialog = new FileDialog(shell, SWT.OPEN);
            dialog.setFilterExtensions(new String[] { "*.xls", "*.*" });
            if (wTemplateFilename.getText() != null) {
                dialog.setFileName(transMeta.environmentSubstitute(wTemplateFilename.getText()));
            }
            dialog.setFilterNames(new String[] { BaseMessages.getString(PKG, "System.FileType.ExcelFiles"), BaseMessages.getString(PKG, "System.FileType.AllFiles") });
            if (dialog.open() != null) {
                wTemplateFilename.setText(dialog.getFilterPath() + System.getProperty("file.separator") + dialog.getFileName());
            }
        }
    });
    // Detect X or ALT-F4 or something that kills this window...
    shell.addShellListener(new ShellAdapter() {

        @Override
        public void shellClosed(ShellEvent e) {
            cancel();
        }
    });
    lsResize = new Listener() {

        @Override
        public void handleEvent(Event event) {
            Point size = shell.getSize();
            wFields.setSize(size.x - 10, size.y - 50);
            wFields.table.setSize(size.x - 10, size.y - 50);
            wFields.redraw();
        }
    };
    shell.addListener(SWT.Resize, lsResize);
    wTabFolder.setSelection(0);
    // Set the shell size, based upon previous time...
    setSize();
    getData();
    setDateTimeFormat();
    EnableAutoSize();
    useTempFile();
    input.setChanged(changed);
    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) 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) ShellEvent(org.eclipse.swt.events.ShellEvent) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) 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) 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) ExcelOutputMeta(org.pentaho.di.trans.steps.exceloutput.ExcelOutputMeta) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Text(org.eclipse.swt.widgets.Text) Point(org.eclipse.swt.graphics.Point) StepMeta(org.pentaho.di.trans.step.StepMeta) BaseStepMeta(org.pentaho.di.trans.step.BaseStepMeta) Point(org.eclipse.swt.graphics.Point) TextVar(org.pentaho.di.ui.core.widget.TextVar) PasswordTextVar(org.pentaho.di.ui.core.widget.PasswordTextVar) MessageBox(org.eclipse.swt.widgets.MessageBox) PasswordTextVar(org.pentaho.di.ui.core.widget.PasswordTextVar) 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) FocusListener(org.eclipse.swt.events.FocusListener) FileDialog(org.eclipse.swt.widgets.FileDialog) Display(org.eclipse.swt.widgets.Display)

Example 74 with CTabItem

use of org.eclipse.swt.custom.CTabItem in project pentaho-kettle by pentaho.

the class ExecProcessDialog method open.

@Override
public String open() {
    Shell parent = getParent();
    Display display = parent.getDisplay();
    shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN);
    props.setLook(shell);
    setShellImage(shell, input);
    ModifyListener lsMod = new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            input.setChanged();
        }
    };
    changed = input.hasChanged();
    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = Const.FORM_MARGIN;
    formLayout.marginHeight = Const.FORM_MARGIN;
    shell.setLayout(formLayout);
    shell.setText(BaseMessages.getString(PKG, "ExecProcessDialog.Shell.Title"));
    int middle = props.getMiddlePct();
    int margin = Const.MARGIN;
    // Stepname line
    wlStepname = new Label(shell, SWT.RIGHT);
    wlStepname.setText(BaseMessages.getString(PKG, "ExecProcessDialog.Stepname.Label"));
    props.setLook(wlStepname);
    fdlStepname = new FormData();
    fdlStepname.left = new FormAttachment(0, 0);
    fdlStepname.right = new FormAttachment(middle, -margin);
    fdlStepname.top = new FormAttachment(0, margin);
    wlStepname.setLayoutData(fdlStepname);
    wStepname = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wStepname.setText(stepname);
    props.setLook(wStepname);
    wStepname.addModifyListener(lsMod);
    fdStepname = new FormData();
    fdStepname.left = new FormAttachment(middle, 0);
    fdStepname.top = new FormAttachment(0, margin);
    fdStepname.right = new FormAttachment(100, 0);
    wStepname.setLayoutData(fdStepname);
    // The Tab Folders
    wTabFolder = new CTabFolder(shell, SWT.BORDER);
    props.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
    // ///////////////////////
    // START OF GENERAL TAB //
    // ///////////////////////
    wGeneralTab = new CTabItem(wTabFolder, SWT.NONE);
    wGeneralTab.setText(BaseMessages.getString(PKG, "ExecProcessDialog.GeneralTab.TabItem"));
    wGeneralComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wGeneralComp);
    FormLayout generalLayout = new FormLayout();
    generalLayout.marginWidth = margin;
    generalLayout.marginHeight = margin;
    wGeneralComp.setLayout(generalLayout);
    // filename field
    wlProcess = new Label(wGeneralComp, SWT.RIGHT);
    wlProcess.setText(BaseMessages.getString(PKG, "ExecProcessDialog.Process.Label"));
    props.setLook(wlProcess);
    fdlProcess = new FormData();
    fdlProcess.left = new FormAttachment(0, 0);
    fdlProcess.right = new FormAttachment(middle, -margin);
    fdlProcess.top = new FormAttachment(wStepname, margin);
    wlProcess.setLayoutData(fdlProcess);
    wProcess = new CCombo(wGeneralComp, SWT.BORDER | SWT.READ_ONLY);
    wProcess.setEditable(true);
    props.setLook(wProcess);
    wProcess.addModifyListener(lsMod);
    fdProcess = new FormData();
    fdProcess.left = new FormAttachment(middle, 0);
    fdProcess.top = new FormAttachment(wStepname, margin);
    fdProcess.right = new FormAttachment(100, -margin);
    wProcess.setLayoutData(fdProcess);
    wProcess.addFocusListener(new FocusListener() {

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

        @Override
        public void focusGained(org.eclipse.swt.events.FocusEvent e) {
            Cursor busy = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
            shell.setCursor(busy);
            get();
            shell.setCursor(null);
            busy.dispose();
        }
    });
    // Command Arguments are in separate fields
    wlArgumentsInFields = new Label(wGeneralComp, SWT.RIGHT);
    wlArgumentsInFields.setText(BaseMessages.getString(PKG, "ExecProcessDialog.ArgumentInFields.Label"));
    props.setLook(wlArgumentsInFields);
    fdlArgumentsInFields = new FormData();
    fdlArgumentsInFields.left = new FormAttachment(0, 0);
    fdlArgumentsInFields.top = new FormAttachment(wProcess, margin);
    fdlArgumentsInFields.right = new FormAttachment(middle, -margin);
    wlArgumentsInFields.setLayoutData(fdlArgumentsInFields);
    wArgumentsInFields = new Button(wGeneralComp, SWT.CHECK);
    wArgumentsInFields.setToolTipText(BaseMessages.getString(PKG, "ExecProcessDialog.ArgumentInFields.Tooltip"));
    props.setLook(wArgumentsInFields);
    fdArgumentsInFields = new FormData();
    fdArgumentsInFields.left = new FormAttachment(middle, 0);
    fdArgumentsInFields.top = new FormAttachment(wProcess, margin);
    fdArgumentsInFields.right = new FormAttachment(100, 0);
    wArgumentsInFields.setLayoutData(fdArgumentsInFields);
    wArgumentsInFields.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            enableFields();
            input.setChanged();
        }
    });
    // Fail when status is different than 0
    wlFailWhenNotSuccess = new Label(wGeneralComp, SWT.RIGHT);
    wlFailWhenNotSuccess.setText(BaseMessages.getString(PKG, "ExecProcessDialog.FailWhenNotSuccess.Label"));
    props.setLook(wlFailWhenNotSuccess);
    fdlFailWhenNotSuccess = new FormData();
    fdlFailWhenNotSuccess.left = new FormAttachment(0, 0);
    fdlFailWhenNotSuccess.top = new FormAttachment(wArgumentsInFields, margin);
    fdlFailWhenNotSuccess.right = new FormAttachment(middle, -margin);
    wlFailWhenNotSuccess.setLayoutData(fdlFailWhenNotSuccess);
    wFailWhenNotSuccess = new Button(wGeneralComp, SWT.CHECK);
    wFailWhenNotSuccess.setToolTipText(BaseMessages.getString(PKG, "ExecProcessDialog.FailWhenNotSuccess.Tooltip"));
    props.setLook(wFailWhenNotSuccess);
    fdFailWhenNotSuccess = new FormData();
    fdFailWhenNotSuccess.left = new FormAttachment(middle, 0);
    fdFailWhenNotSuccess.top = new FormAttachment(wArgumentsInFields, margin);
    fdFailWhenNotSuccess.right = new FormAttachment(100, 0);
    wFailWhenNotSuccess.setLayoutData(fdFailWhenNotSuccess);
    wFailWhenNotSuccess.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            input.setChanged();
        }
    });
    // List of Argument Fields when ArgumentsInFields is enabled
    wlArgumentFields = new Label(wGeneralComp, SWT.LEFT);
    wlArgumentFields.setText(BaseMessages.getString(PKG, "ExecProcessDialog.ArgumentFields.Label"));
    props.setLook(wlArgumentFields);
    fdlArgumentFields = new FormData();
    fdlArgumentFields.left = new FormAttachment(0, 0);
    fdlArgumentFields.top = new FormAttachment(wFailWhenNotSuccess, margin);
    fdlArgumentFields.right = new FormAttachment(middle, -margin);
    wlArgumentFields.setLayoutData(fdlArgumentFields);
    ColumnInfo[] colinf = new ColumnInfo[1];
    colinf[0] = new ColumnInfo(BaseMessages.getString(PKG, "ExecProcessDialog.ArgumentField.Label"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false);
    colinf[0].setToolTip(BaseMessages.getString(PKG, "ExecProcessDialog.ArgumentField.Tooltip"));
    wArgumentFields = new TableView(null, wGeneralComp, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI, colinf, 1, lsMod, props);
    fdArgumentFields = new FormData();
    fdArgumentFields.left = new FormAttachment(0, 0);
    fdArgumentFields.top = new FormAttachment(wlArgumentFields, margin);
    fdArgumentFields.right = new FormAttachment(100, 0);
    fdArgumentFields.bottom = new FormAttachment(100, -margin);
    wArgumentFields.setLayoutData(fdArgumentFields);
    FormData fdGeneralComp = new FormData();
    fdGeneralComp.left = new FormAttachment(0, 0);
    fdGeneralComp.top = new FormAttachment(0, 0);
    fdGeneralComp.right = new FormAttachment(100, 0);
    fdGeneralComp.bottom = new FormAttachment(100, 0);
    wGeneralComp.setLayoutData(fdGeneralComp);
    wGeneralComp.layout();
    wGeneralTab.setControl(wGeneralComp);
    // /////////////////////
    // END OF GENERAL TAB //
    // /////////////////////
    // //////////////////////
    // START OF OUTPUT TAB //
    // //////////////////////
    wOutputTab = new CTabItem(wTabFolder, SWT.NONE);
    wOutputTab.setText(BaseMessages.getString(PKG, "ExecProcessDialog.Output.TabItem"));
    wOutputComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wOutputComp);
    FormLayout fdOutputCompLayout = new FormLayout();
    fdOutputCompLayout.marginWidth = margin;
    fdOutputCompLayout.marginHeight = margin;
    wOutputComp.setLayout(fdOutputCompLayout);
    // Output Line Delimiter
    wOutputDelim = new LabelTextVar(transMeta, wOutputComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER, BaseMessages.getString(PKG, "ExecProcessDialog.OutputDelimiterField.Label"), BaseMessages.getString(PKG, "ExecProcessDialog.OutputDelimiterField.Tooltip"));
    wOutputDelim.addModifyListener(lsMod);
    fdOutputDelim = new FormData();
    fdOutputDelim.left = new FormAttachment(0, 0);
    fdOutputDelim.top = new FormAttachment(0, margin);
    fdOutputDelim.right = new FormAttachment(100, 0);
    wOutputDelim.setLayoutData(fdOutputDelim);
    // Result fieldname ...
    wResult = new LabelTextVar(transMeta, wOutputComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER, BaseMessages.getString(PKG, "ExecProcessDialog.ResultField.Label"), BaseMessages.getString(PKG, "ExecProcessDialog.ResultField.Tooltip"));
    wResult.addModifyListener(lsMod);
    fdResult = new FormData();
    fdResult.left = new FormAttachment(0, 0);
    fdResult.top = new FormAttachment(wOutputDelim, margin);
    fdResult.right = new FormAttachment(100, 0);
    wResult.setLayoutData(fdResult);
    // Error fieldname ...
    wError = new LabelTextVar(transMeta, wOutputComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER, BaseMessages.getString(PKG, "ExecProcessDialog.ErrorField.Label"), BaseMessages.getString(PKG, "ExecProcessDialog.ErrorField.Tooltip"));
    wError.addModifyListener(lsMod);
    fdError = new FormData();
    fdError.left = new FormAttachment(0, 0);
    fdError.top = new FormAttachment(wResult, margin);
    fdError.right = new FormAttachment(100, 0);
    wError.setLayoutData(fdError);
    // ExitValue fieldname ...
    wExitValue = new LabelTextVar(transMeta, wOutputComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER, BaseMessages.getString(PKG, "ExecProcessDialog.ExitValueField.Label"), BaseMessages.getString(PKG, "ExecProcessDialog.ExitValueField.Tooltip"));
    wExitValue.addModifyListener(lsMod);
    fdExitValue = new FormData();
    fdExitValue.left = new FormAttachment(0, 0);
    fdExitValue.top = new FormAttachment(wError, margin);
    fdExitValue.right = new FormAttachment(100, 0);
    wExitValue.setLayoutData(fdExitValue);
    FormData fdOutputComp = new FormData();
    fdOutputComp.left = new FormAttachment(0, 0);
    fdOutputComp.top = new FormAttachment(0, 0);
    fdOutputComp.right = new FormAttachment(100, 0);
    fdOutputComp.bottom = new FormAttachment(100, 0);
    wOutputComp.setLayoutData(fdOutputComp);
    wOutputComp.layout();
    wOutputTab.setControl(wOutputComp);
    // ////////////////////
    // END OF OUTPUT TAB //
    // ////////////////////
    FormData fdTabFolder = new FormData();
    fdTabFolder.left = new FormAttachment(0, 0);
    fdTabFolder.top = new FormAttachment(wStepname, margin);
    fdTabFolder.right = new FormAttachment(100, 0);
    fdTabFolder.bottom = new FormAttachment(100, -50);
    wTabFolder.setLayoutData(fdTabFolder);
    wTabFolder.setSelection(0);
    // ////////////////////
    // END OF TAB FOLDER //
    // ////////////////////
    // THE BUTTONS
    wOK = new Button(shell, SWT.PUSH);
    wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
    wCancel = new Button(shell, SWT.PUSH);
    wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
    setButtonPositions(new Button[] { wOK, wCancel }, margin, wTabFolder);
    // Add listeners
    lsOK = new Listener() {

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

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

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            ok();
        }
    };
    wStepname.addSelectionListener(lsDef);
    // Detect X or ALT-F4 or something that kills this window...
    shell.addShellListener(new ShellAdapter() {

        @Override
        public void shellClosed(ShellEvent e) {
            cancel();
        }
    });
    // Set the shell size, based upon previous time...
    setSize();
    RowMetaInterface r = null;
    try {
        r = transMeta.getPrevStepFields(stepname);
        if (r != null) {
            wArgumentFields.getColumns()[0].setComboValues(r.getFieldNames());
        }
    } catch (KettleStepException ignore) {
    // Do nothing
    }
    getData();
    enableFields();
    input.setChanged(changed);
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
    return stepname;
}
Also used : CTabFolder(org.eclipse.swt.custom.CTabFolder) FocusListener(org.eclipse.swt.events.FocusListener) Listener(org.eclipse.swt.widgets.Listener) ModifyListener(org.eclipse.swt.events.ModifyListener) KettleStepException(org.pentaho.di.core.exception.KettleStepException) 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) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) 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) 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) LabelTextVar(org.pentaho.di.ui.core.widget.LabelTextVar) 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) FocusListener(org.eclipse.swt.events.FocusListener) Display(org.eclipse.swt.widgets.Display)

Example 75 with CTabItem

use of org.eclipse.swt.custom.CTabItem in project pentaho-kettle by pentaho.

the class TextFileInputDialog method addFiltersTabs.

private void addFiltersTabs() {
    // Filters tab...
    // 
    wFilterTab = new CTabItem(wTabFolder, SWT.NONE);
    wFilterTab.setText(BaseMessages.getString(PKG, "TextFileInputDialog.FilterTab.TabTitle"));
    FormLayout FilterLayout = new FormLayout();
    FilterLayout.marginWidth = Const.FORM_MARGIN;
    FilterLayout.marginHeight = Const.FORM_MARGIN;
    wFilterComp = new Composite(wTabFolder, SWT.NONE);
    wFilterComp.setLayout(FilterLayout);
    props.setLook(wFilterComp);
    final int FilterRows = input.getFilter().length;
    ColumnInfo[] colinf = new ColumnInfo[] { new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.FilterStringColumn.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.FilterPositionColumn.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false), new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.StopOnFilterColumn.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, YES_NO_COMBO), new ColumnInfo(BaseMessages.getString(PKG, "TextFileInputDialog.FilterPositiveColumn.Column"), ColumnInfo.COLUMN_TYPE_CCOMBO, YES_NO_COMBO) };
    colinf[2].setToolTip(BaseMessages.getString(PKG, "TextFileInputDialog.StopOnFilterColumn.Tooltip"));
    colinf[3].setToolTip(BaseMessages.getString(PKG, "TextFileInputDialog.FilterPositiveColumn.Tooltip"));
    wFilter = new TableView(transMeta, wFilterComp, SWT.FULL_SELECTION | SWT.MULTI, colinf, FilterRows, lsMod, props);
    fdFilter = new FormData();
    fdFilter.left = new FormAttachment(0, 0);
    fdFilter.top = new FormAttachment(0, 0);
    fdFilter.right = new FormAttachment(100, 0);
    fdFilter.bottom = new FormAttachment(100, 0);
    wFilter.setLayoutData(fdFilter);
    fdFilterComp = new FormData();
    fdFilterComp.left = new FormAttachment(0, 0);
    fdFilterComp.top = new FormAttachment(0, 0);
    fdFilterComp.right = new FormAttachment(100, 0);
    fdFilterComp.bottom = new FormAttachment(100, 0);
    wFilterComp.setLayoutData(fdFilterComp);
    wFilterComp.layout();
    wFilterTab.setControl(wFilterComp);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ColumnInfo(org.pentaho.di.ui.core.widget.ColumnInfo) CTabItem(org.eclipse.swt.custom.CTabItem) FormAttachment(org.eclipse.swt.layout.FormAttachment) TableView(org.pentaho.di.ui.core.widget.TableView)

Aggregations

CTabItem (org.eclipse.swt.custom.CTabItem)377 Composite (org.eclipse.swt.widgets.Composite)246 FormLayout (org.eclipse.swt.layout.FormLayout)189 FormAttachment (org.eclipse.swt.layout.FormAttachment)185 FormData (org.eclipse.swt.layout.FormData)185 SelectionEvent (org.eclipse.swt.events.SelectionEvent)173 Label (org.eclipse.swt.widgets.Label)168 CTabFolder (org.eclipse.swt.custom.CTabFolder)165 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)149 Button (org.eclipse.swt.widgets.Button)142 Text (org.eclipse.swt.widgets.Text)117 Event (org.eclipse.swt.widgets.Event)107 Listener (org.eclipse.swt.widgets.Listener)107 TextVar (org.pentaho.di.ui.core.widget.TextVar)107 ModifyListener (org.eclipse.swt.events.ModifyListener)106 ModifyEvent (org.eclipse.swt.events.ModifyEvent)104 Shell (org.eclipse.swt.widgets.Shell)101 ColumnInfo (org.pentaho.di.ui.core.widget.ColumnInfo)100 TableView (org.pentaho.di.ui.core.widget.TableView)99 ShellEvent (org.eclipse.swt.events.ShellEvent)95