summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2011-07-18 13:50:35 +0000
committerArtur Signell <artur.signell@itmill.com>2011-07-18 13:50:35 +0000
commit430c759be0a18b8f5573899dc89e23590302577a (patch)
treea6e47ed3699a3dde8fa013d428d8b4a81570efa3 /src/com
parent1bbad422177eac5a795e0b63cfbd788f9e99d864 (diff)
downloadvaadin-framework-430c759be0a18b8f5573899dc89e23590302577a.tar.gz
vaadin-framework-430c759be0a18b8f5573899dc89e23590302577a.zip
#7284 Disabling a VNativeButton should set v-disabled style
svn changeset:19822/svn branch:6.7
Diffstat (limited to 'src/com')
-rwxr-xr-xsrc/com/vaadin/terminal/gwt/client/ApplicationConnection.java4
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VNativeButton.java12
2 files changed, 15 insertions, 1 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
index 056428881f..d320e463cb 100755
--- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
+++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
@@ -65,6 +65,8 @@ public class ApplicationConnection {
private static final String MODIFIED_CLASSNAME = "v-modified";
+ public static final String DISABLED_CLASSNAME = "v-disabled";
+
private static final String REQUIRED_CLASSNAME_EXT = "-required";
private static final String ERROR_CLASSNAME_EXT = "-error";
@@ -1768,7 +1770,7 @@ public class ApplicationConnection {
// first disabling and read-only status
if (!enabled) {
styleBuf.append(" ");
- styleBuf.append("v-disabled");
+ styleBuf.append(DISABLED_CLASSNAME);
}
if (uidl.getBooleanAttribute("readonly")) {
styleBuf.append(" ");
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VNativeButton.java b/src/com/vaadin/terminal/gwt/client/ui/VNativeButton.java
index 8ea2e1a688..6a785ae211 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VNativeButton.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VNativeButton.java
@@ -227,4 +227,16 @@ public class VNativeButton extends Button implements Paintable, ClickHandler,
client.updateVariable(id, EventId.BLUR, "", true);
}
+ @Override
+ public void setEnabled(boolean enabled) {
+ if (isEnabled() != enabled) {
+ super.setEnabled(enabled);
+ if (enabled) {
+ removeStyleName(ApplicationConnection.DISABLED_CLASSNAME);
+ } else {
+ addStyleName(ApplicationConnection.DISABLED_CLASSNAME);
+ }
+ }
+ }
+
}