Class DesignerChooserEnvironment
java.lang.Object
com.iizigo.prop.editor.color.swt.DesignerChooserEnvironment
- All Implemented Interfaces:
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 TypeMethodDescriptionThe roles mapped toApplicationUI's members: the panels' background iswidgetBackground(the light theme's widget background, the dark theme's panel gray), the field background isbackground(white in the light theme, the dark theme's field gray), the frames and shade lines areborder, the cross of an unresolved value isdisabledForeground, the checkerboard isbackgroundandpaleLine(the pale line role: a gray standing out palely from the background in both themes), the diagram marker iswhiteandblack(a contrast pair over any color).Gets the dialog font every text of the chooser is drawn in.intGets the height of the dialog font's metrics in points (ApplicationUI.fontCY), from which the swatch cell size follows.static DesignerChooserEnvironmentGets the Designer's environment.getPaletteEntries(GProp<?> context) Gets the entries of the Palette tab for a context.Gets the preference store holding the recent colors and the remembered tab.booleanChecks which scheme's literal a chosen palette entry sets in the chooser.
Method Details
getInstance
Gets the Designer's environment.getDialogFont
Description copied from interface:IChooserEnvironmentGets the dialog font every text of the chooser is drawn in.- Specified by:
getDialogFontin interfaceIChooserEnvironment- Returns:
- The font (not owned by the chooser), or null for the controls' default font.
getFontHeight
public int getFontHeight()Description copied from interface:IChooserEnvironmentGets the height of the dialog font's metrics in points (ApplicationUI.fontCY), from which the swatch cell size follows.- Specified by:
getFontHeightin interfaceIChooserEnvironment- Returns:
- The height, or a value below 1 for the reference height.
getPreferenceStore
Description copied from interface:IChooserEnvironmentGets the preference store holding the recent colors and the remembered tab.- Specified by:
getPreferenceStorein interfaceIChooserEnvironment- Returns:
- The store, or null to persist nothing.
getPaletteEntries
Description copied from interface:IChooserEnvironmentGets the entries of the Palette tab for a context.- Specified by:
getPaletteEntriesin interfaceIChooserEnvironment- 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:IChooserEnvironmentChecks which scheme's literal a chosen palette entry sets in the chooser.- Specified by:
isDarkSchemein interfaceIChooserEnvironment- Returns:
- true for the dark scheme, false for the light one.
getColors
The roles mapped toApplicationUI's members: the panels' background iswidgetBackground(the light theme's widget background, the dark theme's panel gray), the field background isbackground(white in the light theme, the dark theme's field gray), the frames and shade lines areborder, the cross of an unresolved value isdisabledForeground, the checkerboard isbackgroundandpaleLine(the pale line role: a gray standing out palely from the background in both themes), the diagram marker iswhiteandblack(a contrast pair over any color). Read at each call: the members follow a theme change at run time.- Specified by:
getColorsin interfaceIChooserEnvironment- Returns:
- The colors, never null; the chooser does not dispose of them.