From 22b20bc9fc4067a026cf08b5130bd20afa89d27e Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 9 Dec 2014 16:58:01 +0200 Subject: Add public Field.isEmpty() and clear() (#15354) Change-Id: I6bda7ff2a66a9ad172c899d855ca868881600be4 --- server/src/com/vaadin/ui/AbstractField.java | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'server/src/com/vaadin/ui/AbstractField.java') diff --git a/server/src/com/vaadin/ui/AbstractField.java b/server/src/com/vaadin/ui/AbstractField.java index 369ad1253c..df7bbb68a2 100644 --- a/server/src/com/vaadin/ui/AbstractField.java +++ b/server/src/com/vaadin/ui/AbstractField.java @@ -1502,25 +1502,12 @@ public abstract class AbstractField extends AbstractComponent implements markAsDirty(); } - /** - * Is the field empty? - * - * In general, "empty" state is same as null. As an exception, TextField - * also treats empty string as "empty". - */ - protected boolean isEmpty() { + @Override + public boolean isEmpty() { return (getFieldValue() == null); } - /** - * Clear the value of the field. - *

- * The field value is typically reset to the initial value of the field but - * this is not mandatory. Calling {@link #isEmpty()} on a cleared field must - * always returns true. - * - * @since - */ + @Override public void clear() { setValue(null); } -- cgit v1.2.3