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 Details

    • items

      public javafx.beans.property.ListProperty<V> itemsProperty
      Stores a typed list of available items on this field.
      See Also:
      getItems()
  • Field Details

    • items

      protected final javafx.beans.property.ListProperty<V> items
      Stores a typed list of available items on this field.
  • Constructor Details

    • SelectionField

      protected SelectionField​(javafx.beans.property.ListProperty<V> items)
      Internal constructor for the SelectionField class. To create new elements, see the static factory methods in Field.
      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

      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 - 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

      public javafx.beans.property.ListProperty<V> itemsProperty()
      Stores a typed list of available items on this field.
      See Also:
      getItems()