当前位置: 首页>>代码示例>>Java>>正文


Java ColorSelector类代码示例

本文整理汇总了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;
}
 
开发者ID:sjclemen,项目名称:peten,代码行数:20,代码来源:CreateTagDialog.java

示例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());
        }
    });
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:32,代码来源:AppearancePreferencePage.java

示例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());
        }
    });
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:29,代码来源:AppearancePreferencePage.java

示例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());
        }
    });
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:32,代码来源:AppearancePreferencePage.java

示例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());
        }
    });
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:29,代码来源:AppearancePreferencePage.java

示例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());
        }
    });
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:32,代码来源:AppearancePreferencePage.java

示例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());
        }
    });
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:32,代码来源:AppearancePreferencePage.java

示例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());
        }
    });
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:29,代码来源:AppearancePreferencePage.java

示例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();
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:UITheme.java

示例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);
		}
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:19,代码来源:PrefPageMap2Appearance.java

示例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();
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:18,代码来源:DialogMap2ColorEditor.java

示例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()));
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:22,代码来源:RGBBindingFactory.java

示例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;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:17,代码来源:ColorEditor.java

示例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));
                    }
                }
            });
        }
    });
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:39,代码来源:ShapeSection.java

示例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));
                    }
                }
            });

        }
    });

}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:38,代码来源:ShapeSection.java


注:本文中的org.eclipse.jface.preference.ColorSelector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。