Search in sources :

Example 86 with CTabItem

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

the class GetXMLDataDialog method addAdditionalFieldsTab.

private void addAdditionalFieldsTab() {
    // ////////////////////////
    // START OF ADDITIONAL FIELDS TAB ///
    // ////////////////////////
    wAdditionalFieldsTab = new CTabItem(wTabFolder, SWT.NONE);
    wAdditionalFieldsTab.setText(BaseMessages.getString(PKG, "GetXMLDataDialog.AdditionalFieldsTab.TabTitle"));
    wAdditionalFieldsComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wAdditionalFieldsComp);
    FormLayout fieldsLayout = new FormLayout();
    fieldsLayout.marginWidth = 3;
    fieldsLayout.marginHeight = 3;
    wAdditionalFieldsComp.setLayout(fieldsLayout);
    // ShortFileFieldName line
    wlShortFileFieldName = new Label(wAdditionalFieldsComp, SWT.RIGHT);
    wlShortFileFieldName.setText(BaseMessages.getString(PKG, "GetXMLDataDialog.ShortFileFieldName.Label"));
    props.setLook(wlShortFileFieldName);
    fdlShortFileFieldName = new FormData();
    fdlShortFileFieldName.left = new FormAttachment(0, 0);
    fdlShortFileFieldName.top = new FormAttachment(wInclRownumField, margin);
    fdlShortFileFieldName.right = new FormAttachment(middle, -margin);
    wlShortFileFieldName.setLayoutData(fdlShortFileFieldName);
    wShortFileFieldName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wShortFileFieldName);
    wShortFileFieldName.addModifyListener(lsMod);
    fdShortFileFieldName = new FormData();
    fdShortFileFieldName.left = new FormAttachment(middle, 0);
    fdShortFileFieldName.right = new FormAttachment(100, -margin);
    fdShortFileFieldName.top = new FormAttachment(wInclRownumField, margin);
    wShortFileFieldName.setLayoutData(fdShortFileFieldName);
    // ExtensionFieldName line
    wlExtensionFieldName = new Label(wAdditionalFieldsComp, SWT.RIGHT);
    wlExtensionFieldName.setText(BaseMessages.getString(PKG, "GetXMLDataDialog.ExtensionFieldName.Label"));
    props.setLook(wlExtensionFieldName);
    fdlExtensionFieldName = new FormData();
    fdlExtensionFieldName.left = new FormAttachment(0, 0);
    fdlExtensionFieldName.top = new FormAttachment(wShortFileFieldName, margin);
    fdlExtensionFieldName.right = new FormAttachment(middle, -margin);
    wlExtensionFieldName.setLayoutData(fdlExtensionFieldName);
    wExtensionFieldName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wExtensionFieldName);
    wExtensionFieldName.addModifyListener(lsMod);
    fdExtensionFieldName = new FormData();
    fdExtensionFieldName.left = new FormAttachment(middle, 0);
    fdExtensionFieldName.right = new FormAttachment(100, -margin);
    fdExtensionFieldName.top = new FormAttachment(wShortFileFieldName, margin);
    wExtensionFieldName.setLayoutData(fdExtensionFieldName);
    // PathFieldName line
    wlPathFieldName = new Label(wAdditionalFieldsComp, SWT.RIGHT);
    wlPathFieldName.setText(BaseMessages.getString(PKG, "GetXMLDataDialog.PathFieldName.Label"));
    props.setLook(wlPathFieldName);
    fdlPathFieldName = new FormData();
    fdlPathFieldName.left = new FormAttachment(0, 0);
    fdlPathFieldName.top = new FormAttachment(wExtensionFieldName, margin);
    fdlPathFieldName.right = new FormAttachment(middle, -margin);
    wlPathFieldName.setLayoutData(fdlPathFieldName);
    wPathFieldName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wPathFieldName);
    wPathFieldName.addModifyListener(lsMod);
    fdPathFieldName = new FormData();
    fdPathFieldName.left = new FormAttachment(middle, 0);
    fdPathFieldName.right = new FormAttachment(100, -margin);
    fdPathFieldName.top = new FormAttachment(wExtensionFieldName, margin);
    wPathFieldName.setLayoutData(fdPathFieldName);
    // SizeFieldName line
    wlSizeFieldName = new Label(wAdditionalFieldsComp, SWT.RIGHT);
    wlSizeFieldName.setText(BaseMessages.getString(PKG, "GetXMLDataDialog.SizeFieldName.Label"));
    props.setLook(wlSizeFieldName);
    fdlSizeFieldName = new FormData();
    fdlSizeFieldName.left = new FormAttachment(0, 0);
    fdlSizeFieldName.top = new FormAttachment(wPathFieldName, margin);
    fdlSizeFieldName.right = new FormAttachment(middle, -margin);
    wlSizeFieldName.setLayoutData(fdlSizeFieldName);
    wSizeFieldName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wSizeFieldName);
    wSizeFieldName.addModifyListener(lsMod);
    fdSizeFieldName = new FormData();
    fdSizeFieldName.left = new FormAttachment(middle, 0);
    fdSizeFieldName.right = new FormAttachment(100, -margin);
    fdSizeFieldName.top = new FormAttachment(wPathFieldName, margin);
    wSizeFieldName.setLayoutData(fdSizeFieldName);
    // IsHiddenName line
    wlIsHiddenName = new Label(wAdditionalFieldsComp, SWT.RIGHT);
    wlIsHiddenName.setText(BaseMessages.getString(PKG, "GetXMLDataDialog.IsHiddenName.Label"));
    props.setLook(wlIsHiddenName);
    fdlIsHiddenName = new FormData();
    fdlIsHiddenName.left = new FormAttachment(0, 0);
    fdlIsHiddenName.top = new FormAttachment(wSizeFieldName, margin);
    fdlIsHiddenName.right = new FormAttachment(middle, -margin);
    wlIsHiddenName.setLayoutData(fdlIsHiddenName);
    wIsHiddenName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wIsHiddenName);
    wIsHiddenName.addModifyListener(lsMod);
    fdIsHiddenName = new FormData();
    fdIsHiddenName.left = new FormAttachment(middle, 0);
    fdIsHiddenName.right = new FormAttachment(100, -margin);
    fdIsHiddenName.top = new FormAttachment(wSizeFieldName, margin);
    wIsHiddenName.setLayoutData(fdIsHiddenName);
    // LastModificationTimeName line
    wlLastModificationTimeName = new Label(wAdditionalFieldsComp, SWT.RIGHT);
    wlLastModificationTimeName.setText(BaseMessages.getString(PKG, "GetXMLDataDialog.LastModificationTimeName.Label"));
    props.setLook(wlLastModificationTimeName);
    fdlLastModificationTimeName = new FormData();
    fdlLastModificationTimeName.left = new FormAttachment(0, 0);
    fdlLastModificationTimeName.top = new FormAttachment(wIsHiddenName, margin);
    fdlLastModificationTimeName.right = new FormAttachment(middle, -margin);
    wlLastModificationTimeName.setLayoutData(fdlLastModificationTimeName);
    wLastModificationTimeName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wLastModificationTimeName);
    wLastModificationTimeName.addModifyListener(lsMod);
    fdLastModificationTimeName = new FormData();
    fdLastModificationTimeName.left = new FormAttachment(middle, 0);
    fdLastModificationTimeName.right = new FormAttachment(100, -margin);
    fdLastModificationTimeName.top = new FormAttachment(wIsHiddenName, margin);
    wLastModificationTimeName.setLayoutData(fdLastModificationTimeName);
    // UriName line
    wlUriName = new Label(wAdditionalFieldsComp, SWT.RIGHT);
    wlUriName.setText(BaseMessages.getString(PKG, "GetXMLDataDialog.UriName.Label"));
    props.setLook(wlUriName);
    fdlUriName = new FormData();
    fdlUriName.left = new FormAttachment(0, 0);
    fdlUriName.top = new FormAttachment(wLastModificationTimeName, margin);
    fdlUriName.right = new FormAttachment(middle, -margin);
    wlUriName.setLayoutData(fdlUriName);
    wUriName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wUriName);
    wUriName.addModifyListener(lsMod);
    fdUriName = new FormData();
    fdUriName.left = new FormAttachment(middle, 0);
    fdUriName.right = new FormAttachment(100, -margin);
    fdUriName.top = new FormAttachment(wLastModificationTimeName, margin);
    wUriName.setLayoutData(fdUriName);
    // RootUriName line
    wlRootUriName = new Label(wAdditionalFieldsComp, SWT.RIGHT);
    wlRootUriName.setText(BaseMessages.getString(PKG, "GetXMLDataDialog.RootUriName.Label"));
    props.setLook(wlRootUriName);
    fdlRootUriName = new FormData();
    fdlRootUriName.left = new FormAttachment(0, 0);
    fdlRootUriName.top = new FormAttachment(wUriName, margin);
    fdlRootUriName.right = new FormAttachment(middle, -margin);
    wlRootUriName.setLayoutData(fdlRootUriName);
    wRootUriName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wRootUriName);
    wRootUriName.addModifyListener(lsMod);
    fdRootUriName = new FormData();
    fdRootUriName.left = new FormAttachment(middle, 0);
    fdRootUriName.right = new FormAttachment(100, -margin);
    fdRootUriName.top = new FormAttachment(wUriName, margin);
    wRootUriName.setLayoutData(fdRootUriName);
    fdAdditionalFieldsComp = new FormData();
    fdAdditionalFieldsComp.left = new FormAttachment(0, 0);
    fdAdditionalFieldsComp.top = new FormAttachment(wStepname, margin);
    fdAdditionalFieldsComp.right = new FormAttachment(100, 0);
    fdAdditionalFieldsComp.bottom = new FormAttachment(100, 0);
    wAdditionalFieldsComp.setLayoutData(fdAdditionalFieldsComp);
    wAdditionalFieldsComp.layout();
    wAdditionalFieldsTab.setControl(wAdditionalFieldsComp);
// ///////////////////////////////////////////////////////////
// / END OF ADDITIONAL FIELDS TAB
// ///////////////////////////////////////////////////////////
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Composite(org.eclipse.swt.widgets.Composite) Label(org.eclipse.swt.widgets.Label) CTabItem(org.eclipse.swt.custom.CTabItem) FormAttachment(org.eclipse.swt.layout.FormAttachment) TextVar(org.pentaho.di.ui.core.widget.TextVar)

Example 87 with CTabItem

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

the class XsdValidatorDialog method open.

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

        public void modifyText(ModifyEvent e) {
            input.setChanged();
        }
    };
    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, "XsdValidatorDialog.Shell.Title"));
    int middle = props.getMiddlePct();
    int margin = Const.MARGIN;
    // Filename line
    wlStepname = new Label(shell, SWT.RIGHT);
    wlStepname.setText(BaseMessages.getString(PKG, "XsdValidatorDialog.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);
    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, "XsdValidatorDialog.GeneralTab.TabTitle"));
    wGeneralComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wGeneralComp);
    FormLayout generalLayout = new FormLayout();
    generalLayout.marginWidth = 3;
    generalLayout.marginHeight = 3;
    wGeneralComp.setLayout(generalLayout);
    // ////////////////////////
    // START OF XML GROUP
    // 
    wXML = new Group(wGeneralComp, SWT.SHADOW_NONE);
    props.setLook(wXML);
    wXML.setText("XML source");
    FormLayout groupXML = new FormLayout();
    groupXML.marginWidth = 10;
    groupXML.marginHeight = 10;
    wXML.setLayout(groupXML);
    // XML Source = file ?
    wlXMLSourceFile = new Label(wXML, SWT.RIGHT);
    wlXMLSourceFile.setText(BaseMessages.getString(PKG, "XsdValidatorDialog.XMLSourceFile.Label"));
    props.setLook(wlXMLSourceFile);
    fdlXMLSourceFile = new FormData();
    fdlXMLSourceFile.left = new FormAttachment(0, 0);
    fdlXMLSourceFile.top = new FormAttachment(wStepname, 2 * margin);
    fdlXMLSourceFile.right = new FormAttachment(middle, -margin);
    wlXMLSourceFile.setLayoutData(fdlXMLSourceFile);
    wXMLSourceFile = new Button(wXML, SWT.CHECK);
    props.setLook(wXMLSourceFile);
    wXMLSourceFile.setToolTipText(BaseMessages.getString(PKG, "XsdValidatorDialog.XMLSourceFile.Tooltip"));
    fdXMLSourceFile = new FormData();
    fdXMLSourceFile.left = new FormAttachment(middle, margin);
    fdXMLSourceFile.top = new FormAttachment(wStepname, 2 * margin);
    wXMLSourceFile.setLayoutData(fdXMLSourceFile);
    wXMLSourceFile.addSelectionListener(new ComponentSelectionListener(input));
    // XML Stream Field
    wlXMLStream = new Label(wXML, SWT.RIGHT);
    wlXMLStream.setText(BaseMessages.getString(PKG, "XsdValidatorDialog.XMLStream.Label"));
    props.setLook(wlXMLStream);
    fdlXMLStream = new FormData();
    fdlXMLStream.left = new FormAttachment(0, 0);
    fdlXMLStream.top = new FormAttachment(wXMLSourceFile, margin);
    fdlXMLStream.right = new FormAttachment(middle, -margin);
    wlXMLStream.setLayoutData(fdlXMLStream);
    wXMLStream = new CCombo(wXML, SWT.BORDER | SWT.READ_ONLY);
    wXMLStream.setEditable(true);
    props.setLook(wXMLStream);
    wXMLStream.addModifyListener(lsMod);
    fdXMLStream = new FormData();
    fdXMLStream.left = new FormAttachment(middle, margin);
    fdXMLStream.top = new FormAttachment(wXMLSourceFile, margin);
    fdXMLStream.right = new FormAttachment(100, -margin);
    wXMLStream.setLayoutData(fdXMLStream);
    wXMLStream.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);
            PopulateFields();
            shell.setCursor(null);
            busy.dispose();
        }
    });
    fdXML = new FormData();
    fdXML.left = new FormAttachment(0, margin);
    fdXML.top = new FormAttachment(wStepname, margin);
    fdXML.right = new FormAttachment(100, -margin);
    wXML.setLayoutData(fdXML);
    // ///////////////////////////////////////////////////////////
    // / END OF XML GROUP
    // ///////////////////////////////////////////////////////////
    // ////////////////////////
    // START OF OutputFields GROUP
    // 
    wOutputFields = new Group(wGeneralComp, SWT.SHADOW_NONE);
    props.setLook(wOutputFields);
    wOutputFields.setText("Output Fields");
    FormLayout groupLayout = new FormLayout();
    groupLayout.marginWidth = 10;
    groupLayout.marginHeight = 10;
    wOutputFields.setLayout(groupLayout);
    // Output Fieldame
    wResultField = new LabelTextVar(transMeta, wOutputFields, BaseMessages.getString(PKG, "XsdValidatorDialog.ResultField.Label"), BaseMessages.getString(PKG, "XsdValidatorDialog.ResultField.Tooltip"));
    props.setLook(wResultField);
    wResultField.addModifyListener(lsMod);
    fdResultField = new FormData();
    fdResultField.left = new FormAttachment(0, 0);
    fdResultField.top = new FormAttachment(wXML, margin);
    fdResultField.right = new FormAttachment(100, 0);
    wResultField.setLayoutData(fdResultField);
    // Output String Field ?
    wlOutputStringField = new Label(wOutputFields, SWT.RIGHT);
    wlOutputStringField.setText(BaseMessages.getString(PKG, "XsdValidatorDialog.OutputStringField.Label"));
    props.setLook(wlOutputStringField);
    fdlOutputStringField = new FormData();
    fdlOutputStringField.left = new FormAttachment(0, 0);
    fdlOutputStringField.top = new FormAttachment(wResultField, 2 * margin);
    fdlOutputStringField.right = new FormAttachment(middle, -margin);
    wlOutputStringField.setLayoutData(fdlOutputStringField);
    wOutputStringField = new Button(wOutputFields, SWT.CHECK);
    props.setLook(wOutputStringField);
    wOutputStringField.setToolTipText(BaseMessages.getString(PKG, "XsdValidatorDialog.OutputStringField.Tooltip"));
    fdOutputStringField = new FormData();
    fdOutputStringField.left = new FormAttachment(middle, margin);
    fdOutputStringField.top = new FormAttachment(wResultField, 2 * margin);
    wOutputStringField.setLayoutData(fdOutputStringField);
    wOutputStringField.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            activeOutputStringField();
            input.setChanged();
        }
    });
    // Output if XML is valid field
    wIfXMLValid = new LabelTextVar(transMeta, wOutputFields, BaseMessages.getString(PKG, "XsdValidatorDialog.IfXMLValid.Label"), BaseMessages.getString(PKG, "XsdValidatorDialog.IfXMLValid.Tooltip"));
    props.setLook(wIfXMLValid);
    wIfXMLValid.addModifyListener(lsMod);
    fdIfXMLValid = new FormData();
    fdIfXMLValid.left = new FormAttachment(0, 0);
    fdIfXMLValid.top = new FormAttachment(wOutputStringField, margin);
    fdIfXMLValid.right = new FormAttachment(100, 0);
    wIfXMLValid.setLayoutData(fdIfXMLValid);
    // Output if XML is not valid field
    wIfXMLUnValid = new LabelTextVar(transMeta, wOutputFields, BaseMessages.getString(PKG, "XsdValidatorDialog.IfXMLUnValid.Label"), BaseMessages.getString(PKG, "XsdValidatorDialog.IfXMLUnValid.Tooltip"));
    props.setLook(wIfXMLUnValid);
    wIfXMLUnValid.addModifyListener(lsMod);
    fdIfXMLUnValid = new FormData();
    fdIfXMLUnValid.left = new FormAttachment(0, 0);
    fdIfXMLUnValid.top = new FormAttachment(wIfXMLValid, margin);
    fdIfXMLUnValid.right = new FormAttachment(100, 0);
    wIfXMLUnValid.setLayoutData(fdIfXMLUnValid);
    // Add validation message ?
    wlAddValidationMsg = new Label(wOutputFields, SWT.RIGHT);
    wlAddValidationMsg.setText(BaseMessages.getString(PKG, "XsdValidatorDialog.AddValidationMsg.Label"));
    props.setLook(wlAddValidationMsg);
    fdlAddValidationMsg = new FormData();
    fdlAddValidationMsg.left = new FormAttachment(0, 0);
    fdlAddValidationMsg.top = new FormAttachment(wIfXMLUnValid, 2 * margin);
    fdlAddValidationMsg.right = new FormAttachment(middle, -margin);
    wlAddValidationMsg.setLayoutData(fdlAddValidationMsg);
    wAddValidationMsg = new Button(wOutputFields, SWT.CHECK);
    props.setLook(wAddValidationMsg);
    wAddValidationMsg.setToolTipText(BaseMessages.getString(PKG, "XsdValidatorDialog.AddValidationMsg.Tooltip"));
    fdAddValidationMsg = new FormData();
    fdAddValidationMsg.left = new FormAttachment(middle, margin);
    fdAddValidationMsg.top = new FormAttachment(wIfXMLUnValid, 2 * margin);
    wAddValidationMsg.setLayoutData(fdAddValidationMsg);
    wAddValidationMsg.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            activeValidationMsg();
            input.setChanged();
        }
    });
    // Validation Msg Fieldame
    wValidationMsg = new LabelTextVar(transMeta, wOutputFields, BaseMessages.getString(PKG, "XsdValidatorDialog.ValidationMsg.Label"), BaseMessages.getString(PKG, "XsdValidatorDialog.ValidationMsg.Tooltip"));
    props.setLook(wValidationMsg);
    wValidationMsg.addModifyListener(lsMod);
    fdValidationMsg = new FormData();
    fdValidationMsg.left = new FormAttachment(0, 0);
    fdValidationMsg.top = new FormAttachment(wAddValidationMsg, margin);
    fdValidationMsg.right = new FormAttachment(100, 0);
    wValidationMsg.setLayoutData(fdValidationMsg);
    fdOutputFields = new FormData();
    fdOutputFields.left = new FormAttachment(0, margin);
    fdOutputFields.top = new FormAttachment(wXML, margin);
    fdOutputFields.right = new FormAttachment(100, -margin);
    wOutputFields.setLayoutData(fdOutputFields);
    // ///////////////////////////////////////////////////////////
    // / END OF OUTPUT FIELDS GROUP
    // ///////////////////////////////////////////////////////////
    // ////////////////////////
    // START OF XSD GROUP
    // 
    wXSD = new Group(wGeneralComp, SWT.SHADOW_NONE);
    props.setLook(wXSD);
    wXSD.setText("XML Schema Definition");
    FormLayout groupXSD = new FormLayout();
    groupXSD.marginWidth = 10;
    groupXSD.marginHeight = 10;
    wXSD.setLayout(groupLayout);
    // XSD Source?
    wlXSDSource = new Label(wXSD, SWT.RIGHT);
    wlXSDSource.setText(BaseMessages.getString(PKG, "XsdValidatorDialog.XSDSource.Label"));
    props.setLook(wlXSDSource);
    fdlXSDSource = new FormData();
    fdlXSDSource.left = new FormAttachment(0, 0);
    fdlXSDSource.top = new FormAttachment(wStepname, margin);
    fdlXSDSource.right = new FormAttachment(middle, -margin);
    wlXSDSource.setLayoutData(fdlXSDSource);
    wXSDSource = new CCombo(wXSD, SWT.BORDER | SWT.READ_ONLY);
    wXSDSource.setEditable(true);
    props.setLook(wXSDSource);
    wXSDSource.addModifyListener(lsMod);
    fdXSDSource = new FormData();
    fdXSDSource.left = new FormAttachment(middle, margin);
    fdXSDSource.top = new FormAttachment(wStepname, margin);
    fdXSDSource.right = new FormAttachment(100, -margin);
    wXSDSource.setLayoutData(fdXSDSource);
    wXSDSource.add(BaseMessages.getString(PKG, "XsdValidatorDialog.XSDSource.IS_A_FILE"));
    wXSDSource.add(BaseMessages.getString(PKG, "XsdValidatorDialog.XSDSource.IS_A_FIELD"));
    wXSDSource.add(BaseMessages.getString(PKG, "XsdValidatorDialog.XSDSource.NO_NEED"));
    wXSDSource.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            setXSDSource();
        }
    });
    // XSD Filename
    wlFilename = new Label(wXSD, SWT.RIGHT);
    wlFilename.setText(BaseMessages.getString(PKG, "XsdValidatorDialog.XSDFilename.Label"));
    props.setLook(wlFilename);
    fdlFilename = new FormData();
    fdlFilename.left = new FormAttachment(0, 0);
    fdlFilename.top = new FormAttachment(wXSDSource, margin);
    fdlFilename.right = new FormAttachment(middle, -margin);
    wlFilename.setLayoutData(fdlFilename);
    wbbFilename = new Button(wXSD, SWT.PUSH | SWT.CENTER);
    props.setLook(wbbFilename);
    wbbFilename.setText(BaseMessages.getString(PKG, "XsdValidatorDialog.FilenameBrowse.Button"));
    wbbFilename.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.BrowseForFileOrDirAndAdd"));
    fdbFilename = new FormData();
    fdbFilename.right = new FormAttachment(100, 0);
    fdbFilename.top = new FormAttachment(wXSDSource, margin);
    wbbFilename.setLayoutData(fdbFilename);
    wFilename = new TextVar(transMeta, wXSD, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wFilename);
    wFilename.addModifyListener(lsMod);
    fdFilename = new FormData();
    fdFilename.left = new FormAttachment(middle, margin);
    fdFilename.right = new FormAttachment(wbbFilename, -margin);
    fdFilename.top = new FormAttachment(wXSDSource, margin);
    wFilename.setLayoutData(fdFilename);
    // XSD file defined in a column
    wlXSDDefinedColumn = new Label(wXSD, SWT.RIGHT);
    wlXSDDefinedColumn.setText(BaseMessages.getString(PKG, "XsdValidatorDialog.XSDDefinedColumn.Label"));
    props.setLook(wlXSDDefinedColumn);
    fdlXSDDefinedColumn = new FormData();
    fdlXSDDefinedColumn.left = new FormAttachment(0, 0);
    fdlXSDDefinedColumn.top = new FormAttachment(wFilename, 2 * margin);
    fdlXSDDefinedColumn.right = new FormAttachment(middle, -margin);
    wlXSDDefinedColumn.setLayoutData(fdlXSDDefinedColumn);
    wXSDDefinedColumn = new CCombo(wXSD, SWT.BORDER | SWT.READ_ONLY);
    wXSDDefinedColumn.setEditable(true);
    props.setLook(wXSDDefinedColumn);
    wXSDDefinedColumn.addModifyListener(lsMod);
    fdXSDDefinedColumn = new FormData();
    fdXSDDefinedColumn.left = new FormAttachment(middle, margin);
    fdXSDDefinedColumn.top = new FormAttachment(wFilename, 2 * margin);
    fdXSDDefinedColumn.right = new FormAttachment(100, -margin);
    wXSDDefinedColumn.setLayoutData(fdXSDDefinedColumn);
    wXSDDefinedColumn.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);
            PopulateFields();
            shell.setCursor(null);
            busy.dispose();
        }
    });
    fdXSD = new FormData();
    fdXSD.left = new FormAttachment(0, margin);
    fdXSD.top = new FormAttachment(wOutputFields, margin);
    fdXSD.right = new FormAttachment(100, -margin);
    wXSD.setLayoutData(fdXSD);
    // ///////////////////////////////////////////////////////////
    // / END OF XSD GROUP
    // ///////////////////////////////////////////////////////////
    fdGeneralComp = new FormData();
    fdGeneralComp.left = new FormAttachment(0, 0);
    fdGeneralComp.top = new FormAttachment(0, 0);
    fdGeneralComp.right = new FormAttachment(100, 0);
    fdGeneralComp.bottom = new FormAttachment(100, 0);
    wGeneralComp.setLayoutData(fdGeneralComp);
    wGeneralComp.layout();
    wGeneralTab.setControl(wGeneralComp);
    props.setLook(wGeneralComp);
    // ///////////////////////////////////////////////////////////
    // / END OF GENERAL TAB
    // ///////////////////////////////////////////////////////////
    // ///////////////////////////////////////////////////////////
    // / END OF GENERAL TAB
    // ///////////////////////////////////////////////////////////
    fdTabFolder = new FormData();
    fdTabFolder.left = new FormAttachment(0, 0);
    fdTabFolder.top = new FormAttachment(wStepname, margin);
    fdTabFolder.right = new FormAttachment(100, 0);
    fdTabFolder.bottom = new FormAttachment(100, -50);
    wTabFolder.setLayoutData(fdTabFolder);
    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
    lsCancel = new Listener() {

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

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

        public void widgetDefaultSelected(SelectionEvent e) {
            ok();
        }
    };
    wStepname.addSelectionListener(lsDef);
    // 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) {
            FileDialog dialog = new FileDialog(shell, SWT.OPEN);
            dialog.setFilterExtensions(new String[] { "*xsd;*.XSD", "*" });
            if (wFilename.getText() != null) {
                String fname = transMeta.environmentSubstitute(wFilename.getText());
                dialog.setFileName(fname);
            }
            dialog.setFilterNames(new String[] { BaseMessages.getString(PKG, "XsdValidatorDialog.FileType"), BaseMessages.getString(PKG, "System.FileType.AllFiles") });
            if (dialog.open() != null) {
                String str = dialog.getFilterPath() + System.getProperty("file.separator") + dialog.getFileName();
                wFilename.setText(str);
            }
        }
    });
    wTabFolder.setSelection(0);
    // Set the shell size, based upon previous time...
    setSize();
    getData();
    activeValidationMsg();
    activeOutputStringField();
    setXSDSource();
    input.setChanged(changed);
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
    return stepname;
}
Also used : Group(org.eclipse.swt.widgets.Group) CTabFolder(org.eclipse.swt.custom.CTabFolder) FocusListener(org.eclipse.swt.events.FocusListener) Listener(org.eclipse.swt.widgets.Listener) ModifyListener(org.eclipse.swt.events.ModifyListener) ComponentSelectionListener(org.pentaho.di.ui.trans.step.ComponentSelectionListener) ModifyListener(org.eclipse.swt.events.ModifyListener) Label(org.eclipse.swt.widgets.Label) Cursor(org.eclipse.swt.graphics.Cursor) CTabItem(org.eclipse.swt.custom.CTabItem) ComponentSelectionListener(org.pentaho.di.ui.trans.step.ComponentSelectionListener) 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) FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Text(org.eclipse.swt.widgets.Text) TextVar(org.pentaho.di.ui.core.widget.TextVar) LabelTextVar(org.pentaho.di.ui.core.widget.LabelTextVar) 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) 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 88 with CTabItem

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

the class JobDialog method addLogTab.

private void addLogTab() {
    // ////////////////////////
    // START OF LOG TAB///
    // /
    wLogTab = new CTabItem(wTabFolder, SWT.NONE);
    wLogTab.setText(BaseMessages.getString(PKG, "JobDialog.LogTab.Label"));
    FormLayout LogLayout = new FormLayout();
    LogLayout.marginWidth = Const.MARGIN;
    LogLayout.marginHeight = Const.MARGIN;
    wLogComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wLogComp);
    wLogComp.setLayout(LogLayout);
    // Add a log type List on the left hand side...
    // 
    wLogTypeList = new List(wLogComp, SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
    props.setLook(wLogTypeList);
    for (LogTableInterface logTable : logTables) {
        wLogTypeList.add(logTable.getLogTableType());
    }
    FormData fdLogTypeList = new FormData();
    fdLogTypeList.left = new FormAttachment(0, 0);
    fdLogTypeList.top = new FormAttachment(0, 0);
    fdLogTypeList.right = new FormAttachment(middle / 2, 0);
    fdLogTypeList.bottom = new FormAttachment(100, 0);
    wLogTypeList.setLayoutData(fdLogTypeList);
    wLogTypeList.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent arg0) {
            showLogTypeOptions(wLogTypeList.getSelectionIndex());
        }
    });
    // On the right side we see a dynamic area : a composite...
    // 
    wLogOptionsComposite = new Composite(wLogComp, SWT.BORDER);
    FormLayout logOptionsLayout = new FormLayout();
    logOptionsLayout.marginWidth = Const.MARGIN;
    logOptionsLayout.marginHeight = Const.MARGIN;
    wLogOptionsComposite.setLayout(logOptionsLayout);
    props.setLook(wLogOptionsComposite);
    FormData fdLogOptionsComposite = new FormData();
    fdLogOptionsComposite.left = new FormAttachment(wLogTypeList, margin);
    fdLogOptionsComposite.top = new FormAttachment(0, 0);
    fdLogOptionsComposite.right = new FormAttachment(100, 0);
    fdLogOptionsComposite.bottom = new FormAttachment(100, 0);
    wLogOptionsComposite.setLayoutData(fdLogOptionsComposite);
    FormData fdLogComp = new FormData();
    fdLogComp.left = new FormAttachment(0, 0);
    fdLogComp.top = new FormAttachment(0, 0);
    fdLogComp.right = new FormAttachment(100, 0);
    fdLogComp.bottom = new FormAttachment(100, 0);
    wLogComp.setLayoutData(fdLogComp);
    wLogComp.layout();
    wLogTab.setControl(wLogComp);
// ///////////////////////////////////////////////////////////
// / END OF LOG TAB
// ///////////////////////////////////////////////////////////
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) LogTableInterface(org.pentaho.di.core.logging.LogTableInterface) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) List(org.eclipse.swt.widgets.List) ArrayList(java.util.ArrayList) CTabItem(org.eclipse.swt.custom.CTabItem) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 89 with CTabItem

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

the class JobDialog method addJobTab.

private void addJobTab() {
    // ////////////////////////
    // START OF JOB TAB///
    // /
    wJobTab = new CTabItem(wTabFolder, SWT.NONE);
    wJobTab.setText(BaseMessages.getString(PKG, "JobDialog.JobTab.Label"));
    Composite wJobComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wJobComp);
    FormLayout transLayout = new FormLayout();
    transLayout.marginWidth = Const.MARGIN;
    transLayout.marginHeight = Const.MARGIN;
    wJobComp.setLayout(transLayout);
    // Jobname:
    wlJobname = new Label(wJobComp, SWT.RIGHT);
    wlJobname.setText(BaseMessages.getString(PKG, "JobDialog.JobName.Label"));
    props.setLook(wlJobname);
    fdlJobname = new FormData();
    fdlJobname.left = new FormAttachment(0, 0);
    fdlJobname.right = new FormAttachment(middle, -margin);
    fdlJobname.top = new FormAttachment(0, margin);
    wlJobname.setLayoutData(fdlJobname);
    wJobname = new Text(wJobComp, rep == null ? SWT.SINGLE | SWT.LEFT | SWT.BORDER : SWT.SINGLE | SWT.LEFT | SWT.BORDER | SWT.READ_ONLY);
    wJobname.setEnabled(rep == null);
    props.setLook(wJobname);
    wJobname.addModifyListener(lsMod);
    fdJobname = new FormData();
    fdJobname.left = new FormAttachment(middle, 0);
    fdJobname.top = new FormAttachment(0, margin);
    fdJobname.right = new FormAttachment(100, 0);
    wJobname.setLayoutData(fdJobname);
    // JobFilename:
    wlJobFilename = new Label(wJobComp, SWT.RIGHT);
    wlJobFilename.setText(BaseMessages.getString(PKG, "JobDialog.JobFilename.Label"));
    props.setLook(wlJobFilename);
    fdlJobFilename = new FormData();
    fdlJobFilename.left = new FormAttachment(0, 0);
    fdlJobFilename.right = new FormAttachment(middle, -margin);
    fdlJobFilename.top = new FormAttachment(wJobname, margin);
    wlJobFilename.setLayoutData(fdlJobFilename);
    wJobFilename = new Text(wJobComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wJobFilename);
    wJobFilename.addModifyListener(lsMod);
    fdJobFilename = new FormData();
    fdJobFilename.left = new FormAttachment(middle, 0);
    fdJobFilename.top = new FormAttachment(wJobname, margin);
    fdJobFilename.right = new FormAttachment(100, 0);
    wJobFilename.setLayoutData(fdJobFilename);
    wJobFilename.setEditable(false);
    wJobFilename.setBackground(GUIResource.getInstance().getColorLightGray());
    // Job description:
    Label wlJobdescription = new Label(wJobComp, SWT.RIGHT);
    wlJobdescription.setText(BaseMessages.getString(PKG, "JobDialog.Jobdescription.Label"));
    props.setLook(wlJobdescription);
    FormData fdlJobdescription = new FormData();
    fdlJobdescription.left = new FormAttachment(0, 0);
    fdlJobdescription.right = new FormAttachment(middle, -margin);
    fdlJobdescription.top = new FormAttachment(wJobFilename, margin);
    wlJobdescription.setLayoutData(fdlJobdescription);
    wJobdescription = new Text(wJobComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wJobdescription);
    wJobdescription.addModifyListener(lsMod);
    FormData fdJobdescription = new FormData();
    fdJobdescription.left = new FormAttachment(middle, 0);
    fdJobdescription.top = new FormAttachment(wJobFilename, margin);
    fdJobdescription.right = new FormAttachment(100, 0);
    wJobdescription.setLayoutData(fdJobdescription);
    // Transformation Extended description
    wlExtendeddescription = new Label(wJobComp, SWT.RIGHT);
    wlExtendeddescription.setText(BaseMessages.getString(PKG, "JobDialog.Extendeddescription.Label"));
    props.setLook(wlExtendeddescription);
    fdlExtendeddescription = new FormData();
    fdlExtendeddescription.left = new FormAttachment(0, 0);
    fdlExtendeddescription.top = new FormAttachment(wJobdescription, margin);
    fdlExtendeddescription.right = new FormAttachment(middle, -margin);
    wlExtendeddescription.setLayoutData(fdlExtendeddescription);
    wExtendeddescription = new Text(wJobComp, SWT.MULTI | SWT.LEFT | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    props.setLook(wExtendeddescription, Props.WIDGET_STYLE_FIXED);
    wExtendeddescription.addModifyListener(lsMod);
    fdExtendeddescription = new FormData();
    fdExtendeddescription.left = new FormAttachment(middle, 0);
    fdExtendeddescription.top = new FormAttachment(wJobdescription, margin);
    fdExtendeddescription.right = new FormAttachment(100, 0);
    fdExtendeddescription.bottom = new FormAttachment(50, -margin);
    wExtendeddescription.setLayoutData(fdExtendeddescription);
    // Trans Status
    wlJobstatus = new Label(wJobComp, SWT.RIGHT);
    wlJobstatus.setText(BaseMessages.getString(PKG, "JobDialog.Jobstatus.Label"));
    props.setLook(wlJobstatus);
    fdlJobstatus = new FormData();
    fdlJobstatus.left = new FormAttachment(0, 0);
    fdlJobstatus.right = new FormAttachment(middle, 0);
    fdlJobstatus.top = new FormAttachment(wExtendeddescription, margin * 2);
    wlJobstatus.setLayoutData(fdlJobstatus);
    wJobstatus = new CCombo(wJobComp, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
    wJobstatus.add(BaseMessages.getString(PKG, "JobDialog.Draft_Jobstatus.Label"));
    wJobstatus.add(BaseMessages.getString(PKG, "JobDialog.Production_Jobstatus.Label"));
    wJobstatus.add("");
    // +1: starts at -1
    wJobstatus.select(-1);
    props.setLook(wJobstatus);
    fdJobstatus = new FormData();
    fdJobstatus.left = new FormAttachment(middle, 0);
    fdJobstatus.top = new FormAttachment(wExtendeddescription, margin * 2);
    fdJobstatus.right = new FormAttachment(100, 0);
    wJobstatus.setLayoutData(fdJobstatus);
    // Job version:
    Label wlJobversion = new Label(wJobComp, SWT.RIGHT);
    wlJobversion.setText(BaseMessages.getString(PKG, "JobDialog.Jobversion.Label"));
    props.setLook(wlJobversion);
    FormData fdlJobversion = new FormData();
    fdlJobversion.left = new FormAttachment(0, 0);
    fdlJobversion.right = new FormAttachment(middle, -margin);
    fdlJobversion.top = new FormAttachment(wJobstatus, margin);
    wlJobversion.setLayoutData(fdlJobversion);
    wJobversion = new Text(wJobComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wJobversion);
    wJobversion.addModifyListener(lsMod);
    FormData fdJobversion = new FormData();
    fdJobversion.left = new FormAttachment(middle, 0);
    fdJobversion.top = new FormAttachment(wJobstatus, margin);
    fdJobversion.right = new FormAttachment(100, 0);
    wJobversion.setLayoutData(fdJobversion);
    // Directory:
    wlDirectory = new Label(wJobComp, SWT.RIGHT);
    wlDirectory.setText(BaseMessages.getString(PKG, "JobDialog.Directory.Label"));
    props.setLook(wlDirectory);
    fdlDirectory = new FormData();
    fdlDirectory.left = new FormAttachment(0, 0);
    fdlDirectory.right = new FormAttachment(middle, -margin);
    fdlDirectory.top = new FormAttachment(wJobversion, margin);
    wlDirectory.setLayoutData(fdlDirectory);
    wbDirectory = new Button(wJobComp, SWT.PUSH);
    wbDirectory.setToolTipText(BaseMessages.getString(PKG, "JobDialog.SelectJobFolderFolder.Tooltip"));
    wbDirectory.setImage(GUIResource.getInstance().getImageArrow());
    props.setLook(wbDirectory);
    fdbDirectory = new FormData();
    fdbDirectory.top = new FormAttachment(wJobversion, 0);
    fdbDirectory.right = new FormAttachment(100, 0);
    wbDirectory.setLayoutData(fdbDirectory);
    wbDirectory.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent arg0) {
            RepositoryDirectoryInterface directoryFrom = jobMeta.getRepositoryDirectory();
            RepositoryDirectoryInterface rd = RepositoryDirectoryUI.chooseDirectory(shell, rep, directoryFrom);
            if (rd == null) {
                return;
            }
            // We need to change this in the repository as well!!
            // We do this when the user pressed OK
            newDirectory = rd;
            wDirectory.setText(rd.getPath());
        }
    });
    wDirectory = new Text(wJobComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wDirectory);
    wDirectory.setToolTipText(BaseMessages.getString(PKG, "JobDialog.Directory.Tooltip"));
    wDirectory.setEditable(false);
    wDirectory.setEnabled(false);
    fdDirectory = new FormData();
    fdDirectory.top = new FormAttachment(wJobversion, margin);
    fdDirectory.left = new FormAttachment(middle, 0);
    fdDirectory.right = new FormAttachment(wbDirectory, 0);
    wDirectory.setLayoutData(fdDirectory);
    // Create User:
    Label wlCreateUser = new Label(wJobComp, SWT.RIGHT);
    wlCreateUser.setText(BaseMessages.getString(PKG, "JobDialog.CreateUser.Label"));
    props.setLook(wlCreateUser);
    FormData fdlCreateUser = new FormData();
    fdlCreateUser.left = new FormAttachment(0, 0);
    fdlCreateUser.right = new FormAttachment(middle, -margin);
    fdlCreateUser.top = new FormAttachment(wDirectory, margin);
    wlCreateUser.setLayoutData(fdlCreateUser);
    wCreateUser = new Text(wJobComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wCreateUser);
    wCreateUser.setEditable(false);
    wCreateUser.addModifyListener(lsMod);
    FormData fdCreateUser = new FormData();
    fdCreateUser.left = new FormAttachment(middle, 0);
    fdCreateUser.top = new FormAttachment(wDirectory, margin);
    fdCreateUser.right = new FormAttachment(100, 0);
    wCreateUser.setLayoutData(fdCreateUser);
    // Created Date:
    Label wlCreateDate = new Label(wJobComp, SWT.RIGHT);
    wlCreateDate.setText(BaseMessages.getString(PKG, "JobDialog.CreateDate.Label"));
    props.setLook(wlCreateDate);
    FormData fdlCreateDate = new FormData();
    fdlCreateDate.left = new FormAttachment(0, 0);
    fdlCreateDate.right = new FormAttachment(middle, -margin);
    fdlCreateDate.top = new FormAttachment(wCreateUser, margin);
    wlCreateDate.setLayoutData(fdlCreateDate);
    wCreateDate = new Text(wJobComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wCreateDate);
    wCreateDate.setEditable(false);
    wCreateDate.addModifyListener(lsMod);
    FormData fdCreateDate = new FormData();
    fdCreateDate.left = new FormAttachment(middle, 0);
    fdCreateDate.top = new FormAttachment(wCreateUser, margin);
    fdCreateDate.right = new FormAttachment(100, 0);
    wCreateDate.setLayoutData(fdCreateDate);
    // Modified User:
    Label wlModUser = new Label(wJobComp, SWT.RIGHT);
    wlModUser.setText(BaseMessages.getString(PKG, "JobDialog.LastModifiedUser.Label"));
    props.setLook(wlModUser);
    FormData fdlModUser = new FormData();
    fdlModUser.left = new FormAttachment(0, 0);
    fdlModUser.right = new FormAttachment(middle, -margin);
    fdlModUser.top = new FormAttachment(wCreateDate, margin);
    wlModUser.setLayoutData(fdlModUser);
    wModUser = new Text(wJobComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wModUser);
    wModUser.setEditable(false);
    wModUser.addModifyListener(lsMod);
    FormData fdModUser = new FormData();
    fdModUser.left = new FormAttachment(middle, 0);
    fdModUser.top = new FormAttachment(wCreateDate, margin);
    fdModUser.right = new FormAttachment(100, 0);
    wModUser.setLayoutData(fdModUser);
    // Modified Date:
    Label wlModDate = new Label(wJobComp, SWT.RIGHT);
    wlModDate.setText(BaseMessages.getString(PKG, "JobDialog.LastModifiedDate.Label"));
    props.setLook(wlModDate);
    FormData fdlModDate = new FormData();
    fdlModDate.left = new FormAttachment(0, 0);
    fdlModDate.right = new FormAttachment(middle, -margin);
    fdlModDate.top = new FormAttachment(wModUser, margin);
    wlModDate.setLayoutData(fdlModDate);
    wModDate = new Text(wJobComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wModDate);
    wModDate.setEditable(false);
    wModDate.addModifyListener(lsMod);
    FormData fdModDate = new FormData();
    fdModDate.left = new FormAttachment(middle, 0);
    fdModDate.top = new FormAttachment(wModUser, margin);
    fdModDate.right = new FormAttachment(100, 0);
    wModDate.setLayoutData(fdModDate);
    FormData fdJobComp = new FormData();
    fdJobComp.left = new FormAttachment(0, 0);
    fdJobComp.top = new FormAttachment(0, 0);
    fdJobComp.right = new FormAttachment(100, 0);
    fdJobComp.bottom = new FormAttachment(100, 0);
    wJobComp.setLayoutData(fdJobComp);
    wJobTab.setControl(wJobComp);
// ///////////////////////////////////////////////////////////
// / END OF JOB TAB
// ///////////////////////////////////////////////////////////
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) RepositoryDirectoryInterface(org.pentaho.di.repository.RepositoryDirectoryInterface) CCombo(org.eclipse.swt.custom.CCombo) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Text(org.eclipse.swt.widgets.Text) CTabItem(org.eclipse.swt.custom.CTabItem) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 90 with CTabItem

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

the class JobDialog method addSettingsTab.

private void addSettingsTab() {
    // ////////////////////////
    // START OF SETTINGS TAB///
    // /
    wSettingsTab = new CTabItem(wTabFolder, SWT.NONE);
    wSettingsTab.setText(BaseMessages.getString(PKG, "JobDialog.SettingsTab.Label"));
    FormLayout LogLayout = new FormLayout();
    LogLayout.marginWidth = Const.MARGIN;
    LogLayout.marginHeight = Const.MARGIN;
    Composite wSettingsComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wSettingsComp);
    wSettingsComp.setLayout(LogLayout);
    wlBatchTrans = new Label(wSettingsComp, SWT.RIGHT);
    wlBatchTrans.setText(BaseMessages.getString(PKG, "JobDialog.PassBatchID.Label"));
    props.setLook(wlBatchTrans);
    fdlBatchTrans = new FormData();
    fdlBatchTrans.left = new FormAttachment(0, 0);
    fdlBatchTrans.top = new FormAttachment(0, margin);
    fdlBatchTrans.right = new FormAttachment(middle, -margin);
    wlBatchTrans.setLayoutData(fdlBatchTrans);
    wBatchTrans = new Button(wSettingsComp, SWT.CHECK);
    props.setLook(wBatchTrans);
    wBatchTrans.setToolTipText(BaseMessages.getString(PKG, "JobDialog.PassBatchID.Tooltip"));
    fdBatchTrans = new FormData();
    fdBatchTrans.left = new FormAttachment(middle, 0);
    fdBatchTrans.top = new FormAttachment(0, margin);
    fdBatchTrans.right = new FormAttachment(100, 0);
    wBatchTrans.setLayoutData(fdBatchTrans);
    // Shared objects file
    Label wlSharedObjectsFile = new Label(wSettingsComp, SWT.RIGHT);
    wlSharedObjectsFile.setText(BaseMessages.getString(PKG, "JobDialog.SharedObjectsFile.Label"));
    props.setLook(wlSharedObjectsFile);
    FormData fdlSharedObjectsFile = new FormData();
    fdlSharedObjectsFile.left = new FormAttachment(0, 0);
    fdlSharedObjectsFile.right = new FormAttachment(middle, -margin);
    fdlSharedObjectsFile.top = new FormAttachment(wBatchTrans, 4 * margin);
    wlSharedObjectsFile.setLayoutData(fdlSharedObjectsFile);
    wSharedObjectsFile = new TextVar(jobMeta, wSettingsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wlSharedObjectsFile.setToolTipText(BaseMessages.getString(PKG, "JobDialog.SharedObjectsFile.Tooltip"));
    wSharedObjectsFile.setToolTipText(BaseMessages.getString(PKG, "JobDialog.SharedObjectsFile.Tooltip"));
    props.setLook(wSharedObjectsFile);
    FormData fdSharedObjectsFile = new FormData();
    fdSharedObjectsFile.left = new FormAttachment(middle, 0);
    fdSharedObjectsFile.top = new FormAttachment(wBatchTrans, 4 * margin);
    fdSharedObjectsFile.right = new FormAttachment(100, 0);
    wSharedObjectsFile.setLayoutData(fdSharedObjectsFile);
    wSharedObjectsFile.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent arg0) {
            sharedObjectsFileChanged = true;
        }
    });
    FormData fdLogComp = new FormData();
    fdLogComp.left = new FormAttachment(0, 0);
    fdLogComp.top = new FormAttachment(0, 0);
    fdLogComp.right = new FormAttachment(100, 0);
    fdLogComp.bottom = new FormAttachment(100, 0);
    wSettingsComp.setLayoutData(fdLogComp);
    wSettingsComp.layout();
    wSettingsTab.setControl(wSettingsComp);
// ///////////////////////////////////////////////////////////
// / END OF LOG TAB
// ///////////////////////////////////////////////////////////
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) Button(org.eclipse.swt.widgets.Button) Label(org.eclipse.swt.widgets.Label) CTabItem(org.eclipse.swt.custom.CTabItem) FormAttachment(org.eclipse.swt.layout.FormAttachment) TextVar(org.pentaho.di.ui.core.widget.TextVar)

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