summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2010-03-24 14:57:23 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2010-03-24 14:57:23 +0000
commitd595ded5f102204d4c68899649c41a336f9a4531 (patch)
tree952be184e917cee9b193489b5361e0b8ec83d840 /src
parent07981b72072ec1aea6a5116b018016760b288a06 (diff)
downloadvaadin-framework-d595ded5f102204d4c68899649c41a336f9a4531.tar.gz
vaadin-framework-d595ded5f102204d4c68899649c41a336f9a4531.zip
renaming criteria
svn changeset:12070/svn branch:6.3
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/event/dd/acceptcriteria/IsDataBound.java48
-rw-r--r--src/com/vaadin/ui/AbstractSelect.java10
2 files changed, 10 insertions, 48 deletions
diff --git a/src/com/vaadin/event/dd/acceptcriteria/IsDataBound.java b/src/com/vaadin/event/dd/acceptcriteria/IsDataBound.java
deleted file mode 100644
index 6b7121e493..0000000000
--- a/src/com/vaadin/event/dd/acceptcriteria/IsDataBound.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-@ITMillApache2LicenseForJavaFiles@
- */
-/**
- *
- */
-package com.vaadin.event.dd.acceptcriteria;
-
-import com.vaadin.data.Container;
-import com.vaadin.data.Item;
-import com.vaadin.event.DataBoundTransferable;
-import com.vaadin.event.Transferable;
-import com.vaadin.event.dd.DragAndDropEvent;
-import com.vaadin.ui.Table;
-import com.vaadin.ui.Tree;
-
-/**
- * A simple accept criterion which ensures that {@link Transferable} contains an
- * {@link Item} identifiers. In other words the criterion check that drag is
- * coming from a {@link Container} like {@link Tree} or {@link Table}. TODO
- * Javadoc
- * <p>
- * Note! class is singleton, use {@link #get()} method to get the instance.
- *
- * @since 6.3
- *
- */
-public final class IsDataBound extends ContainsDataFlavor {
- private static final long serialVersionUID = 1952366107184656946L;
- private static IsDataBound singleton = new IsDataBound();
-
- private IsDataBound() {
- super("itemId");
- }
-
- public static IsDataBound get() {
- return singleton;
- }
-
- @Override
- public boolean accept(DragAndDropEvent dragEvent) {
- if (dragEvent.getTransferable() instanceof DataBoundTransferable) {
- return ((DataBoundTransferable) dragEvent.getTransferable())
- .getItemId() != null;
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/src/com/vaadin/ui/AbstractSelect.java b/src/com/vaadin/ui/AbstractSelect.java
index b12e7e05d8..42bc93a183 100644
--- a/src/com/vaadin/ui/AbstractSelect.java
+++ b/src/com/vaadin/ui/AbstractSelect.java
@@ -26,6 +26,7 @@ import com.vaadin.event.dd.DropTarget;
import com.vaadin.event.dd.DropTargetDetailsImpl;
import com.vaadin.event.dd.acceptcriteria.ClientCriterion;
import com.vaadin.event.dd.acceptcriteria.ClientSideCriterion;
+import com.vaadin.event.dd.acceptcriteria.ContainsDataFlavor;
import com.vaadin.terminal.KeyMapper;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
@@ -1788,6 +1789,15 @@ public abstract class AbstractSelect extends AbstractField implements
return itemIds.contains(transferable.getItemId());
}
+ /**
+ * A simple accept criterion which ensures that {@link Transferable}
+ * contains an {@link Item} (or actually its identifier). In other words
+ * the criterion check that drag is coming from a {@link Container} like
+ * {@link Tree} or {@link Table}.
+ */
+ public static final ClientSideCriterion ALL = new ContainsDataFlavor(
+ "itemId");
+
}
/**