RFR: 8271846 a11y API lacks setSelectedIndex method [v4]

Sergey Bylokhov serb at openjdk.org
Wed Nov 23 02:31:44 UTC 2022


On Mon, 21 Nov 2022 10:44:43 GMT, Artem Semenov <asemenov at openjdk.org> wrote:

>> It is unclear why the `setSelectionInterval `is actually any better than `addAccessibleSelection`. Both have a similar implementation,  in some cases, the addSelectionInterval just calls setSelectionInterval, and seems that posts similar notifications. So it is unclear why the setSelectionInterval works fine and addAccessibleSelection does not work.
>
> I tried calling clearSelection again instead of adding an interface:
> 
>                 if (as == null) return;
>                 if (pac.getAccessibleRole().equals(AccessibleRole.LIST)) {
>                     as.clearAccessibleSelection();
>                 }
>                 as.addAccessibleSelection(i);
> 
> After that I changed the call to ```javax.swing.JList.AccessibleJList#addAccessibleSelection```
> 
> JList.this.addSelectionInterval(i, i);
> 
> on the
> 
> JList.this.getSelectionModel().setSelectionInterval(i, i);
> 
> Nothing changed. VoiceOVer still freezes.
> I think that the problem is not that setting the selection doesn't work, but that clearing the selection before setting causes the VO to fris.

Some probably related points, the implementation of the addAccessibleSelection for the JComboBox. is the same:

            clearAccessibleSelection();
            JComboBox.this.setSelectedIndex(i);


It is possible that it also hangs?

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

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



More information about the client-libs-dev mailing list