Class FieldAssistColors


@Deprecated public class FieldAssistColors extends Object
As of 3.3, this class is no longer necessary.
FieldAssistColors defines protocol for retrieving colors that can be used to provide visual cues with fields. For consistency with JFace dialogs and wizards, it is recommended that FieldAssistColors is used when colors are used to annotate fields.

Color resources that are returned using methods in this class are maintained in the JFace color registries, or by SWT. Users of any color resources provided by this class are not responsible for the lifecycle of the color. Colors provided by this class should never be disposed by clients. In some cases, clients are provided information, such as RGB values, in order to create their own color resources. In these cases, the client should manage the lifecycle of any created resource.

  • Constructor Details

    • FieldAssistColors

      public FieldAssistColors()
  • Method Details

    • computeErrorFieldBackgroundRGB

      public static RGB computeErrorFieldBackgroundRGB(Control control)
      Compute the RGB of the color that should be used for the background of a control to indicate that the control has an error. Because the color suitable for indicating an error depends on the colors set into the control, this color is always computed dynamically and provided as an RGB value. Clients who use this RGB to create a Color resource are responsible for managing the life cycle of the color.

      This color is computed dynamically each time that it is queried. Clients should typically call this method once, create a color from the RGB provided, and dispose of the color when finished using it.

      control - the control for which the background color should be computed.
      the RGB value indicating a background color appropriate for indicating an error in the control.
    • getRequiredFieldBackgroundColor

      public static Color getRequiredFieldBackgroundColor(Control control)
      Return the color that should be used for the background of a control to indicate that the control is a required field and does not have content.

      This color is managed by FieldAssistResources and should never be disposed by clients.

      control - the control on which the background color will be used.
      the color used to indicate that a field is required.