From ad1c84aabaf6a33b77a49bda47e8145c22e4190c Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Wed, 26 Sep 2012 09:48:28 +0300 Subject: [PATCH] Primary stylename handling for button #9724 --- client/src/com/vaadin/client/ui/button/VButton.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/client/src/com/vaadin/client/ui/button/VButton.java b/client/src/com/vaadin/client/ui/button/VButton.java index d4cd40e2e9..2486876856 100644 --- a/client/src/com/vaadin/client/ui/button/VButton.java +++ b/client/src/com/vaadin/client/ui/button/VButton.java @@ -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); } -- 2.39.5