changeset 7242:0cfa9e528b26

[Accessibility] improve comments to MacAccessible.java
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Wed, 11 Jun 2014 10:14:59 -0700
parents 4d490de09504
children 18ca3f87dab2
files modules/graphics/src/main/java/com/sun/glass/ui/mac/MacAccessible.java
diffstat 1 files changed, 20 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/glass/ui/mac/MacAccessible.java	Wed Jun 11 09:43:00 2014 -0400
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/mac/MacAccessible.java	Wed Jun 11 10:14:59 2014 -0700
@@ -585,7 +585,8 @@
         ;long ptr; /* Initialized natively - treat as final */
     }
 
-    /* Do not access the following lists directly from the Mac enums.
+    /* 
+     * Do not access the following lists directly from the Mac enums.
      * It can cause the static initialization to happen in an unexpected order.
      */
     static final List<MacAttribute> baseAttributes = Arrays.asList(
@@ -692,7 +693,8 @@
                 Node node = (Node)getAttribute(FOCUS_NODE);
                 View view = getView();
                 if (node == null && view == null) {
-                    /* The transientFocusContainer resigns focus.
+                    /* 
+                     * The transientFocusContainer resigns focus.
                      * Delegate to the scene.
                      */
                     Scene scene = (Scene)getAttribute(SCENE);
@@ -709,7 +711,8 @@
                     Node item = (Node)node.getAccessible().getAttribute(FOCUS_ITEM);
                     id = item != null ? getAccessible(item) : getAccessible(node);
                 } else {
-                    /* No focused element. Send the notification to the scene itself.
+                    /* 
+                     * No focused element. Send the notification to the scene itself.
                      * Note, the view is NULL when the FOCUS_NODE notification is sent
                      * by the transientFocusContainer.
                      */
@@ -753,11 +756,12 @@
                     } else {
                         macNotification = MacNotification.AXMenuClosed;
 
-                        /* When a submenu closes the focus is returned to the main
+                        /* 
+                         * When a submenu closes the focus is returned to the main
                          * window, as opposite of the previous menu.
                          * The work around is to look for a previous menu
                          * and send a close and open event for it.
-                         * */
+                         */
                         Node menuItemOwner = (Node)getAttribute(MENU_FOR);
                         long menu = getAccessible(getContainerNode(menuItemOwner, Role.CONTEXT_MENU));
                         if (menu != 0) {
@@ -828,7 +832,8 @@
     Boolean ignoreInnerText;
     boolean ignoreInnerText() {
         if (ignoreInnerText != null) return ignoreInnerText;
-        /* JavaFX controls are implemented by the skin by adding new nodes.
+        /* 
+         * JavaFX controls are implemented by the skin by adding new nodes.
          * In accessibility these nodes sometimes duplicate the data in the
          * control. For example, a Label is implemented using a Text, creating a
          * AXStaticText inside an AXStaticText. In order to  improve accessibility
@@ -992,6 +997,13 @@
                 return count != null ? count : 1;
             }
             case NSAccessibilityChildrenAttribute: {
+                /*
+                 * The way VoiceOver identifies a menu item as having a sub menu is
+                 * by detecting an AXMenu child. It is important that the AXMenu
+                 * child be the actual sub menu so that navigation between menus
+                 * work.
+                 * Note: strictly the context menu is a child of the PopWindow.
+                 */
                 if (getAttribute(ROLE) == Role.MENU_ITEM) {
                     @SuppressWarnings("unchecked")
                     ObservableList<Node> children = (ObservableList<Node>)getAttribute(CHILDREN);
@@ -1771,7 +1783,8 @@
     boolean accessibilityIsIgnored() {
         if (isIgnored()) return true;
         if (isInSlider()) {
-            /* Ignoring the children within the slider, otherwise VoiceOver
+            /* 
+             * Ignoring the children within the slider, otherwise VoiceOver
              * reports 'multiple indicator slider' instead of the value.
              */
             return true;