aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin/ui/AbstractTextField.java
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2016-09-01 14:56:41 +0300
committerVaadin Code Review <review@vaadin.com>2016-09-12 08:11:33 +0000
commit78a5468279ddc442ac64d045f5fe4aa79ed9ef6e (patch)
tree4aabf5ea7495e1b0a3e39dc40ab1813bbe67dd69 /server/src/main/java/com/vaadin/ui/AbstractTextField.java
parentea89e24646cead0eef80dd42a7426fae4e0a6092 (diff)
downloadvaadin-framework-78a5468279ddc442ac64d045f5fe4aa79ed9ef6e.tar.gz
vaadin-framework-78a5468279ddc442ac64d045f5fe4aa79ed9ef6e.zip
Implement new RichTextArea
Change-Id: I6f430c77caaad6d610133f340eba960f2268897e
Diffstat (limited to 'server/src/main/java/com/vaadin/ui/AbstractTextField.java')
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractTextField.java49
1 files changed, 10 insertions, 39 deletions
diff --git a/server/src/main/java/com/vaadin/ui/AbstractTextField.java b/server/src/main/java/com/vaadin/ui/AbstractTextField.java
index e1b0273c6c..b5119ec92c 100644
--- a/server/src/main/java/com/vaadin/ui/AbstractTextField.java
+++ b/server/src/main/java/com/vaadin/ui/AbstractTextField.java
@@ -27,10 +27,10 @@ import com.vaadin.event.FieldEvents.FocusEvent;
import com.vaadin.event.FieldEvents.FocusListener;
import com.vaadin.shared.Registration;
import com.vaadin.shared.communication.FieldRpc.FocusAndBlurServerRpc;
+import com.vaadin.shared.ui.ValueChangeMode;
import com.vaadin.shared.ui.textfield.AbstractTextFieldClientRpc;
import com.vaadin.shared.ui.textfield.AbstractTextFieldServerRpc;
import com.vaadin.shared.ui.textfield.AbstractTextFieldState;
-import com.vaadin.shared.ui.textfield.ValueChangeMode;
import com.vaadin.ui.declarative.DesignAttributeHandler;
import com.vaadin.ui.declarative.DesignContext;
@@ -40,7 +40,8 @@ import com.vaadin.ui.declarative.DesignContext;
* @author Vaadin Ltd.
* @since 8.0
*/
-public abstract class AbstractTextField extends AbstractField<String> {
+public abstract class AbstractTextField extends AbstractField<String>
+ implements HasValueChangeMode {
private final class AbstractTextFieldServerRpcImpl
implements AbstractTextFieldServerRpc {
@@ -173,6 +174,7 @@ public abstract class AbstractTextField extends AbstractField<String> {
/**
* Returns the last known cursor position of the field.
*
+ * @return the last known cursor position
*/
public int getCursorPosition() {
return lastKnownCursorPosition;
@@ -212,41 +214,17 @@ public abstract class AbstractTextField extends AbstractField<String> {
listener);
}
- /**
- * Sets the mode how the TextField triggers {@link ValueChange}s.
- *
- * @param mode
- * the new mode
- *
- * @see ValueChangeMode
- */
+ @Override
public void setValueChangeMode(ValueChangeMode mode) {
getState().valueChangeMode = mode;
}
- /**
- * Returns the currently set {@link ValueChangeMode}.
- *
- * @return the mode used to trigger {@link ValueChange}s.
- *
- * @see ValueChangeMode
- */
+ @Override
public ValueChangeMode getValueChangeMode() {
return getState(false).valueChangeMode;
}
- /**
- * Sets how often {@link ValueChange}s are triggered when the
- * {@link ValueChangeMode} is set to either {@link ValueChangeMode#LAZY} or
- * {@link ValueChangeMode#TIMEOUT}.
- *
- * @param timeout
- * timeout in milliseconds, must be greater or equal to 0
- * @throws IllegalArgumentException
- * if given timeout is smaller than 0
- *
- * @see ValueChangeMode
- */
+ @Override
public void setValueChangeTimeout(int timeout) {
if (timeout < 0) {
throw new IllegalArgumentException(
@@ -255,15 +233,7 @@ public abstract class AbstractTextField extends AbstractField<String> {
getState().valueChangeTimeout = timeout;
}
- /**
- * Returns the currently set timeout, in milliseconds, for how often
- * {@link ValueChange}s are triggered if the current {@link ValueChangeMode}
- * is set to either {@link ValueChangeMode#LAZY} or
- * {@link ValueChangeMode#TIMEOUT}.
- *
- * @return the timeout in milliseconds of how often {@link ValueChange}s are
- * triggered.
- */
+ @Override
public int getValueChangeTimeout() {
return getState(false).valueChangeTimeout;
}
@@ -303,7 +273,8 @@ public abstract class AbstractTextField extends AbstractField<String> {
/**
* Checks if the field is empty.
*
- * @return true if the field value is an empty string, false otherwise
+ * @return <code>true</code> if the field value is an empty string,
+ * <code>false</code> otherwise
*/
public boolean isEmpty() {
return "".equals(getValue());