Search in sources :

Example 11 with LabelledCombo

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

the class ConnectionFormComposite method addListeners.

private void addListeners() {
    repositoryCombo.addPostSelectionChangedListener(repositoryListener);
    nameText.addModifyListener(standardTextListener);
    descriptionText.addModifyListener(standardTextListener);
    userText.addModifyListener(standardTextListener);
    passwordText.addModifyListener(standardTextListener);
    workSpaceText.addModifyListener(standardTextListener);
    for (IRepositoryFactory f : dynamicControls.keySet()) {
        for (LabelText control : dynamicControls.get(f).values()) {
            control.addModifyListener(standardTextListener);
        }
    }
    for (IRepositoryFactory f : dynamicChoices.keySet()) {
        for (LabelledCombo control : dynamicChoices.get(f).values()) {
            control.getCombo().addModifyListener(standardTextListener);
        }
    }
    deleteProjectsButton.addSelectionListener(deleteProjectClickListener);
}
Also used : LabelledCombo(org.talend.commons.ui.swt.formtools.LabelledCombo) IRepositoryFactory(org.talend.core.repository.model.IRepositoryFactory) LabelText(org.talend.commons.ui.swt.formtools.LabelText)

Example 12 with LabelledCombo

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

the class ConnectionFormComposite method showHideDynamicsControls.

private void showHideDynamicsControls() {
    // 1. Hide all controls:
    for (IRepositoryFactory f : dynamicControls.keySet()) {
        for (LabelText control : dynamicControls.get(f).values()) {
            // control.setVisible(false);
            hideControl(control.getLabelControl(), true, false);
            hideControl(control.getTextControl(), true, false);
        }
        for (Button control : dynamicButtons.get(f).values()) {
            // control.setVisible(false);
            hideControl(control, true, false);
        }
        for (LabelledCombo control : dynamicChoices.get(f).values()) {
            // control.setVisible(false);
            hideControl(control.getCombo(), true, false);
        }
    }
    // 2. Show active repository controls:
    if (getRepository() != null) {
        for (LabelText control : dynamicControls.get(getRepository()).values()) {
            // control.setVisible(true);
            hideControl(control.getLabelControl(), false, false);
            hideControl(control.getTextControl(), false, false);
        }
        for (Button control : dynamicButtons.get(getRepository()).values()) {
            // control.setVisible(true);
            hideControl(control, false, false);
        }
        for (LabelledCombo control : dynamicChoices.get(getRepository()).values()) {
            // control.setVisible(true);
            hideControl(control.getCombo(), false, false);
        }
    }
    nameText.getParent().layout();
}
Also used : LabelledCombo(org.talend.commons.ui.swt.formtools.LabelledCombo) IRepositoryFactory(org.talend.core.repository.model.IRepositoryFactory) Button(org.eclipse.swt.widgets.Button) LabelText(org.talend.commons.ui.swt.formtools.LabelText)

Example 13 with LabelledCombo

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

the class ConnectionFormComposite method removeListeners.

private void removeListeners() {
    repositoryCombo.removePostSelectionChangedListener(repositoryListener);
    nameText.removeModifyListener(standardTextListener);
    descriptionText.removeModifyListener(standardTextListener);
    userText.removeModifyListener(standardTextListener);
    passwordText.removeModifyListener(standardTextListener);
    workSpaceText.removeModifyListener(standardTextListener);
    for (IRepositoryFactory f : dynamicControls.keySet()) {
        for (LabelText control : dynamicControls.get(f).values()) {
            control.removeModifyListener(standardTextListener);
        }
    }
    for (IRepositoryFactory f : dynamicChoices.keySet()) {
        for (LabelledCombo control : dynamicChoices.get(f).values()) {
            control.getCombo().removeModifyListener(standardTextListener);
        }
    }
    deleteProjectsButton.removeSelectionListener(deleteProjectClickListener);
}
Also used : LabelledCombo(org.talend.commons.ui.swt.formtools.LabelledCombo) IRepositoryFactory(org.talend.core.repository.model.IRepositoryFactory) LabelText(org.talend.commons.ui.swt.formtools.LabelText)

Example 14 with LabelledCombo

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

the class PublishOnSpagoExportWizardPage 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<SpagoBiServer> listServerSapgo = null;
    List<String> listEngine = new ArrayList<String>();
    // TODO SML remove unused lines if this fabulous code works fine
    // ProxyRepositoryFactory proxyRepositoryFactory = ProxyRepositoryFactory.getInstance();
    // try {
    // listServerSapgo = proxyRepositoryFactory.getSpagoBiServer();
    listServerSapgo = SpagoBiServerHelper.parse(new SpagoBiPreferencePage().getPreferenceStore().getString(SpagoBiServer.SPAGOBI_SERVER));
    if (listServerSapgo != null && !listServerSapgo.isEmpty()) {
        Iterator<SpagoBiServer> iterator = listServerSapgo.iterator();
        while (iterator.hasNext()) {
            SpagoBiServer spagoBiServer = iterator.next();
            listEngine.add(spagoBiServer.getEngineName());
        }
    }
    // } catch (PersistenceException e) {
    // displayErrorDialog(e.getMessage());
    // }
    serverSpagoBi = new LabelledCombo(optionsGroup, Messages.getString("PublishOnSpagoExportWizardPage.SpagoBI.Server"), Messages.getString("PublishOnSpagoExportWizardPage.SpecifyServer.PublishJob"), //$NON-NLS-1$ //$NON-NLS-2$
    listEngine);
    serverSpagoBi.select(0);
    //$NON-NLS-1$
    jobLabel = new LabelledText(optionsGroup, Messages.getString("PublishOnSpagoExportWizardPage.jobLabel"), true);
    jobLabel.setText(jobLabelName);
    //$NON-NLS-1$
    jobName = new LabelledText(optionsGroup, Messages.getString("PublishOnSpagoExportWizardPage.jobName"), true);
    jobName.setText(jobLabelName);
    //$NON-NLS-1$
    jobDescription = new LabelledText(optionsGroup, Messages.getString("PublishOnSpagoExportWizardPage.jobDescription"), true);
    jobDescription.setText(jobPurposeDescription);
    contextButton = new Button(optionsGroup, SWT.CHECK | SWT.LEFT);
    //$NON-NLS-1$
    contextButton.setText(Messages.getString("JobScriptsExportWizardPage.contextPerlScripts"));
    contextButton.setSelection(true);
    contextButton.setFont(font);
    contextCombo = new Combo(optionsGroup, SWT.PUSH);
// spagoVisible = new Button(optionsGroup, SWT.CHECK | SWT.LEFT);
// spagoVisible.setText(Messages.getString("PublishOnSpagoExportWizardPage.spagoVisible")); //$NON-NLS-1$
// spagoVisible.setSelection(true);
// spagoVisible.setFont(font);
}
Also used : SpagoBiServer(org.talend.core.model.properties.SpagoBiServer) LabelledCombo(org.talend.commons.ui.swt.formtools.LabelledCombo) LabelledText(org.talend.commons.ui.swt.formtools.LabelledText) Button(org.eclipse.swt.widgets.Button) ArrayList(java.util.ArrayList) Combo(org.eclipse.swt.widgets.Combo) LabelledCombo(org.talend.commons.ui.swt.formtools.LabelledCombo) SpagoBiPreferencePage(org.talend.sbi.engines.client.ui.preferences.SpagoBiPreferencePage)

Example 15 with LabelledCombo

use of org.talend.commons.ui.swt.formtools.LabelledCombo 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)

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