aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2016-08-24 12:55:11 +0300
committerVaadin Code Review <review@vaadin.com>2016-08-25 06:10:15 +0000
commit082929fbdf06374fd6208284be7cc144a75f1cd9 (patch)
treeac8cebb499460c2c66c8f0f9d207b7baaede404b /server/src/main/java/com/vaadin
parent36111d94fab942264199a106bfb7e13751cb3b86 (diff)
downloadvaadin-framework-082929fbdf06374fd6208284be7cc144a75f1cd9.tar.gz
vaadin-framework-082929fbdf06374fd6208284be7cc144a75f1cd9.zip
Allow multiple data change handlers in client-side data sources
This patch moves Registration to shared so it can be used in both client and server Change-Id: I16757f70beb474403903bbcf92c7f850aed68b88
Diffstat (limited to 'server/src/main/java/com/vaadin')
-rw-r--r--server/src/main/java/com/vaadin/data/Binder.java2
-rw-r--r--server/src/main/java/com/vaadin/data/HasValue.java2
-rw-r--r--server/src/main/java/com/vaadin/event/Registration.java33
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractField.java6
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractTextField.java2
5 files changed, 6 insertions, 39 deletions
diff --git a/server/src/main/java/com/vaadin/data/Binder.java b/server/src/main/java/com/vaadin/data/Binder.java
index 658160a930..34027c1f77 100644
--- a/server/src/main/java/com/vaadin/data/Binder.java
+++ b/server/src/main/java/com/vaadin/data/Binder.java
@@ -29,9 +29,9 @@ import java.util.function.Predicate;
import com.vaadin.data.util.converter.Converter;
import com.vaadin.data.util.converter.StringToIntegerConverter;
-import com.vaadin.event.Registration;
import com.vaadin.server.ErrorMessage;
import com.vaadin.server.UserError;
+import com.vaadin.shared.Registration;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Label;
diff --git a/server/src/main/java/com/vaadin/data/HasValue.java b/server/src/main/java/com/vaadin/data/HasValue.java
index 3376ffe347..cbd6bc390f 100644
--- a/server/src/main/java/com/vaadin/data/HasValue.java
+++ b/server/src/main/java/com/vaadin/data/HasValue.java
@@ -20,8 +20,8 @@ import java.util.function.Consumer;
import com.vaadin.event.ConnectorEvent;
import com.vaadin.event.ConnectorEventListener;
-import com.vaadin.event.Registration;
import com.vaadin.server.ClientConnector;
+import com.vaadin.shared.Registration;
/**
* A generic interface for field components and other user interface objects
diff --git a/server/src/main/java/com/vaadin/event/Registration.java b/server/src/main/java/com/vaadin/event/Registration.java
deleted file mode 100644
index ac4879d882..0000000000
--- a/server/src/main/java/com/vaadin/event/Registration.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2000-2016 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.vaadin.event;
-
-import java.io.Serializable;
-
-/**
- * A registration object for removing an event listener added to a source.
- *
- * @author Vaadin Ltd.
- * @since
- */
-@FunctionalInterface
-public interface Registration extends Serializable {
-
- /**
- * Removes the associated listener from the event source.
- */
- public void remove();
-}
diff --git a/server/src/main/java/com/vaadin/ui/AbstractField.java b/server/src/main/java/com/vaadin/ui/AbstractField.java
index d8397a65e1..ee5ded1147 100644
--- a/server/src/main/java/com/vaadin/ui/AbstractField.java
+++ b/server/src/main/java/com/vaadin/ui/AbstractField.java
@@ -25,8 +25,8 @@ import org.jsoup.nodes.Element;
import com.vaadin.data.HasRequired;
import com.vaadin.data.HasValue;
-import com.vaadin.event.Registration;
import com.vaadin.shared.AbstractFieldState;
+import com.vaadin.shared.Registration;
import com.vaadin.ui.Component.Focusable;
import com.vaadin.ui.declarative.DesignAttributeHandler;
import com.vaadin.ui.declarative.DesignContext;
@@ -39,8 +39,8 @@ import com.vaadin.util.ReflectTools;
* <p>
* This class replaces the Vaadin 7 {@code com.vaadin.ui.AbstractField} class.
* The old {@code AbstractField} is retained, under the new name
- * {@link com.vaadin.v7.ui.AbstractField}, for compatibility and
- * migration purposes.
+ * {@link com.vaadin.v7.ui.AbstractField}, for compatibility and migration
+ * purposes.
*
* @author Vaadin Ltd.
* @since
diff --git a/server/src/main/java/com/vaadin/ui/AbstractTextField.java b/server/src/main/java/com/vaadin/ui/AbstractTextField.java
index a192cea137..d265ddf89e 100644
--- a/server/src/main/java/com/vaadin/ui/AbstractTextField.java
+++ b/server/src/main/java/com/vaadin/ui/AbstractTextField.java
@@ -25,7 +25,7 @@ import com.vaadin.event.FieldEvents.BlurEvent;
import com.vaadin.event.FieldEvents.BlurListener;
import com.vaadin.event.FieldEvents.FocusEvent;
import com.vaadin.event.FieldEvents.FocusListener;
-import com.vaadin.event.Registration;
+import com.vaadin.shared.Registration;
import com.vaadin.shared.ui.textfield.TextFieldServerRpc;
import com.vaadin.shared.ui.textfield.TextFieldState;
import com.vaadin.shared.ui.textfield.ValueChangeMode;