<AWT Dev> RFR: 8267385: Create NSAccessibilityElement implementation for JavaComponentAccessibility [v8]
Sergey Bylokhov
serb at openjdk.java.net
Mon Aug 2 05:56:38 UTC 2021
On Wed, 21 Jul 2021 17:25:48 GMT, Artem Semenov <github.com+36081106+savoptik at openjdk.org> wrote:
>> src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java line 556:
>>
>>> 554: ((JList) parent).setSelectedIndex(i);
>>> 555: return;
>>> 556: }
>>
>> Looks like the a11y interface miss "setSelectedIndex" method? The code above will not work for the custom component which uses the "AccessibleJListChild" a11y object?
>
> Unfortunately, the current a11y interface does not allow this action.
> As for the custom AccessibleJListChild, I prepared a [sample project](https://github.com/savoptik/AccessibilityJListItemA11yExample) in which I implemented a custom child. The experiment showed that there are no negative consequences. The custom child works as intended.
In the example, you use a JList class, and the checks in the code above works, but if some other "AccessibleJList" class will be used then it will not work, right? This is the reason why implementations of a11y classes usually use specific interfaces like "AccessibleJList".
>> src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m line 50:
>>
>>> 48: #define JAVA_AX_ALL_CHILDREN (-1)
>>> 49: #define JAVA_AX_SELECTED_CHILDREN (-2)
>>> 50: #define JAVA_AX_VISIBLE_CHILDREN (-3)
>>
>> Why not mark them as @native in the CAccessibility and use constants generated by the javac?
>
> Done
But the code above still exits or it is a github glitch?
>> src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableAccessibility.m line 155:
>>
>>> 153: - (NSArray *)accessibilitySelectedChildren
>>> 154: {
>>> 155: return [self accessibilitySelectedRows];
>>
>> Does it mean that the children of the table are rows and columns and not "cells".? How it will work if only one cell is selected?
>
> As @ azuev-java canceled below this is not functional regression.
> However, cell navigation will be implemented later in [JDK-8271071](https://bugs.openjdk.java.net/browse/JDK-8271071).
ok
-------------
PR: https://git.openjdk.java.net/jdk/pull/4412
More information about the awt-dev
mailing list