From: Matti Tahvonen Date: Wed, 30 Jan 2008 07:01:16 +0000 (+0000) Subject: fixes #1085 X-Git-Tag: 6.7.0.beta1~5145 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5fd7e541ba61b75a182fba0b1a24add016da63a3;p=vaadin-framework.git fixes #1085 svn changeset:3668/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITree.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITree.java index 4568339c72..64693b5b93 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITree.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITree.java @@ -179,6 +179,8 @@ public class ITree extends FlowPanel implements Paintable { private boolean open; + private Icon icon; + public TreeNode() { constructDom(); sinkEvents(Event.ONCLICK); @@ -264,6 +266,20 @@ public class ITree extends FlowPanel implements Paintable { if (uidl.getBooleanAttribute("selected")) { setSelected(true); } + + if (uidl.hasAttribute("icon")) { + if (icon == null) { + icon = new Icon(client); + DOM.insertBefore(nodeCaptionDiv, icon.getElement(), + nodeCaptionSpan); + } + icon.setUri(uidl.getStringAttribute("icon")); + } else { + if (icon != null) { + DOM.removeChild(nodeCaptionDiv, icon.getElement()); + icon = null; + } + } } private void setState(boolean state, boolean notifyServer) {