From af61d005a3d79e669f088b8d506d8792fe708ce2 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 18 Jul 2011 13:53:35 +0000 Subject: [PATCH] Code cleanup: Use constant instead of "v-disabled" string svn changeset:19823/svn branch:6.7 --- src/com/vaadin/terminal/gwt/client/ui/VButton.java | 4 ++-- src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java | 5 +++-- src/com/vaadin/terminal/gwt/client/ui/VOptionGroup.java | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VButton.java b/src/com/vaadin/terminal/gwt/client/ui/VButton.java index 1cb2a92e2e..bde6320b32 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VButton.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VButton.java @@ -419,12 +419,12 @@ public class VButton extends FocusWidget implements Paintable, ClickHandler, Accessibility.removeState(getElement(), Accessibility.STATE_PRESSED); super.setTabIndex(-1); - addStyleName("v-disabled"); + addStyleName(ApplicationConnection.DISABLED_CLASSNAME); } else { Accessibility.setState(getElement(), Accessibility.STATE_PRESSED, "false"); super.setTabIndex(tabIndex); - removeStyleName("v-disabled"); + removeStyleName(ApplicationConnection.DISABLED_CLASSNAME); } } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java index c1d9f56a4f..f4691a3f27 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java @@ -69,7 +69,7 @@ public class VFormLayout extends SimplePanel implements Container { } if (uidl.hasAttribute("disabled")) { - styles.add("v-disabled"); + styles.add(ApplicationConnection.DISABLED_CLASSNAME); } return styles.toArray(new String[styles.size()]); @@ -339,7 +339,8 @@ public class VFormLayout extends SimplePanel implements Container { public void updateCaption(UIDL uidl) { setVisible(!uidl.getBooleanAttribute("invisible")); - setStyleName(getElement(), "v-disabled", + setStyleName(getElement(), + ApplicationConnection.DISABLED_CLASSNAME, uidl.hasAttribute("disabled")); boolean isEmpty = true; diff --git a/src/com/vaadin/terminal/gwt/client/ui/VOptionGroup.java b/src/com/vaadin/terminal/gwt/client/ui/VOptionGroup.java index b6ae9cca1a..51702cdf8a 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VOptionGroup.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VOptionGroup.java @@ -113,7 +113,8 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, boolean enabled = !opUidl.getBooleanAttribute("disabled") && !isReadonly() && !isDisabled(); op.setEnabled(enabled); - setStyleName(op.getElement(), "v-disabled", !enabled); + setStyleName(op.getElement(), + ApplicationConnection.DISABLED_CLASSNAME, !enabled); op.addClickHandler(this); optionsToKeys.put(op, opUidl.getStringAttribute("key")); panel.add(op); -- 2.39.5