From 1da5d9f4e2df6a8f678ed9fe221e7c15f15ca57d Mon Sep 17 00:00:00 2001 From: Joonas Lehtinen Date: Fri, 4 Jul 2008 07:07:17 +0000 Subject: [PATCH] Fixes #1906 : Button should provide easy to use method for getting the boolean state of the checkbox svn changeset:5052/svn branch:trunk --- src/com/itmill/toolkit/ui/Button.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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. * -- 2.39.5