]> source.dussan.org Git - vaadin-framework.git/commitdiff
Simplified if-else conditional for actions in Tree as well #5992
authorJohn Alhroos <john.ahlroos@itmill.com>
Wed, 27 Apr 2011 11:33:14 +0000 (11:33 +0000)
committerJohn Alhroos <john.ahlroos@itmill.com>
Wed, 27 Apr 2011 11:33:14 +0000 (11:33 +0000)
svn changeset:18495/svn branch:6.6

src/com/vaadin/ui/Tree.java

index 38dbfdae75434506eb2f7f2f6a13da92be296566..e47d9c79090844142373f4d69cd603054b6b3c1f 100644 (file)
@@ -443,18 +443,11 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
             if (st.countTokens() == 2) {
                 final Object itemId = itemIdMapper.get(st.nextToken());
                 final Action action = (Action) actionMapper.get(st.nextToken());
-                if (action != null && containsId(itemId)
+                if (action != null && (itemId == null || containsId(itemId))
                         && actionHandlers != null) {
-                    // Item action
                     for (Handler ah : actionHandlers) {
                         ah.handleAction(action, this, itemId);
                     }
-                } else if (action != null && actionHandlers != null
-                        && itemId == null) {
-                    // Body action
-                    for (Handler ah : actionHandlers) {
-                        ah.handleAction(action, this, null);
-                    }
                 }
             }
         }