]> source.dussan.org Git - vaadin-framework.git/commitdiff
Primary stylename handling for button #9724
authorJohn Ahlroos <john@vaadin.com>
Wed, 26 Sep 2012 06:48:28 +0000 (09:48 +0300)
committerJohn Ahlroos <john@vaadin.com>
Wed, 26 Sep 2012 06:48:28 +0000 (09:48 +0300)
client/src/com/vaadin/client/ui/button/VButton.java

index d4cd40e2e9e46d64680856972c9c099866daaebe..248687685633315ddae44e8d955d4ce57c70abe7 100644 (file)
@@ -97,19 +97,24 @@ public class VButton extends FocusWidget implements ClickHandler {
         sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.FOCUSEVENTS
                 | Event.KEYEVENTS);
 
-        setStyleName(CLASSNAME);
-
         // Add a11y role "button"
         Accessibility.setRole(getElement(), Accessibility.ROLE_BUTTON);
 
-        wrapper.setClassName(getStylePrimaryName() + "-wrap");
         getElement().appendChild(wrapper);
-        captionElement.setClassName(getStylePrimaryName() + "-caption");
         wrapper.appendChild(captionElement);
 
+        setStyleName(CLASSNAME);
+
         addClickHandler(this);
     }
 
+    @Override
+    public void setStyleName(String style) {
+        super.setStyleName(style);
+        wrapper.setClassName(getStylePrimaryName() + "-wrap");
+        captionElement.setClassName(getStylePrimaryName() + "-caption");
+    }
+
     public void setText(String text) {
         captionElement.setInnerText(text);
     }