Style "empty-caption" for button without caption #PL-5218

This commit is contained in:
Yuriy Artamonov 2015-04-10 09:45:41 +00:00
parent aebeffc7c9
commit 48dfead0f1

View File

@ -18,6 +18,10 @@ import com.vaadin.client.ui.VButton;
*/
public class CubaButtonWidget extends VButton {
public CubaButtonWidget() {
addStyleDependentName("empty-caption");
}
@Override
public void onClick(ClickEvent event) {
if (BrowserInfo.get().isIE() && BrowserInfo.get().getIEVersion() >= 11) {
@ -28,6 +32,17 @@ public class CubaButtonWidget extends VButton {
super.onClick(event);
}
@Override
public void setText(String text) {
if (text == null || "".equals(text)) {
addStyleDependentName("empty-caption");
} else {
removeStyleDependentName("empty-caption");
}
super.setText(text);
}
@Override
protected boolean handleKeyboardEvents(Event event) {
int type = DOM.eventGetType(event);