Interface IChooserEnvironment

All Known Implementing Classes:
DesignerChooserEnvironment

public interface IChooserEnvironment
What the SWT color chooser reads from its surroundings (CC-COLOR-CHOOSER-SWT-PANELS, 2026-10-10): the dialog font and its height, the preference store of the recents and the remembered tab, the entries of the Palette tab and, since CC-FIX-COLOR-CHOOSER-DARK (2026-10-19), the theme colors of its own painted surfaces (ChooserColors). The Designer supplies DesignerChooserEnvironment; a test or a measurement rig supplies its own, so that the chooser runs in a plain shell without the workbench and without touching the user's preferences.
Author:
Christopher Mindus
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the colors the chooser paints its own surfaces with: its own panels' background, the swatch grids' background, the frames and shade lines, the cross of an unresolved value, the transparency checkerboard and the diagram marker.
    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 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

    • getDialogFont

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

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

      IPreferenceStore getPreferenceStore()
      Gets the preference store holding the recent colors and the remembered tab.
      Returns:
      The store, or null to persist nothing.
    • getPaletteEntries

      List<PaletteEntries.Entry> getPaletteEntries(GProp<?> context)
      Gets the entries of the Palette tab for a context.
      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

      boolean isDarkScheme()
      Checks which scheme's literal a chosen palette entry sets in the chooser.
      Returns:
      true for the dark scheme, false for the light one.
    • getColors

      ChooserColors getColors()
      Gets the colors the chooser paints its own surfaces with: its own panels' background, the swatch grids' background, the frames and shade lines, the cross of an unresolved value, the transparency checkerboard and the diagram marker. Roles of the theme, never literals; read when a chooser is created.
      Returns:
      The colors, never null; the chooser does not dispose of them.