]> source.dussan.org Git - vaadin-framework.git/commitdiff
renaming criteria
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 24 Mar 2010 14:59:03 +0000 (14:59 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 24 Mar 2010 14:59:03 +0000 (14:59 +0000)
svn changeset:12071/svn branch:6.3

src/com/vaadin/event/dd/acceptcriteria/DragSourceIs.java [deleted file]
src/com/vaadin/event/dd/acceptcriteria/SourceIs.java [new file with mode: 0644]
tests/src/com/vaadin/tests/dd/DDTest2.java
tests/src/com/vaadin/tests/dd/DDTest4.java

diff --git a/src/com/vaadin/event/dd/acceptcriteria/DragSourceIs.java b/src/com/vaadin/event/dd/acceptcriteria/DragSourceIs.java
deleted file mode 100644 (file)
index cd54911..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-@ITMillApache2LicenseForJavaFiles@
- */
-/**
- * 
- */
-package com.vaadin.event.dd.acceptcriteria;
-
-import com.vaadin.event.TransferableImpl;
-import com.vaadin.event.dd.DragAndDropEvent;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.dd.VDragSourceIs;
-import com.vaadin.ui.Component;
-
-/**
- * Client side criteria that checks if the drag source is one of the given
- * components.
- * 
- * @since 6.3
- */
-@ClientCriterion(VDragSourceIs.class)
-public class DragSourceIs extends ClientSideCriterion {
-
-    private Component[] component;
-
-    public DragSourceIs(Component... component) {
-        this.component = component;
-    }
-
-    @Override
-    public void paintContent(PaintTarget target) throws PaintException {
-        super.paintContent(target);
-        target.addAttribute("c", component.length);
-        for (int i = 0; i < component.length; i++) {
-            target.addAttribute("component" + i, component[i]);
-        }
-    }
-
-    public boolean accept(DragAndDropEvent dragEvent) {
-        if (dragEvent.getTransferable() instanceof TransferableImpl) {
-            Component sourceComponent = ((TransferableImpl) dragEvent
-                    .getTransferable()).getSourceComponent();
-            for (Component c : component) {
-                if (c == sourceComponent) {
-                    return true;
-                }
-            }
-        }
-
-        return false;
-    }
-
-}
\ No newline at end of file
diff --git a/src/com/vaadin/event/dd/acceptcriteria/SourceIs.java b/src/com/vaadin/event/dd/acceptcriteria/SourceIs.java
new file mode 100644 (file)
index 0000000..8e81f99
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+@ITMillApache2LicenseForJavaFiles@
+ */
+/**
+ * 
+ */
+package com.vaadin.event.dd.acceptcriteria;
+
+import com.vaadin.event.TransferableImpl;
+import com.vaadin.event.dd.DragAndDropEvent;
+import com.vaadin.terminal.PaintException;
+import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.dd.VDragSourceIs;
+import com.vaadin.ui.Component;
+
+/**
+ * Client side criteria that checks if the drag source is one of the given
+ * components.
+ * 
+ * @since 6.3
+ */
+@SuppressWarnings("serial")
+@ClientCriterion(VDragSourceIs.class)
+public class SourceIs extends ClientSideCriterion {
+
+    private Component[] component;
+
+    public SourceIs(Component... component) {
+        this.component = component;
+    }
+
+    @Override
+    public void paintContent(PaintTarget target) throws PaintException {
+        super.paintContent(target);
+        target.addAttribute("c", component.length);
+        for (int i = 0; i < component.length; i++) {
+            target.addAttribute("component" + i, component[i]);
+        }
+    }
+
+    public boolean accept(DragAndDropEvent dragEvent) {
+        if (dragEvent.getTransferable() instanceof TransferableImpl) {
+            Component sourceComponent = ((TransferableImpl) dragEvent
+                    .getTransferable()).getSourceComponent();
+            for (Component c : component) {
+                if (c == sourceComponent) {
+                    return true;
+                }
+            }
+        }
+
+        return false;
+    }
+
+}
\ No newline at end of file
index fb496164436b83d906405209d5e7ff28a80f972c..7efdf0b23d5e3bea872b3c6c0bfcd74b37d25a39 100644 (file)
@@ -15,7 +15,7 @@ import com.vaadin.event.dd.DragAndDropEvent;
 import com.vaadin.event.dd.DropHandler;
 import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
 import com.vaadin.event.dd.acceptcriteria.And;
-import com.vaadin.event.dd.acceptcriteria.DragSourceIs;
+import com.vaadin.event.dd.acceptcriteria.SourceIs;
 import com.vaadin.event.dd.acceptcriteria.Or;
 import com.vaadin.terminal.Resource;
 import com.vaadin.terminal.ThemeResource;
@@ -121,13 +121,13 @@ public class DDTest2 extends TestBase {
         table.setDragMode(Table.TableDragMode.ROW);
 
         OverFolderNode onNode = new OverFolderNode();
-        DragSourceIs fromTable = new DragSourceIs(table);
+        SourceIs fromTable = new SourceIs(table);
 
-        DragSourceIs fromTree = new DragSourceIs(tree1);
+        SourceIs fromTree = new SourceIs(tree1);
         final Or fromTree1OrTable = new Or(fromTable, fromTree);
         // Or could in the case be replaced with, keeping here as an example and
         // test
-        DragSourceIs treeOrTable = new DragSourceIs(table, tree1);
+        SourceIs treeOrTable = new SourceIs(table, tree1);
 
         final And and = new And(fromTree1OrTable, onNode);
 
index 3e458745fbf3a7c094ec067bfc24f8444a8db56e..7ee866afc40b31dbd075978fc48779b61bf41402 100644 (file)
@@ -10,7 +10,7 @@ import com.vaadin.event.DataBoundTransferable;
 import com.vaadin.event.dd.DragAndDropEvent;
 import com.vaadin.event.dd.DropHandler;
 import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
-import com.vaadin.event.dd.acceptcriteria.DragSourceIs;
+import com.vaadin.event.dd.acceptcriteria.SourceIs;
 import com.vaadin.terminal.ThemeResource;
 import com.vaadin.terminal.gwt.client.ui.dd.VerticalDropLocation;
 import com.vaadin.tests.components.TestBase;
@@ -63,7 +63,7 @@ public class DDTest4 extends TestBase {
 
         table.setDropHandler(new DropHandler() {
             // accept only drags from this table
-            AcceptCriterion crit = new DragSourceIs(table);
+            AcceptCriterion crit = new SourceIs(table);
 
             public AcceptCriterion getAcceptCriterion() {
                 return crit;