]> source.dussan.org Git - vaadin-framework.git/commitdiff
Small bugfix related to #6745: Connectors for Tree
authorJouni Koivuviita <jouni.koivuviita@itmill.com>
Wed, 24 Aug 2011 09:45:31 +0000 (09:45 +0000)
committerJouni Koivuviita <jouni.koivuviita@itmill.com>
Wed, 24 Aug 2011 09:45:31 +0000 (09:45 +0000)
-Tree root nodes received a wrong classname if they had childnodes (the last root node was always treated as a leaf)
-Fixed hover styles in Reindeer

svn changeset:20605/svn branch:6.7

WebContent/VAADIN/themes/reindeer/tree/tree.css
src/com/vaadin/terminal/gwt/client/ui/VTree.java

index d33985f713b573c65687d787389dfb28fdfa43da..0274d8b18e64092c514694dc3c2281faa54290d2 100644 (file)
 .v-tree-node-expanded {
        background-position: -7px 5px;
 }
-.v-tree-connectors .v-tree-node-leaf {
+.v-tree-connectors .v-tree-node-leaf,
+.v-tree-connectors .v-tree-node-leaf:hover {
        background-position: 8px -1px;
 }
-.v-ie6 .v-tree-connectors div.v-tree-node-leaf {
+.v-ie6 .v-tree-connectors div.v-tree-node-leaf,
+.v-ie6 .v-tree-connectors div.v-tree-node-leaf:hover {
        background: transparent url(../../base/tree/img/connector-item.png) no-repeat 8px -1px;
 }
-.v-ie6 .v-tree-connectors div.v-tree-node-leaf-last {
+.v-ie6 .v-tree-connectors div.v-tree-node-leaf-last,
+.v-ie6 .v-tree-connectors div.v-tree-node-leaf-last:hover {
        background: transparent url(../../base/tree/img/connector-item-last.png) no-repeat 8px -1px;
 }
 .v-tree-node-caption {
index d7f575d67543ce1f2fd900486d18ab7af36a57d6..d63ddc5e02c8ac72eb0d9051612a422049fb2c90 100644 (file)
@@ -266,8 +266,9 @@ public class VTree extends FocusElementPanel implements Paintable,
 
         body.clear();
         TreeNode childTree = null;
+        UIDL childUidl = null;
         for (final Iterator<?> i = uidl.getChildIterator(); i.hasNext();) {
-            final UIDL childUidl = (UIDL) i.next();
+            childUidl = (UIDL) i.next();
             if ("actions".equals(childUidl.getTag())) {
                 updateActionMap(childUidl);
                 continue;
@@ -286,8 +287,8 @@ public class VTree extends FocusElementPanel implements Paintable,
             childTree.addStyleDependentName("root");
             childTree.childNodeContainer.addStyleDependentName("root");
         }
-        if (childTree != null) {
-            boolean leaf = !uidl.getTag().equals("node");
+        if (childTree != null && childUidl != null) {
+            boolean leaf = !childUidl.getTag().equals("node");
             childTree.addStyleDependentName(leaf ? "leaf-last" : "last");
             childTree.childNodeContainer.addStyleDependentName("last");
         }