Search in sources :

Example 1 with LabelledText

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

the class MultiSchemasUI method createCardComposite.

private void createCardComposite(Composite parent) {
    Composite cardComposite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(2, false);
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    cardComposite.setLayout(layout);
    GridData layoutData = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
    cardComposite.setLayoutData(layoutData);
    final ToolBar menuBar = new ToolBar(cardComposite, SWT.FLAT | SWT.NO_BACKGROUND);
    GridDataFactory.swtDefaults().align(SWT.LEFT, SWT.TOP).span(2, 1).applyTo(menuBar);
    createMenuBar(menuBar);
    cardText = new LabelledText(cardComposite, "Cardinality");
    layoutData = new GridData();
    layoutData.minimumWidth = 90;
    layoutData.widthHint = 90;
    cardText.getTextControl().setLayoutData(layoutData);
    cardText.setEnabled(false);
}
Also used : LabelledText(org.talend.commons.ui.swt.formtools.LabelledText) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) CommandStackForComposite(org.talend.commons.ui.command.CommandStackForComposite) GridData(org.eclipse.swt.layout.GridData) ToolBar(org.eclipse.swt.widgets.ToolBar)

Example 2 with LabelledText

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

the class GenericUIBuilder method createWidgetUIByPropertyType.

private void createWidgetUIByPropertyType(Composite parent, Widget widget) {
    NamedThing property = getProperty(widget);
    if (property == null) {
        return;
    }
    int hSpan = widget.getOrder();
    if (property instanceof PresentationItem) {
        PresentationItem item = (PresentationItem) property;
        createLabel(parent, item.getDisplayName(), hSpan);
        return;
    } else if (property instanceof Property) {
        Property element = (Property) property;
        String displayName = element.getDisplayName();
        String type = element.getType();
        if (type == null) {
            createLabel(parent, displayName, hSpan);
            return;
        }
        if (GenericTypeUtils.isStringType(type)) {
            new LabelledText(parent, displayName, hSpan);
        } else if (GenericTypeUtils.isBooleanType(type)) {
        // nothing
        } else {
            new LabelledText(parent, element.getDisplayName(), hSpan);
        }
    }
}
Also used : LabelledText(org.talend.commons.ui.swt.formtools.LabelledText) PresentationItem(org.talend.daikon.properties.PresentationItem) NamedThing(org.talend.daikon.NamedThing) Property(org.talend.daikon.properties.property.Property)

Example 3 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 4 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 5 with LabelledText

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

the class NameSpaceDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    super.createDialogArea(parent);
    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(6, true));
    //$NON-NLS-1$
    nsValueLabel = new LabelledText(composite, "Namespace", 5);
    nsValueLabel.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            nsValue = nsValueLabel.getText();
            validateField();
        }
    });
    prefixBtn = new Button(composite, SWT.CHECK | SWT.RIGHT);
    prefixBtn.setText("Prefix");
    prefixBtn.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            if (prefixText != null) {
                if (prefixBtn.getSelection()) {
                    prefixText.setVisible(true);
                } else {
                    prefixText.setVisible(false);
                    prefixText.setText("");
                }
                validateField();
            }
        }
    });
    //$NON-NLS-1$
    prefixText = new Text(composite, SWT.BORDER);
    GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
    gridData.horizontalSpan = 5;
    prefixText.setLayoutData(gridData);
    prefixText.setVisible(false);
    prefixText.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            prefixValue = prefixText.getText();
            validateField();
        }
    });
    if (currentNode != null) {
        nsValueLabel.setText(currentNode.getDefaultValue());
        String prefix = currentNode.getName();
        if (prefix != null && !"".equals(prefix) && !XmlMapUtil.DEFAULT_NAME_SPACE_PREFIX.equals(prefix)) {
            prefixBtn.setSelection(true);
            prefixText.setVisible(true);
            prefixText.setText(prefix);
        }
    }
    nsValue = nsValueLabel.getText();
    if (prefixText.isVisible()) {
        prefixValue = prefixText.getText();
    }
    return parent;
}
Also used : LabelledText(org.talend.commons.ui.swt.formtools.LabelledText) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) Text(org.eclipse.swt.widgets.Text) LabelledText(org.talend.commons.ui.swt.formtools.LabelledText)

Aggregations

LabelledText (org.talend.commons.ui.swt.formtools.LabelledText)46 GridData (org.eclipse.swt.layout.GridData)40 Composite (org.eclipse.swt.widgets.Composite)31 GridLayout (org.eclipse.swt.layout.GridLayout)28 Group (org.eclipse.swt.widgets.Group)26 Button (org.eclipse.swt.widgets.Button)21 LabelledCombo (org.talend.commons.ui.swt.formtools.LabelledCombo)11 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)9 UtilsButton (org.talend.commons.ui.swt.formtools.UtilsButton)7 Label (org.eclipse.swt.widgets.Label)6 FillLayout (org.eclipse.swt.layout.FillLayout)5 LabelledFileField (org.talend.commons.ui.swt.formtools.LabelledFileField)5 MetadataEmfTableEditor (org.talend.core.ui.metadata.editor.MetadataEmfTableEditor)5 Text (org.eclipse.swt.widgets.Text)4 MetadataEmfTableEditorView (org.talend.core.ui.metadata.editor.MetadataEmfTableEditorView)4 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)3 SelectionEvent (org.eclipse.swt.events.SelectionEvent)3 Point (org.eclipse.swt.graphics.Point)3 NoSQLRepositoryFactory (org.talend.repository.nosql.factory.NoSQLRepositoryFactory)3 ArrayList (java.util.ArrayList)2