public class DataField<P extends Property,V,F extends Field> extends Field<F>
DataField
holds a single value. This value can be represented and
manipulated as a String
. It is stored as a concrete type.Type | Property and Description |
---|---|
StringProperty |
userInput |
P |
value
Every field tracks its value in multiple ways.
|
changedProperty, editableProperty, errorMessagesProperty, idProperty, labelProperty, placeholderProperty, requiredProperty, spanProperty, styleClassProperty, tooltipProperty, validProperty
Modifier and Type | Method and Description |
---|---|
F |
bind(P binding)
Binds the given property with the field.
|
F |
format(String errorMessage)
Adds an error message to handle formatting errors with the default
value transformers.
|
F |
format(ValueTransformer<V> newValue)
Sets the value transformer for the current field.
|
F |
format(ValueTransformer<V> newValue,
String errorMessage)
Applies a new value transformer that converts the entered string input
to a concrete value.
|
String |
getUserInput()
Gets the value of the property userInput.
|
V |
getValue()
Gets the value of the property value.
|
void |
setBindingMode(BindingMode newValue)
Activates or deactivates the
bindingModeListener based on the
given BindingMode . |
F |
unbind(P binding)
Unbinds the given property with the field.
|
StringProperty |
userInputProperty() |
F |
validate(Validator<V>... newValue)
Sets the list of validators for the current field.
|
protected boolean |
validateRequired(String newValue)
Validates that the new field input matches the required condition.
|
P |
valueProperty()
Every field tracks its value in multiple ways.
|
changedProperty, editable, editableProperty, errorMessagesProperty, getErrorMessages, getID, getLabel, getPlaceholder, getRenderer, getSpan, getStyleClass, getTooltip, hasChanged, id, idProperty, isEditable, isI18N, isRequired, isValid, label, labelProperty, ofBooleanType, ofBooleanType, ofDoubleType, ofDoubleType, ofIntegerType, ofIntegerType, ofMultiSelectionType, ofMultiSelectionType, ofMultiSelectionType, ofSingleSelectionType, ofSingleSelectionType, ofSingleSelectionType, ofStringType, ofStringType, placeholder, placeholderProperty, render, required, required, requiredProperty, span, span, spanProperty, styleClass, styleClassProperty, tooltip, tooltipProperty, validProperty
public StringProperty userInputProperty
getUserInput()
public P extends Property valueProperty
getValue()
public F format(ValueTransformer<V> newValue)
newValue
- The value transformer that parses the user input string to
the field's underlying value.public F format(ValueTransformer<V> newValue, String errorMessage)
newValue
- The new value transformer. Takes a string as an input and
returns the concrete type.errorMessage
- The error message to display if the transformation was
unsuccessful.public F format(String errorMessage)
errorMessage
- The error message to display if the transformation was
unsuccessful.@SafeVarargs public final F validate(Validator<V>... newValue)
newValue
- The validators that are to be used for validating this
field. Limited to validators that are able to handle the
field's underlying type.public F bind(P binding)
binding
- The property to be bound with.public F unbind(P binding)
binding
- The property to be unbound with.public void setBindingMode(BindingMode newValue)
bindingModeListener
based on the
given BindingMode
.newValue
- The new binding mode for the current field.protected boolean validateRequired(String newValue)
newValue
- The new value to check for the required state.public String getUserInput()
public StringProperty userInputProperty()
getUserInput()
public V getValue()
public P valueProperty()
getValue()
Copyright © 2017. All rights reserved.