changeset 7863:6feed77a2bfa

RT-37792: [Accessibility] Combobox list items are counted incorrectly
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Tue, 26 Aug 2014 12:58:58 -0700
parents 6efbcb758363
children e68dd7128fdd
files modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Tue Aug 26 15:54:28 2014 -0400
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Tue Aug 26 12:58:58 2014 -0700
@@ -1023,6 +1023,15 @@
             case NavigateDirection_FirstChild:
             case NavigateDirection_LastChild: {
                 lastIndex = -1;
+                if (role == AccessibleRole.LIST_VIEW) {
+                    /* Windows 7. Initially the ComboBox contains the ListView,
+                     * but the ListCells will only be created if one an item is 
+                     * selected. This causes Narrator to read combo box with
+                     * zero items. The fix is to ask for first item, which will
+                     * cause NavigateListView to be used.
+                     * */
+                    getAttribute(ITEM_AT_INDEX, 0);
+                }
                 if (role == AccessibleRole.TREE_VIEW) {
                     /* The TreeView only returns the root node as child */
                     lastIndex = 0;