Package org.eclipse.jface.resource
Class JFaceColors
- java.lang.Object
-
- org.eclipse.jface.resource.JFaceColors
-
public class JFaceColors extends Object
JFaceColors is the class that stores references to all of the colors used by JFace.
-
-
Constructor Summary
Constructors Constructor Description JFaceColors()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
clearColor(String colorName)
Deprecated.JFaceColors no longer maintains a cache of colors.static void
disposeColors()
Deprecated.JFaceColors no longer maintains a cache of colors.static Color
getActiveHyperlinkText(Display display)
static Color
getBannerBackground(Display display)
static Color
getBannerForeground(Display display)
static Color
getErrorBackground(Display display)
static Color
getErrorBorder(Display display)
static Color
getErrorText(Display display)
static Color
getHyperlinkText(Display display)
static Color
getInformationViewerBackgroundColor(Display display)
Background color intended for widgets that display text.static Color
getInformationViewerForegroundColor(Display display)
Foreground color intended for widgets that display text.static void
setColors(Control control, Color foreground, Color background)
Set the foreground and background colors of the control to the specified values.
-
-
-
Method Detail
-
getBannerBackground
public static Color getBannerBackground(Display display)
- Parameters:
display
- the display the color is from- Returns:
- the Color used for banner backgrounds
- See Also:
SWT.COLOR_LIST_BACKGROUND
,Display.getSystemColor(int)
-
getBannerForeground
public static Color getBannerForeground(Display display)
- Parameters:
display
- the display the color is from- Returns:
- the Color used for banner foregrounds
- See Also:
SWT.COLOR_LIST_FOREGROUND
,Display.getSystemColor(int)
-
getErrorBackground
public static Color getErrorBackground(Display display)
- Parameters:
display
- the display the color is from- Returns:
- the background Color for widgets that display errors.
- See Also:
SWT.COLOR_WIDGET_BACKGROUND
,Display.getSystemColor(int)
-
getErrorBorder
public static Color getErrorBorder(Display display)
- Parameters:
display
- the display the color is from- Returns:
- the border Color for widgets that display errors.
- See Also:
SWT.COLOR_WIDGET_DARK_SHADOW
,Display.getSystemColor(int)
-
getErrorText
public static Color getErrorText(Display display)
- Parameters:
display
- the display the color is from- Returns:
- the default color to use for displaying errors.
- See Also:
ColorRegistry.get(String)
,JFacePreferences.ERROR_COLOR
-
getHyperlinkText
public static Color getHyperlinkText(Display display)
- Parameters:
display
- the display the color is from- Returns:
- the default color to use for displaying hyperlinks, or
null
if the color definition does not exists. - See Also:
ColorRegistry.get(String)
,JFacePreferences.HYPERLINK_COLOR
-
getActiveHyperlinkText
public static Color getActiveHyperlinkText(Display display)
- Parameters:
display
- the display the color is from- Returns:
- the default color to use for displaying active hyperlinks, or
null
if the color definition does not exists. - See Also:
ColorRegistry.get(String)
,JFacePreferences.ACTIVE_HYPERLINK_COLOR
-
getInformationViewerBackgroundColor
public static Color getInformationViewerBackgroundColor(Display display)
Background color intended for widgets that display text. This color is compatible with with Gtk system themes, for example on the white theme this color is white and on the dark theme it is dark.Note, there is no need to free this color because it's a color managed by the system not the application.
- Parameters:
display
- the display the color is from- Returns:
- Color most suitable for presenting text background depending on the platform, to match the rest of the environment.
- Since:
- 3.13
-
getInformationViewerForegroundColor
public static Color getInformationViewerForegroundColor(Display display)
Foreground color intended for widgets that display text. This color is compatible with with Gtk system themes, for example on the white theme this color is black and on the dark theme it is bright.Note, there is no need to free this color because it's a color managed by the system not the application.
- Parameters:
display
- the display the color is from- Returns:
- Color most suitable for presenting text foreground depending on the platform, to match the rest of the environment.
- Since:
- 3.13
-
clearColor
@Deprecated public static void clearColor(String colorName)
Deprecated.JFaceColors no longer maintains a cache of colors. This job is now handled by the ColorRegistry.Clear out the cached color for name. This is generally done when the color preferences changed and any cached colors may be disposed. Users of the colors in this class should add a IPropertyChangeListener to detect when any of these colors change.- Parameters:
colorName
- name of the color
-
disposeColors
@Deprecated public static void disposeColors()
Deprecated.JFaceColors no longer maintains a cache of colors. This job is now handled by the ColorRegistry.Dispose of all allocated colors. Called on workbench shutdown.
-
setColors
public static void setColors(Control control, Color foreground, Color background)
Set the foreground and background colors of the control to the specified values. If the values are null than ignore them.- Parameters:
control
- the control the foreground and/or background color should be setforeground
- Color the foreground color (maybenull
)background
- Color the background color (maybenull
)
-
-