List of usage examples for org.eclipse.jface.resource ColorRegistry ColorRegistry
public ColorRegistry(Display display)
From source file:au.gov.ga.earthsci.common.ui.color.ColorMapEditor.java
License:Apache License
/** * Create a new {@link ColorMap} editor widget with the given seed map and * optional data value range./*w ww . j a va 2 s . c om*/ * <p/> * If a data value range is provided, the user will be able to create a map * whose entries are absolute values (rather than percentages). * * @param seed * The see map to base the editor on * @param minDataValue * The minimum data value to use when an absolute value colour * map is used * @param maxDataValue * The maximum data value to use when an absolute value colour * map is used * @param parent * The parent composite for the editor * @param style * The style to apply to this editor */ public ColorMapEditor(ColorMap seed, Double minDataValue, Double maxDataValue, Composite parent, int style) { // TODO: Support vertical / horizontal style super(parent, style); setLayout(new GridLayout(3, false)); colorRegistry = new ColorRegistry(getDisplay()); map = new MutableColorMap(seed); if (minDataValue != null && maxDataValue != null) { hasDataValues = true; this.minDataValue = minDataValue; this.maxDataValue = maxDataValue; } addUIElements(); wireListeners(); }
From source file:ca.uvic.chisel.javasketch.SketchPlugin.java
License:Open Source License
public ColorRegistry getColorRegistry() { if (this.colorRegistry == null) { colorRegistry = new ColorRegistry(PlatformUI.getWorkbench().getDisplay()); colorRegistry.put(ISketchColorConstants.RED_KEY, new RGB(200, 0, 0)); colorRegistry.put(ISketchColorConstants.GREEN_KEY, new RGB(0, 150, 0)); colorRegistry.put(ISketchColorConstants.BLUE_KEY, new RGB(0, 0, 200)); colorRegistry.put(ISketchColorConstants.LIGHT_RED_KEY, new RGB(255, 225, 225)); colorRegistry.put(ISketchColorConstants.LIGHT_GREEN_KEY, new RGB(225, 255, 225)); colorRegistry.put(ISketchColorConstants.LIGHT_BLUE_KEY, new RGB(225, 225, 255)); colorRegistry.put(ISketchColorConstants.ERROR_BG_KEY, new RGB(255, 250, 250)); colorRegistry.put(ISketchColorConstants.CONDITION_BG_KEY, new RGB(250, 255, 250)); colorRegistry.put(ISketchColorConstants.LOOP_BG_KEY, new RGB(250, 250, 255)); colorRegistry.put(ISketchColorConstants.AMBER_KEY, new RGB(255, 160, 32)); colorRegistry.put(ISketchColorConstants.LIGHT_AMBER_KEY, new RGB(255, 225, 180)); colorRegistry.put(ISketchColorConstants.LIGHT_PURPLE_KEY, new RGB(255, 225, 255)); colorRegistry.put(ISketchColorConstants.PURPLE_KEY, new RGB(255, 180, 255)); colorRegistry.put(ISketchColorConstants.GRAY_KEY, new RGB(150, 150, 150)); colorRegistry.put(ISketchColorConstants.BLACK_KEY, new RGB(0, 0, 0)); }/*from w w w . ja v a 2 s . co m*/ return colorRegistry; }
From source file:ccw.CCWPlugin.java
License:Open Source License
private synchronized void createColorCache() { if (colorCache == null) { colorCache = new ColorRegistry(getWorkbench().getDisplay()); colorCache.put("ccw.repl.expressionBackground", new RGB(0xf0, 0xf0, 0xf0)); }// ww w.jav a2 s . c om }
From source file:com.agynamix.platform.infra.ApplicationContext.java
License:Open Source License
public ColorRegistry getColorRegistry() { if (colorRegistry == null) { colorRegistry = new ColorRegistry(Display.getDefault()); }/* w w w . j ava2 s. com*/ return colorRegistry; }
From source file:com.aljoschability.rendis.ui.runtime.ActivatorImpl.java
License:Open Source License
private ColorRegistry getColorRegistry() { if (colorRegistry == null) { colorRegistry = new ColorRegistry(getDisplay()); } return colorRegistry; }
From source file:net.sf.eclipsensis.util.ColorManager.java
License:Open Source License
private static synchronized ColorRegistry getColorRegistry() { if (cColorRegistry == null) { if (Display.getCurrent() != null) { cColorRegistry = new ColorRegistry(Display.getCurrent()); } else if (PlatformUI.isWorkbenchRunning()) { cColorRegistry = new ColorRegistry(PlatformUI.getWorkbench().getDisplay()); } else {//from w w w . j av a 2 s. c o m Display.getDefault().syncExec(new Runnable() { public void run() { cColorRegistry = new ColorRegistry(Display.getDefault()); } }); } } return cColorRegistry; }
From source file:org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator.java
License:Apache License
/** * {@inheritDoc}/* w ww . jav a 2 s. c om*/ */ public void start(BundleContext context) throws Exception { super.start(context); if (eventRunner == null) { eventRunner = new UiThreadEventRunner(); } if (fontRegistry == null) { fontRegistry = new FontRegistry(getWorkbench().getDisplay()); } if (colorRegistry == null) { colorRegistry = new ColorRegistry(getWorkbench().getDisplay()); } valueEditorPreferences = new ValueEditorsPreferences(); if (filterTemplateContextTypeRegistry == null) { filterTemplateContextTypeRegistry = new ContributionContextTypeRegistry(); filterTemplateContextTypeRegistry.addContextType(BrowserCommonConstants.FILTER_TEMPLATE_ID); filterTemplateContextTypeRegistry.getContextType(BrowserCommonConstants.FILTER_TEMPLATE_ID) .addResolver(new GlobalTemplateVariables.Cursor()); } if (filterTemplateStore == null) { filterTemplateStore = new ContributionTemplateStore(getFilterTemplateContextTypeRegistry(), getPreferenceStore(), "templates"); //$NON-NLS-1$ try { filterTemplateStore.load(); } catch (IOException e) { e.printStackTrace(); } } }
From source file:org.apache.directory.studio.ldifeditor.LdifEditorActivator.java
License:Apache License
/** * {@inheritDoc} //from w ww . ja v a 2 s .c o m */ public void start(BundleContext context) throws Exception { super.start(context); if (colorRegistry == null) { colorRegistry = new ColorRegistry(getWorkbench().getDisplay()); } if (ldifTemplateContextTypeRegistry == null) { ldifTemplateContextTypeRegistry = new ContributionContextTypeRegistry(); ldifTemplateContextTypeRegistry.addContextType(LdifEditorConstants.LDIF_FILE_TEMPLATE_ID); ldifTemplateContextTypeRegistry.getContextType(LdifEditorConstants.LDIF_FILE_TEMPLATE_ID) .addResolver(new GlobalTemplateVariables.Cursor()); ldifTemplateContextTypeRegistry.addContextType(LdifEditorConstants.LDIF_ATTR_VAL_RECORD_TEMPLATE_ID); ldifTemplateContextTypeRegistry.getContextType(LdifEditorConstants.LDIF_ATTR_VAL_RECORD_TEMPLATE_ID) .addResolver(new GlobalTemplateVariables.Cursor()); ldifTemplateContextTypeRegistry .addContextType(LdifEditorConstants.LDIF_MODIFICATION_RECORD_TEMPLATE_ID); ldifTemplateContextTypeRegistry.getContextType(LdifEditorConstants.LDIF_MODIFICATION_RECORD_TEMPLATE_ID) .addResolver(new GlobalTemplateVariables.Cursor()); ldifTemplateContextTypeRegistry.addContextType(LdifEditorConstants.LDIF_MODIFICATION_ITEM_TEMPLATE_ID); ldifTemplateContextTypeRegistry.addContextType(LdifEditorConstants.LDIF_MODDN_RECORD_TEMPLATE_ID); } if (ldifTemplateStore == null) { ldifTemplateStore = new ContributionTemplateStore(getLdifTemplateContextTypeRegistry(), getPreferenceStore(), "templates"); //$NON-NLS-1$ try { ldifTemplateStore.load(); } catch (IOException e) { e.printStackTrace(); } } }
From source file:org.csstudio.dal.ui.util.CustomMediaFactory.java
License:Open Source License
/** * Private constructor to avoid instantiation. *//*from w w w. jav a2 s .c o m*/ private CustomMediaFactory() { Display display = Display.getDefault(); _colorRegistry = new ColorRegistry(display); _imageRegistry = new ImageRegistry(display); _fontRegistry = new FontRegistry(display); _imageCache = new HashMap<String, Image>(); // dispose all images from the image cache, when the display is disposed display.addListener(SWT.Dispose, new Listener() { public void handleEvent(final Event event) { for (Image img : _imageCache.values()) { img.dispose(); } } }); }
From source file:org.eclipse.cdt.visualizer.ui.util.UIResourceManager.java
License:Open Source License
/** Creates/returns color registry */ protected ColorRegistry getColorRegistry() { if (m_colors == null) { Display display = getDisplay();// ww w .j a v a 2 s.com m_colors = new ColorRegistry(display); } return m_colors; }