List of usage examples for org.eclipse.jface.resource JFaceResources getColorRegistry
public static ColorRegistry getColorRegistry()
From source file:org.xmind.ui.properties.PropertiesEditor.java
License:Open Source License
private void updateEntriesSelectedForegroundColor() { Color color = JFaceResources.getColorRegistry().get(getColorFontId(COLOR_ENTRY_SELECTED_FOREGROUND)); Iterator<PropertyEditingEntry> entries = entries(); while (entries.hasNext()) { entries.next().setSelectedForeground(color); }/*from w ww . ja v a2 s . com*/ }
From source file:org.xmind.ui.resources.ColorUtils.java
License:Open Source License
/** * @deprecated Use {@link LocalResourceManager} *//*from ww w .jav a 2 s . c o m*/ public static Color getColor(String key, RGB rgb) { if (key == null) { key = toString(rgb); if (key == null) return null; } ColorRegistry reg = JFaceResources.getColorRegistry(); if (!reg.hasValueFor(key)) { if (rgb == null) { rgb = toRGB(key); if (rgb == null) return null; } reg.put(key, rgb); } return reg.get(key); }
From source file:org.xtuml.bp.model.compare.contentmergeviewer.ModelContentMergeViewer.java
License:Open Source License
public void updateColors() { ColorRegistry registry = JFaceResources.getColorRegistry(); RGB bg = getBackground(PlatformUI.getWorkbench().getDisplay()); INCOMING_BASE = registry.getRGB(INCOMING_COLOR); if (INCOMING_BASE == null) { INCOMING_BASE = new RGB(0, 0, 255); registry.put(INCOMING_COLOR, INCOMING_BASE); }// w w w.j a v a 2 s .c o m INCOMING = interpolate(INCOMING_BASE, bg, 0.6); OUTGOING_BASE = registry.getRGB(OUTGOING_COLOR); if (OUTGOING_BASE == null) { OUTGOING_BASE = new RGB(0, 0, 0); // BLACK registry.put(OUTGOING_COLOR, OUTGOING_BASE); } OUTGOING = interpolate(OUTGOING_BASE, bg, 0.6); CONFLICT_BASE = registry.getRGB(CONFLICTING_COLOR); if (CONFLICT_BASE == null) { CONFLICT_BASE = new RGB(255, 0, 0); registry.put(CONFLICTING_COLOR, CONFLICT_BASE); // RED } CONFLICT = interpolate(CONFLICT_BASE, bg, 0.6); RESOLVED = registry.getRGB(RESOLVED_COLOR); if (RESOLVED == null) { RESOLVED = new RGB(0, 255, 0); // GREEN } CONTAINED = registry.getRGB(CONTAINED_COLOR); if (CONTAINED == null) { CONTAINED = new RGB(50, 255, 25); } }
From source file:ralfstx.mylyn.bugview.internal.TaskLabelProvider.java
License:Open Source License
@Override public Color getForeground(Object element) { if (element instanceof ITask) { ITask task = (ITask) element;/*from w w w . j ava 2 s. com*/ String priority = task.getPriority(); if ("P1".equals(priority)) { return JFaceResources.getColorRegistry().get(COLOR_P1); } if ("P2".equals(priority)) { return JFaceResources.getColorRegistry().get(COLOR_P2); } if ("P4".equals(priority)) { return JFaceResources.getColorRegistry().get(COLOR_P4); } if ("P5".equals(priority)) { return JFaceResources.getColorRegistry().get(COLOR_P5); } } return null; }
From source file:ralfstx.mylyn.bugview.internal.TaskLabelProvider.java
License:Open Source License
private static void initializeColors() { ColorRegistry colorRegistry = JFaceResources.getColorRegistry(); colorRegistry.put(COLOR_P1, new RGB(0xFF, 0, 0)); colorRegistry.put(COLOR_P2, new RGB(0x80, 0, 0)); colorRegistry.put(COLOR_P4, new RGB(0x80, 0x80, 0x80)); colorRegistry.put(COLOR_P5, new RGB(0xC0, 0xC0, 0xC0)); }
From source file:x10dt.ui.typeHierarchy.HierarchyLabelProvider.java
License:Open Source License
public Color getForeground(Object element) { if (element instanceof IMethodInfo) { if (fSpecialColor == null) { fSpecialColor = Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE); }/* w w w . j a v a2 s .c o m*/ return fSpecialColor; } else if (element instanceof ITypeInfo && isDifferentScope((ITypeInfo) element)) { return JFaceResources.getColorRegistry().get(JFacePreferences.QUALIFIER_COLOR); } return null; }
From source file:x10dt.ui.typeHierarchy.MethodsLabelProvider.java
License:Open Source License
public Color getForeground(Object element) { if (fMethodsViewer.isShowInheritedMethods() && element instanceof IMethodInfo) { IMethodInfo curr = (IMethodInfo) element; IMemberInfo declaringType = curr.getDeclaringType(); if (!declaringType.equals(fMethodsViewer.getInput())) { return JFaceResources.getColorRegistry().get(ColoredViewersManager.INHERITED_COLOR_NAME); }//from ww w . j a v a 2s. com } return null; }