diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2016-11-02 11:02:16 +0200 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2016-11-02 10:07:49 +0000 |
commit | 35c0e4dc46d9ef420e4cc45806cbb9f7e3fc85d8 (patch) | |
tree | b105ef11567405e785d704678f89e78e64900120 /server/src/main | |
parent | cff9d87dd9554727a44cf6af535a644706391ab4 (diff) | |
download | vaadin-framework-35c0e4dc46d9ef420e4cc45806cbb9f7e3fc85d8.tar.gz vaadin-framework-35c0e4dc46d9ef420e4cc45806cbb9f7e3fc85d8.zip |
Clean up state hierarchy for AbstractFieldState
Change-Id: I33c8c977bf8cd2d4c637d7988586496ce963465f
Diffstat (limited to 'server/src/main')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/AbstractComponent.java | 20 | ||||
-rw-r--r-- | server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java | 10 |
2 files changed, 15 insertions, 15 deletions
diff --git a/server/src/main/java/com/vaadin/ui/AbstractComponent.java b/server/src/main/java/com/vaadin/ui/AbstractComponent.java index 5d8c422a7c..f03f1f438f 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractComponent.java +++ b/server/src/main/java/com/vaadin/ui/AbstractComponent.java @@ -55,13 +55,13 @@ import com.vaadin.server.Sizeable; import com.vaadin.server.UserError; import com.vaadin.server.VaadinSession; import com.vaadin.shared.AbstractComponentState; +import com.vaadin.shared.AbstractFieldState; import com.vaadin.shared.ComponentConstants; import com.vaadin.shared.ContextClickRpc; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.Registration; import com.vaadin.shared.ui.ComponentStateUtil; -import com.vaadin.shared.ui.RequiredIndicatorState; import com.vaadin.shared.util.SharedUtil; import com.vaadin.ui.declarative.DesignAttributeHandler; import com.vaadin.ui.declarative.DesignContext; @@ -1386,27 +1386,27 @@ public abstract class AbstractComponent extends AbstractClientConnector * apply for all components!</strong>. * <p> * If the component supports the required indicator (state extends - * {@link RequiredIndicatorState}), then expose this method and + * {@link AbstractFieldState}), then expose this method and * {@link #isRequiredIndicatorVisible()} as {@code public} in the component * and call this method. * <p> * This method will throw a {@link IllegalStateException} if the component * state (returned by {@link #getState()}) does not inherit - * {@link RequiredIndicatorState}. + * {@link AbstractFieldState}. * * @param visible * <code>true</code> to make the required indicator visible, * <code>false</code> if not */ protected void setRequiredIndicatorVisible(boolean visible) { - if (getState(false) instanceof RequiredIndicatorState) { - ((RequiredIndicatorState) getState()).required = visible; + if (getState(false) instanceof AbstractFieldState) { + ((AbstractFieldState) getState()).required = visible; } else { throw new IllegalStateException( "This component does not support the required indicator, since state is of type " + getStateType().getSimpleName() + " and does not inherit " - + RequiredIndicatorState.class.getSimpleName()); + + AbstractFieldState.class.getSimpleName()); } } @@ -1416,20 +1416,20 @@ public abstract class AbstractComponent extends AbstractClientConnector * <p> * This method will throw a {@link IllegalStateException} if the component * state (returned by {@link #getState()}) does not inherit - * {@link RequiredIndicatorState}. + * {@link AbstractFieldState}. * * @return <code>true</code> if visible, <code>false</code> if not * @see #setRequiredIndicatorVisible(boolean) */ protected boolean isRequiredIndicatorVisible() { - if (getState(false) instanceof RequiredIndicatorState) { - return ((RequiredIndicatorState) getState(false)).required; + if (getState(false) instanceof AbstractFieldState) { + return ((AbstractFieldState) getState(false)).required; } else { throw new IllegalStateException( "This component does not support the required indicator, since state is of type " + getStateType().getSimpleName() + " and does not inherit " - + RequiredIndicatorState.class.getSimpleName()); + + AbstractFieldState.class.getSimpleName()); } } diff --git a/server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java b/server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java index 52cd02481c..bd1fc8937a 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java +++ b/server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java @@ -32,12 +32,12 @@ import com.vaadin.server.Resource; import com.vaadin.server.ResourceReference; import com.vaadin.server.SerializablePredicate; import com.vaadin.server.data.DataGenerator; +import com.vaadin.shared.AbstractFieldState; import com.vaadin.shared.Registration; import com.vaadin.shared.data.selection.MultiSelectServerRpc; import com.vaadin.shared.data.selection.SelectionModel; import com.vaadin.shared.data.selection.SelectionModel.Multi; import com.vaadin.shared.ui.ListingJsonConstants; -import com.vaadin.shared.ui.RequiredIndicatorState; import com.vaadin.util.ReflectTools; import elemental.json.JsonObject; @@ -484,13 +484,13 @@ public abstract class AbstractMultiSelect<T> } @Override - protected RequiredIndicatorState getState() { - return (RequiredIndicatorState) super.getState(); + protected AbstractFieldState getState() { + return (AbstractFieldState) super.getState(); } @Override - protected RequiredIndicatorState getState(boolean markAsDirty) { - return (RequiredIndicatorState) super.getState(markAsDirty); + protected AbstractFieldState getState(boolean markAsDirty) { + return (AbstractFieldState) super.getState(markAsDirty); } @Override |