On Wed, 5 Jul 2023 17:45:35 GMT, Abhishek Kumar <abhis...@openjdk.org> wrote:

>> The issue exist only for non-editable combobox and the root cause is 
>> accessible object is not created due to incorrect index returned from 
>> component class which results in no a11y API invoked.
>> 
>> Proposed solution is to return the correct accessible child from 
>> getAccessibleChild method which is AquaComboBoxButton (arrowButton) instance 
>> and that results in invoking the a11y APIs to return the current selected 
>> item in combobox. 
>> 
>> Further when the application comes up first time the accessible name is not 
>> set for current displayed item in JCombobox that is handled in 
>> AquaComboBoxButton which will take care for the current selected item as 
>> well as if user modifies the selection by drop-down list.
>> 
>> CI link is posted in JBS.
>
> 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 233:

> 231:         rendererPane.paintComponent(g, c, this, left, top, cWidth, 
> height, shouldValidate); // h - (insets.top + insets.bottom) );
> 232: 
> 233:         // fix for 8283214

we usually do not mention the bugid in the comments, it can be found in the git 
history, just describe why it is needed.

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?

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?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14497#discussion_r1268840292
PR Review Comment: https://git.openjdk.org/jdk/pull/14497#discussion_r1268841214
PR Review Comment: https://git.openjdk.org/jdk/pull/14497#discussion_r1268842498

Reply via email to