Class PaletteEntries
java.lang.Object
com.iizigo.prop.editor.color.swt.PaletteEntries
The entries of the Palette tab of the SWT color chooser (CC-COLOR-CHOOSER-SWT-PANELS, 2026-10-10; the list the Swing
PaletteChooserPanel shows, THEME-DESIGN section 5, phase B3): the platform roles, then every loaded module's palette colors in their folders and its palettes with their members, each with what it resolves to in the light and the dark scheme. Choosing an entry selects that literal and records the reference, which the color dialog and the drop-down hand back as a referenced GColor.The reference is written the way a holder in the context's module would write it: a bare name for a role, a module-relative path for a color of the same module, a module-qualified path for a color of another module.
Pure functions of their arguments: nothing else is read, so the test fragment can call them headless across the bundle boundary.
- Author:
- Christopher Mindus
Nested Class Summary
Nested ClassesField Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe literal shown for an entry that does not resolve: magenta.Method Summary
Modifier and TypeMethodDescriptionstatic List<PaletteEntries.Entry> entries(Collection<? extends PropCnr> moduleRoots, GProp<?> context, PropCnr basePalette) Builds the entries: the roles, then per module its palette colors by folder and its palettes by member, in display order.static Stringhex(int argb, boolean resolved) Formats the hex shown beside an entry:#RRGGBB, or-for an unresolved value.static StringreferenceFor(GProp<?> context, PaletteColor pc) Gets the reference a holder of a context writes for a palette color: module-relative in the same module, module-qualified otherwise.
Field Details
UNRESOLVED_MARKER
public static final int UNRESOLVED_MARKERThe literal shown for an entry that does not resolve: magenta.- See Also:
Method Details
referenceFor
Gets the reference a holder of a context writes for a palette color: module-relative in the same module, module-qualified otherwise.- Parameters:
context- A property of the tree the color is written in, or null.pc- The palette color.
entries
public static List<PaletteEntries.Entry> entries(Collection<? extends PropCnr> moduleRoots, GProp<?> context, PropCnr basePalette) Builds the entries: the roles, then per module its palette colors by folder and its palettes by member, in display order.- Parameters:
moduleRoots- The loaded module roots.context- A property of the tree the color is written in, or null.basePalette- The base palette of the family shown, or null.- Returns:
- The entries, never null.
hex
Formats the hex shown beside an entry:#RRGGBB, or-for an unresolved value.