diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-03-24 15:13:24 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-03-24 15:13:24 +0000 |
commit | fa397b38e7de75b61dff5b9db0387c23be8c5f74 (patch) | |
tree | 186c65d8f8b924bdaf7a4c0a309b9a59d5d8c170 | |
parent | 36bc8fe1ea5eba476e28f93e5742d8c15754eaa1 (diff) | |
download | vaadin-framework-fa397b38e7de75b61dff5b9db0387c23be8c5f74.tar.gz vaadin-framework-fa397b38e7de75b61dff5b9db0387c23be8c5f74.zip |
renaming criteria
svn changeset:12072/svn branch:6.3
-rw-r--r-- | src/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java (renamed from src/com/vaadin/event/dd/acceptcriteria/DropTargetDetailEquals.java) | 12 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/dd/VTargetDetailIs.java (renamed from src/com/vaadin/terminal/gwt/client/ui/dd/VDropDetailEquals.java) | 2 | ||||
-rw-r--r-- | src/com/vaadin/ui/Tree.java | 19 | ||||
-rw-r--r-- | tests/src/com/vaadin/tests/dd/DDTest2.java | 6 | ||||
-rw-r--r-- | tests/src/com/vaadin/tests/dd/HorizontalLayoutSortableWithWrappers.java | 4 |
5 files changed, 26 insertions, 17 deletions
diff --git a/src/com/vaadin/event/dd/acceptcriteria/DropTargetDetailEquals.java b/src/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java index ceb98bbcee..c20f10667d 100644 --- a/src/com/vaadin/event/dd/acceptcriteria/DropTargetDetailEquals.java +++ b/src/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java @@ -10,7 +10,7 @@ import com.vaadin.event.dd.DragAndDropEvent; import com.vaadin.event.dd.DropTargetDetails; import com.vaadin.terminal.PaintException; import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.gwt.client.ui.dd.VDropDetailEquals; +import com.vaadin.terminal.gwt.client.ui.dd.VTargetDetailIs; /** * Criterion for checking if drop target details contains the specific property @@ -21,8 +21,8 @@ import com.vaadin.terminal.gwt.client.ui.dd.VDropDetailEquals; * TODO add support for other basic data types that we support in UIDL. * */ -@ClientCriterion(VDropDetailEquals.class) -public class DropTargetDetailEquals extends ClientSideCriterion { +@ClientCriterion(VTargetDetailIs.class) +public class TargetDetailIs extends ClientSideCriterion { private static final long serialVersionUID = 763165450054331246L; private String propertyName; @@ -38,12 +38,12 @@ public class DropTargetDetailEquals extends ClientSideCriterion { * the reference value to which the drop target detail will be * compared */ - public DropTargetDetailEquals(String dataFlavor, String value) { + public TargetDetailIs(String dataFlavor, String value) { propertyName = dataFlavor; this.value = value; } - public DropTargetDetailEquals(String dataFlavor, Boolean true1) { + public TargetDetailIs(String dataFlavor, Boolean true1) { propertyName = dataFlavor; value = true1; } @@ -68,6 +68,6 @@ public class DropTargetDetailEquals extends ClientSideCriterion { @Override protected String getIdentifier() { // sub classes by default use VDropDetailEquals a client implementation - return DropTargetDetailEquals.class.getCanonicalName(); + return TargetDetailIs.class.getCanonicalName(); } }
\ No newline at end of file diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/VDropDetailEquals.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VTargetDetailIs.java index 6d04e4c35e..4e838fb031 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/dd/VDropDetailEquals.java +++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VTargetDetailIs.java @@ -8,7 +8,7 @@ package com.vaadin.terminal.gwt.client.ui.dd; import com.vaadin.terminal.gwt.client.UIDL; -final public class VDropDetailEquals extends VAcceptCriterion { +final public class VTargetDetailIs extends VAcceptCriterion { @Override protected boolean accept(VDragEvent drag, UIDL configuration) { diff --git a/src/com/vaadin/ui/Tree.java b/src/com/vaadin/ui/Tree.java index 2ce6fe2341..ac4222f8ec 100644 --- a/src/com/vaadin/ui/Tree.java +++ b/src/com/vaadin/ui/Tree.java @@ -35,8 +35,8 @@ import com.vaadin.event.dd.DropTarget; import com.vaadin.event.dd.DropTargetDetails; import com.vaadin.event.dd.acceptcriteria.ClientCriterion; import com.vaadin.event.dd.acceptcriteria.ClientSideCriterion; -import com.vaadin.event.dd.acceptcriteria.DropTargetDetailEquals; import com.vaadin.event.dd.acceptcriteria.ServerSideCriterion; +import com.vaadin.event.dd.acceptcriteria.TargetDetailIs; import com.vaadin.terminal.KeyMapper; import com.vaadin.terminal.PaintException; import com.vaadin.terminal.PaintTarget; @@ -1361,16 +1361,25 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, } /** - * A criterion that accepts transferable only directly on a tree node that - * can have children. + * A criterion that accepts {@link Transferable} only directly on a tree + * node that can have children. + * <p> + * Class is singleton, use {@link TargetItemAllowsChildren#get()} to get the + * instance. * * @see Tree#setChildrenAllowed(Object, boolean) * * @since 6.3 */ - public static class OverFolderNode extends DropTargetDetailEquals { + public static class TargetItemAllowsChildren extends TargetDetailIs { + + private static TargetItemAllowsChildren instance = new TargetItemAllowsChildren(); + + public static TargetItemAllowsChildren get() { + return instance; + } - public OverFolderNode() { + private TargetItemAllowsChildren() { super("itemIdOverIsNode", Boolean.TRUE); } diff --git a/tests/src/com/vaadin/tests/dd/DDTest2.java b/tests/src/com/vaadin/tests/dd/DDTest2.java index 7efdf0b23d..45552d9c79 100644 --- a/tests/src/com/vaadin/tests/dd/DDTest2.java +++ b/tests/src/com/vaadin/tests/dd/DDTest2.java @@ -15,8 +15,8 @@ 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.SourceIs; import com.vaadin.event.dd.acceptcriteria.Or; +import com.vaadin.event.dd.acceptcriteria.SourceIs; import com.vaadin.terminal.Resource; import com.vaadin.terminal.ThemeResource; import com.vaadin.tests.components.TestBase; @@ -28,7 +28,7 @@ import com.vaadin.ui.Window; import com.vaadin.ui.AbstractSelect.AbstractSelectDropTargetDetails; import com.vaadin.ui.AbstractSelect.AcceptItem; import com.vaadin.ui.Table.TableTransferable; -import com.vaadin.ui.Tree.OverFolderNode; +import com.vaadin.ui.Tree.TargetItemAllowsChildren; import com.vaadin.ui.Tree.TreeDragMode; public class DDTest2 extends TestBase { @@ -120,7 +120,7 @@ public class DDTest2 extends TestBase { */ table.setDragMode(Table.TableDragMode.ROW); - OverFolderNode onNode = new OverFolderNode(); + TargetItemAllowsChildren onNode = TargetItemAllowsChildren.get(); SourceIs fromTable = new SourceIs(table); SourceIs fromTree = new SourceIs(tree1); diff --git a/tests/src/com/vaadin/tests/dd/HorizontalLayoutSortableWithWrappers.java b/tests/src/com/vaadin/tests/dd/HorizontalLayoutSortableWithWrappers.java index 4837934cad..2f2baa581c 100644 --- a/tests/src/com/vaadin/tests/dd/HorizontalLayoutSortableWithWrappers.java +++ b/tests/src/com/vaadin/tests/dd/HorizontalLayoutSortableWithWrappers.java @@ -10,7 +10,7 @@ import com.vaadin.event.dd.DropTarget; import com.vaadin.event.dd.DropTargetDetails; import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; import com.vaadin.event.dd.acceptcriteria.And; -import com.vaadin.event.dd.acceptcriteria.DropTargetDetailEquals; +import com.vaadin.event.dd.acceptcriteria.TargetDetailIs; import com.vaadin.event.dd.acceptcriteria.IsSameSourceAndTarget; import com.vaadin.event.dd.acceptcriteria.Not; import com.vaadin.ui.Component; @@ -51,7 +51,7 @@ public class HorizontalLayoutSortableWithWrappers extends Window { } private DropHandler dh = new DropHandler() { - AcceptCriterion crit = new And(new DropTargetDetailEquals( + AcceptCriterion crit = new And(new TargetDetailIs( "horizontalLocation", "LEFT"), new Not(IsSameSourceAndTarget .get())); |