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

Create implementation for NSAccessibilitySlider protocol



    • CSR
    • Resolution: Withdrawn
    • P3
    • 11-pool
    • client-libs
    • None
    • behavioral
    • low
    • No significant risk.
    • Java API
    • SE



      Update the AccessibleJSlider class to implement the AccessibleAction interface so that Assistive Technologies on MacOs can increment/decrement the value of Slider


      The Voice Over Assistive Technology (AT) for MacOS is not able to increment/decrement the slider values by using the VO hot keys. Voice Over is able to do so for JSpinner as the AccessibleJSpinner class is already implementing the AccessibleAction interface. We need this as we are migrating from old Apple Accessibility API to new Apple Accessibility API under the https://bugs.openjdk.java.net/browse/JDK-8152350. For Slider, we need to create the implement the NSAccessibilitySlider protocol defined here https://developer.apple.com/documentation/appkit/nsaccessibilityslider. This states that the slider component should allow the Assistive Technology to increment/decrement the slider values. For this, the native accessibility peer for Slider being created should be able to increment/decrement the Slider value.


      Update the AccessibleJSlider class to implement the AccessibleAction interface, so that the value of slider can be changed from native accessibility peer. This change makes the AccessibleJSlider code consistent with AccessibleJSpinner as AccessibleJSpinner is already implementing the AccessibleAction interface.


      The javax.swing.JSlider.AccessibleJSlider class is updated to implement the javax.accessibility.AccessibleAction interface and corresponding functions have been implemented

          protected class AccessibleJSlider extends AccessibleJComponent
          implements AccessibleValue, ChangeListener, AccessibleAction {
           * Returns the number of accessible actions available in this object
           * If there are more than one, the first one is considered the "default"
           * action of the object.
           * Two actions are supported: AccessibleAction.INCREMENT which
           * increments the slider value and AccessibleAction.DECREMENT
           * which decrements the slider value
           * @return the zero-based number of Actions in this object
          public int getAccessibleActionCount() {
           * Returns a description of the specified action of the object.
           * @param i zero-based index of the actions
           * @return a String description of the action
           * @see #getAccessibleActionCount
          public String getAccessibleActionDescription(int i) {
           * Performs the specified Action on the object
           * @param i zero-based index of actions. The first action
           * (index 0) is AccessibleAction.INCREMENT and the second
           * action (index 1) is AccessibleAction.DECREMENT.
           * @return true.
           * @see #getAccessibleActionCount
          public boolean doAccessibleAction(int direction) {


        Issue Links



              clanger Christoph Langer
              pbansal Pankaj Bansal (Inactive)
              0 Vote for this issue
              2 Start watching this issue