OpenJDK / openjfx / 8u-dev / rt
changeset 7671:088856d1b79a
RT-37959: [Accessibility] Review a11y enums
Rename MENU_FOR -> PARENT_MENU
Rename MENU -> SUBMENU
author | Felipe Heidrich <felipe.heidrich@oracle.com> |
---|---|
date | Wed, 13 Aug 2014 14:50:35 -0700 |
parents | 46ba065ec37e |
children | 027b83703d37 |
files | modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ContextMenuContent.java modules/graphics/src/main/java/com/sun/glass/ui/mac/MacAccessible.java modules/graphics/src/main/java/javafx/scene/AccessibleAttribute.java |
diffstat | 3 files changed, 18 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ContextMenuContent.java Wed Aug 13 14:31:41 2014 -0700 +++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ContextMenuContent.java Wed Aug 13 14:50:35 2014 -0700 @@ -981,7 +981,7 @@ public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) { switch (attribute) { case VISIBLE: return contextMenu.isShowing(); - case MENU_FOR: return contextMenu.getOwnerNode(); + case PARENT_MENU: return contextMenu.getOwnerNode(); default: return super.queryAccessibleAttribute(attribute, parameters); } } @@ -1517,7 +1517,7 @@ return null; } case DISABLED: return item.isDisable(); - case MENU: + case SUBMENU: createSubmenu(); // Accessibility might need to see the menu node before the window // is visible (i.e. before the skin is applied).
--- a/modules/graphics/src/main/java/com/sun/glass/ui/mac/MacAccessible.java Wed Aug 13 14:31:41 2014 -0700 +++ b/modules/graphics/src/main/java/com/sun/glass/ui/mac/MacAccessible.java Wed Aug 13 14:50:35 2014 -0700 @@ -771,7 +771,7 @@ * 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); + Node menuItemOwner = (Node)getAttribute(PARENT_MENU); MacAccessible acc = (MacAccessible)getAccessible(menuItemOwner); if (acc != null) { MacAccessible menu = (MacAccessible)acc.getContainerAccessible(AccessibleRole.CONTEXT_MENU); @@ -1044,7 +1044,7 @@ ObservableList<Node> children = (ObservableList<Node>)getAttribute(CHILDREN); long[] ids = getUnignoredChildren(children); int count = ids.length; - if (getAttribute(MENU) != null) { + if (getAttribute(SUBMENU) != null) { count++; } return count; @@ -1083,7 +1083,7 @@ long[] result = new long[maxCount]; int i = 0; if (index == 0) { - Node menu = (Node)getAttribute(MENU); + Node menu = (Node)getAttribute(SUBMENU); if (menu != null) result[i++] = getNativeAccessible(menu); } if (i < maxCount) { @@ -1350,7 +1350,7 @@ result = getView().getWindow().getNativeWindow(); } else if (result != null) { if (role == AccessibleRole.CONTEXT_MENU) { - Node menuItem = (Node)getAttribute(MENU_FOR); + Node menuItem = (Node)getAttribute(PARENT_MENU); if (menuItem != null) { if (getAccessible(menuItem).getAttribute(ROLE) == AccessibleRole.MENU) { result = menuItem;
--- a/modules/graphics/src/main/java/javafx/scene/AccessibleAttribute.java Wed Aug 13 14:31:41 2014 -0700 +++ b/modules/graphics/src/main/java/javafx/scene/AccessibleAttribute.java Wed Aug 13 14:50:35 2014 -0700 @@ -252,18 +252,6 @@ MAX_VALUE("MaxValue", Double.class), /** - * Returns the Menu. - * Type: Node - */ - MENU("Menu", Node.class), - - /** - * Returns the owner Menu. - * Type: Node - */ - MENU_FOR("MenuFor", Node.class), - - /** * Returns the mnemonic for the node. * Type: String */ @@ -308,6 +296,12 @@ PARENT("Parent", Parent.class), /** + * Returns the owner Menu. + * Type: Node + */ + PARENT_MENU("MenuFor", Node.class), + + /** * Returns the role for the Node. * Type: Role */ @@ -369,6 +363,12 @@ SELECTION_START("SelectionStart", Integer.class), /** + * Returns the Menu. + * Type: Node + */ + SUBMENU("Menu", Node.class), + + /** * Returns the title for the Node. * E.g. * <ul>