changeset 7287:9229486ecaea

RT-36990: [Accessibility, Mac] Toolbar side menu does not get narrator focus. reviewed-by: felipe
author "Joseph Andresen <joseph.andresen@oracle.com>"
date Wed, 11 Jun 2014 12:06:59 -0700
parents dddec7c8b7c2
children b7698ff4b6e3
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ContextMenuContent.java
diffstat 1 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ContextMenuContent.java	Wed Jun 11 13:44:09 2014 -0400
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ContextMenuContent.java	Wed Jun 11 12:06:59 2014 -0700
@@ -1488,12 +1488,24 @@
                     return false;
                 case ACCELERATOR: return item.getAccelerator();
                 case TITLE: {
+                    String title = "";
+                    if (graphic != null) {
+                        String t = (String)graphic.accGetAttribute(Attribute.TITLE);
+                        if (t != null) title += t;
+                    }                  
                     final Label label = getLabel();
                     if (label != null) {
-                        String title = (String)label.accGetAttribute(Attribute.TITLE);
-                        if (title != null) return title;
+                        String t = (String)label.accGetAttribute(Attribute.TITLE);
+                        if (t != null) title += t;
                     }
-                    return item.getText();
+                    if (item instanceof CustomMenuItem) {
+                        Node content = ((CustomMenuItem) item).getContent();
+                        if (content != null) {
+                            String t = (String)content.accGetAttribute(Attribute.TITLE);
+                            if (t != null) title += t;
+                        }
+                    }
+                    return title;
                 }
                 case MNEMONIC: {
                     final Label label = getLabel();