/** * Returns the RGB for the given key in the given color registry. * * @param registry the color registry * @param key the key for the constant in the registry * @param defaultRGB the default RGB if no entry is found * @return RGB the RGB * @since 3.3 */ private static RGB findRGB(ColorRegistry registry, String key, RGB defaultRGB) { if (registry == null) return defaultRGB; RGB rgb= registry.getRGB(key); if (rgb != null) return rgb; return defaultRGB; }
/** * Returns the RGB for the given key in the given color registry. * * @param registry the color registry * @param key the key for the constant in the registry * @param defaultRGB the default RGB if no entry is found * @return RGB the RGB * @since 3.4 */ private static RGB findRGB(ColorRegistry registry, String key, RGB defaultRGB) { if (registry == null) return defaultRGB; RGB rgb= registry.getRGB(key); if (rgb != null) return rgb; return defaultRGB; }
/** * Returns the RGB for the given key in the given color registry. * * @param registry the color registry * @param key the key for the constant in the registry * @param defaultRGB the default RGB if no entry is found * @return RGB the RGB * @since 3.4 */ private static RGB findRGB(ColorRegistry registry, String key, RGB defaultRGB) { if (registry == null) return defaultRGB; RGB rgb= registry.getRGB(key); if (rgb != null) return rgb; return defaultRGB; }
/** * Returns the RGB for the given key in the given color registry. * * @param registry the color registry * @param key the key for the constant in the registry * @param defaultRGB the default RGB if no entry is found * @return RGB the RGB * @since 3.4 */ private static RGB findRGB(ColorRegistry registry, String key, RGB defaultRGB) { if (registry == null) return defaultRGB; RGB rgb= registry.getRGB(key); if (rgb != null) return rgb; return defaultRGB; }
/** * Returns the RGB for the given key in the given color registry. * * @param registry the color registry * @param key the key for the constant in the registry * @param defaultRGB the default RGB if no entry is found * @return RGB the RGB * @since 3.3 */ private static RGB findRGB(ColorRegistry registry, String key, RGB defaultRGB) { if (registry == null) return defaultRGB; RGB rgb= registry.getRGB(key); if (rgb != null) return rgb; return defaultRGB; }
/** * Returns the RGB for the given key in the given color registry. * * @param registry the color registry * @param key the key for the constant in the registry * @param defaultRGB the default RGB if no entry is found * @return RGB the RGB * @since 3.4 */ private static RGB findRGB(ColorRegistry registry, String key, RGB defaultRGB) { if (registry == null) { return defaultRGB; } RGB rgb= registry.getRGB(key); if (rgb != null) { return rgb; } return defaultRGB; }
/** * Returns the color descriptor associated with the given symbolic color * name. If this name does not exist within the registry the supplied * default value will be used. * * @param symbolicName * @param defaultValue * @return the color descriptor associated with the given symbolic color * name or the default * @since 1.1 */ public ColorDescriptor getColorDescriptor(String symbolicName, ColorDescriptor defaultValue) { RGB rgb = getRGB(symbolicName); if (rgb == null) return defaultValue; return ColorDescriptor.createFrom(rgb); }
/** * Returns the color descriptor associated with the given symbolic color * name. If this name does not exist within the registry the supplied * default value will be used. * * @param symbolicName * @param defaultValue * @return the color descriptor associated with the given symbolic color * name or the default * @since 3.4 */ public ColorDescriptor getColorDescriptor(String symbolicName, ColorDescriptor defaultValue) { RGB rgb = getRGB(symbolicName); if (rgb == null) return defaultValue; return ColorDescriptor.createFrom(rgb); }
/** * Returns the color descriptor associated with the given symbolic color * name. If this name does not exist within the registry the supplied * default value will be used. * * @param symbolicName * @param defaultValue * @return the color descriptor associated with the given symbolic color * name or the default * @since 3.4 */ public ColorDescriptor getColorDescriptor(String symbolicName, ColorDescriptor defaultValue) { RGB rgb = getRGB(symbolicName); if (rgb == null) return defaultValue; return ColorDescriptor.createFrom(rgb); }
@Override public RGB getColor(String symbolicName) { return getCurrentTheme().getColorRegistry().getRGB(symbolicName); }
/** * Get the RGB value for the specified definition. Cascades through * preferenceToSet, valuesToSet and finally the registry. * * @param definition the <code>ColorDefinition</code>. * @return the <code>RGB</code> value. */ private RGB getColorValue(ColorDefinition definition) { String id = definition.getId(); RGB updatedRGB = colorPreferencesToSet.get(definition); if (updatedRGB == null) { updatedRGB = (RGB) colorValuesToSet.get(id); if (updatedRGB == null) updatedRGB = currentTheme.getColorRegistry().getRGB(id); } return updatedRGB; }
public TextStyle counterStyle() { TextStyle textStyle = new TextStyle(); RGB color = JFaceResources.getColorRegistry().getRGB(JFacePreferences.COUNTER_COLOR); textStyle.setColor(color); return textStyle; }
public TextStyle decorationsStyle() { TextStyle textStyle = new TextStyle(); RGB color = JFaceResources.getColorRegistry().getRGB(JFacePreferences.DECORATIONS_COLOR); textStyle.setColor(color); return textStyle; }
/** * Returns the RGB for the given key in the given color registry. * * @param key the key for the constant in the registry * @param defaultRGB the default RGB if no entry is found * @return RGB the RGB * @since 3.3 */ private static RGB findRGB(String key, RGB defaultRGB) { if (!PlatformUI.isWorkbenchRunning()) return defaultRGB; ColorRegistry registry= PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry(); RGB rgb= registry.getRGB(key); if (rgb != null) return rgb; return defaultRGB; }
/** * Returns the RGB for the given key in the given color registry. * * @param key the key for the constant in the registry * @param defaultRGB the default RGB if no entry is found * @return RGB the RGB * @since 3.3 */ private static RGB findRGB(String key, RGB defaultRGB) { if (!PlatformUI.isWorkbenchRunning()) return defaultRGB; ColorRegistry registry= PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry(); RGB rgb= registry.getRGB(key); if (rgb != null) return rgb; return defaultRGB; }
/** * Returns the RGB for the given key in the given color registry. * * @param key the key for the constant in the registry * @param defaultRGB the default RGB if no entry is found * @return RGB the RGB * @since 3.3 */ private static RGB findRGB(String key, RGB defaultRGB) { if (!PlatformUI.isWorkbenchRunning()) return defaultRGB; ColorRegistry registry= PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry(); RGB rgb= registry.getRGB(key); if (rgb != null) return rgb; return defaultRGB; }
private void inititalizeColors() { if (getSite().getShell().isDisposed()) return; Display display= getSite().getShell().getDisplay(); if (display == null || display.isDisposed()) return; setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND)); ColorRegistry registry= JFaceResources.getColorRegistry(); registry.addListener(this); fBackgroundColorRGB= registry.getRGB(getBackgroundColorKey()); Color bgColor; if (fBackgroundColorRGB == null) { bgColor= display.getSystemColor(SWT.COLOR_INFO_BACKGROUND); fBackgroundColorRGB= bgColor.getRGB(); } else { bgColor= new Color(display, fBackgroundColorRGB); fBackgroundColor= bgColor; } setBackground(bgColor); }
private void inititalizeColors() { if (getSite().getShell().isDisposed()) return; Display display= getSite().getShell().getDisplay(); if (display == null || display.isDisposed()) return; setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND)); ColorRegistry registry= JFaceResources.getColorRegistry(); registry.addListener(this); fBackgroundColorRGB= registry.getRGB(getBackgroundColorKey()); Color bgColor; if (fBackgroundColorRGB == null) { bgColor= display.getSystemColor(SWT.COLOR_INFO_BACKGROUND); fBackgroundColorRGB= bgColor.getRGB(); } else { bgColor= new Color(display, fBackgroundColorRGB); fBackgroundColor= bgColor; } setBackground(bgColor); }
protected void inititalizeColors() { Display display = getDisplay(); if (display == null) { return; } getSourceViewer().getTextWidget().setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND)); getColorRegistry().addListener(this); backgroundColorRGB = getColorRegistry().getRGB(Strings.nullToEmpty(getBackgroundColorKey())); Color bgColor; if (backgroundColorRGB == null) { bgColor = display.getSystemColor(SWT.COLOR_INFO_BACKGROUND); backgroundColorRGB = bgColor.getRGB(); } else { bgColor = new Color(display, backgroundColorRGB); backgroundColor = bgColor; } getSourceViewer().getTextWidget().setBackground(bgColor); }