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: rjrjr@google.com git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@10152 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/ui/AttachableComposite.java b/user/src/com/google/gwt/user/client/ui/AttachableComposite.java index 2e89650..f807e1e 100644 --- a/user/src/com/google/gwt/user/client/ui/AttachableComposite.java +++ b/user/src/com/google/gwt/user/client/ui/AttachableComposite.java
@@ -109,6 +109,14 @@ } @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) { if (attachable != null) { assert (initFinished == false);