RFR: 8283214: [macos] Screen magnifier does not show the magnified text for JcomboBox [v5]
Abhishek Kumar
abhiscxk at openjdk.org
Fri Jul 21 19:36:48 UTC 2023
On Thu, 20 Jul 2023 01:41:46 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
>> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Add condition to check JLabel instance
>
> src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java line 242:
>
>> 240: ac.setAccessibleName(label.getText());
>> 241: }
>> 242: }
>
> How it will work in other L&Fs?
In case of other LAFs except **Aqua** in MacOS, the accessible component invoked for screen magnifier is an instance of `AccessibleJComboBox` and subsequently the a11y API called on `AccessibleJComboBox` to return the accessible name.
But for aqua, the accessible component invoked for screen magnifier is an instance for `AquaComboBoxButton`, so it is required to return the accessible button instance for a11y APIs to get called for retrieving accessible name.
> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java line 1133:
>
>> 1131: if ( popup instanceof Accessible accessiblePopup) {
>> 1132: AccessibleContext ac = accessiblePopup.getAccessibleContext();
>> 1133: ac.setAccessibleParent(comboBox);
>
> do we need to reset it back at some point?
I don't think so, as comboBox is the accessible parent for popup. Moreover, this piece of code is unchanged for the current fix.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14497#discussion_r1271014965
PR Review Comment: https://git.openjdk.org/jdk/pull/14497#discussion_r1271015991
More information about the client-libs-dev
mailing list