From: Joonas Lehtinen Date: Fri, 4 Jul 2008 07:07:17 +0000 (+0000) Subject: Fixes #1906 : Button should provide easy to use method for getting the boolean state... X-Git-Tag: 6.7.0.beta1~4471 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1da5d9f4e2df6a8f678ed9fe221e7c15f15ca57d;p=vaadin-framework.git Fixes #1906 : Button should provide easy to use method for getting the boolean state of the checkbox svn changeset:5052/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/ui/Button.java b/src/com/itmill/toolkit/ui/Button.java index 0af982268f..3184ec554d 100644 --- a/src/com/itmill/toolkit/ui/Button.java +++ b/src/com/itmill/toolkit/ui/Button.java @@ -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. *