Module javafx.controls
Package javafx.scene.control
Class SpinnerValueFactory.ListSpinnerValueFactory<T>
- java.lang.Object
- 
- javafx.scene.control.SpinnerValueFactory<T>
- 
- javafx.scene.control.SpinnerValueFactory.ListSpinnerValueFactory<T>
 
 
- 
- Type Parameters:
- T- The type of the elements in the- List.
 - Enclosing class:
- SpinnerValueFactory<T>
 
 public static class SpinnerValueFactory.ListSpinnerValueFactory<T> extends SpinnerValueFactory<T> ASpinnerValueFactoryimplementation designed to iterate through a list of values.Note that the default converteris implemented simply as shown below, which may be adequate in many cases, but it is important for users to ensure that this suits their needs (and adjust when necessary):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; } });- Since:
- JavaFX 8u40
 
- 
- 
Property SummaryProperties Type Property Description ObjectProperty<ObservableList<T>>itemsThe underlying data model for the ListView.- 
Properties inherited from class javafx.scene.control.SpinnerValueFactoryconverter, value, wrapAround
 
- 
 - 
Nested Class Summary- 
Nested classes/interfaces inherited from class javafx.scene.control.SpinnerValueFactorySpinnerValueFactory.DoubleSpinnerValueFactory, SpinnerValueFactory.IntegerSpinnerValueFactory, SpinnerValueFactory.ListSpinnerValueFactory<T>
 
- 
 - 
Constructor SummaryConstructors Constructor Description ListSpinnerValueFactory(ObservableList<T> items)Creates a new instance of the ListSpinnerValueFactory with the given list used as the list to step through.
 - 
Method SummaryModifier and Type Method Description voiddecrement(int steps)Attempts to decrement thevalueby the given number of steps.ObservableList<T>getItems()Returns anObservableListthat contains the items currently able to be iterated through by the user.voidincrement(int steps)Attempts to omcrement thevalueby the given number of steps.ObjectProperty<ObservableList<T>>itemsProperty()The underlying data model for the ListView.voidsetItems(ObservableList<T> value)Sets the underlying data model for the ListSpinnerValueFactory.- 
Methods inherited from class javafx.scene.control.SpinnerValueFactoryconverterProperty, getConverter, getValue, isWrapAround, setConverter, setValue, setWrapAround, valueProperty, wrapAroundProperty
 
- 
 
- 
- 
- 
Property Detail- 
itemspublic final ObjectProperty<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
 
 
- 
 - 
Constructor Detail- 
ListSpinnerValueFactorypublic ListSpinnerValueFactory(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 Detail- 
setItemspublic final void setItems(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
 
 - 
getItemspublic final ObservableList<T> getItems() Returns anObservableListthat contains the items currently able to be iterated through by the user. This may be null ifsetItems(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.
 
 - 
itemsPropertypublic final ObjectProperty<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
 
 - 
decrementpublic void decrement(int steps) Attempts to decrement thevalueby the given number of steps.- Specified by:
- decrementin class- SpinnerValueFactory<T>
- Parameters:
- steps- The number of decrements that should be performed on the value.
 
 - 
incrementpublic void increment(int steps) Attempts to omcrement thevalueby the given number of steps.- Specified by:
- incrementin class- SpinnerValueFactory<T>
- Parameters:
- steps- The number of increments that should be performed on the value.
 
 
- 
 
-