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 Details

    • JFaceColors

      public JFaceColors()
  • Method Details

    • getBannerBackground

      public static Color getBannerBackground(Display display)
      Parameters:
      display - the display the color is from
      Returns:
      the Color used for banner backgrounds
      See Also:
    • getBannerForeground

      public static Color getBannerForeground(Display display)
      Parameters:
      display - the display the color is from
      Returns:
      the Color used for banner foregrounds
      See Also:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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 set
      foreground - Color the foreground color (maybe null)
      background - Color the background color (maybe null)