Search in sources :

Example 16 with LabelledCombo

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

the class DeployOnMDMExportWizardPage method createOptions.

/**
 * Create the buttons for the group that determine if the entire or selected directory structure should be created.
 *
 * @param optionsGroup
 * @param font
 */
protected void createOptions(Composite optionsGroup, Font font) {
    // create directory structure radios
    List<MDMServerDef> listServerSapgo = com.amalto.workbench.utils.MDMServerHelper.getServers();
    List<String> listEngine = new ArrayList<String>();
    if (mdmServer == null) {
        for (MDMServerDef serv : listServerSapgo) {
            listEngine.add(serv.getName());
        }
        serverSpagoBi = new LabelledCombo(optionsGroup, Messages.DeployOnMDMExportWizardPage_SpagoBI_Server, Messages.DeployOnMDMExportWizardPage_SpecifyServer_PublishJob, listEngine);
        serverSpagoBi.addModifyListener(new ModifyListener() {

            public void modifyText(ModifyEvent e) {
                updateSelectedServer();
            }
        });
        serverSpagoBi.select(0);
    }
    Composite typeComp = new Composite(optionsGroup, SWT.NONE);
    typeComp.setLayout(new FillLayout(SWT.HORIZONTAL));
    typeComp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    Label typeLabel = new Label(typeComp, SWT.NONE);
    typeLabel.setText(Messages.DeployOnMDMExportWizardPage_ExportType);
    Label contentLabel = new Label(typeComp, SWT.NONE);
    contentLabel.setText(Messages.DeployOnMDMExportWizardPage_hostedZip);
    contextButton = new Button(optionsGroup, SWT.CHECK | SWT.LEFT);
    contextButton.setText(Messages.JobScriptsExportWizardPage_contextPerlScripts);
    contextButton.setSelection(true);
    contextButton.setFont(font);
    contextCombo = new Combo(optionsGroup, SWT.PUSH);
}
Also used : LabelledCombo(org.talend.commons.ui.swt.formtools.LabelledCombo) ModifyListener(org.eclipse.swt.events.ModifyListener) Composite(org.eclipse.swt.widgets.Composite) ArrayList(java.util.ArrayList) Label(org.eclipse.swt.widgets.Label) Combo(org.eclipse.swt.widgets.Combo) LabelledCombo(org.talend.commons.ui.swt.formtools.LabelledCombo) FillLayout(org.eclipse.swt.layout.FillLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) MDMServerDef(com.amalto.workbench.utils.MDMServerDef)

Example 17 with LabelledCombo

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

the class SetJDBCDriverPreferencePage method createContents.

@Override
protected Control createContents(Composite parent) {
    mainComposite = new Composite(parent, SWT.NONE);
    mainComposite.setLayout(new GridLayout(3, false));
    mainComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout2 = (GridLayout) mainComposite.getLayout();
    layout2.marginHeight = 0;
    layout2.marginTop = 0;
    layout2.marginBottom = 0;
    GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.horizontalSpan = 3;
    header = new Label(mainComposite, SWT.WRAP);
    header.setLayoutData(gridData);
    // $NON-NLS-1$
    header.setText(DefaultMessagesImpl.getString("SetJDBCDriverPreferencePage.heard"));
    dbTypeLabel = new Label(mainComposite, SWT.WRAP);
    // $NON-NLS-1$
    dbTypeLabel.setText(DefaultMessagesImpl.getString("SetJDBCDriverPreferencePage.dbType") + dbType_jdbc);
    dbTypeLabel.setLayoutData(gridData);
    generalJdbcUrlText = new LabelledText(mainComposite, DefaultMessagesImpl.getString("SetJDBCDriverPreferencePage.general.url"), // $NON-NLS-1$
    2);
    String url = getPreferenceStore().getString(URL_KEY);
    generalJdbcUrlText.setText(url != null ? url : PluginConstant.EMPTY_STRING);
    generalJdbcDriverjarText = new LabelledText(mainComposite, // $NON-NLS-1$
    DefaultMessagesImpl.getString("SetJDBCDriverPreferencePage.general.jarfile"), 1);
    String driver = getPreferenceStore().getString(DRIVER_KEY);
    generalJdbcDriverjarText.setText(driver != null ? driver : PluginConstant.EMPTY_STRING);
    browseJarFilesButton = new Button(mainComposite, SWT.NONE);
    // $NON-NLS-1$
    browseJarFilesButton.setText("...");
    generalJdbcClassNameText = new LabelledCombo(mainComposite, DefaultMessagesImpl.getString("SetJDBCDriverPreferencePage.general.classname"), "", null, 1, true, // $NON-NLS-1$
    SWT.NONE);
    String className = getPreferenceStore().getString(CLASSNAME_KEY);
    generalJdbcClassNameText.setText(className != null ? className : PluginConstant.EMPTY_STRING);
    browseClassButton = new Button(mainComposite, SWT.NONE);
    // $NON-NLS-1$
    browseClassButton.setText("...");
    generalJdbcUserText = new LabelledText(mainComposite, DefaultMessagesImpl.getString("SetJDBCDriverPreferencePage.general.user"), // $NON-NLS-1$
    2);
    String userName = getPreferenceStore().getString(USERNAME_KEY);
    generalJdbcUserText.setText(userName != null ? userName : PluginConstant.EMPTY_STRING);
    generalJdbcPasswordText = new LabelledText(mainComposite, DefaultMessagesImpl.getString("SetJDBCDriverPreferencePage.general.password"), // $NON-NLS-1$
    2);
    // see
    generalJdbcPasswordText.getTextControl().setEchoChar('*');
    String password = getPreferenceStore().getString(PASSWORD_KEY);
    generalJdbcPasswordText.setText(password != null ? password : PluginConstant.EMPTY_STRING);
    generalMappingFileText = new LabelledText(mainComposite, DefaultMessagesImpl.getString("SetJDBCDriverPreferencePage.general.mapping"), // $NON-NLS-1$
    1);
    String mapFile = getPreferenceStore().getString(MAPFILE_KEY);
    generalMappingFileText.setText(mapFile != null ? mapFile : PluginConstant.EMPTY_STRING);
    generalMappingSelectButton = new Button(mainComposite, SWT.NONE);
    // $NON-NLS-1$
    generalMappingSelectButton.setText("...");
    applyButton = new Button(mainComposite, SWT.CENTER | SWT.BOTTOM);
    // $NON-NLS-1$
    applyButton.setText(DefaultMessagesImpl.getString("SetJDBCDriverPreferencePage.selectConnectionButton"));
    GridData gd = new GridData();
    gd.horizontalAlignment = GridData.CENTER;
    gd.horizontalSpan = 3;
    applyButton.setLayoutData(gd);
    applyButton.addSelectionListener(new SelectionListener() {

        public void widgetSelected(SelectionEvent e) {
            CheckedTreeSelectionDialog dialog = createConnSelectDialog();
            dialog.create();
            if (dialog.open() == Window.OK) {
                Object[] selects = dialog.getResult();
                if (selects != null && selects.length > 0) {
                    boolean isConfirm = MessageDialog.openConfirm(dialog.getShell(), // $NON-NLS-1$
                    DefaultMessagesImpl.getString("SetJDBCDriverPreferencePage.confirmTitle"), // $NON-NLS-1$
                    DefaultMessagesImpl.getString("SetJDBCDriverPreferencePage.confirmContent"));
                    if (!isConfirm) {
                        return;
                    }
                    saveDatabases(selects);
                }
            }
        }

        public void widgetDefaultSelected(SelectionEvent e) {
        }
    });
    browseJarFilesButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            SelectDatabaseJarDialog dialog = new SelectDatabaseJarDialog(getShell(), generalJdbcDriverjarText.getText());
            if (dialog.open() == Window.OK) {
                generalJdbcDriverjarText.setText(dialog.getJarsString());
            }
        }
    });
    browseClassButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            generalJdbcClassNameText.removeAll();
            for (String stringToFile : generalJdbcDriverjarText.getText().trim().split(";")) {
                // $NON-NLS-1$
                File file = new File(stringToFile);
                if (file != null) {
                    try {
                        MyURLClassLoader cl = new MyURLClassLoader(file.toURL());
                        Class[] classes = cl.getAssignableClasses(Driver.class);
                        for (Class classe : classes) {
                            generalJdbcClassNameText.add(classe.getName());
                        }
                    } catch (Exception ex) {
                        ExceptionHandler.process(ex);
                    }
                }
            }
            if (generalJdbcClassNameText.getItemCount() > 0) {
                String driverClassName = generalJdbcClassNameText.getItem(0);
                generalJdbcClassNameText.setText(driverClassName);
            }
        }
    });
    generalMappingSelectButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            MappingFileSelectDialog dialog = new MappingFileSelectDialog(getShell());
            dialog.open();
            generalMappingFileText.setText(dialog.getSelectId());
        }
    });
    return mainComposite;
}
Also used : LabelledText(org.talend.commons.ui.swt.formtools.LabelledText) LabelledCombo(org.talend.commons.ui.swt.formtools.LabelledCombo) Composite(org.eclipse.swt.widgets.Composite) CheckedTreeSelectionDialog(org.eclipse.ui.dialogs.CheckedTreeSelectionDialog) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) MyURLClassLoader(org.talend.commons.ui.utils.loader.MyURLClassLoader) Driver(java.sql.Driver) PersistenceException(org.talend.commons.exception.PersistenceException) SelectDatabaseJarDialog(org.talend.repository.ui.wizards.metadata.connection.database.SelectDatabaseJarDialog) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) MappingFileSelectDialog(org.talend.metadata.managment.ui.dialog.MappingFileSelectDialog) File(java.io.File) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 18 with LabelledCombo

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

the class SynapseInfoForm method addFSFields.

private void addFSFields() {
    // $NON-NLS-1$
    Group azureGroup = Form.createGroup(this, 1, Messages.getString("SynapseInfoForm.azureSettings"), 110);
    azureGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    storagePartComposite = new Composite(azureGroup, SWT.NULL);
    GridLayout storagePartLayout = new GridLayout(4, false);
    storagePartLayout.marginWidth = 0;
    storagePartLayout.marginHeight = 0;
    storagePartComposite.setLayout(storagePartLayout);
    storagePartComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    storageCombo = new LabelledCombo(storagePartComposite, Messages.getString("SynapseInfoForm.text.azure.storage"), Messages.getString("SynapseInfoForm.text.azure.storage.tip"), ESynapseStorage.getAllSynapseStorageDisplayNames().toArray(new String[0]), 1, true);
    Composite azurePartComposite = new Composite(azureGroup, SWT.NULL);
    GridLayout azurePartLayout = new GridLayout(4, false);
    azurePartLayout.marginWidth = 0;
    azurePartLayout.marginHeight = 0;
    azurePartComposite.setLayout(azurePartLayout);
    azurePartComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    // $NON-NLS-1$
    azureHostnameText = new LabelledText(azurePartComposite, Messages.getString("SynapseInfoForm.text.azure.hostname"), 1);
    // $NON-NLS-1$
    azureUsernameText = new LabelledText(azurePartComposite, Messages.getString("SynapseInfoForm.text.azure.username"), 1);
    // $NON-NLS-1$
    azureContainerText = new LabelledText(azurePartComposite, Messages.getString("SynapseInfoForm.text.azure.container"), 1);
    azurePasswordText = new LabelledText(azurePartComposite, Messages.getString("SynapseInfoForm.text.azure.password"), 1, // $NON-NLS-1$
    SWT.PASSWORD | SWT.BORDER | SWT.SINGLE);
    azurePasswordText.getTextControl().setEchoChar('*');
    azureDeployBlobText = new LabelledText(azurePartComposite, Messages.getString("SynapseInfoForm.text.azure.deployBlob"), 1);
}
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) GridData(org.eclipse.swt.layout.GridData)

Example 19 with LabelledCombo

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

the class AbstractHadoopSubForm method addSeparatorFields.

protected void addSeparatorFields() {
    // $NON-NLS-1$
    Group separatorGroup = Form.createGroup(this, 1, Messages.getString("AbstractHadoopSubForm.separatorSettings"));
    separatorGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    ScrolledComposite separatorComposite = new ScrolledComposite(separatorGroup, SWT.V_SCROLL | SWT.H_SCROLL);
    separatorComposite.setExpandHorizontal(true);
    separatorComposite.setExpandVertical(true);
    separatorComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    Composite separatorGroupComposite = Form.startNewGridLayout(separatorComposite, 6);
    GridLayout separatorGroupCompLayout = (GridLayout) separatorGroupComposite.getLayout();
    separatorGroupCompLayout.marginHeight = 0;
    separatorGroupCompLayout.marginTop = 0;
    separatorGroupCompLayout.marginBottom = 0;
    separatorGroupCompLayout.marginLeft = 0;
    separatorGroupCompLayout.marginRight = 0;
    separatorGroupCompLayout.marginWidth = 0;
    separatorComposite.setContent(separatorGroupComposite);
    rowSeparatorCombo = new // $NON-NLS-1$
    LabelledCombo(// $NON-NLS-1$
    separatorGroupComposite, // $NON-NLS-1$
    Messages.getString("AbstractHadoopSubForm.rowSeparator"), Messages.getString("AbstractHadoopSubForm.rowSeparator.tooltip"), // $NON-NLS-1$
    EHDFSRowSeparator.getAllRowSeparators(true).toArray(new String[0]), 1, true);
    rowSeparatorCombo.setVisibleItemCount(VISIBLE_COMBO_ITEM_COUNT);
    rowSeparatorText = new Text(separatorGroupComposite, SWT.BORDER);
    rowSeparatorText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fieldSeparatorCombo = new LabelledCombo(separatorGroupComposite, // $NON-NLS-1$
    Messages.getString("AbstractHadoopSubForm.fieldSeparator"), Messages.getString("AbstractHadoopSubForm.fieldSeparator.tooltip"), EHDFSFieldSeparator.getAllFieldSeparators(true).toArray(new String[0]), 1, // $NON-NLS-1$
    true);
    fieldSeparatorCombo.setVisibleItemCount(VISIBLE_COMBO_ITEM_COUNT);
    fieldSeparatorText = new Text(separatorGroupComposite, SWT.BORDER);
    fieldSeparatorText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
Also used : 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) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) GridData(org.eclipse.swt.layout.GridData) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) Text(org.eclipse.swt.widgets.Text)

Example 20 with LabelledCombo

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

the class MongoDBConnForm method addAuthGroup.

private void addAuthGroup(Composite composite) {
    // $NON-NLS-1$
    authGroup = Form.createGroup(composite, 4, Messages.getString("MongoDBConnForm.authentication"));
    authGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    GridLayout gpGrid = new GridLayout(4, false);
    gpGrid.marginWidth = 5;
    gpGrid.marginHeight = 5;
    authGroup.setLayout(gpGrid);
    checkRequireAuthBtn = new Button(authGroup, SWT.CHECK);
    // $NON-NLS-1$
    checkRequireAuthBtn.setText(Messages.getString("MongoDBConnForm.requireAuth"));
    checkRequireAuthBtn.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false, 4, 1));
    authComposite = new Composite(authGroup, SWT.NONE);
    authComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 4, 1));
    GridLayout authCompLayout = new GridLayout(4, false);
    authCompLayout.marginWidth = 0;
    authCompLayout.marginHeight = 0;
    authComposite.setLayout(authCompLayout);
    authMechanismCombo = new LabelledCombo(authComposite, Messages.getString("MongoDBConnForm.authMechanism"), Messages.getString("MongoDBConnForm.authMechanism"), getAuthMechanismLables(repositoryTranslator.getValue(dbVersionCombo.getText())), 3, false);
    authMechanismCombo.select(0);
    checkSetAuthDatabaseBtn = new Button(authComposite, SWT.CHECK);
    // $NON-NLS-1$
    checkSetAuthDatabaseBtn.setText(Messages.getString("MongoDBConnForm.setAuthDatabase"));
    checkSetAuthDatabaseBtn.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false, 4, 1));
    authDatabaseText = new LabelledText(authComposite, Messages.getString("MongoDBConnForm.authDatabase"), 3);
    // $NON-NLS-1$
    userText = new LabelledText(authComposite, Messages.getString("MongoDBConnForm.username"), 1);
    pwdText = new LabelledText(authComposite, Messages.getString("MongoDBConnForm.password"), 1, // $NON-NLS-1$
    SWT.PASSWORD | SWT.BORDER | SWT.SINGLE);
    pwdText.getTextControl().setEchoChar('*');
    // $NON-NLS-1$
    authKrbUserPrincipalText = new LabelledText(authComposite, Messages.getString("MongoDBConnForm.KRB_USER_PRINCIPAL"), 3);
    // $NON-NLS-1$
    authKrbRealmText = new LabelledText(authComposite, Messages.getString("MongoDBConnForm.KRB_REALM"), 3);
    // $NON-NLS-1$
    authKrbKdcText = new LabelledText(authComposite, Messages.getString("MongoDBConnForm.KRB_KDC"), 3);
    certificateField = new LabelledFileField(authComposite, Messages.getString("MongoDBConnForm.KeyStoreCertificate"), new String[] { "*.jks", "*.pem" }, 2, true);
    certificateField.getButtonControl().setText("...");
    keyStorePassText = new LabelledText(authComposite, Messages.getString("MongoDBConnForm.KeyStoreCertificatePassword"), 1, SWT.BORDER | SWT.SINGLE | SWT.PASSWORD);
    keyStorePassText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
    checkUseCertAuthBtn = new Button(authComposite, SWT.CHECK);
    checkUseCertAuthBtn.setText(Messages.getString("MongoDBConnForm.UseCertificateAuthority"));
    checkUseCertAuthBtn.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false, 4, 1));
    authCertificateField = new LabelledFileField(authComposite, Messages.getString("MongoDBConnForm.TrustStoreCertificate"), new String[] { "*.jks", "*.pem" }, 2, true);
    authCertificateField.getButtonControl().setText("...");
    trustStorePassText = new LabelledText(authComposite, Messages.getString("MongoDBConnForm.TrustStoreCertificatePassword"), 1, SWT.BORDER | SWT.SINGLE | SWT.PASSWORD);
    trustStorePassText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
}
Also used : LabelledCombo(org.talend.commons.ui.swt.formtools.LabelledCombo) LabelledText(org.talend.commons.ui.swt.formtools.LabelledText) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) LabelledFileField(org.talend.commons.ui.swt.formtools.LabelledFileField)

Aggregations

LabelledCombo (org.talend.commons.ui.swt.formtools.LabelledCombo)23 GridData (org.eclipse.swt.layout.GridData)16 Button (org.eclipse.swt.widgets.Button)14 Composite (org.eclipse.swt.widgets.Composite)13 GridLayout (org.eclipse.swt.layout.GridLayout)12 LabelledText (org.talend.commons.ui.swt.formtools.LabelledText)11 Group (org.eclipse.swt.widgets.Group)9 Label (org.eclipse.swt.widgets.Label)5 Text (org.eclipse.swt.widgets.Text)5 LabelText (org.talend.commons.ui.swt.formtools.LabelText)5 IRepositoryFactory (org.talend.core.repository.model.IRepositoryFactory)4 ArrayList (java.util.ArrayList)3 Combo (org.eclipse.swt.widgets.Combo)3 LabelledFileField (org.talend.commons.ui.swt.formtools.LabelledFileField)3 EMetadataEncoding (org.talend.core.model.metadata.EMetadataEncoding)3 NoSQLRepositoryFactory (org.talend.repository.nosql.factory.NoSQLRepositoryFactory)3 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