Class PaletteTab
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
com.iizigo.prop.editor.color.swt.PaletteTab
- All Implemented Interfaces:
Drawable
The Palette tab of the SWT color chooser (CC-COLOR-CHOOSER-SWT-PANELS, 2026-10-10): the
PaletteEntries in a table of three columns (the header hidden) - a group as a bold header in the first column that cannot be chosen, an entry with its two swatches (light, dark) and its path in the first column, its light hex value in the second and its dark hex value in the third, so that the values align (CC-COLOR-CHOOSER-SWT-SWITCH, the owner's addition of 2026-10-10; the first version wrote path and values into one cell). Choosing an entry sets the literal of the Designer's saved scheme in the chooser and records the reference; a change of the color made elsewhere clears the selection, and with it the reference. The swatch images paint on the theme's field background with a frame in its border color and an unresolved value's cross in its disabled foreground (ChooserColors, CC-FIX-COLOR-CHOOSER-DARK); the table itself is themed by Eclipse.- Author:
- Christopher Mindus
Field Summary
Constructor Summary
ConstructorsConstructorDescriptionPaletteTab(Composite parent, ColorChooserComposite chooser, List<PaletteEntries.Entry> entries, boolean isDark, String currentRef, Font font, int fontHeight, ChooserColors colors) Creates the tab.Method Summary
Modifier and TypeMethodDescriptionvoidClears the selection: the chooser's color was changed elsewhere.Gets the entries shown, one per table item.getHint()Gets the hint label.Gets the entry chosen, null for none.getTable()Gets the table.booleanSelects the entry of a reference as the user would: the chooser gets its literal and the reference.Methods inherited from class Composite
changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, redraw, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toStringMethods inherited from class Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsModeMethods inherited from class Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setAutoscalingMode, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, updateMethods inherited from class Widget
addDisposeListener, addListener, addTypedListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setDataMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Drawable
isAutoScalable
Constructor Details
PaletteTab
public PaletteTab(Composite parent, ColorChooserComposite chooser, List<PaletteEntries.Entry> entries, boolean isDark, String currentRef, Font font, int fontHeight, ChooserColors colors) Creates the tab.- Parameters:
parent- The parent.chooser- The chooser.entries- The entries in display order.isDark- true to set the dark scheme's literal when an entry is chosen.currentRef- The reference to preselect, or null.font- The dialog font, or null for the default.fontHeight- The height of the dialog font's metrics in points, for the swatch size.colors- The theme colors: this page's background, and of the swatch images the field background, the border for the frame, the disabled foreground for an unresolved value's cross.
Method Details
getTable
Gets the table.getHint
Gets the hint label.getEntries
Gets the entries shown, one per table item.getSelectedEntry
Gets the entry chosen, null for none.select
Selects the entry of a reference as the user would: the chooser gets its literal and the reference.- Parameters:
ref- The reference.- Returns:
- true if an entry holds the reference.
clearSelection
public void clearSelection()Clears the selection: the chooser's color was changed elsewhere.