Top Description Fields Constructors Methods
com.dlsc.preferencesfx.model

public Class Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

extends Object
Class Inheritance
Imports
com.dlsc.formsfx.model.structure.DataField, .Element, .Field, .NodeElement, com.dlsc.formsfx.model.validators.Validator, com.dlsc.preferencesfx.formsfx.view.controls.DoubleSliderControl, .IntegerSliderControl, .SimpleChooserControl, .SimpleColorPickerControl, .SimpleComboBoxControl, .SimpleControl, .SimpleDoubleControl, .SimpleIntegerControl, .SimpleListViewControl, .SimpleTextControl, .ToggleControl, com.dlsc.preferencesfx.util.Constants, .VisibilityProperty, .StorageHandler, java.io.File, java.util.Objects, javafx.beans.property.BooleanProperty, .DoubleProperty, .IntegerProperty, .ListProperty, .ObjectProperty, .Property, .SimpleListProperty, .SimpleStringProperty, .StringProperty, javafx.collections.ObservableList, javafx.event.EventHandler, javafx.scene.Node, javafx.scene.control.Slider, .TextField, javafx.scene.input.MouseEvent, javafx.scene.paint.Color, javafx.util.StringConverter, org.slf4j.Logger, .LoggerFactory

Represents a setting, which holds the field to be displayed and the property which is bound.
Authors
François Martin, Marco Sanfratello

Field Summary

Modifier and TypeField and Description
private String
private E
private String
private static final Logger
private boolean
public static final String
private final EventHandler<MouseEvent>
private P

Constructor Summary

AccessConstructor and Description
protected
Setting(String description, E element, P value)

Method Summary

Modifier and TypeMethod and Description
public void
addToBreadcrumb(String
the breadcrumb to add to this group's breadcrumb
breadCrumb
)

Adds the breadCrumb to this breadcrumb and updates all of its settings accordingly.

public Setting<E extends Element<E extends Element<E>>, P extends Property<T>>
applyVisibility(VisibilityProperty
source visibility condition
visibilityProperty
,
boolean
define the visibility condition to be added (ANDed) to the current (if any)
additionalVisibilityCondition
)

Apply VisibilityProperty to renderer (SimpleControl.

public Setting<E extends Element<E extends Element<E>>, P extends Property<T>>
applyVisibility(VisibilityProperty visibilityProperty)

public Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

this Setting
customKey
(String
the string key to be used for the preference
key
)

Sets the Preference key to be used instead of the breadcrumb.

public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public String
public String

Returns:

the description
getDescription
()

Returns the description of this setting or if i18n is used, it will return the translated description in the current locale.

public E
public boolean

Returns:

true if there is a description
hasDescription
()

Returns whether or not this Setting has a description.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean

Returns:

true if value is not null
hasValue
()

Returns whether or not this Setting has a value.

public void
loadSettingValue(StorageHandler
the StorageHandler to use
storageHandler
)

Loads the value of this setting using a StorageHandler.

public void
mark()

Marks a setting.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
BooleanProperty
to be bound, saved / loaded and used for undo / redo
property
)

Constructs a setting of Boolean type, which is represented by a ToggleControl.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>
of(String description, BooleanProperty property, VisibilityProperty visibilityProperty)

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
IntegerProperty
to be bound, saved / loaded and used for undo / redo
property
)

Constructs a setting of Integer type, which is represented by a TextField.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
IntegerProperty
to be bound, saved / loaded and used for undo / redo
property
,
VisibilityProperty
control visibility of element
visibilityProperty
)

Constructs a setting of Integer type, which is represented by a TextField.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
DoubleProperty
to be bound, saved / loaded and used for undo / redo
property
)

Constructs a setting of Double type, which is represented by a TextField.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
DoubleProperty
to be bound, saved / loaded and used for undo / redo
property
,
VisibilityProperty
control visibility of element
visibilityProperty
)

Constructs a setting of Double type, which is represented by a TextField.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
DoubleProperty
to be bound, saved / loaded and used for undo / redo
property
,
double
minimum value of the Slider
min
,
double
maximum value of the Slider
max
,
int
number of digits after the decimal point
precision
)

Constructs a setting of Double type, which is represented by a Slider.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
DoubleProperty
to be bound, saved / loaded and used for undo / redo
property
,
double
minimum value of the Slider
min
,
double
maximum value of the Slider
max
,
int
number of digits after the decimal point
precision
,
VisibilityProperty
control visibility of element
visibilityProperty
)

Constructs a setting of Double type, which is represented by a Slider.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
IntegerProperty
to be bound, saved / loaded and used for undo / redo
property
,
int
minimum value of the Slider
min
,
int
maximum value of the Slider
max
)

Constructs a setting of Integer type, which is represented by a Slider.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
IntegerProperty
to be bound, saved / loaded and used for undo / redo
property
,
int
minimum value of the Slider
min
,
int
maximum value of the Slider
max
,
VisibilityProperty
control visibility of element
visibilityProperty
)

Constructs a setting of Integer type, which is represented by a Slider.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
StringProperty
to be bound, saved / loaded and used for undo / redo
property
)

Constructs a setting of String type, which is represented by a TextField.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
StringProperty
to be bound, saved / loaded and used for undo / redo
property
,
VisibilityProperty
control visibility of element
visibilityProperty
)

Constructs a setting of String type, which is represented by a TextField.

public static <
the type of objects which should be displayed in the combobox
P
>
Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
ListProperty<P>
the items which are possible to choose in the combobox, which are shown in their toString() representation
items
,
ObjectProperty<P>
the currently selected item of the combobox to be bound, saved / loaded and used for undo / redo
selection
)

Creates a combobox with single selection.

public static <
the type of objects which should be displayed in the combobox
P
>
Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
ListProperty<P>
the items which are possible to choose in the combobox, which are shown in their toString() representation
items
,
ObjectProperty<P>
the currently selected item of the combobox to be bound, saved / loaded and used for undo / redo
selection
,
VisibilityProperty
control visibility of element
visibilityProperty
)

Creates a combobox with single selection.

public static <
the type of objects which should be displayed in the combobox
P
>
Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
ObservableList<P>
the items which are possible to choose in the combobox, which are shown in their toString() representation
items
,
ObjectProperty<P>
the currently selected item of the combobox to be bound, saved / loaded and used for undo / redo
selection
)

Creates a combobox with single selection.

public static <
the type of objects which should be displayed in the combobox
P
>
Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
ObservableList<P>
the items which are possible to choose in the combobox, which are shown in their toString() representation
items
,
ObjectProperty<P>
the currently selected item of the combobox to be bound, saved / loaded and used for undo / redo
selection
,
VisibilityProperty
control visibility of element
visibilityProperty
)

Creates a combobox with single selection.

public static <
the type of objects which should be displayed in the combobox
P
>
Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
ListProperty<P>
the items which are possible to choose in the combobox, which are shown in their toString() representation
items
,
ListProperty<P>
the currently selected item(s) of the combobox to be bound, saved / loaded and used for undo / redo
selections
)

Creates a combobox with multiselection.

public static <
the type of objects which should be displayed in the combobox
P
>
Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
ListProperty<P>
the items which are possible to choose in the combobox, which are shown in their toString() representation
items
,
ListProperty<P>
the currently selected item(s) of the combobox to be bound, saved / loaded and used for undo / redo
selections
,
VisibilityProperty
control visibility of element
visibilityProperty
)

Creates a combobox with multiselection.

public static <
the type of objects which should be displayed in the combobox
P
>
Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
ObservableList<P>
the items which are possible to choose in the combobox, which are shown in their toString() representation
items
,
ListProperty<P>
the currently selected item(s) of the combobox to be bound, saved / loaded and used for undo / redo
selections
)

Creates a combobox with multiselection.

public static <
the type of objects which should be displayed in the combobox
P
>
Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
ObservableList<P>
the items which are possible to choose in the combobox, which are shown in their toString() representation
items
,
ListProperty<P>
the currently selected item(s) of the combobox to be bound, saved / loaded and used for undo / redo
selections
,
VisibilityProperty
control visibility of element
visibilityProperty
)

Creates a combobox with multiselection.

public static <
the field type
F extends Field<F>
,
the property type
P extends Property<T>
>
Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
F
custom Field object from FormsFX
field
,
P
to be bound, saved / loaded and used for undo / redo
property
)

Creates a setting of a custom defined field.

public static <
the node element type
N extends Node
>
Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(N
custom node
node
)

Creates a setting of a custom defined node element.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
ObjectProperty<Color>
the current selected color value
colorProperty
)

Creates a custom color picker control.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
ObjectProperty<Color>
the current selected color value
colorProperty
,
VisibilityProperty
control visibility of element
visibilityProperty
)

Creates a custom color picker control.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
ObjectProperty<File>
the property to which the chosen file / directory should be set to
fileProperty
,
boolean
true, if only directories are allowed
directory
)

Creates a file/directory chooser control.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
ObjectProperty<File>
the property to which the chosen file / directory should be set to
fileProperty
,
File
An optional initial path, can be null. If null, will use the path from the previously chosen file if present.
initialDirectory
,
boolean
true, if only directories are allowed
directory
)

Creates a file/directory chooser control.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
ObjectProperty<File>
the property to which the chosen file / directory should be set to
fileProperty
,
String
text of the button to open the file / directory chooser
buttonText
,
File
An optional initial path, can be null. If null, will use the path from the previously chosen file if present.
initialDirectory
,
boolean
true, if only directories are allowed
directory
)

Creates a file/directory chooser control.

public static Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the constructed setting
of
(String
the title of this setting
description
,
ObjectProperty<File>
the property to which the chosen file / directory should be set to
fileProperty
,
String
text of the button to open the file / directory chooser
buttonText
,
File
An optional initial path, can be null. If null, will use the path from the previously chosen file if present.
initialDirectory
,
boolean
true, if only directories are allowed
directory
,
VisibilityProperty
control visibility of element
visibilityProperty
)

Creates a file/directory chooser control.

public void
saveSettingValue(StorageHandler
the StorageHandler to use
storageHandler
)

Saves the current value of this setting using a StorageHandler.

public void
setBreadcrumb(String breadcrumb)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
unmark()

Unmarks a setting.

public final Setting<E extends Element<E extends Element<E>>, P extends Property<T>>

Returns:

the current setting to allow for chaining
validate
(Validator<T>...
The validators that are to be used for validating this field. Limited to validators that are able to handle the field's underlying type.
newValue
)

Sets the list of validators for the current field.

public P
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait