Class JFaceColors


  • public class JFaceColors
    extends Object
    JFaceColors is the class that stores references to all of the colors used by JFace.
    • Constructor Detail

      • JFaceColors

        public JFaceColors()
    • Method Detail

      • 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)