1 11 package org.eclipse.jface.resource; 12 13 import org.eclipse.jface.preference.JFacePreferences; 14 import org.eclipse.swt.SWT; 15 import org.eclipse.swt.graphics.Color; 16 import org.eclipse.swt.widgets.Control; 17 import org.eclipse.swt.widgets.Display; 18 19 23 public class JFaceColors { 24 25 31 public static Color getBannerBackground(Display display) { 32 return display.getSystemColor(SWT.COLOR_LIST_BACKGROUND); 33 } 34 35 41 public static Color getBannerForeground(Display display) { 42 return display.getSystemColor(SWT.COLOR_LIST_FOREGROUND); 43 } 44 45 51 public static Color getErrorBackground(Display display) { 52 return display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND); 53 } 54 55 61 public static Color getErrorBorder(Display display) { 62 return display.getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW); 63 } 64 65 71 public static Color getErrorText(Display display) { 72 return JFaceResources.getColorRegistry().get( 73 JFacePreferences.ERROR_COLOR); 74 } 75 76 82 public static Color getHyperlinkText(Display display) { 83 return JFaceResources.getColorRegistry().get( 84 JFacePreferences.HYPERLINK_COLOR); 85 } 86 87 93 public static Color getActiveHyperlinkText(Display display) { 94 return JFaceResources.getColorRegistry().get( 95 JFacePreferences.ACTIVE_HYPERLINK_COLOR); 96 } 97 98 108 public static void clearColor(String colorName) { 109 } 111 112 119 public static void disposeColors() { 120 } 122 123 132 public static void setColors(Control control, Color foreground, 133 Color background) { 134 if (foreground != null) { 135 control.setForeground(foreground); 136 } 137 if (background != null) { 138 control.setBackground(background); 139 } 140 } 141 142 } 143 | Popular Tags |