diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2009-11-26 14:09:37 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2009-11-26 14:09:37 +0000 |
commit | 2406a8b6f5ffaf2899646c962ed904923d644b77 (patch) | |
tree | 074c7b7b07a20fd5eb92ecec1b9a0c55fca48331 | |
parent | 34c148c276a05c9f514955ce08f7d2dcb0c9f1db (diff) | |
download | vaadin-framework-2406a8b6f5ffaf2899646c962ed904923d644b77.tar.gz vaadin-framework-2406a8b6f5ffaf2899646c962ed904923d644b77.zip |
fixes #3775, added most obvious optimizations for VTree rendering
svn changeset:10077/svn branch:6.2
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VTree.java | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java index aafe7048df..0fe4bfba31 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java @@ -119,8 +119,13 @@ public class VTree extends FlowPanel implements Paintable { continue; } final TreeNode childTree = new TreeNode(); - this.add(childTree); + if (childTree.ie6compatnode != null) { + this.add(childTree); + } childTree.updateFromUIDL(childUidl, client); + if (childTree.ie6compatnode == null) { + this.add(childTree); + } } final String selectMode = uidl.getStringAttribute("selectmode"); selectable = !"none".equals(selectMode); @@ -256,12 +261,14 @@ public class VTree extends FlowPanel implements Paintable { protected void constructDom() { // workaround for a very weird IE6 issue #1245 - ie6compatnode = DOM.createDiv(); - setStyleName(ie6compatnode, CLASSNAME + "-ie6compatnode"); - DOM.setInnerText(ie6compatnode, " "); - DOM.appendChild(getElement(), ie6compatnode); + if (BrowserInfo.get().isIE6()) { + ie6compatnode = DOM.createDiv(); + setStyleName(ie6compatnode, CLASSNAME + "-ie6compatnode"); + DOM.setInnerText(ie6compatnode, " "); + DOM.appendChild(getElement(), ie6compatnode); - DOM.sinkEvents(ie6compatnode, Event.ONCLICK); + DOM.sinkEvents(ie6compatnode, Event.ONCLICK); + } nodeCaptionDiv = DOM.createDiv(); DOM.setElementProperty(nodeCaptionDiv, "className", CLASSNAME @@ -388,8 +395,13 @@ public class VTree extends FlowPanel implements Paintable { continue; } final TreeNode childTree = new TreeNode(); - childNodeContainer.add(childTree); + if (ie6compatnode != null) { + childNodeContainer.add(childTree); + } childTree.updateFromUIDL(childUidl, client); + if (ie6compatnode == null) { + childNodeContainer.add(childTree); + } } childrenLoaded = true; } @@ -467,7 +479,7 @@ public class VTree extends FlowPanel implements Paintable { @Override public void onAttach() { super.onAttach(); - if (BrowserInfo.get().isIE6()) { + if (ie6compatnode != null) { fixWidth(); } } |