Summary
Add APIs to configure the step repeat timing for Spinner control.
Problem
The duration that the mouse has to be pressed on a Spinner control arrow button before the value steps is set to 750ms with no way for an application to alter this timing.
Solution
Introduce two new properties initialDelay and repeatDelay, along with APIs to configure these properties. The new properties can be styled with CSS.
Specification
Spinner.java
/**
* The duration that the mouse has to be pressed on an arrow button
* before the next value steps. Successive step duration is set using
* {@link #repeatDelayProperty() repeat delay}.
*
* @return inital delay property
* @since 11
* @defaultValue 300ms
*/
public final ObjectProperty<Duration> initialDelayProperty() { }
public final void setInitialDelay(Duration value) { }
public final Duration getInitialDelay() { }
/**
* The duration that the mouse has to be pressed for each successive step
* after the first value steps. Initial step duration is set using
* {@link #initialDelayProperty() initial delay}.
*
* @return repeat delay property
* @since 11
* @defaultValue 60ms
*/
public final ObjectProperty<Duration> repeatDelayProperty() { }
public final void setRepeatDelay(Duration value) { }
public final Duration getRepeatDelay() { }
/**
* @return The CssMetaData associated with this class, which may include the
* CssMetaData of its superclasses.
* @since 11
*/
public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData() { }
/**
* {@inheritDoc}
* @since 11
*/
@Override
public List<CssMetaData<? extends Styleable, ?>> getControlCssMetaData() { }
cssref.html
Style class: spinner
CSS Property Values Default
-fx-initial-delay <duration> 300ms
-fx-repeat-delay <duration> 60ms
- csr of
-
JDK-8167096 Add APIs to customize step repeat timing for Spinner control
- Resolved