public abstract class Field<F extends Field> extends Object
Type | Property and Description |
---|---|
BooleanProperty |
changed |
BooleanProperty |
editable |
ListProperty<String> |
errorMessages
The results of the field's validation is stored in this property.
|
StringProperty |
id
Fields can be styled using CSS through ID or class hooks.
|
StringProperty |
label
The label acts as a description for the field.
|
StringProperty |
placeholder
The placeholder is only visible in an empty field.
|
BooleanProperty |
required |
IntegerProperty |
span |
ListProperty<String> |
styleClass |
StringProperty |
tooltip
The tooltip is an extension of the label.
|
BooleanProperty |
valid
The field's current state is represented by the value properties, as
well as by the
valid and changed flags. |
Modifier and Type | Method and Description |
---|---|
BooleanProperty |
changedProperty() |
F |
editable(boolean newValue)
Sets the editable property of the current field.
|
BooleanProperty |
editableProperty() |
ListProperty<String> |
errorMessagesProperty()
The results of the field's validation is stored in this property.
|
List<String> |
getErrorMessages()
Gets the value of the property errorMessages.
|
String |
getID() |
String |
getLabel()
Gets the value of the property label.
|
String |
getPlaceholder()
Gets the value of the property placeholder.
|
SimpleControl<F> |
getRenderer() |
int |
getSpan()
Gets the value of the property span.
|
ObservableList<String> |
getStyleClass()
Gets the value of the property styleClass.
|
String |
getTooltip()
Gets the value of the property tooltip.
|
boolean |
hasChanged() |
F |
id(String newValue)
Sets the id property of the current field.
|
StringProperty |
idProperty()
Fields can be styled using CSS through ID or class hooks.
|
boolean |
isEditable()
Gets the value of the property editable.
|
boolean |
isI18N() |
boolean |
isRequired()
Gets the value of the property required.
|
boolean |
isValid()
Gets the value of the property valid.
|
F |
label(String newValue)
Sets the label property of the current field.
|
StringProperty |
labelProperty()
The label acts as a description for the field.
|
static BooleanField |
ofBooleanType(boolean defaultValue)
Creates a new
BooleanField with the given default value. |
static BooleanField |
ofBooleanType(BooleanProperty binding)
Creates a new
BooleanField with the given property. |
static DoubleField |
ofDoubleType(double defaultValue)
Creates a new
DoubleField with the given default value. |
static DoubleField |
ofDoubleType(DoubleProperty binding)
Creates a new
DoubleField with the given property. |
static IntegerField |
ofIntegerType(int defaultValue)
Creates a new
IntegerField with the given default value. |
static IntegerField |
ofIntegerType(IntegerProperty binding)
Creates a new
IntegerField with the given property. |
static <T> MultiSelectionField<T> |
ofMultiSelectionType(List<T> items)
Creates a new
MultiSelectionField with the given items and no
pre-defined selection. |
static <T> MultiSelectionField<T> |
ofMultiSelectionType(List<T> items,
List<Integer> selection)
Creates a new
MultiSelectionField with the given items and a
pre-defined selection. |
static <T> MultiSelectionField |
ofMultiSelectionType(ListProperty<T> itemsBinding,
ListProperty<T> selectionBinding)
Creates a new
MultiSelectionField with the given properties for
items and selection. |
static <T> SingleSelectionField<T> |
ofSingleSelectionType(List<T> items)
Creates a new
SingleSelectionField with the given items and no
pre-defined selection. |
static <T> SingleSelectionField<T> |
ofSingleSelectionType(List<T> items,
int selection)
Creates a new
SingleSelectionField with the given items and a
pre-defined selection. |
static <T> SingleSelectionField<T> |
ofSingleSelectionType(ListProperty<T> itemsBinding,
ObjectProperty<T> selectionBinding)
Creates a new
SingleSelectionField with the given properties for
items and selection. |
static StringField |
ofStringType(String defaultValue)
Creates a new
StringField with the given default value. |
static StringField |
ofStringType(StringProperty binding)
Creates a new
StringField with the given property. |
F |
placeholder(String newValue)
Sets the placeholder property of the current field.
|
StringProperty |
placeholderProperty()
The placeholder is only visible in an empty field.
|
F |
render(SimpleControl<F> newValue)
Sets the control that renders this field.
|
F |
required(boolean newValue)
Sets the required property to for the current field without providing an
error message.
|
F |
required(String errorMessage)
Sets the required property to true for the current field.
|
BooleanProperty |
requiredProperty() |
F |
span(ColSpan newValue)
Sets the amount of columns the field takes up inside the section grid.
|
F |
span(int newValue)
Sets the amount of columns the field takes up inside the section grid.
|
IntegerProperty |
spanProperty() |
F |
styleClass(String... newValue)
Sets the style classes for the current field.
|
ListProperty<String> |
styleClassProperty() |
F |
tooltip(String newValue)
Sets the tooltip property of the current field.
|
StringProperty |
tooltipProperty()
The tooltip is an extension of the label.
|
BooleanProperty |
validProperty()
The field's current state is represented by the value properties, as
well as by the
valid and changed flags. |
public StringProperty placeholderProperty
TranslationService
is set on
the containing form.getPlaceholder()
public StringProperty labelProperty
TranslationService
is set on
the containing form.getLabel()
public StringProperty tooltipProperty
TranslationService
is set on
the containing form.getTooltip()
public BooleanProperty validProperty
valid
and changed
flags.isValid()
public BooleanProperty changedProperty
public BooleanProperty requiredProperty
isRequired()
public BooleanProperty editableProperty
isEditable()
public IntegerProperty spanProperty
getSpan()
public StringProperty idProperty
public ListProperty<String> styleClassProperty
getStyleClass()
public ListProperty<String> errorMessagesProperty
TranslationService
is set on
the containing form.getErrorMessages()
public static StringField ofStringType(String defaultValue)
StringField
with the given default value.defaultValue
- The initial value and persistent value of the field.StringField
.public static StringField ofStringType(StringProperty binding)
StringField
with the given property.binding
- The property from the model to be bound with.StringField
.public static DoubleField ofDoubleType(double defaultValue)
DoubleField
with the given default value.defaultValue
- The initial value and persistent value of the field.DoubleField
.public static DoubleField ofDoubleType(DoubleProperty binding)
DoubleField
with the given property.binding
- The property from the model to be bound with.DoubleField
.public static IntegerField ofIntegerType(int defaultValue)
IntegerField
with the given default value.defaultValue
- The initial value and persistent value of the field.IntegerField
.public static IntegerField ofIntegerType(IntegerProperty binding)
IntegerField
with the given property.binding
- The property from the model to be bound with.IntegerField
.public static BooleanField ofBooleanType(boolean defaultValue)
BooleanField
with the given default value.defaultValue
- The initial value and persistent value of the field.BooleanField
.public static BooleanField ofBooleanType(BooleanProperty binding)
BooleanField
with the given property.binding
- The property from the model to be bound with.BooleanField
.public static <T> MultiSelectionField<T> ofMultiSelectionType(List<T> items, List<Integer> selection)
MultiSelectionField
with the given items and a
pre-defined selection.items
- The list of available items on the field.selection
- The pre-defined indices of the selected items.MultiSelectionField
.public static <T> MultiSelectionField<T> ofMultiSelectionType(List<T> items)
MultiSelectionField
with the given items and no
pre-defined selection.items
- The list of available items on the field.MultiSelectionField
.public static <T> MultiSelectionField ofMultiSelectionType(ListProperty<T> itemsBinding, ListProperty<T> selectionBinding)
MultiSelectionField
with the given properties for
items and selection.itemsBinding
- The items property to be bound with.selectionBinding
- The selection property to be bound with.MultiSelectionField
.public static <T> SingleSelectionField<T> ofSingleSelectionType(List<T> items, int selection)
SingleSelectionField
with the given items and a
pre-defined selection.items
- The list of available items on the field.selection
- The pre-defined index of the selected item.SingleSelectionField
.public static <T> SingleSelectionField<T> ofSingleSelectionType(List<T> items)
SingleSelectionField
with the given items and no
pre-defined selection.items
- The list of available items on the field.SingleSelectionField
.public static <T> SingleSelectionField<T> ofSingleSelectionType(ListProperty<T> itemsBinding, ObjectProperty<T> selectionBinding)
SingleSelectionField
with the given properties for
items and selection.itemsBinding
- The items property to be bound with.selectionBinding
- The selection property to be bound with.SingleSelectionField
.public F required(boolean newValue)
newValue
- The new state of the required property.public F required(String errorMessage)
errorMessage
- The error message if the field is not filled in.public F editable(boolean newValue)
newValue
- The new value for the editable property.public F label(String newValue)
newValue
- The new value for the label property. This can be the label
itself or a key that is then used for translation.TranslationService
public F tooltip(String newValue)
newValue
- The new value for the tooltip property. This can be the
label itself or a key that is then used for translation.TranslationService
public F placeholder(String newValue)
newValue
- The new value for the placeholder property. This can be the
label itself or a key that is then used for translation.TranslationService
public F id(String newValue)
newValue
- The new value for the id property.public F styleClass(String... newValue)
newValue
- The new style classes.public F render(SimpleControl<F> newValue)
newValue
- The new control to render the field.public F span(int newValue)
newValue
- The new number of columns.public F span(ColSpan newValue)
newValue
- The new span fraction.public String getPlaceholder()
public StringProperty placeholderProperty()
TranslationService
is set on
the containing form.getPlaceholder()
public String getLabel()
public StringProperty labelProperty()
TranslationService
is set on
the containing form.getLabel()
public String getTooltip()
public StringProperty tooltipProperty()
TranslationService
is set on
the containing form.getTooltip()
public boolean isValid()
public BooleanProperty validProperty()
valid
and changed
flags.isValid()
public boolean hasChanged()
public BooleanProperty changedProperty()
public boolean isRequired()
public BooleanProperty requiredProperty()
isRequired()
public boolean isEditable()
public BooleanProperty editableProperty()
isEditable()
public boolean isI18N()
public int getSpan()
public IntegerProperty spanProperty()
getSpan()
public String getID()
public StringProperty idProperty()
public ObservableList<String> getStyleClass()
public ListProperty<String> styleClassProperty()
getStyleClass()
public SimpleControl<F> getRenderer()
public List<String> getErrorMessages()
public ListProperty<String> errorMessagesProperty()
TranslationService
is set on
the containing form.getErrorMessages()
Copyright © 2017. All rights reserved.