RFR: 8284542: Missing attribute for state of CheckBox in CheckBoxTreeItem

Kevin Rushforth kcr at openjdk.org
Tue May 9 15:14:29 UTC 2023


On Wed, 3 May 2023 21:27:29 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Issue:
>> CheckBoxTreeItem extends TreeItem and adds a CheckBox.
>> The state of this CheckBox is not visible to an accessibility client application.
>> If we analyze a simple program that contains a CheckBoxTreeItem using a windows application "Accessibility Insights for Window", we can notice that toggle state of CheckBox is not exposed.
>> 
>> Fix:
>> Include the [Toggle Control Pattern](https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-implementingtoggle) in Accessibility information of a CheckBoxTreeItem in addition to the patterns that are used for a TreeItem.
>> 
>> Verification:
>> On Windows: Do the following with and without the fix.
>> 1. Run the sample program attached to JBS issue.
>> 2. Launch "Accessibility Insights for Window"
>> 3. Observe that patterns section for each item
>> 4. Select / de-select the CheckBoxes and observe the patterns section for correctness of toggle state.
>
> modules/javafx.graphics/src/main/java/javafx/scene/AccessibleAttribute.java line 357:
> 
>> 355:      * @since 21
>> 356:      */
>> 357:     TOGGLE_STATE(Integer.class),
> 
> Would a dedicated enum be a better choice here?

Yes, that might be cleaner. In any case, we should not hard-code or specify int values that are Windows-specific. I recommend defining this as a platform-independent attribute and then mapping it in the Windows platform code.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1088#discussion_r1187660261


More information about the openjfx-dev mailing list