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));
}
}
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);
}
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();
}
});
}
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);
}
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);
}
Aggregations