]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixes #1906 : Button should provide easy to use method for getting the boolean state...
authorJoonas Lehtinen <joonas.lehtinen@itmill.com>
Fri, 4 Jul 2008 07:07:17 +0000 (07:07 +0000)
committerJoonas Lehtinen <joonas.lehtinen@itmill.com>
Fri, 4 Jul 2008 07:07:17 +0000 (07:07 +0000)
svn changeset:5052/svn branch:trunk

src/com/itmill/toolkit/ui/Button.java

index 0af982268f75d2087d1c7242a7ec1e6903a8bbb1..3184ec554dbec217e8bc3806e9ac3301c5a6c0be 100644 (file)
@@ -152,7 +152,7 @@ public class Button extends AbstractField {
      * @param variables
      */
     public void changeVariables(Object source, Map variables) {
-       super.changeVariables(source, variables);
+        super.changeVariables(source, variables);
         if (isReadOnly()) {
             System.err.println("Button: ignoring variable change for"
                     + " read-only component, caption=" + getCaption());
@@ -209,6 +209,15 @@ public class Button extends AbstractField {
         }
     }
 
+    /**
+     * Get the boolean value of the button state.
+     * 
+     * @return True iff the button is pressed down or checked.
+     */
+    boolean booleanValue() {
+        return ((Boolean) getValue()).booleanValue();
+    }
+
     /**
      * Sets immediate mode. Push buttons can not be set in non-immediate mode.
      *