changeset 6905:f1da54afa580

[Accessibility] RT-36903 - fix EDITABLE attribute for Windows; remove a11y re-parenting of listView (as it only causes Mac to fail to read the list); add fix for Mac (using FOCUS_ITEM) to read the list the first time it shows.
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Tue, 29 Apr 2014 16:10:15 -0700
parents 3596a176eeed
children 26306d581529
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java
diffstat 2 files changed, 12 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java	Tue Apr 29 14:24:23 2014 -0400
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java	Tue Apr 29 16:10:15 2014 -0700
@@ -605,13 +605,6 @@
             @Override protected double computePrefHeight(double width) {
                 return getListViewPrefHeight();
             }
-
-            @Override public Object accGetAttribute(Attribute attribute, Object... parameters) {
-                switch (attribute) {
-                    case PARENT: return comboBox;
-                    default: return super.accGetAttribute(attribute, parameters);
-                }
-            }
         };
 
         _listView.setId("list-view");
@@ -725,13 +718,17 @@
 
     @Override public Object accGetAttribute(Attribute attribute, Object... parameters) {
         switch (attribute) {
-            case CHILDREN: {
-                ObservableList<Node> children = comboBox.getChildrenUnmodifiable();
-                ObservableList<Node> list =  FXCollections.observableArrayList();
-                list.addAll(children);
-                if (!list.contains(listView)) list.add(listView);
-                return list;
-            }
+            case FOCUS_ITEM: {
+              if (comboBox.isShowing()) {
+                  /* On Mac, for some reason, changing the selection on the list is not 
+                   * reported by VoiceOver the first time it shows.
+                   * Note that this fix returns a child of the PopupWindow back to the main
+                   * Stage, which doesn't seem to cause problems.
+                   */
+                  return listView.accGetAttribute(attribute, parameters);
+              }
+              return null;
+          }
             case TITLE: {
                 String title = comboBox.isEditable() ? textField.getText() : buttonCell.getText();
                 if (title == null || title.isEmpty()) {
--- a/modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Tue Apr 29 14:24:23 2014 -0400
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Tue Apr 29 16:10:15 2014 -0700
@@ -1119,6 +1119,7 @@
                 case SCROLL_BAR:
                 case TEXT_FIELD:
                 case TEXT_AREA: return false;
+                case COMBOBOX: return Boolean.FALSE.equals(getAttribute(EDITABLE));
                 default:
             }
         }