<AWT Dev> RFR: 8264299: Create implementation of native accessibility peer for ScrollPane and ScrollBar Java Accessibility roles [v3]

Alexander Zuev kizune at openjdk.java.net
Wed May 12 16:34:49 UTC 2021

On Tue, 11 May 2021 06:44:26 GMT, Pankaj Bansal <pbansal at openjdk.org> wrote:

>> Create implementation of native accessibility peer for ScrollPane and ScrollBar Java Accessibility roles.
>> There are no direct protocols for these two roles and there is no protocol in list of role based protocols defined by Apple Accessibility API, which can be used for these roles directly. So ScrollAreaAccessibility and ScrollBarAccessibility classes do not implement any of the role based protocols in this list. https://developer.apple.com/library/archive/documentation/Accessibility/Conceptual/AccessibilityMacOSX/ImplementingAccessibilityforCustomControls.html. 
>> By looking at the current implementation of ScrollAreaAccessibility class in JavaComponentAccessibility and the complete list of properties and methods which can be used for any NSAccessibility class listed in https://developer.apple.com/documentation/appkit/nsaccessibility, custom implementation of ScrollAreaAccessibility and ScrollBarAccessibility is created.
>> I have tested these implementations by running ScrollPane demo in SwingSet2 and scrollPane demo here https://docs.oracle.com/javase/tutorial/uiswing/components/scrollpane.html. The Voice Over behaviour is consistent with the old implementation and user can navigate and interact with the ScrollArea children hierarchy as expected.
>> The old ScrollAreaAccessibility class in JavaComponentAccessibility is renamed to ScrollAreaAccessibility_Old as this was causing compiler errors and we are not deleting old implementations as of now. Please let me know if there is a better way to handle this.
>> Also, some constants defined in JavaComponentAccessibility.m have been moved to JavaComponentAccessibility.h to avoid duplication in ScrollAreaAccessibility.
> Pankaj Bansal has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
>  - Merge branch 'master' of https://git.openjdk.java.net/jdk into JDK-8264299
>  - Use accessibilityRoleAttribute to get component role
>  - Add ScrollBar Accessibility
>  - remove logs
>  - Add functions to get ScrollBars from ScrollArea children
>  - 8264299: Create implementation of native accessibility peer for ScrollPane  Java Accessibility role

src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m line 54:

> 52: #define JAVA_AX_VISIBLE_CHILDREN (-3)
> 53: // If the value is >=0, it's an index
> 54: 

Since we are going to get rid of the JavaComponentAccessibility in the future i would rather copy the definitions into the CommonComponentAccessibility.h - that would save the double work in the future.


PR: https://git.openjdk.java.net/jdk/pull/3794

More information about the awt-dev mailing list