From e8ae3d54d9c5f984c34813240d069aa613875d6d Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 28 Nov 2011 13:39:03 +0200 Subject: [PATCH] Default value for a CheckBox is now false and not null. Removed old booleanValue as getValue() returns true/false now for all basic cases --- src/com/vaadin/ui/CheckBox.java | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/com/vaadin/ui/CheckBox.java b/src/com/vaadin/ui/CheckBox.java index 358e2a62c6..250ab5f095 100644 --- a/src/com/vaadin/ui/CheckBox.java +++ b/src/com/vaadin/ui/CheckBox.java @@ -21,6 +21,7 @@ public class CheckBox extends AbstractField { * Creates a new checkbox. */ public CheckBox() { + setValue(Boolean.FALSE); } /** @@ -68,7 +69,7 @@ public class CheckBox extends AbstractField { public void paintContent(PaintTarget target) throws PaintException { super.paintContent(target); - target.addVariable(this, VCheckBox.VARIABLE_STATE, booleanValue()); + target.addVariable(this, VCheckBox.VARIABLE_STATE, getValue()); } @Override @@ -114,19 +115,4 @@ public class CheckBox extends AbstractField { } - /** - * Get the boolean value of the checkbox state. - * - * @return True iff the checkbox is checked. - * @deprecated in Vaadin 7.0.0. Retained to ease migration from Vaadin 6 - */ - @Deprecated - public boolean booleanValue() { - // FIXME: How should null really be handled? A default converter that - // converts it to false? The only UI values supported are true and - // false. - Boolean value = getValue(); - return (null == value) ? false : value.booleanValue(); - } - } -- 2.39.5