Search in sources :

Example 1 with ColorFieldEditor

use of org.eclipse.jface.preference.ColorFieldEditor in project tdi-studio-se by Talend.

the class DesignerColorsPreferencePage method createConnectionFieldEditors.

private void createConnectionFieldEditors(Composite parent) {
    Group connGroup = new Group(parent, SWT.NULL);
    //$NON-NLS-1$
    connGroup.setText(Messages.getString("DesignerColorsPreferencePage.ConnectionColorGroup"));
    connGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    GridLayout layout = new GridLayout(2, true);
    layout.marginLeft = 10;
    connGroup.setLayout(layout);
    Label message = new Label(connGroup, SWT.NULL);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 2;
    data.minimumWidth = 400;
    data.heightHint = 20;
    message.setLayoutData(data);
    //$NON-NLS-1$
    message.setText(Messages.getString("DesignerColorsPreferencePage.ConnectionColorMessages"));
    Composite left = new Composite(connGroup, SWT.NULL);
    left.setLayoutData(new GridData(GridData.FILL_BOTH));
    Composite right = new Composite(connGroup, SWT.NULL);
    right.setLayoutData(new GridData(GridData.FILL_BOTH));
    EConnectionType[] values = EConnectionType.values();
    for (int i = 0; i < values.length; i++) {
        Composite comp = left;
        if (i % 2 > 0) {
            comp = right;
        }
        addField(new ColorFieldEditor(DesignerColorUtils.getPreferenceConnectionName(values[i]), values[i].getDefaultMenuName(), comp));
    }
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ColorFieldEditor(org.eclipse.jface.preference.ColorFieldEditor) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) EConnectionType(org.talend.core.model.process.EConnectionType)

Example 2 with ColorFieldEditor

use of org.eclipse.jface.preference.ColorFieldEditor in project tdi-studio-se by Talend.

the class DesignerColorsPreferencePage method createEditorFieldEditors.

private void createEditorFieldEditors(Composite parent) {
    Group jobBackgroundGroup = new Group(parent, SWT.NULL);
    //$NON-NLS-1$
    jobBackgroundGroup.setText(Messages.getString("DesignerPreferencePage.JobDesignerEditorBackgroundColorLabel"));
    jobBackgroundGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    addField(new ColorFieldEditor(DesignerColorUtils.JOBDESIGNER_EGITOR_BACKGROUND_COLOR_NAME, Messages.getString("DesignerPreferencePage.DesignerEditorBackgroundColor"), //$NON-NLS-1$
    jobBackgroundGroup));
    addField(new ColorFieldEditor(DesignerColorUtils.READONLY_BACKGROUND_COLOR_NAME, Messages.getString("DesignerPreferencePage.ReadonlyBackgroundColor"), //$NON-NLS-1$
    jobBackgroundGroup));
    GridLayout layout = new GridLayout(2, false);
    layout.marginLeft = 10;
    jobBackgroundGroup.setLayout(layout);
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) ColorFieldEditor(org.eclipse.jface.preference.ColorFieldEditor) GridData(org.eclipse.swt.layout.GridData)

Example 3 with ColorFieldEditor

use of org.eclipse.jface.preference.ColorFieldEditor in project cubrid-manager by CUBRID.

the class ChartCompositePart method createSeriesList.

/**
	 * Create the sub composite of Series selection combo and its related
	 * properties such as check and color
	 *
	 * @param composite the parent composite
	 */
private void createSeriesList(Composite composite) {
    Composite comp = new Composite(composite, SWT.NONE);
    GridLayout layout = new GridLayout(3, false);
    comp.setLayout(layout);
    comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    combo = new Combo(comp, SWT.DROP_DOWN);
    for (Map.Entry<String, String> entry : valueMap.entrySet()) {
        combo.add(entry.getKey());
    }
    combo.setLayout(new GridLayout());
    combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    combo.addSelectionListener(new SelectionAdapter() {

        /**
			 * Sent when selection occurs in the control.
			 *
			 * @param event an event containing information about the selection
			 */
        public void widgetSelected(SelectionEvent event) {
            widgetDefaultSelected(event);
        }

        /**
			 * Sent when default selection occurs in the control.
			 *
			 * @param event an event containing information about the default
			 *        selection
			 */
        public void widgetDefaultSelected(SelectionEvent event) {
            String selectedItem = combo.getItem(combo.getSelectionIndex());
            boolean checked = settingMap.get(selectedItem).isChecked();
            RGB rgb = settingMap.get(selectedItem).getSeriesRgb();
            checkBtn.setSelection(checked);
            colorField.getColorSelector().setColorValue(rgb);
        }
    });
    checkBtn = new Button(comp, SWT.CHECK);
    checkBtn.setText(Messages.seriesSelectCheckBtn);
    checkBtn.addSelectionListener(new SelectionAdapter() {

        /**
			 * Sent when selection occurs in the control.
			 *
			 * @param event an event containing information about the selection
			 */
        public void widgetSelected(SelectionEvent event) {
            widgetDefaultSelected(event);
        }

        /**
			 * Sent when default selection occurs in the control.
			 *
			 * @param event an event containing information about the default
			 *        selection
			 */
        public void widgetDefaultSelected(SelectionEvent event) {
            handleUpdateSettingChange();
        }
    });
    Composite selComp = new Composite(comp, SWT.NONE);
    colorField = new ColorFieldEditor(Messages.seriesSelectColorBtnName, Messages.seriesSelectColorBtnLbl, selComp);
    colorField.getColorSelector().addListener(new IPropertyChangeListener() {

        /**
			 * Notification that a property has changed.
			 *
			 * @param event the property change event object describing which
			 *        property changed and how
			 */
        public void propertyChange(PropertyChangeEvent event) {
            handleUpdateSettingChange();
        }
    });
}
Also used : IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent) Composite(org.eclipse.swt.widgets.Composite) ChartComposite(org.jfree.experimental.chart.swt.ChartComposite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Combo(org.eclipse.swt.widgets.Combo) RGB(org.eclipse.swt.graphics.RGB) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) ColorFieldEditor(org.eclipse.jface.preference.ColorFieldEditor) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Map(java.util.Map) TreeMap(java.util.TreeMap)

Example 4 with ColorFieldEditor

use of org.eclipse.jface.preference.ColorFieldEditor in project tdi-studio-se by Talend.

the class DesignerColorsPreferencePage method createJobletGroupFieldEditors.

private void createJobletGroupFieldEditors(Composite parent) {
    Group jobletGroup = new Group(parent, SWT.NULL);
    //$NON-NLS-1$
    jobletGroup.setText(Messages.getString("DesignerPreferencePage.JobletColorGroup"));
    jobletGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    addField(new ColorFieldEditor(DesignerColorUtils.JOBLET_COLOR_NAME, Messages.getString("DesignerPreferencePage.JobletGroupColorLabel"), //$NON-NLS-1$
    jobletGroup));
    GridLayout layout = new GridLayout(2, false);
    layout.marginLeft = 10;
    jobletGroup.setLayout(layout);
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) ColorFieldEditor(org.eclipse.jface.preference.ColorFieldEditor) GridData(org.eclipse.swt.layout.GridData)

Example 5 with ColorFieldEditor

use of org.eclipse.jface.preference.ColorFieldEditor in project tdi-studio-se by Talend.

the class DesignerColorsPreferencePage method createMRGroupFieldEditors.

private void createMRGroupFieldEditors(Composite parent) {
    Group mrGroup = new Group(parent, SWT.NULL);
    //$NON-NLS-1$
    mrGroup.setText(Messages.getString("DesignerPreferencePage.MRColorGroup"));
    mrGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    addField(new ColorFieldEditor(DesignerColorUtils.MRGROUP_COLOR_NAME, Messages.getString("DesignerPreferencePage.MRGroupColorLabel"), //$NON-NLS-1$
    mrGroup));
    GridLayout layout = new GridLayout(2, false);
    layout.marginLeft = 10;
    mrGroup.setLayout(layout);
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) ColorFieldEditor(org.eclipse.jface.preference.ColorFieldEditor) GridData(org.eclipse.swt.layout.GridData)

Aggregations

ColorFieldEditor (org.eclipse.jface.preference.ColorFieldEditor)6 GridData (org.eclipse.swt.layout.GridData)6 GridLayout (org.eclipse.swt.layout.GridLayout)6 Group (org.eclipse.swt.widgets.Group)5 Composite (org.eclipse.swt.widgets.Composite)2 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 IPropertyChangeListener (org.eclipse.jface.util.IPropertyChangeListener)1 PropertyChangeEvent (org.eclipse.jface.util.PropertyChangeEvent)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 RGB (org.eclipse.swt.graphics.RGB)1 Button (org.eclipse.swt.widgets.Button)1 Combo (org.eclipse.swt.widgets.Combo)1 Label (org.eclipse.swt.widgets.Label)1 ChartComposite (org.jfree.experimental.chart.swt.ChartComposite)1 EConnectionType (org.talend.core.model.process.EConnectionType)1