Class DesignerChooserEnvironment

java.lang.Object
com.iizigo.prop.editor.color.swt.DesignerChooserEnvironment
All Implemented Interfaces:
IChooserEnvironment

public final class DesignerChooserEnvironment extends Object implements IChooserEnvironment
The Designer's environment of the SWT color chooser (CC-COLOR-CHOOSER-SWT-PANELS, 2026-10-10): the SWT dialog font and fontCY of ApplicationUI, the com.iizigo instance preference store, the Palette tab's entries from the loaded modules and the saved theme family and scheme of DesignerPalette, and the colors of the chooser's own surfaces from ApplicationUI's named theme members (CC-FIX-COLOR-CHOOSER-DARK, 2026-10-19), so that the chooser follows the light and the dark Eclipse theme.
Author:
Christopher Mindus
  • Method Summary

    Modifier and Type
    Method
    Description
    The roles mapped to ApplicationUI's members: the panels' background is widgetBackground (the light theme's widget background, the dark theme's panel gray), the field background is background (white in the light theme, the dark theme's field gray), the frames and shade lines are border, the cross of an unresolved value is disabledForeground, the checkerboard is background and paleLine (the pale line role: a gray standing out palely from the background in both themes), the diagram marker is white and black (a contrast pair over any color).
    Gets the dialog font every text of the chooser is drawn in.
    int
    Gets the height of the dialog font's metrics in points (ApplicationUI.fontCY), from which the swatch cell size follows.
    Gets the Designer's environment.
    Gets the entries of the Palette tab for a context.
    Gets the preference store holding the recent colors and the remembered tab.
    boolean
    Checks which scheme's literal a chosen palette entry sets in the chooser.
  • Method Details

    • getInstance

      public static DesignerChooserEnvironment getInstance()
      Gets the Designer's environment.
    • getDialogFont

      public Font getDialogFont()
      Description copied from interface: IChooserEnvironment
      Gets the dialog font every text of the chooser is drawn in.
      Specified by:
      getDialogFont in interface IChooserEnvironment
      Returns:
      The font (not owned by the chooser), or null for the controls' default font.
    • getFontHeight

      public int getFontHeight()
      Description copied from interface: IChooserEnvironment
      Gets the height of the dialog font's metrics in points (ApplicationUI.fontCY), from which the swatch cell size follows.
      Specified by:
      getFontHeight in interface IChooserEnvironment
      Returns:
      The height, or a value below 1 for the reference height.
    • getPreferenceStore

      public IPreferenceStore getPreferenceStore()
      Description copied from interface: IChooserEnvironment
      Gets the preference store holding the recent colors and the remembered tab.
      Specified by:
      getPreferenceStore in interface IChooserEnvironment
      Returns:
      The store, or null to persist nothing.
    • getPaletteEntries

      public List<PaletteEntries.Entry> getPaletteEntries(GProp<?> context)
      Description copied from interface: IChooserEnvironment
      Gets the entries of the Palette tab for a context.
      Specified by:
      getPaletteEntries in interface IChooserEnvironment
      Parameters:
      context - A property of the tree the chosen color is written in, or null.
      Returns:
      The entries in display order, never null; empty for no Palette tab contents.
    • isDarkScheme

      public boolean isDarkScheme()
      Description copied from interface: IChooserEnvironment
      Checks which scheme's literal a chosen palette entry sets in the chooser.
      Specified by:
      isDarkScheme in interface IChooserEnvironment
      Returns:
      true for the dark scheme, false for the light one.
    • getColors

      public ChooserColors getColors()
      The roles mapped to ApplicationUI's members: the panels' background is widgetBackground (the light theme's widget background, the dark theme's panel gray), the field background is background (white in the light theme, the dark theme's field gray), the frames and shade lines are border, the cross of an unresolved value is disabledForeground, the checkerboard is background and paleLine (the pale line role: a gray standing out palely from the background in both themes), the diagram marker is white and black (a contrast pair over any color). Read at each call: the members follow a theme change at run time.
      Specified by:
      getColors in interface IChooserEnvironment
      Returns:
      The colors, never null; the chooser does not dispose of them.