Module com.dlsc.formsfx
Package com.dlsc.formsfx.model.structure
Class SelectionField<V,F extends SelectionField<V,F>>
java.lang.Object
com.dlsc.formsfx.model.structure.Element<F>
com.dlsc.formsfx.model.structure.Field<F>
com.dlsc.formsfx.model.structure.SelectionField<V,F>
- All Implemented Interfaces:
FormElement
- Direct Known Subclasses:
MultiSelectionField,SingleSelectionField
public abstract class SelectionField<V,F extends SelectionField<V,F>> extends Field<F>
SelectionField holds a list of values. Users can select one or more
of these values, depending on the concrete type of the field.- Author:
- Sacha Schmid, Rinesch Murugathas
-
Property Summary
Properties Type Property Description javafx.beans.property.ListProperty<V>itemsStores a typed list of available items on this field.Properties inherited from class com.dlsc.formsfx.model.structure.Field
changed, editable, errorMessages, label, placeholder, required, tooltip, valid -
Field Summary
Fields Modifier and Type Field Description protected javafx.beans.property.ListProperty<V>itemsStores a typed list of available items on this field.Fields inherited from class com.dlsc.formsfx.model.structure.Field
bindingModeListener, changed, editable, errorMessageKeys, errorMessages, eventHandlers, id, label, labelKey, placeholder, placeholderKey, renderer, rendererSupplier, required, requiredError, requiredErrorKey, span, styleClass, tooltip, tooltipKey, translationService, valid -
Constructor Summary
Constructors Modifier Constructor Description protectedSelectionField(javafx.beans.property.ListProperty<V> items)Internal constructor for theSelectionFieldclass. -
Method Summary
Modifier and Type Method Description javafx.collections.ObservableListgetItems()Gets the value of the property items.javafx.beans.property.ListProperty<V>itemsProperty()Stores a typed list of available items on this field.protected booleanvalidate(List<String> errorMessages)Validates a user input based on the field's selection and its validation rules.protected abstract booleanvalidateRequired()Validates that the new field input matches the required condition.Methods inherited from class com.dlsc.formsfx.model.structure.Field
addEventHandler, changedProperty, editable, editableProperty, errorMessagesProperty, fireEvent, getErrorMessages, getLabel, getLabelDescription, getPlaceholder, getRenderer, getTooltip, getValueDescription, hasChanged, isEditable, isI18N, isRequired, isValid, label, labelDescription, labelDescription, labelProperty, ofBooleanType, ofBooleanType, ofDate, ofDate, ofDoubleType, ofDoubleType, ofIntegerType, ofIntegerType, ofMultiSelectionType, ofMultiSelectionType, ofMultiSelectionType, ofPasswordType, ofPasswordType, ofSingleSelectionType, ofSingleSelectionType, ofSingleSelectionType, ofStringType, ofStringType, placeholder, placeholderProperty, removeEventHandler, render, render, required, required, requiredProperty, setBindingMode, tooltip, tooltipProperty, translate, updateElement, validate, validProperty, valueDescription, valueDescriptionMethods inherited from class com.dlsc.formsfx.model.structure.Element
getID, getSpan, getStyleClass, id, idProperty, span, span, spanProperty, styleClass, styleClassProperty
-
Property Details
-
items
Stores a typed list of available items on this field.- See Also:
getItems()
-
-
Field Details
-
items
Stores a typed list of available items on this field.
-
-
Constructor Details
-
SelectionField
Internal constructor for theSelectionFieldclass. To create new elements, see the static factory methods inField.- Parameters:
items- The list of available items on the field.
-
-
Method Details
-
validateRequired
protected abstract boolean validateRequired()Validates that the new field input matches the required condition.- Returns:
- Returns whether the input matches the required condition.
-
validate
Validates a user input based on the field's selection and its validation rules. Also considers therequiredflag. This method directly updates thevalidproperty. This method should not be called directly but instead only be used in concrete subclasses.- Parameters:
errorMessages- A list of error messages based on the field's validators.- Returns:
- Returns whether the user selection is a valid value or not.
-
getItems
public javafx.collections.ObservableList getItems()Gets the value of the property items.- Property description:
- Stores a typed list of available items on this field.
-
itemsProperty
Stores a typed list of available items on this field.- See Also:
getItems()
-