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

Create implementation for NSAccessibilitySlider protocol

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 17
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      No significant risk
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

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

      Problem

      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.

      Solution

      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.

      Specification

      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) {
          }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pbansal Pankaj Bansal (Inactive)
              Reporter:
              pbansal Pankaj Bansal (Inactive)
              Reviewed By:
              Alexander Zuev
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: