RFR: 8284542: [Accessibility] [Win] Missing attribute for toggle state of CheckBox in CheckBoxTreeItem [v3]

Andy Goryachev angorya at openjdk.org
Fri May 12 22:09:58 UTC 2023


On Fri, 12 May 2023 21:34:20 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java line 436:
>> 
>>> 434:                 case TAB_ITEM: return getContainerAccessible(AccessibleRole.TAB_PANE);
>>> 435:                 case PAGE_ITEM: return getContainerAccessible(AccessibleRole.PAGINATION);
>>> 436:                 case CHECK_BOX_TREE_ITEM:
>> 
>> I would recommend reformatting the switch cases here for clarity:
>> 
>> 
>>     private Accessible getContainer() {
>>         if (isDisposed()) {
>>             return null;
>>         }
>>         AccessibleRole role = (AccessibleRole)getAttribute(ROLE);
>>         if (role != null) {
>>             switch (role) {
>>             case TABLE_ROW:
>>             case TABLE_CELL:
>>                 return getContainerAccessible(AccessibleRole.TABLE_VIEW);
>>             case LIST_ITEM:
>>                 return getContainerAccessible(AccessibleRole.LIST_VIEW);
>>             case TAB_ITEM:
>>                 return getContainerAccessible(AccessibleRole.TAB_PANE);
>>             case PAGE_ITEM:
>>                 return getContainerAccessible(AccessibleRole.PAGINATION);
>>             case CHECK_BOX_TREE_ITEM:
>>             case TREE_ITEM:
>>                 return getContainerAccessible(AccessibleRole.TREE_VIEW);
>>             case TREE_TABLE_ROW:
>>             case TREE_TABLE_CELL:
>>                 return getContainerAccessible(AccessibleRole.TREE_TABLE_VIEW);
>>             }
>>         }
>>         return null;
>>     }
>> 
>> (and below also.  but again, this is just my preference)
>
> I usually prefer to avoid these sort of unrelated changes to minimize the diffs. Either way is fine.

in this particular case, with many fall-throughs, I think the code would benefit from reformatting.

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

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


More information about the openjfx-dev mailing list