changeset 7775:1beb181cb557

[Accessibility] Fix WinAccessible to use ITEM_COUNT and ITEM_AT_INDEX for ListView
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Fri, 22 Aug 2014 09:49:44 -0700
parents 9ec1f60df809
children 8fc31fdab4d7
files modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java
diffstat 1 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Fri Aug 22 18:47:09 2014 +0200
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Fri Aug 22 09:49:44 2014 -0700
@@ -505,7 +505,13 @@
         if (container == null) return;
         Node item = null;
         switch (role) {
-            case LIST_ITEM:
+            case LIST_ITEM: {
+                Integer index = (Integer)getAttribute(INDEX);
+                if (index != null) {
+                    item = (Node)container.getAttribute(ITEM_AT_INDEX, index);
+                }
+                break;
+            }
             case TREE_ITEM: {
                 Integer index = (Integer)getAttribute(INDEX);
                 if (index != null) {
@@ -907,7 +913,7 @@
     private long NavigateListView(WinAccessible listItemAccessible, int direction) {
         Accessible listAccessible = listItemAccessible.getContainer();
         if (listAccessible == null) return 0;
-        Integer count = (Integer)listAccessible.getAttribute(ROW_COUNT);
+        Integer count = (Integer)listAccessible.getAttribute(ITEM_COUNT);
         if (count == null || count == 0) return 0;
         Integer index = (Integer)listItemAccessible.getAttribute(INDEX);
         if (index == null) return 0;
@@ -917,7 +923,7 @@
             case NavigateDirection_FirstChild: index = 0; break;
             case NavigateDirection_LastChild: index = count - 1; break;
         }
-        Node node = (Node)listAccessible.getAttribute(ROW_AT_INDEX, index);
+        Node node = (Node)listAccessible.getAttribute(ITEM_AT_INDEX, index);
         return getNativeAccessible(node);
     }
 
@@ -1750,6 +1756,8 @@
             Integer itemCount = 0;
             switch (role) {
                 case LIST_VIEW:
+                    itemCount = (Integer) getAttribute(ITEM_COUNT);
+                    break;
                 case TABLE_VIEW:
                 case TREE_VIEW:
                 case TREE_TABLE_VIEW:
@@ -1781,7 +1789,13 @@
         if (container == null) return;
         Node item = null;
         switch (role) {
-            case LIST_ITEM:
+            case LIST_ITEM: {
+                Integer index = (Integer)getAttribute(INDEX);
+                if (index != null) {
+                    item = (Node)container.getAttribute(ITEM_AT_INDEX, index);
+                }
+                break;
+            }
             case TREE_ITEM: {
                 Integer index = (Integer)getAttribute(INDEX);
                 if (index != null) {