Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8195139

Add APIs to customize step repeat timing for Spinner control

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • jfx11
    • javafx
    • None
    • behavioral
    • minimal
    • Hide
      This proposal changes the default delay that an end user will see when pressing on a spinner arrow and holding the mouse down. Since the current behavior is anomalous with respect to other toolkits, and is almost unusably slow, the risk of anyone complaining is very slight.
      Show
      This proposal changes the default delay that an end user will see when pressing on a spinner arrow and holding the mouse down. Since the current behavior is anomalous with respect to other toolkits, and is almost unusably slow, the risk of anyone complaining is very slight.
    • Java API
    • JDK

      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 
      
      

            pkbalakr Prem Balakrishnan (Inactive)
            shadowbug Shadow Bug
            Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: