]> source.dussan.org Git - vaadin-framework.git/commitdiff
[merge from 6.7] #8559/#8560 Additional fixes based on review
authorAutomerge <automerge@vaadin.com>
Tue, 27 Mar 2012 09:15:02 +0000 (09:15 +0000)
committerAutomerge <automerge@vaadin.com>
Tue, 27 Mar 2012 09:15:02 +0000 (09:15 +0000)
svn changeset:23328/svn branch:6.8

src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java

index f4bacc05b578ce71ab991830b73e03c38c7ae6e1..12678c9515fdb544cc72aa5f165edd052cee8a29 100644 (file)
@@ -1590,12 +1590,10 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
     private void selectFirstItem() {
         for (int i = 0; i < items.size(); i++) {
             CustomMenuItem item = items.get(i);
-            if (!item.isSelectable()) {
-                continue;
+            if (item.isSelectable()) {
+                setSelected(item);
+                break;
             }
-
-            setSelected(item);
-            break;
         }
     }
 
@@ -1611,7 +1609,7 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
 
         menuVisible = true;
         // Select the first item in the newly open submenu
-        subMenu.setSelected(subMenu.getItems().get(0));
+        subMenu.selectFirstItem();
 
     }