changeset 7866:e1d0a9e30bec

[Accessibility] cosmetic changes
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Tue, 26 Aug 2014 14:49:59 -0700
parents 96b05e9b6bd4
children 4be6763a301a
files modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java
diffstat 1 files changed, 15 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Tue Aug 26 13:56:02 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Tue Aug 26 14:49:59 2014 -0700
@@ -554,10 +554,8 @@
         AccessibleRole role = (AccessibleRole)getAttribute(ROLE);
         boolean impl = false;
         switch (role) {
-            case MENU_ITEM:
-                impl = patternId == UIA_InvokePatternId;
-                break;
             case MENU:
+            case SPLIT_MENU_BUTTON:
                 impl = patternId == UIA_InvokePatternId ||
                        patternId == UIA_ExpandCollapsePatternId;
                 break;
@@ -571,6 +569,7 @@
             case INCREMENT_BUTTON:
             case DECREMENT_BUTTON:
             case MENU_BUTTON:
+            case MENU_ITEM:
                 impl = patternId == UIA_InvokePatternId;
                 break;
             case PAGE_ITEM:
@@ -591,14 +590,6 @@
                        patternId == UIA_TablePatternId ||
                        patternId == UIA_ScrollPatternId;
                 break;
-            case TREE_VIEW:
-                impl = patternId == UIA_SelectionPatternId ||
-                       patternId == UIA_ScrollPatternId;
-                break;
-            case LIST_VIEW:
-                impl = patternId == UIA_SelectionPatternId ||
-                       patternId == UIA_ScrollPatternId;
-                break;
             case TREE_TABLE_CELL:
                 impl = patternId == UIA_SelectionItemPatternId ||
                        patternId == UIA_GridItemPatternId ||
@@ -612,15 +603,23 @@
                        patternId == UIA_TableItemPatternId ||
                        patternId == UIA_ScrollItemPatternId;
                 break;
-            case LIST_ITEM:
-                impl = patternId == UIA_SelectionItemPatternId ||
-                       patternId == UIA_ScrollItemPatternId;
+            case TREE_VIEW:
+                impl = patternId == UIA_SelectionPatternId ||
+                       patternId == UIA_ScrollPatternId;
                 break;
             case TREE_ITEM:
                 impl = patternId == UIA_SelectionItemPatternId ||
                        patternId == UIA_ExpandCollapsePatternId ||
                        patternId == UIA_ScrollItemPatternId;
                 break;
+            case LIST_VIEW:
+                impl = patternId == UIA_SelectionPatternId ||
+                       patternId == UIA_ScrollPatternId;
+                break;
+            case LIST_ITEM:
+                impl = patternId == UIA_SelectionItemPatternId ||
+                       patternId == UIA_ScrollItemPatternId;
+                break;
             /* 
              * MSDN doc is confusing if text elements should implement
              * UIA_ValuePatternId. The article 'Text and TextRange Control
@@ -640,16 +639,10 @@
             case TEXT:
                 /* UIA_TextPatternId seems overkill for text. Use UIA_NamePropertyId instead */
                 break;
-            case SPLIT_MENU_BUTTON:
-                impl = patternId == UIA_InvokePatternId ||
-                       patternId == UIA_ExpandCollapsePatternId;
-                break;
             case RADIO_BUTTON:
                 impl = patternId == UIA_SelectionItemPatternId;
                 break;
             case CHECK_BOX:
-                impl = patternId == UIA_TogglePatternId;
-                break;
             case TOGGLE_BUTTON:
                 impl = patternId == UIA_TogglePatternId;
                 break;
@@ -986,6 +979,7 @@
                             return (Node)parentAccessible.getAttribute(AccessibleAttribute.TREE_ITEM_AT_INDEX, index);
                         };
                     } else {
+                        @SuppressWarnings("unchecked")
                         ObservableList<Node> children = (ObservableList<Node>)parentAccessible.getAttribute(CHILDREN);
                         if (children == null) return 0;
                         count = children.size();
@@ -1043,6 +1037,7 @@
                         node = (Node)getAttribute(TREE_ITEM_AT_INDEX, lastIndex);
                     }
                 } else {
+                    @SuppressWarnings("unchecked")
                     ObservableList<Node> children = (ObservableList<Node>)getAttribute(CHILDREN);
                     if (children != null && children.size() > 0) {
                         lastIndex = direction == NavigateDirection_FirstChild ? 0 : children.size() - 1;