T
- The type of the property of the OptionBase value@IDProperty(value="id") public abstract class OptionBase<T> extends java.lang.Object implements Option<T>
SettingsPane
control.
Typically it contains:
Property
associated to this Option
But this can be modified:
getExtendedDescription()
returns a non empty extended description,
the editor and this description will be shown in a secondary View
getChildren()
is not empty, the observable list of options
will be shown in a secondary View
Type | Property and Description |
---|---|
java.util.Optional<java.util.function.Function<Option<T>,OptionEditor<T>>> |
editorFactory
Returns an
Optional of a Function
that returns an instance of the OptionEditor that should be used for
editing this Option |
javafx.beans.property.StringProperty |
id
The id of this
Option . |
abstract javafx.beans.property.Property<T> |
value
Returns the underlying
Property , where one exists,
that the editor can monitor for changes. |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
caption
Private fields
|
protected java.lang.String |
category |
protected javafx.collections.ObservableList<Option> |
children |
protected java.lang.String |
description |
protected java.util.function.Function<Option<T>,OptionEditor<T>> |
editorFactory |
protected java.lang.String |
extendedDescription |
protected javafx.scene.Node |
graphic |
protected boolean |
isEditable |
protected javafx.geometry.Orientation |
layout |
protected javafx.util.StringConverter<T> |
stringConverter |
protected javafx.beans.property.Property<T> |
value |
Modifier | Constructor and Description |
---|---|
protected |
OptionBase(javafx.scene.Node graphic,
java.lang.String caption,
java.lang.String description,
java.lang.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 calling
Option.getChildren() |
protected |
OptionBase(javafx.scene.Node graphic,
java.lang.String caption,
java.lang.String description,
java.lang.String category,
javafx.beans.property.Property<T> value,
boolean isEditable)
Creates an option instance, with graphic and with default editor, based on the
values set for the option
|
protected |
OptionBase(javafx.scene.Node graphic,
java.lang.String caption,
java.lang.String description,
java.lang.String category,
javafx.beans.property.Property<T> value,
boolean isEditable,
java.util.function.Function<Option<T>,OptionEditor<T>> editorFactory)
Creates an option instance, with graphic and with custom editor, based on the
values set for the option
|
protected |
OptionBase(java.lang.String caption)
Creates an option instance, without graphic and without editor.
|
protected |
OptionBase(java.lang.String caption,
java.lang.String description,
java.lang.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 calling
Option.getChildren() |
protected |
OptionBase(java.lang.String caption,
java.lang.String description,
java.lang.String category,
javafx.beans.property.Property<T> value,
boolean isEditable)
Creates an option instance, without graphic and with default editor, based on the
values set for the option
|
protected |
OptionBase(java.lang.String caption,
java.lang.String description,
java.lang.String category,
javafx.beans.property.Property<T> value,
boolean isEditable,
java.util.function.Function<Option<T>,OptionEditor<T>> editorFactory)
Creates an option instance, without graphic and with custom editor, based on the
values set for the option
|
Modifier and Type | Method and Description |
---|---|
java.util.Optional<java.util.function.Function<Option<T>,OptionEditor<T>>> |
editorFactoryProperty()
Returns an
Optional of a Function
that returns an instance of the OptionEditor that should be used for
editing this Option |
java.lang.String |
getCaption()
Returns the display name of the property associated to the
Option
or the name associated to the group of options. |
java.lang.String |
getCategory()
Returns a
String representation of the category of the property. |
javafx.collections.ObservableList<Option> |
getChildren()
Returns the
ObservableList of sub-options
that a given option contains. |
java.lang.String |
getDescription()
A
String that will be shown to the user as a tooltip. |
java.util.Optional<java.lang.String> |
getExtendedDescription()
A long
String that will be shown to the user in an extended view. |
java.util.Optional<javafx.scene.Node> |
getGraphic()
Returns an
Optional with the node that will be displayed as a graphic on
the left side of the option if not empty |
java.lang.String |
getId()
Gets the value of the property id.
|
javafx.geometry.Orientation |
getLayout()
Returns the
Orientation of the Option , that
defines its layout:
Orientation.HORIZONTAL sets an horizontal layout, with an optional
graphic on the left, caption and description on the center, and editor on the
right. |
java.util.Optional<javafx.util.StringConverter<T>> |
getStringConverter()
Returns an
Optional of a StringConverter
that can be applied to the value |
javafx.beans.property.StringProperty |
idProperty()
The id of this
Option . |
boolean |
isEditable()
Indicates whether the
SettingsPane
control should allow editing this option, or whether it is read-only. |
void |
setExtendedDescription(java.lang.String value)
Sets the long
String description that will be shown to the user in
an extended View |
void |
setId(java.lang.String id)
Sets the value of the property id.
|
void |
setLayout(javafx.geometry.Orientation layout)
Defines the type of layout to apply to the
Option |
void |
setStringConverter(javafx.util.StringConverter value)
Sets the
StringConverter that can be applied to the
used to convert the value of the underlaying Property of
this option |
abstract javafx.beans.property.Property<T> |
valueProperty()
Returns the underlying
Property , where one exists,
that the editor can monitor for changes. |
static <T> javafx.beans.property.Property<T> |
valueProperty(T value)
Allows wrapping primitives into a read-only
Property |
public abstract javafx.beans.property.Property<T> valueProperty
Property
, where one exists,
that the editor can monitor for changes.valueProperty
in interface Option<T>
public java.util.Optional<java.util.function.Function<Option<T>,OptionEditor<T>>> editorFactoryProperty
Optional
of a Function
that returns an instance of the OptionEditor
that should be used for
editing this Option
editorFactoryProperty
in interface Option<T>
public final javafx.beans.property.StringProperty idProperty
Option
. This simple string identifier is useful for
finding a specific Option within the scene graph. While the id of a Option
should be unique within the scene graph, this uniqueness is not enforced.
This is analogous to the "id" attribute on an HTML element
(CSS ID Specification).
For example, if a Option is given the id of "myId", then the lookup method can
be used to find this option as follows: scene.lookup("#myId");
.
getId()
,
setId(String)
protected java.lang.String caption
protected java.lang.String description
protected java.lang.String category
protected javafx.scene.Node graphic
protected javafx.beans.property.Property<T> value
protected boolean isEditable
protected java.util.function.Function<Option<T>,OptionEditor<T>> editorFactory
protected java.lang.String extendedDescription
protected javafx.collections.ObservableList<Option> children
protected javafx.util.StringConverter<T> stringConverter
protected javafx.geometry.Orientation layout
protected OptionBase(java.lang.String caption)
Option.SEPARATOR
will create a Separator. Otherwise
it will create an empty optioncaption
- a String
, usually Option.SEPARATOR
protected OptionBase(java.lang.String caption, java.lang.String description, java.lang.String category)
Option.getChildren()
caption
- a String
a short namedescription
- a String
more descriptivecategory
- a String
indicating the category, in case the option
belongs to a groupprotected OptionBase(javafx.scene.Node graphic, java.lang.String caption, java.lang.String description, java.lang.String category)
Option.getChildren()
graphic
- a Node
with a graphiccaption
- a String
a short namedescription
- a String
more descriptivecategory
- a String
indicating the category, in case the option
belongs to a groupprotected OptionBase(java.lang.String caption, java.lang.String description, java.lang.String category, javafx.beans.property.Property<T> value, boolean isEditable)
caption
- a String
a short namedescription
- a String
more descriptivecategory
- a String
indicating the category, in case the option
belongs to a groupvalue
- the underlying Property
that the editor can monitor for changesisEditable
- if the option is editable or read-onlyprotected OptionBase(java.lang.String caption, java.lang.String description, java.lang.String category, javafx.beans.property.Property<T> value, boolean isEditable, java.util.function.Function<Option<T>,OptionEditor<T>> editorFactory)
caption
- a String
a short namedescription
- a String
more descriptivecategory
- a String
indicating the category, in case the option
belongs to a groupvalue
- the underlying Property
that the editor can monitor for changesisEditable
- if the option is editable or read-onlyeditorFactory
- a Function
that returns a valid
OptionEditor
for editing this Option
protected OptionBase(javafx.scene.Node graphic, java.lang.String caption, java.lang.String description, java.lang.String category, javafx.beans.property.Property<T> value, boolean isEditable)
graphic
- a Node
with a graphiccaption
- a String
a short namedescription
- a String
more descriptivecategory
- a String
indicating the category, in case the option
belongs to a groupvalue
- the underlying Property
that the editor can monitor for changesisEditable
- if the option is editable or read-onlyprotected OptionBase(javafx.scene.Node graphic, java.lang.String caption, java.lang.String description, java.lang.String category, javafx.beans.property.Property<T> value, boolean isEditable, java.util.function.Function<Option<T>,OptionEditor<T>> editorFactory)
graphic
- a Node
with a graphiccaption
- a String
a short namedescription
- a String
more descriptivecategory
- a String
indicating the category, in case the option
belongs to a groupvalue
- the underlying Property
that the editor can monitor for changesisEditable
- if the option is editable or read-onlyeditorFactory
- a Function
that returns a valid
OptionEditor
for editing this Option
public java.util.Optional<javafx.scene.Node> getGraphic()
Optional
with the node that will be displayed as a graphic on
the left side of the option if not emptygetGraphic
in interface Option<T>
Optional
with a Node
if not emptypublic java.lang.String getCaption()
Option
or the name associated to the group of options.
It should be short (i.e. less than two words). This is used to explain to the
end user what the option represents.getCaption
in interface Option<T>
String
with the name or caption of the Option
public java.lang.String getDescription()
String
that will be shown to the user as a tooltip. This allows for
a longer form of detail than what is possible with the Option.getCaption()
method.getDescription
in interface Option<T>
String
with the description of the Option
public java.util.Optional<java.lang.String> getExtendedDescription()
String
that will be shown to the user in an extended view. This allows for
a longer form of detail than what is possible with the Option.getCaption()
method.getExtendedDescription
in interface Option<T>
String
with an extended description of the Option
if
not emptypublic void setExtendedDescription(java.lang.String value)
String
description that will be shown to the user in
an extended View
value
- a String
with a long descriptionpublic java.lang.String getCategory()
String
representation of the category of the property. This
is relevant when properties with the same category can be grouped together
visually.getCategory
in interface Option<T>
String
with the category of the Option
public abstract javafx.beans.property.Property<T> valueProperty()
Property
, where one exists,
that the editor can monitor for changes.valueProperty
in interface Option<T>
public java.util.Optional<java.util.function.Function<Option<T>,OptionEditor<T>>> editorFactoryProperty()
Optional
of a Function
that returns an instance of the OptionEditor
that should be used for
editing this Option
editorFactoryProperty
in interface Option<T>
public boolean isEditable()
SettingsPane
control should allow editing this option, or whether it is read-only.isEditable
in interface Option<T>
public javafx.collections.ObservableList<Option> getChildren()
ObservableList
of sub-options
that a given option contains.getChildren
in interface Option<T>
ObservableList
with options
public void setStringConverter(javafx.util.StringConverter value)
StringConverter
that can be applied to the
used to convert the value of the underlaying Property
of
this optionvalue
- the StringConverter
public java.util.Optional<javafx.util.StringConverter<T>> getStringConverter()
Optional
of a StringConverter
that can be applied to the valuegetStringConverter
in interface Option<T>
Optional
with a StringConverter
if not emptypublic static <T> javafx.beans.property.Property<T> valueProperty(T value)
Property
T
- The primitive typevalue
- The value to be setProperty
public javafx.geometry.Orientation getLayout()
Orientation
of the Option
, that
defines its layout:
Orientation.HORIZONTAL
sets an horizontal layout, with an optional
graphic on the left, caption and description on the center, and editor on the
right.
Orientation.VERTICAL
sets a vertical layout, with an optional
graphic on the left, caption on top and editor on bottom.
Orientation.HORIZONTAL
public void setLayout(javafx.geometry.Orientation layout)
Option
layout
- the Orientation
typepublic final javafx.beans.property.StringProperty idProperty()
Option
. This simple string identifier is useful for
finding a specific Option within the scene graph. While the id of a Option
should be unique within the scene graph, this uniqueness is not enforced.
This is analogous to the "id" attribute on an HTML element
(CSS ID Specification).
For example, if a Option is given the id of "myId", then the lookup method can
be used to find this option as follows: scene.lookup("#myId");
.
getId()
,
setId(String)
public final void setId(java.lang.String id)
Option
. This simple string identifier is useful for
finding a specific Option within the scene graph. While the id of a Option
should be unique within the scene graph, this uniqueness is not enforced.
This is analogous to the "id" attribute on an HTML element
(CSS ID Specification).
For example, if a Option is given the id of "myId", then the lookup method can
be used to find this option as follows: scene.lookup("#myId");
.
public final java.lang.String getId()
Option
. This simple string identifier is useful for
finding a specific Option within the scene graph. While the id of a Option
should be unique within the scene graph, this uniqueness is not enforced.
This is analogous to the "id" attribute on an HTML element
(CSS ID Specification).
For example, if a Option is given the id of "myId", then the lookup method can
be used to find this option as follows: scene.lookup("#myId");
.