]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #1112
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 26 Nov 2007 08:41:50 +0000 (08:41 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 26 Nov 2007 08:41:50 +0000 (08:41 +0000)
svn changeset:2930/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/ICheckBox.java

index 8d80561231a886114999187afb3fe9c9d7192686..8fb87ae06b5f57aa7b7abcdaa662b19430f694c6 100644 (file)
@@ -23,6 +23,8 @@ public class ICheckBox extends com.google.gwt.user.client.ui.CheckBox implements
 
     private Element errorIndicatorElement;
 
+    private Icon icon;
+
     private ErrorMessage errorMessage;
 
     public ICheckBox() {
@@ -73,6 +75,18 @@ public class ICheckBox extends com.google.gwt.user.client.ui.CheckBox implements
             setTitle(uidl.getStringAttribute("description"));
         }
 
+        if (uidl.hasAttribute("icon")) {
+            if (icon == null) {
+                icon = new Icon(client);
+                DOM.insertChild(getElement(), icon.getElement(), 1);
+            }
+            icon.setUri(uidl.getStringAttribute("icon"));
+        } else if (icon != null) {
+            // detach icon
+            DOM.removeChild(getElement(), icon.getElement());
+            icon = null;
+        }
+
         // Set text
         setText(uidl.getStringAttribute("caption"));
         setChecked(uidl.getBooleanVariable("state"));