DataField holds a single value. This value can be represented and
manipulated as a String. It is stored as a concrete type.
| Modifier and Type | Class and Description |
|---|---|
| protected abstract static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final InvalidationListener | externalBindingListener
This listener updates the field when the external binding changes. |
| protected final StringProperty | |
| protected final StringProperty | formatErrorKey
The format error is displayed when the value transformation fails. |
| protected final P | |
| protected StringConverter | |
| protected final StringProperty | |
| protected final List | validators
Every field contains a list of validators. |
| protected final P | value
Every field tracks its value in multiple ways. |
| pack-priv ValueTransformer | valueTransformer
Deprecated
Use DataField#stringConverter instead.
The value transformer is responsible for transforming the user input
string to the specific type of the field's value.
|
| Access | Constructor and Description |
|---|---|
| protected | DataField(P
The property that is used to store the current valid value
of the field. valueProperty, P The property that is used to store the latest persisted
value of the field. persistentValueProperty)Internal constructor for the |
| Modifier and Type | Method and Description |
|---|---|
| public F | Returns: Returns the current field to allow for chaining.The property to be bound with. binding)Binds the given property with the field. |
| public F | Returns: Returns the current field to allow for chaining.The string converter that transforms the user input string to
the field's underlying value and back. newValue)Sets the string converter for the current field. |
| public F | Returns: Returns the current field to allow for chaining.The string converter that transforms the user input string to
the field's underlying value and back. newValue, String The error message to display if the transformation was
unsuccessful. errorMessage)Applies a new string converter that converts the entered string input to a concrete value. |
| public F | Returns: Returns the current field to allow for chaining.The value transformer that parses the user input string to
the field's underlying value. newValue)
Deprecated
Use format(StringConverter) instead
Sets the value transformer for the current field. |
| public F | Returns: Returns the current field to allow for chaining.The new value transformer. Takes a string as an input and
returns the concrete type. newValue, String The error message to display if the transformation was
unsuccessful. errorMessage)
Deprecated
Use format(StringConverter, errorMessage) instead
Applies a new value transformer that converts the entered string input to a concrete value. |
| public F | |
| public String | |
| public V | |
| public void | persist()
Implements com. Stores the field's current value in its persistent value. |
| public void | reset()
Implements com. Sets the field's current value to its persistent value, thus resetting any changes made by the user. |
| public void | setBindingMode(BindingMode
The new binding mode for the current field. newValue)Implements abstract com. Activates or deactivates the |
| public void | translate(TranslationService
The new service to use for translating translatable values. service)Overrides com. This internal method is called by the containing section when a new translation has been added to the form. |
| public F | Returns: Returns the current field to allow for chaining.The property to be unbound with. binding)Unbinds the given property with the field. |
| public StringProperty | |
| public final F | |
| public boolean | Returns: Returns whether the user input is a valid value or not.Implements abstract com. Validates a user input based on the field's value transformer and its validation rules. |
| protected boolean | Returns: Returns whether the input matches the required condition.The new value to check for the required state. newValue)Validates that the new field input matches the required condition. |
| public P |
| externalBindingListener | back to summary |
|---|---|
| private final InvalidationListener externalBindingListener This listener updates the field when the external binding changes. | |
| formatError | back to summary |
|---|---|
| protected final StringProperty formatError | |
| formatErrorKey | back to summary |
|---|---|
| protected final StringProperty formatErrorKey The format error is displayed when the value transformation fails.
This property is translatable if a | |
| persistentValue | back to summary |
|---|---|
| protected final P persistentValue | |
| stringConverter | back to summary |
|---|---|
| protected StringConverter<V> stringConverter | |
| userInput | back to summary |
|---|---|
| protected final StringProperty userInput | |
| validators | back to summary |
|---|---|
| protected final List<Validator<V>> validators Every field contains a list of validators. The validators are limited to the ones that correspond to the field's type. | |
| value | back to summary |
|---|---|
| protected final P value Every field tracks its value in multiple ways. - The user input is bound to a specific control's input value and is a 1-to-1 representation of what the user enters. - The value is the last valid value entered by the user. This means that the value passes the type transformation of the concrete field and all user-defined validations. - The persistent value is the value that was last saved on the field. It is the responsibility of the form creator to persist the field values at the correct time. | |
| valueTransformer | back to summary |
|---|---|
| pack-priv ValueTransformer<V> valueTransformer
Deprecated Use DataField#stringConverter instead. The value transformer is responsible for transforming the user input string to the specific type of the field's value. | |
| DataField | back to summary |
|---|---|
| protected DataField(P valueProperty, P persistentValueProperty) Internal constructor for the
| |
| bind | back to summary |
|---|---|
| public F bind(P binding) Binds the given property with the field.
| |
| format | back to summary |
|---|---|
| public F format(StringConverter<V> newValue) Sets the string converter for the current field.
| |
| format | back to summary |
|---|---|
| public F format(StringConverter<V> newValue, String errorMessage) Applies a new string converter that converts the entered string input to a concrete value.
| |
| format | back to summary |
|---|---|
| public F format(ValueTransformer<V> newValue)
Deprecated Use format(StringConverter) instead Sets the value transformer for the current field.
| |
| format | back to summary |
|---|---|
| public F format(ValueTransformer<V> newValue, String errorMessage)
Deprecated Use format(StringConverter, errorMessage) instead Applies a new value transformer that converts the entered string input to a concrete value.
| |
| format | back to summary |
|---|---|
| public F format(String errorMessage) Adds an error message to handle formatting errors with the default value transformers.
| |
| getUserInput | back to summary |
|---|---|
| public String getUserInput() | |
| getValue | back to summary |
|---|---|
| public V getValue() | |
| persist | back to summary |
|---|---|
| public void persist() Implements com. Stores the field's current value in its persistent value. This stores the user's changes in the model. | |
| reset | back to summary |
|---|---|
| public void reset() Implements com. Sets the field's current value to its persistent value, thus resetting any changes made by the user. | |
| setBindingMode | back to summary |
|---|---|
| public void setBindingMode(BindingMode newValue) Implements abstract com. Doc from com. Activates or deactivates the
| |
| translate | back to summary |
|---|---|
| public void translate(TranslationService service) Overrides com. Doc from com. This internal method is called by the containing section when a new translation has been added to the form.
| |
| unbind | back to summary |
|---|---|
| public F unbind(P binding) Unbinds the given property with the field.
| |
| userInputProperty | back to summary |
|---|---|
| public StringProperty userInputProperty() | |
| validate | back to summary |
|---|---|
| public final F validate(Validator<V>... newValue) Sets the list of validators for the current field. This overrides all validators that have previously been added.
| |
| validate | back to summary |
|---|---|
| public boolean validate() Implements abstract com. Validates a user input based on the field's value transformer and its
validation rules. Also considers the
| |
| validateRequired | back to summary |
|---|---|
| protected boolean validateRequired(String newValue) Validates that the new field input matches the required condition.
| |
| valueProperty | back to summary |
|---|---|
| public P valueProperty() | |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public String | toString(V
the object of type object)T to convertImplements abstract javafx. Converts the object provided into its string form. |
| AbstractStringConverter | back to summary |
|---|---|
| protected AbstractStringConverter() | |
| toString | back to summary |
|---|---|
| public String toString(V object) Implements abstract javafx. Doc from javafx. Converts the object provided into its string form. Format of the returned string is defined by the specific converter. | |
| Modifier and Type | Field and Description |
|---|---|
| private final ValueTransformer | valueTransformer
References Deprecated
ValueTransformer is deprecated or references (maybe indirectly) at least one deprecated element.
|
| Access | Constructor and Description |
|---|---|
| public | StringConverterAdapter(ValueTransformer<V> valueTransformer)
References Deprecated
ValueTransformer is deprecated or references (maybe indirectly) at least one deprecated element.
|
| Modifier and Type | Method and Description |
|---|---|
| public V | fromString(String
the string)String to convertImplements abstract javafx. Converts the string provided into an object defined by the specific converter. |
| valueTransformer | back to summary |
|---|---|
| private final ValueTransformer<V> valueTransformer
References Deprecated
See corresponding docs for further information. | |
| StringConverterAdapter | back to summary |
|---|---|
| public StringConverterAdapter(ValueTransformer<V> valueTransformer)
References Deprecated
See corresponding docs for further information. | |
| fromString | back to summary |
|---|---|
| public V fromString(String string) Implements abstract javafx. Doc from javafx. Converts the string provided into an object defined by the specific converter. Format of the string and type of the resulting object is defined by the specific converter. | |