aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/event
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2010-02-17 09:10:43 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2010-02-17 09:10:43 +0000
commit8d2ace1645c029eafc2de9dd7704980709692819 (patch)
tree2fc8369656e4522581f915c60f50047673f29d8e /src/com/vaadin/event
parent3b012b40d19c9b9b3acb7b675e82e07aad309cbe (diff)
downloadvaadin-framework-8d2ace1645c029eafc2de9dd7704980709692819.tar.gz
vaadin-framework-8d2ace1645c029eafc2de9dd7704980709692819.zip
criterion map now generated from annotations from server side counterpart
svn changeset:11350/svn branch:6.3_dd
Diffstat (limited to 'src/com/vaadin/event')
-rw-r--r--src/com/vaadin/event/dd/acceptCriteria/AcceptAll.java2
-rw-r--r--src/com/vaadin/event/dd/acceptCriteria/AcceptCriterion.java4
-rw-r--r--src/com/vaadin/event/dd/acceptCriteria/And.java1
-rw-r--r--src/com/vaadin/event/dd/acceptCriteria/ClientCriterion.java22
-rw-r--r--src/com/vaadin/event/dd/acceptCriteria/ComponentFilter.java2
-rw-r--r--src/com/vaadin/event/dd/acceptCriteria/IsDatabound.java2
-rw-r--r--src/com/vaadin/event/dd/acceptCriteria/Not.java2
-rw-r--r--src/com/vaadin/event/dd/acceptCriteria/Or.java2
-rw-r--r--src/com/vaadin/event/dd/acceptCriteria/OverTreeNode.java2
-rw-r--r--src/com/vaadin/event/dd/acceptCriteria/ServerSideCriterion.java2
10 files changed, 40 insertions, 1 deletions
diff --git a/src/com/vaadin/event/dd/acceptCriteria/AcceptAll.java b/src/com/vaadin/event/dd/acceptCriteria/AcceptAll.java
index 4424447d97..93a28a4d99 100644
--- a/src/com/vaadin/event/dd/acceptCriteria/AcceptAll.java
+++ b/src/com/vaadin/event/dd/acceptCriteria/AcceptAll.java
@@ -4,7 +4,9 @@
package com.vaadin.event.dd.acceptCriteria;
import com.vaadin.event.dd.DragAndDropEvent;
+import com.vaadin.terminal.gwt.client.ui.dd.VAcceptAll;
+@ClientCriterion(VAcceptAll.class)
public final class AcceptAll extends ClientSideCriterion {
private static AcceptCriterion singleton = new AcceptAll();
diff --git a/src/com/vaadin/event/dd/acceptCriteria/AcceptCriterion.java b/src/com/vaadin/event/dd/acceptCriteria/AcceptCriterion.java
index 24b0d9f2b8..1029e51baa 100644
--- a/src/com/vaadin/event/dd/acceptCriteria/AcceptCriterion.java
+++ b/src/com/vaadin/event/dd/acceptCriteria/AcceptCriterion.java
@@ -3,13 +3,15 @@
*/
package com.vaadin.event.dd.acceptCriteria;
+import java.io.Serializable;
+
import com.vaadin.event.Transferable;
import com.vaadin.event.dd.DragAndDropEvent;
import com.vaadin.event.dd.DropHandler;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-public interface AcceptCriterion {
+public interface AcceptCriterion extends Serializable {
/**
* Criterion that can be used create policy to accept/discard dragged
diff --git a/src/com/vaadin/event/dd/acceptCriteria/And.java b/src/com/vaadin/event/dd/acceptCriteria/And.java
index 29a4a6aa2e..91144771f9 100644
--- a/src/com/vaadin/event/dd/acceptCriteria/And.java
+++ b/src/com/vaadin/event/dd/acceptCriteria/And.java
@@ -11,6 +11,7 @@ import com.vaadin.terminal.PaintTarget;
* TODO consider replacing this with Union
*
*/
+@ClientCriterion(com.vaadin.terminal.gwt.client.ui.dd.VAnd.class)
public class And extends ClientSideCriterion {
/**
*
diff --git a/src/com/vaadin/event/dd/acceptCriteria/ClientCriterion.java b/src/com/vaadin/event/dd/acceptCriteria/ClientCriterion.java
new file mode 100644
index 0000000000..ebc58bcbe3
--- /dev/null
+++ b/src/com/vaadin/event/dd/acceptCriteria/ClientCriterion.java
@@ -0,0 +1,22 @@
+package com.vaadin.event.dd.acceptCriteria;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import com.vaadin.terminal.gwt.client.ui.dd.VAcceptCriteria;
+
+/**
+ * TODO
+ *
+ * @since 6.2
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface ClientCriterion {
+ /**
+ * @return the client side counterpart for the annotated criterion
+ */
+ Class<? extends VAcceptCriteria> value();
+}
diff --git a/src/com/vaadin/event/dd/acceptCriteria/ComponentFilter.java b/src/com/vaadin/event/dd/acceptCriteria/ComponentFilter.java
index 85b0a953e3..fc0ffd2c53 100644
--- a/src/com/vaadin/event/dd/acceptCriteria/ComponentFilter.java
+++ b/src/com/vaadin/event/dd/acceptCriteria/ComponentFilter.java
@@ -7,8 +7,10 @@ import com.vaadin.event.ComponentTransferable;
import com.vaadin.event.dd.DragAndDropEvent;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.dd.VComponentFilter;
import com.vaadin.ui.Component;
+@ClientCriterion(VComponentFilter.class)
public class ComponentFilter extends ClientSideCriterion {
private Component[] component;
diff --git a/src/com/vaadin/event/dd/acceptCriteria/IsDatabound.java b/src/com/vaadin/event/dd/acceptCriteria/IsDatabound.java
index 4b40296e3b..10ac493bf3 100644
--- a/src/com/vaadin/event/dd/acceptCriteria/IsDatabound.java
+++ b/src/com/vaadin/event/dd/acceptCriteria/IsDatabound.java
@@ -5,7 +5,9 @@ package com.vaadin.event.dd.acceptCriteria;
import com.vaadin.event.DataBoundTransferable;
import com.vaadin.event.dd.DragAndDropEvent;
+import com.vaadin.terminal.gwt.client.ui.dd.VDataBound;
+@ClientCriterion(VDataBound.class)
public final class IsDatabound extends ClientSideCriterion {
private static IsDatabound singleton = new IsDatabound();
diff --git a/src/com/vaadin/event/dd/acceptCriteria/Not.java b/src/com/vaadin/event/dd/acceptCriteria/Not.java
index 58d1aed5df..d11df81d55 100644
--- a/src/com/vaadin/event/dd/acceptCriteria/Not.java
+++ b/src/com/vaadin/event/dd/acceptCriteria/Not.java
@@ -4,7 +4,9 @@
package com.vaadin.event.dd.acceptCriteria;
import com.vaadin.event.dd.DragAndDropEvent;
+import com.vaadin.terminal.gwt.client.ui.dd.VNot;
+@ClientCriterion(VNot.class)
public class Not extends ClientSideCriterion {
private AcceptCriterion acceptCriterion;
diff --git a/src/com/vaadin/event/dd/acceptCriteria/Or.java b/src/com/vaadin/event/dd/acceptCriteria/Or.java
index 59f4de90f2..60b7152338 100644
--- a/src/com/vaadin/event/dd/acceptCriteria/Or.java
+++ b/src/com/vaadin/event/dd/acceptCriteria/Or.java
@@ -6,11 +6,13 @@ package com.vaadin.event.dd.acceptCriteria;
import com.vaadin.event.dd.DragAndDropEvent;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.dd.VOr;
/**
* TODO consider replacing this with intersection
*
*/
+@ClientCriterion(VOr.class)
public class Or extends ClientSideCriterion {
/**
*
diff --git a/src/com/vaadin/event/dd/acceptCriteria/OverTreeNode.java b/src/com/vaadin/event/dd/acceptCriteria/OverTreeNode.java
index 80321ef963..9eeed0b617 100644
--- a/src/com/vaadin/event/dd/acceptCriteria/OverTreeNode.java
+++ b/src/com/vaadin/event/dd/acceptCriteria/OverTreeNode.java
@@ -4,6 +4,7 @@
package com.vaadin.event.dd.acceptCriteria;
import com.vaadin.event.dd.DragAndDropEvent;
+import com.vaadin.terminal.gwt.client.ui.dd.VOverTreeNode;
import com.vaadin.ui.Tree;
import com.vaadin.ui.Tree.Location;
import com.vaadin.ui.Tree.TreeDropDetails;
@@ -14,6 +15,7 @@ import com.vaadin.ui.Tree.TreeDropDetails;
* TODO relocate close to {@link Tree} as this is tree specifif
*
*/
+@ClientCriterion(VOverTreeNode.class)
public class OverTreeNode extends ClientSideCriterion {
private static final long serialVersionUID = 1L;
diff --git a/src/com/vaadin/event/dd/acceptCriteria/ServerSideCriterion.java b/src/com/vaadin/event/dd/acceptCriteria/ServerSideCriterion.java
index 36a25346ca..382af29237 100644
--- a/src/com/vaadin/event/dd/acceptCriteria/ServerSideCriterion.java
+++ b/src/com/vaadin/event/dd/acceptCriteria/ServerSideCriterion.java
@@ -4,7 +4,9 @@ import java.io.Serializable;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.dd.VServerAccept;
+@ClientCriterion(VServerAccept.class)
public abstract class ServerSideCriterion implements Serializable,
AcceptCriterion {