Search in sources :

Example 6 with LabelledText

use of org.talend.commons.ui.swt.formtools.LabelledText in project tdi-studio-se by Talend.

the class FTPForm method addFields.

/*
     * (non-Javadoc)
     *
     * @see org.talend.repository.ui.swt.utils.AbstractForm#addFields()
     */
@Override
protected void addFields() {
    Group ftpParameterGroup = new Group(this, SWT.NULL);
    //$NON-NLS-1$
    ftpParameterGroup.setText("Server");
    GridLayout ftpParameterLayout = new GridLayout();
    ftpParameterLayout.numColumns = 2;
    ftpParameterGroup.setLayout(ftpParameterLayout);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    ftpParameterGroup.setLayoutData(gridData);
    //$NON-NLS-1$
    ftpUsernameText = new LabelledText(ftpParameterGroup, Messages.getString("FTPForm_ftpUsernameText"), true);
    ftpPasswordText = new LabelledText(ftpParameterGroup, Messages.getString("FTPForm_ftpPasswordText"), 1, //$NON-NLS-1$
    SWT.BORDER | SWT.PASSWORD);
    //$NON-NLS-1$
    ftpHostText = new LabelledText(ftpParameterGroup, Messages.getString("FTPForm_ftpHostText"), true);
    //$NON-NLS-1$
    ftpPortText = new LabelledText(ftpParameterGroup, Messages.getString("FTPForm_ftpPortText"), true);
    encodingComp = new Composite(ftpParameterGroup, SWT.NONE);
    GridData encodingCompGD = new GridData(SWT.FILL, SWT.CENTER, true, false);
    encodingCompGD.horizontalSpan = 2;
    encodingComp.setLayoutData(encodingCompGD);
    GridLayout encodingCompLayout = new GridLayout(4, false);
    encodingCompLayout.marginWidth = 0;
    encodingComp.setLayout(encodingCompLayout);
    fnEncodingBtn = new Button(encodingComp, SWT.CHECK);
    //$NON-NLS-1$
    fnEncodingBtn.setText("Filename encoding");
    fnEncodingBtnGD = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
    fnEncodingBtn.setLayoutData(fnEncodingBtnGD);
    List<String> codeList = new ArrayList<String>();
    codeList.add(ENCODING);
    //$NON-NLS-1$
    codeList.add("UTF-8");
    codeList.add(CUSTOM);
    //$NON-NLS-1$ //$NON-NLS-2$
    encodeCombo = new LabelledCombo(encodingComp, "Encoding", "", codeList);
    if (getConnection().getEcoding() == null || "".equals(getConnection().getEcoding())) {
        //$NON-NLS-1$
        encodeCombo.setText(ENCODING);
        getConnection().setEcoding(encodeCombo.getText());
    }
    customText = new Text(encodingComp, SWT.BORDER | SWT.SINGLE);
    GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
    gridData.horizontalSpan = 1;
    customText.setLayoutData(gd);
    List<String> connList = new ArrayList<String>();
    //$NON-NLS-1$
    connList.add("Passive");
    //$NON-NLS-1$
    connList.add("Active");
    //$NON-NLS-1$ //$NON-NLS-2$
    connModelCombo = new LabelledCombo(ftpParameterGroup, Messages.getString("FTPForm_conn_model"), "", connList);
    if (getConnection().getMode() == null || "".equals(getConnection().getMode())) {
        //$NON-NLS-1$
        //$NON-NLS-1$
        connModelCombo.setText(Messages.getString("FTPForm_passive"));
        getConnection().setMode(connModelCombo.getText());
    }
    buildGroup = new Group(this, SWT.NULL);
    //$NON-NLS-1$
    buildGroup.setText("Parameter");
    GridLayout layoutGroup = new GridLayout(1, false);
    buildGroup.setLayout(layoutGroup);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    buildGroup.setLayoutData(gridData);
    Composite checkButtonCom = new Composite(buildGroup, SWT.NONE);
    layoutGroup = new GridLayout(2, false);
    checkButtonCom.setLayout(layoutGroup);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    checkButtonCom.setLayoutData(gridData);
    sftpSuppBut = new Button(checkButtonCom, SWT.CHECK);
    //$NON-NLS-1$
    sftpSuppBut.setText(Messages.getString("FTPForm_sftp_suport"));
    ftpsSuppBut = new Button(checkButtonCom, SWT.CHECK);
    //$NON-NLS-1$
    ftpsSuppBut.setText(Messages.getString("FTPForm_ftps_support"));
    String[] methodComboStr = { PUBLIC_KEY, PASSWORD };
    tetsCom = new Composite(buildGroup, SWT.NONE);
    layoutGroup = new GridLayout(1, false);
    tetsCom.setLayout(layoutGroup);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    tetsCom.setLayoutData(gridData);
    sftpChildCom = new Composite(tetsCom, SWT.NONE);
    layoutGroup = new GridLayout(3, false);
    sftpChildCom.setLayout(layoutGroup);
    sftpChildComGridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.minimumWidth = 300;
    gridData.minimumHeight = 120;
    gridData.widthHint = 300;
    gridData.heightHint = 110;
    sftpChildCom.setLayoutData(sftpChildComGridData);
    methodCombo = new LabelledCombo(sftpChildCom, Messages.getString("FTPForm_authen_method"), "", methodComboStr, 2, false, //$NON-NLS-1$ //$NON-NLS-2$
    SWT.NONE);
    // file Field
    //$NON-NLS-1$
    String[] extensions = { "*.*" };
    //$NON-NLS-1$
    privatekeyText = new LabelledFileField(sftpChildCom, Messages.getString("FTPForm_privatekeyText"), extensions);
    passphraseText = new LabelledText(sftpChildCom, Messages.getString("FTPForm_passphraseText"), 1, //$NON-NLS-1$
    SWT.BORDER | SWT.PASSWORD);
    ftpsChildCom = new Composite(tetsCom, SWT.NONE);
    layoutGroup = new GridLayout(3, false);
    ftpsChildCom.setLayout(layoutGroup);
    ftpsChildComGridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.minimumWidth = 300;
    gridData.minimumHeight = 120;
    gridData.widthHint = 300;
    gridData.heightHint = 90;
    ftpsChildCom.setLayoutData(ftpsChildComGridData);
    //$NON-NLS-1$
    keyFileText = new LabelledFileField(ftpsChildCom, Messages.getString("FTPForm_keyFileText"), extensions);
    keyPasswordText = new LabelledText(ftpsChildCom, Messages.getString("FTPForm_keyPasswordText"), 1, //$NON-NLS-1$
    SWT.BORDER | SWT.PASSWORD);
    proxyCom = new Composite(buildGroup, SWT.NONE);
    layoutGroup = new GridLayout(1, false);
    proxyCom.setLayout(layoutGroup);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    proxyCom.setLayoutData(gridData);
    useSocksBut = new Button(proxyCom, SWT.CHECK);
    //$NON-NLS-1$
    useSocksBut.setText(Messages.getString("FTPForm_sccks_proxy"));
    proxyChildCom = new Composite(proxyCom, SWT.NONE);
    layoutGroup = new GridLayout(2, false);
    proxyChildCom.setLayout(layoutGroup);
    proxyChildComGridData = new GridData(GridData.FILL_HORIZONTAL);
    proxyChildCom.setLayoutData(proxyChildComGridData);
    //$NON-NLS-1$
    proxyHostText = new LabelledText(proxyChildCom, Messages.getString("FTPForm_proxyHostText"), true);
    //$NON-NLS-1$
    proxyPortText = new LabelledText(proxyChildCom, Messages.getString("FTPForm_proxyPortText"), true);
    //$NON-NLS-1$
    proxyUsernameText = new LabelledText(proxyChildCom, Messages.getString("FTPForm_proxyUsernameText"), true);
    proxyPasswordText = new LabelledText(proxyChildCom, Messages.getString("FTPForm_proxyPasswordText"), 1, //$NON-NLS-1$
    SWT.BORDER | SWT.PASSWORD);
    checkFieldsValue();
}
Also used : LabelledText(org.talend.commons.ui.swt.formtools.LabelledText) LabelledCombo(org.talend.commons.ui.swt.formtools.LabelledCombo) Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) ArrayList(java.util.ArrayList) Text(org.eclipse.swt.widgets.Text) LabelledText(org.talend.commons.ui.swt.formtools.LabelledText) LabelledFileField(org.talend.commons.ui.swt.formtools.LabelledFileField) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData)

Example 7 with LabelledText

use of org.talend.commons.ui.swt.formtools.LabelledText in project tdi-studio-se by Talend.

the class CreateSandboxProjectDialog method createProjectInfors.

private void createProjectInfors(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout());
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    // url
    Composite urlComp = new Composite(composite, SWT.NONE);
    urlComp.setLayout(new GridLayout(3, false));
    urlComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    //$NON-NLS-1$
    urlText = new LabelledText(urlComp, Messages.getString("CreateSandboxProjectDialog.UrlTitle"));
    // if (existedBeforeConn()) {
    // urlText.setText(getExistedBeforeConnURL());
    // }
    checkBtn = new Button(urlComp, SWT.PUSH);
    //$NON-NLS-1$
    checkBtn.setText(Messages.getString("CreateSandboxProjectDialog.CheckTitle"));
    projectGroup = new Group(composite, SWT.NONE);
    //$NON-NLS-1$
    projectGroup.setText(Messages.getString("CreateSandboxProjectDialog.Settings"));
    projectGroup.setLayout(new GridLayout(2, false));
    projectGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
    projectLabelText = new LabelledText(projectGroup, Messages.getString("CreateSandboxProjectDialog.ProjectLabel"), 1, //$NON-NLS-1$
    SWT.SINGLE);
    GridData layoutData = new GridData();
    layoutData.widthHint = 180;
    layoutData.minimumWidth = 180;
    projectLabelText.setLayoutData(layoutData);
    projectLabelText.getTextControl().setEditable(false);
    languageCombo = new LabelledCombo(projectGroup, Messages.getString("NewProjectWizardPage.language"), null, new String[] { //$NON-NLS-1$
    ECodeLanguage.JAVA.getName() });
    layoutData = new GridData();
    layoutData.widthHint = 100;
    layoutData.minimumWidth = 100;
    languageCombo.getCombo().setLayoutData(layoutData);
    // default for java
    languageCombo.select(0);
    // user
    createUserInfors(projectGroup);
}
Also used : LabelledText(org.talend.commons.ui.swt.formtools.LabelledText) LabelledCombo(org.talend.commons.ui.swt.formtools.LabelledCombo) Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData)

Example 8 with LabelledText

use of org.talend.commons.ui.swt.formtools.LabelledText in project tdi-studio-se by Talend.

the class MultiSchemasUI method addGroupMultiSchemaSettings.

private void addGroupMultiSchemaSettings(final Composite mainComposite) {
    //$NON-NLS-1$
    Group group = Form.createGroup(mainComposite, 1, Messages.getString("FileStep2.groupDelimitedFileSettings"), 280);
    Composite composite = new Composite(group, SWT.NONE);
    GridLayout gridLayout = new GridLayout(4, false);
    gridLayout.marginHeight = 1;
    composite.setLayout(gridLayout);
    GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    composite.setLayoutData(gd);
    EMetadataEncoding[] values = EMetadataEncoding.values();
    String[] encodingData = new String[values.length];
    for (int j = 0; j < values.length; j++) {
        encodingData[j] = values[j].getName();
    }
    encodingCombo = new LabelledCombo(composite, Messages.getString("FileStep2.encoding"), //$NON-NLS-1$
    Messages.getString("FileStep2.encodingTip"), encodingData, 3, true, //$NON-NLS-1$
    SWT.NONE);
    // Field Separator Combo & Text
    String[] fieldSeparatorData = getFieldSeparatorStyleSupportByLanguage();
    fieldSeparatorCombo = new LabelledCombo(composite, Messages.getString("FileStep2.fieldSeparator"), //$NON-NLS-1$
    Messages.getString("FileStep2.fieldSeparatorDelimitedTip"), fieldSeparatorData, 1, true, //$NON-NLS-1$
    SWT.READ_ONLY);
    //$NON-NLS-1$
    fieldSeparatorText = new LabelledText(composite, "", 1, true, SWT.RIGHT);
    // Dimension of columb of Separator Text
    GridData gridData = new GridData(SWT.FILL, SWT.BOTTOM, true, false);
    gridData.minimumWidth = 80;
    fieldSeparatorText.setLayoutData(gridData);
    // Row Separator Combo & Text
    String[] rowSeparatorData = { RowSeparator.STANDART_EOL_LITERAL.getLiteral(), RowSeparator.CUSTOM_STRING_LITERAL.getLiteral() };
    rowSeparatorCombo = new LabelledCombo(composite, Messages.getString("FileStep2.rowSeparator"), //$NON-NLS-1$
    Messages.getString("FileStep2.rowSeparatorTip"), rowSeparatorData, 1, true, //$NON-NLS-1$
    SWT.READ_ONLY);
    //$NON-NLS-1$
    rowSeparatorText = new LabelledText(composite, "", 1, true, SWT.RIGHT);
    useMultiSaparators = new Button(group, SWT.CHECK);
    Composite multiComp = new Composite(group, SWT.NONE);
    gridLayout = new GridLayout(2, false);
    gridLayout.marginHeight = 1;
    multiComp.setLayout(gridLayout);
    gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    multiComp.setLayoutData(gd);
    useMultiSaparators.setText(Messages.getString("MultiSchemasUI.useMultiSchemabtn"));
    //$NON-NLS-1$
    multiSeparatorsText = new LabelledText(multiComp, "Multiple Separators", 1, true);
    multiSeparatorsText.setEditable(false);
    //$NON-NLS-1$
    keyValuesText = new LabelledText(multiComp, Messages.getString("MultiSchemasUI.keyValues"), 1, true);
    keyValuesText.setEditable(false);
    //$NON-NLS-1$
    keyIndexText = new LabelledText(multiComp, Messages.getString("MultiSchemasUI.keyIndex"), 1, true);
    keyIndexText.setEditable(false);
}
Also used : LabelledCombo(org.talend.commons.ui.swt.formtools.LabelledCombo) LabelledText(org.talend.commons.ui.swt.formtools.LabelledText) Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) CommandStackForComposite(org.talend.commons.ui.command.CommandStackForComposite) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) EMetadataEncoding(org.talend.core.model.metadata.EMetadataEncoding) Point(org.eclipse.swt.graphics.Point)

Example 9 with LabelledText

use of org.talend.commons.ui.swt.formtools.LabelledText in project tdi-studio-se by Talend.

the class PropertySetDialog method createDialogArea.

/**
     * Create contents of the dialog
     * 
     * @param parent
     */
@Override
protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);
    final GridLayout gridLayout = new GridLayout();
    gridLayout.marginLeft = 10;
    gridLayout.marginTop = 10;
    gridLayout.marginHeight = 10;
    container.setLayout(gridLayout);
    dieOnErrorButton = new Button(container, SWT.CHECK);
    //$NON-NLS-1$
    dieOnErrorButton.setText("Die on error");
    lookupInParallelButton = new Button(container, SWT.CHECK);
    //$NON-NLS-1$
    lookupInParallelButton.setText("Lookup in parallel");
    lookupInParallelButton.setEnabled(true);
    IComponent tempNode = ComponentsFactoryProvider.getInstance().get("tParallelize", //$NON-NLS-1$
    ComponentCategory.CATEGORY_4_DI.getName());
    if (tempNode == null) {
        lookupInParallelButton.setVisible(false);
    }
    enableAutoConvertTypeBtn = new Button(container, SWT.CHECK);
    //$NON-NLS-1$
    enableAutoConvertTypeBtn.setText(Messages.getString("PropertySetDialog.Button.enable"));
    final Group storeOnDiskGroup = new Group(container, SWT.NONE);
    storeOnDiskGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    storeOnDiskGroup.setText("Store on disk");
    storeOnDiskGroup.setLayout(new GridLayout(3, false));
    directoryField = new LabelledDirectoryField(storeOnDiskGroup, "Temp data directory path:");
    sizeField = new LabelledText(storeOnDiskGroup, "Max buffer size(nb of rows):");
    Label label = new Label(storeOnDiskGroup, SWT.NONE);
    label.setText("*");
    label.setToolTipText("Required filed.");
    init();
    addListener();
    updateStatus();
    //
    return container;
}
Also used : LabelledText(org.talend.commons.ui.swt.formtools.LabelledText) Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) LabelledDirectoryField(org.talend.commons.ui.swt.formtools.LabelledDirectoryField) IComponent(org.talend.core.model.components.IComponent) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label)

Example 10 with LabelledText

use of org.talend.commons.ui.swt.formtools.LabelledText in project tdi-studio-se by Talend.

the class HeaderComposite method createComponents.

private void createComponents() {
    this.setLayout(new GridLayout(3, false));
    GridData headerCompositeGridData = new GridData(GridData.FILL_HORIZONTAL);
    this.setLayoutData(headerCompositeGridData);
    //$NON-NLS-N$
    String[] extensions = new String[] { "*.*" };
    fileField = new LabelledFileField(this, "File path:", extensions, 1, SWT.BORDER) {

        protected void setFileFieldValue(String result) {
            if (result != null) {
                getTextControl().setText(TalendTextUtils.addQuotes(PathUtils.getPortablePath(result)));
            }
        }
    };
    fileField.setText(filePath);
    fileField.setEditable(!isRepository);
    final Group group = Form.createGroup(this, 4, "File Setting", 30);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 3;
    group.setLayoutData(gridData);
    startChar = new LabelledText(group, "Start character");
    startChar.setText(startCharValue);
    startChar.setEditable(!isRepository);
    endChar = new LabelledText(group, "End character");
    endChar.setText(endCharValue);
    endChar.setEditable(!isRepository);
    addListeners();
}
Also used : LabelledText(org.talend.commons.ui.swt.formtools.LabelledText) Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) LabelledFileField(org.talend.commons.ui.swt.formtools.LabelledFileField)

Aggregations

LabelledText (org.talend.commons.ui.swt.formtools.LabelledText)15 Composite (org.eclipse.swt.widgets.Composite)11 GridData (org.eclipse.swt.layout.GridData)10 GridLayout (org.eclipse.swt.layout.GridLayout)10 Group (org.eclipse.swt.widgets.Group)10 Button (org.eclipse.swt.widgets.Button)7 LabelledCombo (org.talend.commons.ui.swt.formtools.LabelledCombo)5 FillLayout (org.eclipse.swt.layout.FillLayout)3 Label (org.eclipse.swt.widgets.Label)3 Text (org.eclipse.swt.widgets.Text)3 MetadataEmfTableEditor (org.talend.core.ui.metadata.editor.MetadataEmfTableEditor)3 MetadataEmfTableEditorView (org.talend.core.ui.metadata.editor.MetadataEmfTableEditorView)3 ArrayList (java.util.ArrayList)2 ModifyEvent (org.eclipse.swt.events.ModifyEvent)2 ModifyListener (org.eclipse.swt.events.ModifyListener)2 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 CommandStackForComposite (org.talend.commons.ui.command.CommandStackForComposite)2 LabelledFileField (org.talend.commons.ui.swt.formtools.LabelledFileField)2 UtilsButton (org.talend.commons.ui.swt.formtools.UtilsButton)2