本文整理汇总了Java中org.eclipse.jface.preference.ColorSelector类的典型用法代码示例。如果您正苦于以下问题:Java ColorSelector类的具体用法?Java ColorSelector怎么用?Java ColorSelector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ColorSelector类属于org.eclipse.jface.preference包,在下文中一共展示了ColorSelector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDialogArea
import org.eclipse.jface.preference.ColorSelector; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
Label tagNameLabel = new Label(container, SWT.NONE);
tagNameLabel.setText("Tag name");
tagInput = new Text(container, SWT.SINGLE | SWT.BORDER);
tagInput.setText(suggestion);
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
tagInput.setLayoutData(gridData);
Label tagCategoryLabel = new Label(container, SWT.NONE);
tagCategoryLabel.setText("Colour");
colourSelector = new ColorSelector(container);
return container;
}
示例2: createCommentFillColor
import org.eclipse.jface.preference.ColorSelector; //导入依赖的package包/类
/**
*
*
* @param colorsAndFontsGroup
* void
*/
private void createCommentFillColor(Group parent) {
Label fontColorLabel = new Label(parent, SWT.NONE);
fontColorLabel.setLayoutData(labelGridData);
fontColorLabel.setText(UMLMessage.getMessage(UMLMessage.LABEL_PREFERENCE_APPEARANCE_COMMENT_FILL_COLOR)
+ UICoreConstant.PROJECT_CONSTANTS__COLON);
commentFillColorSelector = new ColorSelector(parent);
gridData = new GridData();
gridData.horizontalSpan = 2;
gridData.horizontalAlignment = GridData.BEGINNING;
commentFillColorSelector.getButton().setLayoutData(gridData);
commentFillColorSelector.addListener(new IPropertyChangeListener() {
// forward the property change of the color selector
/**
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
changedColorNameList.add(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_COMMENT_FILL);
changedColorMap.put(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_COMMENT_FILL,
(RGB) event.getNewValue());
fireValueChanged(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_COMMENT_FILL,
event.getOldValue(),
event.getNewValue());
}
});
}
示例3: createFontColor
import org.eclipse.jface.preference.ColorSelector; //导入依赖的package包/类
/**
* @param parent
*/
private void createFontColor(Group parent) {
Label fontColorLabel = new Label(parent, SWT.NONE);
fontColorLabel.setLayoutData(labelGridData);
fontColorLabel.setText(UMLMessage.getMessage(UMLMessage.LABEL_PREFERENCE_APPEARANCE_FONT_COLOR)
+ UICoreConstant.PROJECT_CONSTANTS__COLON);
fontColorSelector = new ColorSelector(parent);
gridData = new GridData();
gridData.horizontalSpan = 2;
gridData.horizontalAlignment = GridData.BEGINNING;
fontColorSelector.getButton().setLayoutData(gridData);
fontColorSelector.addListener(new IPropertyChangeListener() {
// forward the property change of the color selector
/**
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
changedColorNameList.add(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_UMLNOTATION_FONT);
changedColorMap.put(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_UMLNOTATION_FONT,
(RGB) event.getNewValue());
fireValueChanged(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_UMLNOTATION_FONT,
event.getOldValue(),
event.getNewValue());
}
});
}
示例4: createNoteFillColor
import org.eclipse.jface.preference.ColorSelector; //导入依赖的package包/类
/**
*
*
* @param colorsAndFontsGroup
* void
*/
private void createNoteFillColor(Group parent) {
Label fontColorLabel = new Label(parent, SWT.NONE);
fontColorLabel.setLayoutData(labelGridData);
fontColorLabel.setText(UMLMessage.getMessage(UMLMessage.LABEL_PREFERENCE_APPEARANCE_NOTE_FILL_COLOR)
+ UICoreConstant.PROJECT_CONSTANTS__COLON);
noteFillColorSelector = new ColorSelector(parent);
gridData = new GridData();
gridData.horizontalSpan = 1;
gridData.horizontalAlignment = GridData.BEGINNING;
noteFillColorSelector.getButton().setLayoutData(gridData);
noteFillColorSelector.addListener(new IPropertyChangeListener() {
// forward the property change of the color selector
/**
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
changedColorNameList.add(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_NOTE_FILL);
changedColorMap.put(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_NOTE_FILL,
(RGB) event.getNewValue());
fireValueChanged(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_NOTE_FILL,
event.getOldValue(),
event.getNewValue());
}
});
}
示例5: createNoteFontColor
import org.eclipse.jface.preference.ColorSelector; //导入依赖的package包/类
/**
* @param parent
*/
private void createNoteFontColor(Group parent) {
Label fontColorLabel = new Label(parent, SWT.NONE);
fontColorLabel.setLayoutData(labelGridData);
fontColorLabel.setText(UMLMessage.getMessage(UMLMessage.LABEL_PREFERENCE_APPEARANCE_FONT_COLOR)
+ UICoreConstant.PROJECT_CONSTANTS__COLON);
noteFontColorSelector = new ColorSelector(parent);
gridData = new GridData();
gridData.horizontalSpan = 1;
gridData.horizontalAlignment = GridData.BEGINNING;
noteFontColorSelector.getButton().setLayoutData(gridData);
noteFontColorSelector.addListener(new IPropertyChangeListener() {
// forward the property change of the color selector
/**
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
changedColorNameList.add(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_NOTE_FONT);
changedColorMap.put(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_NOTE_FONT,
(RGB) event.getNewValue());
fireValueChanged(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_NOTE_FONT,
event.getOldValue(),
event.getNewValue());
}
});
}
示例6: createLineColor
import org.eclipse.jface.preference.ColorSelector; //导入依赖的package包/类
/**
*
*
* @param colorsAndFontsGroup
* void
*/
private void createLineColor(Group parent) {
Label fontColorLabel = new Label(parent, SWT.NONE);
fontColorLabel.setLayoutData(labelGridData);
fontColorLabel.setText(UMLMessage.getMessage(UMLMessage.LABEL_PREFERENCE_APPEARANCE_LINE_COLOR)
+ UICoreConstant.PROJECT_CONSTANTS__COLON);
lineColorSelector = new ColorSelector(parent);
gridData = new GridData();
gridData.horizontalSpan = 2;
gridData.horizontalAlignment = GridData.BEGINNING;
lineColorSelector.getButton().setLayoutData(gridData);
lineColorSelector.addListener(new IPropertyChangeListener() {
// forward the property change of the color selector
/**
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
changedColorNameList.add(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_UMLNOTATION_LINE);
changedColorMap.put(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_UMLNOTATION_LINE,
(RGB) event.getNewValue());
fireValueChanged(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_UMLNOTATION_LINE,
event.getOldValue(),
event.getNewValue());
}
});
}
示例7: createFillColor
import org.eclipse.jface.preference.ColorSelector; //导入依赖的package包/类
/**
*
*
* @param colorsAndFontsGroup
* void
*/
private void createFillColor(Group parent) {
Label fontColorLabel = new Label(parent, SWT.NONE);
fontColorLabel.setLayoutData(labelGridData);
fontColorLabel.setText(UMLMessage.getMessage(UMLMessage.LABEL_PREFERENCE_APPEARANCE_FILL_COLOR)
+ UICoreConstant.PROJECT_CONSTANTS__COLON);
fillColorSelector = new ColorSelector(parent);
gridData = new GridData();
gridData.horizontalSpan = 2;
gridData.horizontalAlignment = GridData.BEGINNING;
fillColorSelector.getButton().setLayoutData(gridData);
fillColorSelector.addListener(new IPropertyChangeListener() {
// forward the property change of the color selector
/**
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
changedColorNameList.add(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_UMLNOTATION_FILL);
changedColorMap.put(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_UMLNOTATION_FILL,
(RGB) event.getNewValue());
fireValueChanged(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_UMLNOTATION_FILL,
event.getOldValue(),
event.getNewValue());
}
});
}
示例8: createCommentFontColor
import org.eclipse.jface.preference.ColorSelector; //导入依赖的package包/类
/**
* @param parent
*/
private void createCommentFontColor(Group parent) {
Label fontColorLabel = new Label(parent, SWT.NONE);
fontColorLabel.setLayoutData(labelGridData);
fontColorLabel.setText(UMLMessage.getMessage(UMLMessage.LABEL_PREFERENCE_APPEARANCE_FONT_COLOR)
+ UICoreConstant.PROJECT_CONSTANTS__COLON);
commentFontColorSelector = new ColorSelector(parent);
gridData = new GridData();
gridData.horizontalSpan = 2;
gridData.horizontalAlignment = GridData.BEGINNING;
commentFontColorSelector.getButton().setLayoutData(gridData);
commentFontColorSelector.addListener(new IPropertyChangeListener() {
// forward the property change of the color selector
/**
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
changedColorNameList.add(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_COMMENT_FONT);
changedColorMap.put(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_COMMENT_FONT,
(RGB) event.getNewValue());
fireValueChanged(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COLORSANDFONTS_COMMENT_FONT,
event.getOldValue(),
event.getNewValue());
}
});
}
示例9: createColorProperty
import org.eclipse.jface.preference.ColorSelector; //导入依赖的package包/类
public void createColorProperty(Composite cmp, final String prop, String name, final IPreferenceStore store) {
new Label(cmp, SWT.NONE).setText(name);
final ColorSelector colorSelector = new ColorSelector(cmp);
colorSelector.addListener(new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
properties.put(prop, StringConverter.asString(colorSelector.getColorValue()));
save(store);
}
});
try {
colorSelector.setColorValue(StringConverter.asRGB(properties.get(prop)));
} catch (DataFormatException e) {
e.printStackTrace();
}
}
示例10: createUI_80_DimmingColor
import org.eclipse.jface.preference.ColorSelector; //导入依赖的package包/类
private void createUI_80_DimmingColor(final Composite parent) {
final Composite container = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
GridLayoutFactory.fillDefaults().numColumns(2).applyTo(container);
{
// label
final Label label = new Label(container, SWT.NONE);
GridDataFactory.fillDefaults()//
.align(SWT.FILL, SWT.CENTER)
.applyTo(label);
label.setText(Messages.pref_map_layout_dim_color);
// dimming color
_colorMapDimmColor = new ColorSelector(container);
_colorMapDimmColor.addListener(_defaultChangePropertyListener);
}
}
示例11: onSelectColor
import org.eclipse.jface.preference.ColorSelector; //导入依赖的package包/类
private void onSelectColor(final ColorSelector colorSelector, final int valueColorIndex) {
// update model
final ColorValue colorValue = _mapColorWorkingCopy.getColorValues()[4 - valueColorIndex];
final RGB selectedRGB = colorSelector.getColorValue();
colorValue.red = selectedRGB.red;
colorValue.green = selectedRGB.green;
colorValue.blue = selectedRGB.blue;
updateUI();
updateUI_LegendImage();
updateModelFromUI();
doLiveUpdate();
}
示例12: createBinding
import org.eclipse.jface.preference.ColorSelector; //导入依赖的package包/类
@Override
public Binding createBinding(DetailProviderParameter p) {
FormToolkit toolkit = p.getDetailFormToolkit();
Composite parent = p.getParent();
EObject target = p.getTarget();
IItemPropertyDescriptor pd = p.getPropertyDescriptor();
EStructuralFeature feature = (EStructuralFeature) pd.getFeature(target);
if (feature == null) {
return null;
}
boolean isEditable = pd.canSetProperty(target);
EMFDetailUtils.createLabel(parent, toolkit, target, pd);
Composite composite = createPaddingComposite(toolkit, parent);
ColorSelector colorSelector = new ColorSelector(composite);
Button button = colorSelector.getButton();
button.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, true));
button.setEnabled(isEditable);
toolkit.adapt(button, true, true);
EMFDetailUtils.bindControlViability(p, new Control[] {button});
return EMFDetailUtils.bindEMFUndoable(p, new RGBSelectorObservableValue(colorSelector, ERGB.class == feature.getEType().getInstanceClass()));
}
示例13: createColorSelector
import org.eclipse.jface.preference.ColorSelector; //导入依赖的package包/类
private ColorSelector createColorSelector() {
final ColorSelector chooser = new ColorSelector(parent);
chooser.addListener(new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
String oldValue = getObject();
// get the RGB values, and update
RGB rgb = colorChooser.getColorValue();
String newValue = ColorUtils.formatRGB(rgb);
setObject(newValue);
firePropertyChange(oldValue, newValue);
}
});
return chooser;
}
示例14: createFillColor
import org.eclipse.jface.preference.ColorSelector; //导入依赖的package包/类
/**
* createFillColor
*
* @param colorsAndFontsGroup
* void
*/
private void createFillColor(Group parent) {
Label fillColorLabel = new Label(parent, SWT.NONE);
fillColorLabel.setLayoutData(labelGridData);
fillColorLabel.setText(UMLMessage.getMessage(UMLMessage.LABEL_PREFERENCE_APPEARANCE_FILL_COLOR) + COLON_TEXT);
fillColorLabel.setBackground(UiCorePlugin.getDefault().getColor("White"));
fillColorSelector = new ColorSelector(parent);
GridData gridData = new GridData();
gridData.horizontalSpan = 2;
gridData.horizontalAlignment = GridData.BEGINNING;
fillColorSelector.getButton().setLayoutData(gridData);
fillColorSelector.addListener(new IPropertyChangeListener() {
// forward the property change of the color selector
/**
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
nodeColor = (RGB) event.getNewValue();
DomainUtil.run(new TransactionalAction() {
/**
* @see nexcore.tool.uml.manager.transaction.TransactionalAction#doExecute()
*/
@Override
public void doExecute() {
AbstractView viewModel = getViewModel();
if (viewModel != null) {
viewModel.setFillColor(StringConverter.asString(nodeColor));
}
}
});
}
});
}
示例15: createFontColor
import org.eclipse.jface.preference.ColorSelector; //导入依赖的package包/类
/**
* @param parent
*/
private void createFontColor(Group parent) {
Label fontColorLabel = new Label(parent, SWT.NONE);
fontColorLabel.setLayoutData(labelGridData);
fontColorLabel.setText(UMLMessage.getMessage(UMLMessage.LABEL_PREFERENCE_APPEARANCE_FONT_COLOR) + COLON_TEXT);
fontColorLabel.setBackground(UiCorePlugin.getDefault().getColor("White"));
fontColorSelector = new ColorSelector(parent);
GridData gridData = new GridData();
gridData.horizontalSpan = 2;
gridData.horizontalAlignment = GridData.BEGINNING;
fontColorSelector.getButton().setLayoutData(gridData);
fontColorSelector.addListener(new IPropertyChangeListener() {
// forward the property change of the color selector
/**
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
fontColor = (RGB) event.getNewValue();
DomainUtil.run(new TransactionalAction() {
/**
* @see nexcore.tool.uml.manager.transaction.TransactionalAction#doExecute()
*/
@Override
public void doExecute() {
AbstractView viewModel = getViewModel();
if (viewModel != null) {
viewModel.setFontColor(StringConverter.asString(fontColor));
}
}
});
}
});
}