List of usage examples for org.eclipse.jface.resource JFaceResources getColorRegistry
public static ColorRegistry getColorRegistry()
From source file:de.walware.ecommons.workbench.ui.DecoratingStyledLabelProvider.java
License:Open Source License
@Override public void initialize(final ColumnViewer viewer, final ViewerColumn column) { PlatformUI.getPreferenceStore().addPropertyChangeListener(this); JFaceResources.getColorRegistry().addListener(this); setOwnerDrawEnabled(showColoredLabels()); super.initialize(viewer, column); }
From source file:de.walware.ecommons.workbench.ui.DecoratingStyledLabelProvider.java
License:Open Source License
@Override public void dispose() { PlatformUI.getPreferenceStore().removePropertyChangeListener(this); JFaceResources.getColorRegistry().removeListener(this); super.dispose(); }
From source file:de.walware.statet.r.internal.ui.intable.PresentationConfig.java
License:Open Source License
public PresentationConfig(final Display display) { final FontRegistry jFaceFontRegistry = JFaceResources.getFontRegistry(); final ColorRegistry jFaceColorRegistry = JFaceResources.getColorRegistry(); fHeaderGridColor = display.getSystemColor(SWT.COLOR_DARK_GRAY); fHeaderBackgroundColor = display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND); fHeaderForegroundColor = display.getSystemColor(SWT.COLOR_WIDGET_FOREGROUND); fBodyGridColor = display.getSystemColor(SWT.COLOR_GRAY); fBodyBackgroundColor = display.getSystemColor(SWT.COLOR_LIST_BACKGROUND); fBodyEvenRowBackgroundColor = fBodyBackgroundColor; fBodyOddRowBackgroundColor = new Color(display, ColorUtil.blend(display.getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW).getRGB(), fBodyEvenRowBackgroundColor.getRGB(), 20)); fBodyForegroundColor = display.getSystemColor(SWT.COLOR_LIST_FOREGROUND); fHeaderSelectionBackgroundColor = new Color(display, ColorUtil.blend( display.getSystemColor(SWT.COLOR_LIST_SELECTION).getRGB(), fHeaderBackgroundColor.getRGB(), 25)); fHeaderSelectionForegroundColor = fHeaderForegroundColor; fHeaderPlaceholderColor = new Color(display, ColorUtil.blend(fBodyGridColor.getRGB(), fHeaderBackgroundColor.getRGB(), 25)); fHeaderFullSelectionBackgroundColor = new Color(display, ColorUtil.blend(display.getSystemColor(SWT.COLOR_LIST_SELECTION).getRGB(), display.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW).getRGB(), 25)); fHeaderFullSelectionForegroundColor = display.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW); fBodySelectionBackgroundColor = display.getSystemColor(SWT.COLOR_LIST_SELECTION); fBodySelectionForegroundColor = display.getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT); fBodyFreezeSeparatorColor = jFaceColorRegistry.get(JFacePreferences.DECORATIONS_COLOR); fHeaderLayerPainter = new GridLineCellLayerPainter(fHeaderGridColor); fHeaderLabelLayerPainter = new CornerGridLineCellLayerPainter(fHeaderGridColor); fBodyAnchorBorderStyle = new BorderStyle(2, fBodyForegroundColor, LineStyle.SOLID, -1); fBaseFont = jFaceFontRegistry.get(JFaceResources.DIALOG_FONT); fInfoFont = jFaceFontRegistry.getItalic(JFaceResources.DIALOG_FONT); {//ww w .j a v a 2 s . co m final GC gc = new GC(display); gc.setFont(fBaseFont); final FontMetrics fontMetrics = gc.getFontMetrics(); final int textHeight = fontMetrics.getHeight(); final int charWidth = (gc.textExtent("1234567890.-120").x + 5) / 15; gc.dispose(); final int textSpace = 3; fBaseSizeConfig = new LayoutSizeConfig(textSpace, textHeight, charWidth); } fBaseCellPainter = new LineBorderDecorator(new RTextPainter(fBaseSizeConfig.getDefaultSpace())); fHeaderCellPainter = new RTextPainter(fBaseSizeConfig.getDefaultSpace()); fHeaderSortedCellPainter = new SortableHeaderTextPainter( new RTextPainter(fBaseSizeConfig.getDefaultSpace()), true, true); fHeaderCornerCellPainter = new DiagCellPainter(fHeaderGridColor); }
From source file:de.walware.statet.r.internal.ui.rhelp.RHelpUIServlet.java
License:Open Source License
private static void appendELinkColors(final StringBuilder sb, final RGB foregroundColor) { final RGB hyperlinkColor = JFaceResources.getColorRegistry().getRGB(JFacePreferences.HYPERLINK_COLOR); sb.append("a { color: "); //$NON-NLS-1$ appendCssColor(sb, hyperlinkColor);/* w w w. j a va 2 s . c o m*/ sb.append("; }\n");//$NON-NLS-1$ sb.append("a:hover, a:active, a:focus { color: "); //$NON-NLS-1$ appendCssColor(sb, JFaceResources.getColorRegistry().getRGB(JFacePreferences.ACTIVE_HYPERLINK_COLOR)); sb.append("; }\n"); //$NON-NLS-1$ sb.append("a:visited { color: "); //$NON-NLS-1$ appendCssColor(sb, new RGB((hyperlinkColor.red + ((hyperlinkColor.red <= 127) ? +64 : -64)), (hyperlinkColor.green + foregroundColor.green) / 2, (hyperlinkColor.blue + ((hyperlinkColor.blue > 32) ? -32 : +32) + foregroundColor.blue) / 2)); sb.append("; }\n"); //$NON-NLS-1$ }
From source file:de.walware.statet.r.internal.ui.rhelp.RHelpUIServlet.java
License:Open Source License
@Override public void init(final ServletConfig config) throws ServletException { super.init(config); fRCodeScanner = new RHelpRCodeScanner(RUIPlugin.getDefault().getEditorPreferenceStore()); EditorsUI.getPreferenceStore().addPropertyChangeListener(this); JFaceResources.getFontRegistry().addListener(this); JFaceResources.getColorRegistry().addListener(this); PreferencesUtil.getSettingsChangeNotifier().addChangeListener(this); updateStyles();/*from w w w .j a va 2 s . c om*/ }
From source file:de.walware.statet.r.internal.ui.rhelp.RHelpUIServlet.java
License:Open Source License
@Override public void destroy() { super.destroy(); final IPreferenceStore preferenceStore = EditorsUI.getPreferenceStore(); if (preferenceStore != null) { preferenceStore.removePropertyChangeListener(this); }/*from w w w .jav a2 s . co m*/ JFaceResources.getFontRegistry().removeListener(this); JFaceResources.getColorRegistry().removeListener(this); PreferencesUtil.getSettingsChangeNotifier().removeChangeListener(this); }
From source file:descent.internal.ui.infoviews.AbstractInfoView.java
License:Open Source License
private void inititalizeColors() { if (getSite().getShell().isDisposed()) return;/*w ww . j a va 2s.c o m*/ 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); }
From source file:descent.internal.ui.infoviews.AbstractInfoView.java
License:Open Source License
public final void dispose() { // cancel possible running computation fComputeCount++;//from w w w .j a v a 2s.com if (fComputeProgressMonitor != null) fComputeProgressMonitor.setCanceled(true); getSite().getWorkbenchWindow().getPartService().removePartListener(fPartListener); ISelectionProvider provider = getSelectionProvider(); if (provider != null) provider.removeSelectionChangedListener(fCopyToClipboardAction); JFaceResources.getColorRegistry().removeListener(this); fBackgroundColorRGB = null; if (fBackgroundColor != null) { fBackgroundColor.dispose(); fBackgroundColor = null; } internalDispose(); }
From source file:edu.uchicago.cs.hao.texdojo.bibeditor.editors.EditorUI.java
License:Open Source License
private void prepareColors() { ColorRegistry reg = JFaceResources.getColorRegistry(); if (null == reg.get(Resources.COLOR_BROWN)) reg.put(Resources.COLOR_BROWN, new RGB(66, 6, 14)); if (null == reg.get(Resources.COLOR_DARKBLUE)) reg.put(Resources.COLOR_DARKBLUE, new RGB(6, 45, 107)); if (null == reg.get(Resources.COLOR_MAGENTA)) reg.put(Resources.COLOR_MAGENTA, new RGB(147, 2, 22)); if (null == reg.get(Resources.COLOR_GRASS)) reg.put(Resources.COLOR_GRASS, new RGB(92, 114, 39)); if (null == reg.get(Resources.COLOR_WARNBACK)) reg.put(Resources.COLOR_WARNBACK, new RGB(255, 188, 196)); if (null == reg.get(Resources.COLOR_HIGHLIGHT)) reg.put(Resources.COLOR_HIGHLIGHT, new RGB(255, 250, 196)); }
From source file:edu.uchicago.cs.hao.texdojo.bibeditor.editors.Resources.java
License:Open Source License
static Color color(String name) { return JFaceResources.getColorRegistry().get(name); }