Class PamListSpinnerFactory<T extends Number & Comparable>

java.lang.Object
javafx.scene.control.SpinnerValueFactory<T>
pamViewFX.fxNodes.PamListSpinnerFactory<T>
Type Parameters:
T - The type of the elements in the List. Must extends number

public class PamListSpinnerFactory<T extends Number & Comparable> extends javafx.scene.control.SpinnerValueFactory<T>
A SpinnerValueFactory implementation designed to iterate through a list of values. This also enables users to set the value. The list has space for one extra set value. When a value which is not part of the list is set, then the it is placed in the list in sorted order. When a new setValue() is called with a number which is not present in the list then the previous set value is deleted.
 setConverter(new StringConverter<T>() {
        @Override
        public String toString(T value) {
                if (value == null) {
                        return "";
                }
                return value.toString();
        }

        @Override
        public T fromString(String string) {
                return (T) string;
        }
 });
 
  • Property Summary Link icon

    Properties
    Type
    Property
    Description
    final javafx.beans.property.ObjectProperty<javafx.collections.ObservableList<T>>
    The underlying data model for the ListView.

    Properties inherited from class javafx.scene.control.SpinnerValueFactory Link icon

    converter, value, wrapAround
  • Nested Class Summary Link icon

    Nested classes/interfaces inherited from class javafx.scene.control.SpinnerValueFactory Link icon

    javafx.scene.control.SpinnerValueFactory.DoubleSpinnerValueFactory, javafx.scene.control.SpinnerValueFactory.IntegerSpinnerValueFactory, javafx.scene.control.SpinnerValueFactory.ListSpinnerValueFactory<T>
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    PamListSpinnerFactory(javafx.collections.ObservableList<T> items)
    Creates a new instance of the ListSpinnerValueFactory with the given list used as the list to step through.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    void
    decrement(int steps)
    final javafx.collections.ObservableList<T>
    Returns an ObservableList that contains the items currently able to be iterated through by the user.
    void
    increment(int steps)
    final javafx.beans.property.ObjectProperty<javafx.collections.ObservableList<T>>
    The underlying data model for the ListView.
    final void
    setItems(javafx.collections.ObservableList<T> value)
    Sets the underlying data model for the ListSpinnerValueFactory.

    Methods inherited from class javafx.scene.control.SpinnerValueFactory Link icon

    converterProperty, getConverter, getValue, isWrapAround, setConverter, setValue, setWrapAround, valueProperty, wrapAroundProperty

    Methods inherited from class java.lang.Object Link icon

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Property Details Link icon

    • items Link icon

      public final javafx.beans.property.ObjectProperty<javafx.collections.ObservableList<T extends Number & Comparable>> itemsProperty
      The underlying data model for the ListView. Note that it has a generic type that must match the type of the ListView itself.
      See Also:
  • Constructor Details Link icon

    • PamListSpinnerFactory Link icon

      public PamListSpinnerFactory(javafx.collections.ObservableList<T> items)
      Creates a new instance of the ListSpinnerValueFactory with the given list used as the list to step through.
      Parameters:
      items - The list of items to step through with the Spinner.
  • Method Details Link icon

    • setItems Link icon

      public final void setItems(javafx.collections.ObservableList<T> value)
      Sets the underlying data model for the ListSpinnerValueFactory. Note that it has a generic type that must match the type of the Spinner itself.
      Parameters:
      value - the list of items
    • getItems Link icon

      public final javafx.collections.ObservableList<T> getItems()
      Returns an ObservableList that contains the items currently able to be iterated through by the user. This may be null if setItems(javafx.collections.ObservableList) has previously been called, however, by default it is an empty ObservableList.
      Returns:
      An ObservableList containing the items to be shown to the user, or null if the items have previously been set to null.
    • itemsProperty Link icon

      public final javafx.beans.property.ObjectProperty<javafx.collections.ObservableList<T>> itemsProperty()
      The underlying data model for the ListView. Note that it has a generic type that must match the type of the ListView itself.
      Returns:
      the list of items
    • decrement Link icon

      public void decrement(int steps)
      Specified by:
      decrement in class javafx.scene.control.SpinnerValueFactory<T extends Number & Comparable>
    • increment Link icon

      public void increment(int steps)
      Specified by:
      increment in class javafx.scene.control.SpinnerValueFactory<T extends Number & Comparable>