RFR: 8271846 a11y API lacks setSelectedIndex method [v4]

Sergey Bylokhov serb at openjdk.org
Fri Nov 11 02:18:33 UTC 2022


On Wed, 9 Nov 2022 09:42:00 GMT, Artem Semenov <asemenov at openjdk.org> wrote:

>> A11Y implementation on macOS has to directly call the 'JList.setSelectedIndex' method in order to request selection on an item (see 'CAccessibility.requestSelection'). The reason is that a11y API lacks appropriate method.There's only 'javax.accessibility.AccessibleSelection#addAccessibleSelection' which is mapped to 'javax.swing.JList#addSelectionInterval', it can not be used to set selected index.
>> 
>> @forantar @azuev-java @mrserb please review.
>> 
>> Please note that the new API allows you to implement a multiple selection in lists from the Java side, but I did not succeed in implementing it, because I could not determine the inclusion of the so-called "VoiceOver multiple selection mode".
>
> Artem Semenov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   We are not using author tags in tests either - but that's just a nitpick.

src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java line 574:

> 572:                     return;
> 573:                 }
> 574:                 as.addAccessibleSelection(i);

I would like to clarify one initial question. Why we cannot use `clearAccessibleSelection `to clean the current selection and then add a new one by the `addAccessibleSelection`?

-------------

PR: https://git.openjdk.org/jdk/pull/8578



More information about the client-libs-dev mailing list