changeset 7478:18b6955caf3f

[Accessibility] cosmetic + use helper method in GetColumnHeaderItems()
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Mon, 14 Jul 2014 15:14:03 -0700
parents 9e26a5eaed82
children 66866f7568a5
files modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java
diffstat 1 files changed, 5 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Sat Jul 12 16:03:15 2014 +1200
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Mon Jul 14 15:14:03 2014 -0700
@@ -441,7 +441,7 @@
         if (isDisposed()) return null;
         AccessibleRole role = (AccessibleRole) getAttribute(ROLE);
         if (role != null) {
-            switch(role) {
+            switch (role) {
                 case TABLE_ROW:
                 case TABLE_CELL: return getContainerAccessible(AccessibleRole.TABLE_VIEW);
                 case LIST_ITEM: return getContainerAccessible(AccessibleRole.LIST_VIEW);
@@ -1404,19 +1404,10 @@
         if (isDisposed()) return null;
        Integer columnIndex = (Integer)getAttribute(COLUMN_INDEX);
        if (columnIndex == null) return null;
-       Node table = null;
-       Node node = (Node)getAttribute(PARENT);
-       while (node != null) {
-           Accessible acc = getAccessible(node);
-           AccessibleRole role = (AccessibleRole)acc.getAttribute(ROLE);
-           if (role == AccessibleRole.TABLE_VIEW || role == AccessibleRole.TREE_TABLE_VIEW) {
-               table = node;
-               break;
-           }
-           node = (Node)acc.getAttribute(PARENT);
-       }
-       if (table == null) return null;
-       Node column = (Node)getAccessible(table).getAttribute(COLUMN_AT_INDEX, columnIndex);
+       Accessible acc = getContainer();
+       if (acc == null) return null;
+       Node column = (Node)acc.getAttribute(COLUMN_AT_INDEX, columnIndex);
+       if (column == null) return null;
        return new long[] {getNativeAccessible(column)};
     }