Class ColorConstants.SystemColorFactory

java.lang.Object
org.eclipse.draw2d.ColorConstants.SystemColorFactory
Enclosing interface:
ColorConstants

public static class ColorConstants.SystemColorFactory extends Object
This utility class is used to create a system Color using any of the supported SWT constants. The Color is created using the Display bound to the current thread.
Since:
3.13
  • Constructor Details

    • SystemColorFactory

      public SystemColorFactory()
  • Method Details

    • getColor

      public static Color getColor(int which)
      Returns the matching standard Color for the given constant, which should be one of the color constants specified in class SWT. Any value other than one of the SWT color constants which is passed in will result in the Color black. This Color should not be free'd because it was allocated by the system, not the application. Note: This method should be invoked from within the UI thread if possible, as it will attempt to create a new Display instance, if not!
      Parameters:
      which - the SWT Color constant
      Returns:
      the corresponding Color or the Color black
      Since:
      3.13