Module com.gluonhq.charm.glisten
Class DefaultOption<T>
- java.lang.Object
-
- com.gluonhq.charm.glisten.control.settings.OptionBase<T>
-
- com.gluonhq.charm.glisten.control.settings.DefaultOption<T>
-
- Type Parameters:
T
- The type of the property of the OptionBase value
- All Implemented Interfaces:
Option<T>
public class DefaultOption<T> extends OptionBase<T>
A convenience class for creating anOptionBase
for use in theSettingsPane
control based on the given property. When an T value is passed, based on the type of that value, a Property is created and based on it, a proper editor will be selected. Developers can override this, and provide their own editor- Since:
- 2.0.0
- See Also:
OptionBase
,SettingsPane
-
-
Field Summary
-
Fields inherited from class com.gluonhq.charm.glisten.control.settings.OptionBase
caption, category, children, description, editorFactory, extendedDescription, graphic, isEditable, layout, stringConverter, value
-
-
Constructor Summary
Constructors Constructor Description DefaultOption(String caption)
Creates an option instance, without graphic and without editor.DefaultOption(String caption, String description, String category)
Creates an option instance, without graphic and without editor, intended to open a new view with a new group of sub-options, that are set callingOption.getChildren()
DefaultOption(String caption, String description, String category, T value, boolean isEditable)
Creates an option instance, without graphic and with default editor, based on the values set for the optionDefaultOption(String caption, String description, String category, T value, boolean isEditable, Function<Option<T>,OptionEditor<T>> editorFactory)
Creates an option instance, without graphic and with custom editor, based on the values set for the optionDefaultOption(Node graphic, String caption, String description, String category)
Creates an option instance, with graphic and without editor, intended to open a new view with a new group of sub-options, that are set callingOption.getChildren()
DefaultOption(Node graphic, String caption, String description, String category, T value, boolean isEditable)
Creates an option instance, with graphic and with default editor, based on the values set for the optionDefaultOption(Node graphic, String caption, String description, String category, T value, boolean isEditable, Function<Option<T>,OptionEditor<T>> editorFactory)
Creates an option instance, with graphic and with custom editor, based on the values set for the option
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Property<T>
valueProperty()
Returns the underlyingProperty
, where one exists, that the editor can monitor for changes.-
Methods inherited from class com.gluonhq.charm.glisten.control.settings.OptionBase
editorFactoryProperty, getCaption, getCategory, getChildren, getDescription, getExtendedDescription, getGraphic, getId, getLayout, getStringConverter, idProperty, isEditable, setExtendedDescription, setId, setLayout, setStringConverter, valueProperty
-
-
-
-
Property Detail
-
value
public Property<T> valueProperty
Returns the underlyingProperty
, where one exists, that the editor can monitor for changes.- Specified by:
valueProperty
in interfaceOption<T>
- Specified by:
valueProperty
in classOptionBase<T>
-
-
Constructor Detail
-
DefaultOption
public DefaultOption(String caption)
Creates an option instance, without graphic and without editor. Using the captionOption.SEPARATOR
will create a Separator. Otherwise it will create an empty option- Parameters:
caption
- aString
, usuallyOption.SEPARATOR
-
DefaultOption
public DefaultOption(String caption, String description, String category)
Creates an option instance, without graphic and without editor, intended to open a new view with a new group of sub-options, that are set callingOption.getChildren()
-
DefaultOption
public DefaultOption(Node graphic, String caption, String description, String category)
Creates an option instance, with graphic and without editor, intended to open a new view with a new group of sub-options, that are set callingOption.getChildren()
-
DefaultOption
public DefaultOption(String caption, String description, String category, T value, boolean isEditable)
Creates an option instance, without graphic and with default editor, based on the values set for the option
-
DefaultOption
public DefaultOption(String caption, String description, String category, T value, boolean isEditable, Function<Option<T>,OptionEditor<T>> editorFactory)
Creates an option instance, without graphic and with custom editor, based on the values set for the option- Parameters:
caption
- aString
a short namedescription
- aString
more descriptivecategory
- aString
indicating the category, in case the option belongs to a groupvalue
- the underlyingProperty
that the editor can monitor for changesisEditable
- if the option is editable or read-onlyeditorFactory
- aFunction
that returns a validOptionEditor
for editing thisOption
-
DefaultOption
public DefaultOption(Node graphic, String caption, String description, String category, T value, boolean isEditable)
Creates an option instance, with graphic and with default editor, based on the values set for the option- Parameters:
graphic
- aNode
with a graphiccaption
- aString
a short namedescription
- aString
more descriptivecategory
- aString
indicating the category, in case the option belongs to a groupvalue
- the underlyingProperty
that the editor can monitor for changesisEditable
- if the option is editable or read-only
-
DefaultOption
public DefaultOption(Node graphic, String caption, String description, String category, T value, boolean isEditable, Function<Option<T>,OptionEditor<T>> editorFactory)
Creates an option instance, with graphic and with custom editor, based on the values set for the option- Parameters:
graphic
- aNode
with a graphiccaption
- aString
a short namedescription
- aString
more descriptivecategory
- aString
indicating the category, in case the option belongs to a groupvalue
- the underlyingProperty
that the editor can monitor for changesisEditable
- if the option is editable or read-onlyeditorFactory
- aFunction
that returns a validOptionEditor
for editing thisOption
-
-
Method Detail
-
valueProperty
public Property<T> valueProperty()
Returns the underlyingProperty
, where one exists, that the editor can monitor for changes.- Specified by:
valueProperty
in interfaceOption<T>
- Specified by:
valueProperty
in classOptionBase<T>
-
-