Top Description Fields Constructors Methods
com.dlsc.formsfx.model.structure

public abstract Class SelectionField<V, F extends SelectionField<V, F>>

extends Field<F extends SelectionField<V, F>>
Class Inheritance
Known Direct Subclasses
com.dlsc.formsfx.model.structure.SingleSelectionField, com.dlsc.formsfx.model.structure.MultiSelectionField
Imports
javafx.beans.property.ListProperty, javafx.collections.ObservableList, java.util.List

SelectionField holds a list of values. Users can select one or more of these values, depending on the concrete type of the field.
Authors
Sacha Schmid, Rinesch Murugathas

Field Summary

Modifier and TypeField and Description
protected final ListProperty<V>
items

Stores a typed list of available items on this field.

Inherited from com.dlsc.formsfx.model.structure.Field:
bindingModeListenerchangededitableerrorMessageKeyserrorMessageseventHandlersidlabellabelKeyplaceholderplaceholderKeyrendererrendererSupplierrequiredrequiredErrorrequiredErrorKeyspanstyleClasstooltiptooltipKeytranslationServicevalid

Constructor Summary

AccessConstructor and Description
protected
SelectionField(ListProperty<V>
The list of available items on the field.
items
)

Internal constructor for the SelectionField class.

Method Summary

Modifier and TypeMethod and Description
public ObservableList<E>
public ListProperty<V>
protected boolean

Returns:

Returns whether the user selection is a valid value or not.
validate
(List<String>
A list of error messages based on the field's validators.
errorMessages
)

Validates a user input based on the field's selection and its validation rules.

protected abstract boolean

Returns:

Returns whether the input matches the required condition.
validateRequired
()

Validates that the new field input matches the required condition.

Inherited from com.dlsc.formsfx.model.structure.Field:
addEventHandlerchangedPropertyeditableeditablePropertyerrorMessagesPropertyfireEventgetErrorMessagesgetLabelgetLabelDescriptiongetPlaceholdergetRenderergetTooltipgetValueDescriptionhasChangedisEditableisI18NisRequiredisValidlabellabelDescriptionlabelDescriptionlabelPropertyofBooleanTypeofBooleanTypeofDateofDateofDoubleTypeofDoubleTypeofIntegerTypeofIntegerTypeofMultiSelectionTypeofMultiSelectionTypeofMultiSelectionTypeofPasswordTypeofPasswordTypeofSingleSelectionTypeofSingleSelectionTypeofSingleSelectionTypeofStringTypeofStringTypeplaceholderplaceholderPropertyremoveEventHandlerrenderrenderrequiredrequiredrequiredPropertysetBindingModetooltiptooltipPropertytranslateupdateElementupdateElementvalidatevalidPropertyvalueDescriptionvalueDescription

Field Detail

itemsback to summary
protected final ListProperty<V> items

Stores a typed list of available items on this field.

Constructor Detail

SelectionFieldback to summary
protected SelectionField(ListProperty<V> items)

Internal constructor for the SelectionField class. To create new elements, see the static factory methods in Field.

Parameters
items:ListProperty<V>

The list of available items on the field.

See Also
Field::ofMultiSelectionType, Field::ofSingleSelectionType

Method Detail

getItemsback to summary
public ObservableList<E> getItems()
itemsPropertyback to summary
public ListProperty<V> itemsProperty()
validateback to summary
protected boolean validate(List<String> errorMessages)

Validates a user input based on the field's selection and its validation rules. Also considers the required flag. This method directly updates the valid property. This method should not be called directly but instead only be used in concrete subclasses.

Parameters
errorMessages:List<String>

A list of error messages based on the field's validators.

Returns:boolean

Returns whether the user selection is a valid value or not.

validateRequiredback to summary
protected abstract boolean validateRequired()

Validates that the new field input matches the required condition.

Returns:boolean

Returns whether the input matches the required condition.