T
- The type of the data this value factory deals with, which must
coincide with the type of the Spinner that the value factory is set on.public abstract class SpinnerValueFactory<T> extends Object
Spinner control
- without a value factory installed a
Spinner is unusable. It is the role of the value factory to handle almost all
aspects of the Spinner, including:
value
,Incrementing
and decrementing
the
value, with one or more steps per call,Converting
text input
from the user (via the Spinner editor
,objects to user-readable strings
for display on screenSpinnerValueFactory classes for some common types are provided with JavaFX, including:
Type | Property and Description |
---|---|
ObjectProperty<StringConverter<T>> |
converter
|
ObjectProperty<T> |
value
Represents the current value of the SpinnerValueFactory, or null if no
value has been set.
|
BooleanProperty |
wrapAround
The wrapAround property is used to specify whether the value factory should
be circular.
|
Modifier and Type | Class and Description |
---|---|
static class |
SpinnerValueFactory.DoubleSpinnerValueFactory
A
SpinnerValueFactory implementation designed to iterate through
double values. |
static class |
SpinnerValueFactory.IntegerSpinnerValueFactory
A
SpinnerValueFactory implementation designed to iterate through
integer values. |
static class |
SpinnerValueFactory.ListSpinnerValueFactory<T>
A
SpinnerValueFactory implementation designed to iterate through
a list of values. |
Constructor and Description |
---|
SpinnerValueFactory() |
Modifier and Type | Method and Description |
---|---|
ObjectProperty<StringConverter<T>> |
converterProperty()
|
abstract void |
decrement(int steps)
Attempts to decrement the
value by the given
number of steps. |
StringConverter<T> |
getConverter()
Gets the value of the property converter.
|
T |
getValue()
Gets the value of the property value.
|
abstract void |
increment(int steps)
Attempts to omcrement the
value by the given
number of steps. |
boolean |
isWrapAround()
Gets the value of the property wrapAround.
|
void |
setConverter(StringConverter<T> newValue)
Sets the value of the property converter.
|
void |
setValue(T newValue)
Sets the value of the property value.
|
void |
setWrapAround(boolean value)
Sets the value of the property wrapAround.
|
ObjectProperty<T> |
valueProperty()
Represents the current value of the SpinnerValueFactory, or null if no
value has been set.
|
BooleanProperty |
wrapAroundProperty()
The wrapAround property is used to specify whether the value factory should
be circular.
|
public final ObjectProperty<T> valueProperty
getValue()
,
setValue(T)
public final ObjectProperty<StringConverter<T>> converterProperty
editable
) to an object of type T,
such that the input may be retrieved via the value
property.getConverter()
,
setConverter(StringConverter)
public final BooleanProperty wrapAroundProperty
isWrapAround()
,
setWrapAround(boolean)
public abstract void decrement(int steps)
value
by the given
number of steps.steps
- The number of decrements that should be performed on the value.public abstract void increment(int steps)
value
by the given
number of steps.steps
- The number of increments that should be performed on the value.public final T getValue()
public final void setValue(T newValue)
public final ObjectProperty<T> valueProperty()
getValue()
,
setValue(T)
public final StringConverter<T> getConverter()
public final void setConverter(StringConverter<T> newValue)
public final ObjectProperty<StringConverter<T>> converterProperty()
editable
) to an object of type T,
such that the input may be retrieved via the value
property.getConverter()
,
setConverter(StringConverter)
public final void setWrapAround(boolean value)
public final boolean isWrapAround()
public final BooleanProperty wrapAroundProperty()
isWrapAround()
,
setWrapAround(boolean)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.