changeset 7963:3beaafe4b671

RT-38452: [Accessibility] HelloTreeView hangs on Windows 7 when running Narrator
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Wed, 03 Sep 2014 09:54:13 -0700
parents c2041e3fd928
children afa5accd7234
files modules/controls/src/main/java/javafx/scene/control/TreeCell.java modules/controls/src/main/java/javafx/scene/control/TreeTableRow.java
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/javafx/scene/control/TreeCell.java	Wed Sep 03 16:32:55 2014 +0200
+++ b/modules/controls/src/main/java/javafx/scene/control/TreeCell.java	Wed Sep 03 09:54:13 2014 -0700
@@ -662,10 +662,13 @@
                 return treeView.queryAccessibleAttribute(AccessibleAttribute.ROW_AT_INDEX, parentIndex);
             }
             case TREE_ITEM_COUNT: {
-                return treeItem == null  ? 0 : treeItem.getChildren().size();
+                if (treeItem == null) return 0;
+                if (!treeItem.isExpanded()) return 0;
+                return treeItem.getChildren().size();
             }
             case TREE_ITEM_AT_INDEX: {
                 if (treeItem == null) return null;
+                if (!treeItem.isExpanded()) return null;
                 int index = (Integer)parameters[0];
                 if (index >= treeItem.getChildren().size()) return null;
                 TreeItem<T> child = treeItem.getChildren().get(index);
--- a/modules/controls/src/main/java/javafx/scene/control/TreeTableRow.java	Wed Sep 03 16:32:55 2014 +0200
+++ b/modules/controls/src/main/java/javafx/scene/control/TreeTableRow.java	Wed Sep 03 09:54:13 2014 -0700
@@ -544,10 +544,13 @@
                 return treeTableView.queryAccessibleAttribute(AccessibleAttribute.ROW_AT_INDEX, parentIndex);
             }
             case TREE_ITEM_COUNT: {
-                return treeItem == null  ? 0 : treeItem.getChildren().size();
+                if (treeItem == null) return 0;
+                if (!treeItem.isExpanded()) return 0;
+                return treeItem.getChildren().size();
             }
             case TREE_ITEM_AT_INDEX: {
                 if (treeItem == null) return null;
+                if (!treeItem.isExpanded()) return null;
                 int index = (Integer)parameters[0];
                 if (index >= treeItem.getChildren().size()) return null;
                 TreeItem<T> child = treeItem.getChildren().get(index);