Package docking.theme.gui
Class ThemeValueEditor<T>
java.lang.Object
docking.theme.gui.ThemeValueEditor<T>
- Type Parameters:
T
- the base property (Color, Font, or Icon)
- Direct Known Subclasses:
ColorValueEditor
,FontValueEditor
,IconValueEditor
Base class for Theme property Editors (Colors, Fonts, and Icons)
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
ThemeValueEditor
(String typeName, PropertyChangeListener listener, PropertyEditor editor) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ThemeValue
<T> createNewThemeValue
(String id, T newValue) Factory method for creating the ThemeValue of the correct type.void
editValue
(ThemeValue<T> themeValue) Edits the ThemeValue by invoking the appropriate dialog for editing the typeprotected abstract T
getRawValue
(String id) Returns the actual value (Color, Font, or Icon)protected void
Called when the user has pressed ok.
-
Field Details
-
currentThemeValue
-
editor
-
-
Constructor Details
-
ThemeValueEditor
Constructor- Parameters:
typeName
- the name of the type (Used in the dialog title)listener
- thePropertyChangeListener
to be notified for changeseditor
- the standard property editor for the type
-
-
Method Details
-
editValue
Edits the ThemeValue by invoking the appropriate dialog for editing the type- Parameters:
themeValue
- the value to be edited
-
storeState
protected void storeState()Called when the user has pressed ok. This allows sub-classes to store any state for future dialog invocations. -
getRawValue
Returns the actual value (Color, Font, or Icon)- Parameters:
id
- the theme property id for the value- Returns:
- the current stored value for the id
-
createNewThemeValue
Factory method for creating the ThemeValue of the correct type.- Parameters:
id
- the id for theme propertynewValue
- the new value for the underlying type (Color, Font, or Icon)- Returns:
- the new ThemeValue for the type
-