Revision: 10152
Author:   [email protected]
Date:     Thu May  5 12:19:19 2011
Log: Make AttachableComposite delegate setStyleName to the wrapped Widget.

Review at http://gwt-code-reviews.appspot.com/1433802

Lack of this is making templates that set the style of AttachableComposite
widgets
fail, because when setStyleName is called the element hasn't been set yet. It's
clear at this point that we need underlying support for this, instead of
replicating this kind of logic all over the place. Again, I'm only overriding setStyleName because that's what UiBinder uses and that's what's holding us back a bit. But this will probably be priority number one when we're ironing out the
API/implementation.

Review by: [email protected]
http://code.google.com/p/google-web-toolkit/source/detail?r=10152

Modified:
 /trunk/user/src/com/google/gwt/user/client/ui/AttachableComposite.java

=======================================
--- /trunk/user/src/com/google/gwt/user/client/ui/AttachableComposite.java Tue Apr 26 11:22:45 2011 +++ /trunk/user/src/com/google/gwt/user/client/ui/AttachableComposite.java Thu May 5 12:19:19 2011
@@ -107,6 +107,14 @@
       builder.append(TEMPLATE.renderWithId(id));
     }
   }
+
+  @Override
+  public void setStyleName(String styleName) {
+    if (this.widget == null) {
+ throw new IllegalStateException("setStyleName called before initWidget.");
+    }
+    widget.setStyleName(styleName);
+  }

   @Override
   public void wrapElement(Element element) {

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to