private void refreshDiffColors() { ColorRegistry reg = PlatformUI.getWorkbench().getThemeManager() .getCurrentTheme().getColorRegistry(); this.addBackgroundColor = reg.get(THEME_DiffAddBackgroundColor); this.addForegroundColor = reg.get(THEME_DiffAddForegroundColor); this.removeBackgroundColor = reg.get(THEME_DiffRemoveBackgroundColor); this.removeForegroundColor = reg.get(THEME_DiffRemoveForegroundColor); this.hunkBackgroundColor = reg.get(THEME_DiffHunkBackgroundColor); this.hunkForegroundColor = reg.get(THEME_DiffHunkForegroundColor); this.headlineBackgroundColor = reg.get(THEME_DiffHeadlineBackgroundColor); this.headlineForegroundColor = reg.get(THEME_DiffHeadlineForegroundColor); }
@Override public void applyStyles(TextStyle textStyle) { ColorRegistry colorRegistry = JFaceResources.getColorRegistry(); if (fForegroundColorName != null) { textStyle.foreground = colorRegistry.get(fForegroundColorName); } if (fBackgroundColorName != null) { textStyle.background = colorRegistry.get(fBackgroundColorName); } } }
/** * @param display the display the color is from * @return the default color to use for displaying errors. * @see ColorRegistry#get(String) * @see JFacePreferences#ERROR_COLOR */ public static Color getErrorText(Display display) { return JFaceResources.getColorRegistry().get( JFacePreferences.ERROR_COLOR); }
/** * @param display * the display the color is from * @return the default color to use for displaying active hyperlinks, or * <code>null</code> if the color definition does not exists. * @see ColorRegistry#get(String) * @see JFacePreferences#ACTIVE_HYPERLINK_COLOR */ public static Color getActiveHyperlinkText(Display display) { return JFaceResources.getColorRegistry().get( JFacePreferences.ACTIVE_HYPERLINK_COLOR); }
@Override protected Color getForeground() { return JFaceResources.getColorRegistry().get( JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR); }
@Override protected Color getForeground() { return JFaceResources.getColorRegistry().get( JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR); }
/** * @param display the display the color is from * @return the default color to use for displaying hyperlinks. * @see ColorRegistry#get(String) * @see JFacePreferences#HYPERLINK_COLOR */ public static Color getHyperlinkText(Display display) { return JFaceResources.getColorRegistry().get( JFacePreferences.HYPERLINK_COLOR); }
/** * @param display * the display the color is from * @return the default color to use for displaying hyperlinks, or * <code>null</code> if the color definition does not exists. * @see ColorRegistry#get(String) * @see JFacePreferences#HYPERLINK_COLOR */ public static Color getHyperlinkText(Display display) { return JFaceResources.getColorRegistry().get( JFacePreferences.HYPERLINK_COLOR); }
/** * @param display the display the color is from * @return the default color to use for displaying errors. * @see ColorRegistry#get(String) * @see JFacePreferences#ERROR_COLOR */ public static Color getErrorText(Display display) { return JFaceResources.getColorRegistry().get( JFacePreferences.ERROR_COLOR); }
public Color getColorFromRgb(RGB rgb) { if (rgb == null) { return null; } String symbolicName = String.format("#%02X%02X%02X", rgb.red, rgb.green, rgb.blue); //$NON-NLS-1$ Color color = JFaceResources.getColorRegistry().get(symbolicName); if (color == null) { JFaceResources.getColorRegistry().put(symbolicName, rgb); color = JFaceResources.getColorRegistry().get(symbolicName); } return color; }
private void customize() { ColorRegistry reg = JFaceResources.getColorRegistry(); Color c1 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_START"), //$NON-NLS-1$ c2 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_END"); //$NON-NLS-1$ customizationsTabFolder.setSelectionBackground(new Color[] {c1, c2}, new int[] {100}, true); customizationsTabFolder.setSelectionForeground(reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_TEXT_COLOR")); //$NON-NLS-1$ customizationsTabFolder.setSimple(PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS)); }
@Override public void applyStyles(TextStyle textStyle) { textStyle.foreground= JFaceResources.getColorRegistry().get(JFacePreferences.COUNTER_COLOR); textStyle.font= boldStylerProvider.getBoldFont(); } };
private static Color getInformationForegroundColor(Display display) { ColorRegistry colorRegistry = JFaceResources.getColorRegistry(); Color foreground = colorRegistry.get(JFacePreferences.INFORMATION_FOREGROUND_COLOR); if (foreground == null) { return JFaceColors.getInformationViewerForegroundColor(display); } return foreground; }
public Color getForeground(Object element) { if (fMethodsViewer.isShowInheritedMethods() && element instanceof IMethod) { IMethod curr= (IMethod) element; IMember declaringType= curr.getDeclaringType(); if (!declaringType.equals(fMethodsViewer.getInput())) { return JFaceResources.getColorRegistry().get(ColoredViewersManager.INHERITED_COLOR_NAME); } } return null; }
@Override public void propertyChange(PropertyChangeEvent event) { if (ACTIVE_TAB_BG_END.equals(event.getProperty())) { if (fComposite.isFocusControl()) { fComposite.setBackground(JFaceResources.getColorRegistry().get(ACTIVE_TAB_BG_END)); } } } };
@Override public Color getForeground(Object element) { if (fMethodsViewer.isShowInheritedMethods() && element instanceof IMethod) { IMethod curr= (IMethod) element; IMember declaringType= curr.getDeclaringType(); if (!declaringType.equals(fMethodsViewer.getInput())) { return JFaceResources.getColorRegistry().get(ColoredViewersManager.INHERITED_COLOR_NAME); } } return null; }
public Color getForeground(Object element) { if (element instanceof IMethod) { if (fSpecialColor == null) { fSpecialColor= Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE); } return fSpecialColor; } else if (element instanceof IType && isDifferentScope((IType) element)) { return JFaceResources.getColorRegistry().get(ColoredViewersManager.QUALIFIER_COLOR_NAME); } return null; }
@Override public Color getForeground(Object element) { if (element instanceof IMethod) { if (fSpecialColor == null) { fSpecialColor= Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE); } return fSpecialColor; } else if (element instanceof IType && isInDifferentHierarchyScope((IType) element)) { return JFaceResources.getColorRegistry().get(JFacePreferences.QUALIFIER_COLOR); } return null; }
@Override public Color getForeground(Object element) { if (element instanceof AbstractHistoryCategory){ // TODO: We should have a Team theme for this ITheme current = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(); return current.getColorRegistry().get("org.eclipse.team.cvs.ui.fontsandcolors.cvshistorypagecategories"); //$NON-NLS-1$ } if (isDeletedEdition(element)) { return Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW); } return null; }
public ResultLabelProvider(ResultContentProvider contentProvider) { Color searchColor = JFaceResources.getColorRegistry().get(ECLIPSE_SEARCH_UI_MATCH_HIGHLIGHT); JFaceResources.getColorRegistry().put(HIGHLIGHT_COLOR_NAME, (searchColor!=null?searchColor.getRGB():new RGB(206, 204, 247))); this.labelProvider = new WorkbenchLabelProvider(); this.highlightStyle = StyledString.createColorRegistryStyler(null, HIGHLIGHT_COLOR_NAME); this.contentProvider = contentProvider; this.matchImage = InstaSearchUI.getSharedImage(IMG_OBJ_TEXT_SEARCH_LINE); imageRegistry.put(DOWN_ARROW_IMG_KEY, InstaSearchPlugin.getImageDescriptor(DOWN_ARROW_IMG_KEY)); this.showMatchCount = InstaSearchPlugin.getBoolPref(PreferenceConstants.P_SHOW_MATCH_COUNT); this.showFullPath = InstaSearchPlugin.getBoolPref(PreferenceConstants.P_SHOW_FULL_PATH); InstaSearchPlugin.addPreferenceChangeListener(this); }