aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2010-02-01 12:54:02 +0000
committerArtur Signell <artur.signell@itmill.com>2010-02-01 12:54:02 +0000
commitd75f17e5fba724e165b7240e191dc6e7181a3fb4 (patch)
tree1fc2fa7ebc88ce76dc5f48b7afbab1bb687565bf /src/com/vaadin
parent9fd975b1b228d339301637a9d225d1d62661c53f (diff)
downloadvaadin-framework-d75f17e5fba724e165b7240e191dc6e7181a3fb4.tar.gz
vaadin-framework-d75f17e5fba724e165b7240e191dc6e7181a3fb4.zip
Prefixed client side classes with V
svn changeset:11075/svn branch:6.3_dd
Diffstat (limited to 'src/com/vaadin')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VDragDropPane.java48
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java10
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VTree.java44
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/dd/AcceptCriteria.java9
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/dd/AcceptCriterion.java21
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/dd/VAbstractDropHandler.java (renamed from src/com/vaadin/terminal/gwt/client/ui/dd/AbstractDropHandler.java)24
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCallback.java (renamed from src/com/vaadin/terminal/gwt/client/ui/dd/AcceptCallback.java)8
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriteria.java9
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriterion.java21
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriterionImpl.java (renamed from src/com/vaadin/terminal/gwt/client/ui/dd/AcceptCriterionImpl.java)30
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/dd/VDragAndDropManager.java (renamed from src/com/vaadin/terminal/gwt/client/ui/dd/DragAndDropManager.java)52
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/dd/VDragEvent.java (renamed from src/com/vaadin/terminal/gwt/client/ui/dd/DragEvent.java)14
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/dd/VDropHandler.java (renamed from src/com/vaadin/terminal/gwt/client/ui/dd/DropHandler.java)16
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/dd/VHasDropHandler.java (renamed from src/com/vaadin/terminal/gwt/client/ui/dd/HasDropHandler.java)6
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent.java (renamed from src/com/vaadin/terminal/gwt/client/ui/dd/Html5DragEvent.java)4
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/dd/VTransferable.java (renamed from src/com/vaadin/terminal/gwt/client/ui/dd/Transferable.java)12
16 files changed, 164 insertions, 164 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VDragDropPane.java b/src/com/vaadin/terminal/gwt/client/ui/VDragDropPane.java
index 3504b8d258..7ebe953733 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VDragDropPane.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VDragDropPane.java
@@ -15,22 +15,22 @@ import com.vaadin.terminal.gwt.client.Container;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.ui.dd.AbstractDropHandler;
-import com.vaadin.terminal.gwt.client.ui.dd.DragAndDropManager;
-import com.vaadin.terminal.gwt.client.ui.dd.DragEvent;
-import com.vaadin.terminal.gwt.client.ui.dd.HasDropHandler;
-import com.vaadin.terminal.gwt.client.ui.dd.Html5DragEvent;
-import com.vaadin.terminal.gwt.client.ui.dd.Transferable;
+import com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler;
+import com.vaadin.terminal.gwt.client.ui.dd.VDragAndDropManager;
+import com.vaadin.terminal.gwt.client.ui.dd.VDragEvent;
+import com.vaadin.terminal.gwt.client.ui.dd.VHasDropHandler;
+import com.vaadin.terminal.gwt.client.ui.dd.VHtml5DragEvent;
+import com.vaadin.terminal.gwt.client.ui.dd.VTransferable;
public class VDragDropPane extends VAbsoluteLayout implements Container,
- HasDropHandler {
+ VHasDropHandler {
private String paintableId;
/**
* DragEvent is stored here in case of HTML5 drag event.
*/
- private DragEvent vaadinDragEvent;
+ private VDragEvent vaadinDragEvent;
public VDragDropPane() {
super();
@@ -40,9 +40,9 @@ public class VDragDropPane extends VAbsoluteLayout implements Container,
.getEventTarget();
Paintable paintable = client.getPaintable((Element) eventTarget
.cast());
- Transferable transferable = new Transferable();
+ VTransferable transferable = new VTransferable();
transferable.setComponent(paintable);
- DragEvent drag = DragAndDropManager.get().startDrag(
+ VDragEvent drag = VDragAndDropManager.get().startDrag(
transferable, event.getNativeEvent(), true);
Element cloneNode = (Element) ((Widget) paintable).getElement()
.cloneNode(true);
@@ -90,20 +90,20 @@ public class VDragDropPane extends VAbsoluteLayout implements Container,
}-*/;
- public boolean html5DragEnter(Html5DragEvent event) {
+ public boolean html5DragEnter(VHtml5DragEvent event) {
ApplicationConnection.getConsole().log("HTML 5 Drag Enter");
- Transferable transferable = new Transferable();
+ VTransferable transferable = new VTransferable();
// TODO refine api somehow so that we will now not use the event preview
// method provided by manager
- vaadinDragEvent = DragAndDropManager.get().startDrag(transferable,
+ vaadinDragEvent = VDragAndDropManager.get().startDrag(transferable,
event, false);
event.preventDefault();
event.stopPropagation();
return false;
}
- public boolean html5DragLeave(Html5DragEvent event) {
+ public boolean html5DragLeave(VHtml5DragEvent event) {
ApplicationConnection.getConsole().log("HTML 5 Drag Leave posponed...");
DeferredCommand.addCommand(new Command() {
public void execute() {
@@ -123,7 +123,7 @@ public class VDragDropPane extends VAbsoluteLayout implements Container,
return false;
}
- public boolean html5DragOver(Html5DragEvent event) {
+ public boolean html5DragOver(VHtml5DragEvent event) {
ApplicationConnection.getConsole().log("HTML 5 Drag Over");
getDropHandler().dragOver(vaadinDragEvent);
// needed to be set for Safari, otherwise drop will not happen
@@ -139,9 +139,9 @@ public class VDragDropPane extends VAbsoluteLayout implements Container,
return false;
}
- public boolean html5DragDrop(Html5DragEvent event) {
+ public boolean html5DragDrop(VHtml5DragEvent event) {
ApplicationConnection.getConsole().log("HTML 5 Drag Drop");
- Transferable transferable = vaadinDragEvent.getTransferrable();
+ VTransferable transferable = vaadinDragEvent.getTransferrable();
JsArrayString types = event.getTypes();
for (int i = 0; i < types.length(); i++) {
@@ -160,7 +160,7 @@ public class VDragDropPane extends VAbsoluteLayout implements Container,
transferable.setData("fileContents", fileAsString);
}
- DragAndDropManager.get().endDrag();
+ VDragAndDropManager.get().endDrag();
vaadinDragEvent = null;
event.preventDefault();
event.stopPropagation();
@@ -178,11 +178,11 @@ public class VDragDropPane extends VAbsoluteLayout implements Container,
}
}
- private AbstractDropHandler dropHandler;
+ private VAbstractDropHandler dropHandler;
- public AbstractDropHandler getDropHandler() {
+ public VAbstractDropHandler getDropHandler() {
if (dropHandler == null) {
- dropHandler = new AbstractDropHandler() {
+ dropHandler = new VAbstractDropHandler() {
@Override
public Paintable getPaintable() {
@@ -190,13 +190,13 @@ public class VDragDropPane extends VAbsoluteLayout implements Container,
}
@Override
- public void dragLeave(DragEvent drag) {
+ public void dragLeave(VDragEvent drag) {
ApplicationConnection.getConsole().log("DragLeave");
getStyleElement().getStyle().setBackgroundColor("yellow");
}
@Override
- public boolean drop(DragEvent drag) {
+ public boolean drop(VDragEvent drag) {
ApplicationConnection.getConsole().log(
"Drop" + drag.sinceStart());
@@ -226,7 +226,7 @@ public class VDragDropPane extends VAbsoluteLayout implements Container,
}
@Override
- protected void dragAccepted(DragEvent drag) {
+ protected void dragAccepted(VDragEvent drag) {
getStyleElement().getStyle().setBackgroundColor("green");
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
index 08419ec45b..bef74ff274 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
@@ -40,9 +40,9 @@ import com.vaadin.terminal.gwt.client.RenderSpace;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.ui.VScrollTable.VScrollTableBody.VScrollTableRow;
-import com.vaadin.terminal.gwt.client.ui.dd.DragAndDropManager;
-import com.vaadin.terminal.gwt.client.ui.dd.DragEvent;
-import com.vaadin.terminal.gwt.client.ui.dd.Transferable;
+import com.vaadin.terminal.gwt.client.ui.dd.VDragAndDropManager;
+import com.vaadin.terminal.gwt.client.ui.dd.VDragEvent;
+import com.vaadin.terminal.gwt.client.ui.dd.VTransferable;
/**
* VScrollTable
@@ -2499,12 +2499,12 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler {
break;
case Event.ONMOUSEMOVE:
if (mDown && dragmode != 0) {
- Transferable transferable = new Transferable();
+ VTransferable transferable = new VTransferable();
transferable.setComponent(VScrollTable.this);
transferable.setItemId("" + rowKey);
// TODO propertyId
- DragEvent ev = DragAndDropManager.get()
+ VDragEvent ev = VDragAndDropManager.get()
.startDrag(transferable, event, true);
Element cloneNode = (Element) getElement()
.cloneNode(true);
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java
index 948e6705c1..f31e652ffc 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java
@@ -27,19 +27,19 @@ import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.ValueMap;
-import com.vaadin.terminal.gwt.client.ui.dd.AbstractDropHandler;
-import com.vaadin.terminal.gwt.client.ui.dd.AcceptCallback;
-import com.vaadin.terminal.gwt.client.ui.dd.DragAndDropManager;
-import com.vaadin.terminal.gwt.client.ui.dd.DragEvent;
-import com.vaadin.terminal.gwt.client.ui.dd.DropHandler;
-import com.vaadin.terminal.gwt.client.ui.dd.HasDropHandler;
-import com.vaadin.terminal.gwt.client.ui.dd.Transferable;
-import com.vaadin.terminal.gwt.client.ui.dd.DragAndDropManager.DragEventType;
+import com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler;
+import com.vaadin.terminal.gwt.client.ui.dd.VAcceptCallback;
+import com.vaadin.terminal.gwt.client.ui.dd.VDragAndDropManager;
+import com.vaadin.terminal.gwt.client.ui.dd.VDragEvent;
+import com.vaadin.terminal.gwt.client.ui.dd.VDropHandler;
+import com.vaadin.terminal.gwt.client.ui.dd.VHasDropHandler;
+import com.vaadin.terminal.gwt.client.ui.dd.VTransferable;
+import com.vaadin.terminal.gwt.client.ui.dd.VDragAndDropManager.DragEventType;
/**
*
*/
-public class VTree extends FlowPanel implements Paintable, HasDropHandler {
+public class VTree extends FlowPanel implements Paintable, VHasDropHandler {
public static final String CLASSNAME = "v-tree";
@@ -72,7 +72,7 @@ public class VTree extends FlowPanel implements Paintable, HasDropHandler {
private int dragModes;
- private AbstractDropHandler dropHandler;
+ private VAbstractDropHandler dropHandler;
public VTree() {
super();
@@ -161,7 +161,7 @@ public class VTree extends FlowPanel implements Paintable, HasDropHandler {
}
- private void updateTreeRelatedTransferData(DragEvent drag) {
+ private void updateTreeRelatedTransferData(VDragEvent drag) {
drag.getEventDetails().put("itemIdOver", currentMouseOverKey);
if (currentMouseOverKey != null) {
@@ -179,20 +179,20 @@ public class VTree extends FlowPanel implements Paintable, HasDropHandler {
private void updateDropHandler(UIDL childUidl) {
if (dropHandler == null) {
- dropHandler = new AbstractDropHandler() {
+ dropHandler = new VAbstractDropHandler() {
@Override
- public void dragEnter(DragEvent drag) {
+ public void dragEnter(VDragEvent drag) {
updateTreeRelatedTransferData(drag);
super.dragEnter(drag);
}
@Override
- protected void dragAccepted(final DragEvent drag) {
+ protected void dragAccepted(final VDragEvent drag) {
}
@Override
- public void dragOver(final DragEvent currentDrag) {
+ public void dragOver(final VDragEvent currentDrag) {
final Object oldIdOver = currentDrag.getEventDetails().get(
"itemIdOver");
final String oldDetail = (String) currentDrag
@@ -217,7 +217,7 @@ public class VTree extends FlowPanel implements Paintable, HasDropHandler {
+ detail);
updateTreeRelatedTransferData(currentDrag);
- AcceptCallback accpectedCb = new AcceptCallback() {
+ VAcceptCallback accpectedCb = new VAcceptCallback() {
public void handleResponse(
ValueMap responseData) {
if (responseData == null // via client
@@ -231,7 +231,7 @@ public class VTree extends FlowPanel implements Paintable, HasDropHandler {
}
};
if (validateOnServer()) {
- DragAndDropManager.get().visitServer(
+ VDragAndDropManager.get().visitServer(
DragEventType.OVER, accpectedCb);
} else {
@@ -253,7 +253,7 @@ public class VTree extends FlowPanel implements Paintable, HasDropHandler {
}
@Override
- public void dragLeave(DragEvent drag) {
+ public void dragLeave(VDragEvent drag) {
cleanUp();
}
@@ -265,7 +265,7 @@ public class VTree extends FlowPanel implements Paintable, HasDropHandler {
}
@Override
- public boolean drop(DragEvent drag) {
+ public boolean drop(VDragEvent drag) {
cleanUp();
return super.drop(drag);
}
@@ -436,10 +436,10 @@ public class VTree extends FlowPanel implements Paintable, HasDropHandler {
ApplicationConnection.getConsole().log(
"TreeNode drag start " + event.getType());
// start actual drag on slight move when mouse is down
- Transferable t = new Transferable();
+ VTransferable t = new VTransferable();
t.setComponent(VTree.this);
t.setItemId(key);
- DragEvent drag = DragAndDropManager.get().startDrag(t,
+ VDragEvent drag = VDragAndDropManager.get().startDrag(t,
mouseDownEvent, true);
Element node = (Element) nodeCaptionDiv.cloneNode(true);
node.getStyle().setOpacity(0.4);
@@ -713,7 +713,7 @@ public class VTree extends FlowPanel implements Paintable, HasDropHandler {
}
}
- public DropHandler getDropHandler() {
+ public VDropHandler getDropHandler() {
return dropHandler;
}
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/AcceptCriteria.java b/src/com/vaadin/terminal/gwt/client/ui/dd/AcceptCriteria.java
deleted file mode 100644
index 8a1081fff3..0000000000
--- a/src/com/vaadin/terminal/gwt/client/ui/dd/AcceptCriteria.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.vaadin.terminal.gwt.client.ui.dd;
-
-import com.vaadin.terminal.gwt.client.UIDL;
-
-public interface AcceptCriteria {
-
- public boolean accept(DragEvent drag, UIDL configuration);
-
-}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/AcceptCriterion.java b/src/com/vaadin/terminal/gwt/client/ui/dd/AcceptCriterion.java
deleted file mode 100644
index db4cb200d1..0000000000
--- a/src/com/vaadin/terminal/gwt/client/ui/dd/AcceptCriterion.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.vaadin.terminal.gwt.client.ui.dd;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import com.google.gwt.core.client.GWT;
-
-public class AcceptCriterion {
- protected static Map<String, AcceptCriteria> criterion = new HashMap<String, AcceptCriteria>();
- private static AcceptCriterionImpl impl;
-
- static {
- impl = GWT.create(AcceptCriterionImpl.class);
- impl.populateCriterionMap(criterion);
- }
-
- public static AcceptCriteria get(String name) {
- return criterion.get(name);
- }
-
-}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/AbstractDropHandler.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VAbstractDropHandler.java
index 0319655b75..81331f334e 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/dd/AbstractDropHandler.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VAbstractDropHandler.java
@@ -3,9 +3,9 @@ package com.vaadin.terminal.gwt.client.ui.dd;
import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ValueMap;
-import com.vaadin.terminal.gwt.client.ui.dd.DragAndDropManager.DragEventType;
+import com.vaadin.terminal.gwt.client.ui.dd.VDragAndDropManager.DragEventType;
-public abstract class AbstractDropHandler implements DropHandler {
+public abstract class VAbstractDropHandler implements VDropHandler {
private boolean serverValidate;
private UIDL criterioUIDL;
@@ -31,27 +31,27 @@ public abstract class AbstractDropHandler implements DropHandler {
/**
* Default implementation does nothing.
*/
- public void dragOver(DragEvent currentDrag) {
+ public void dragOver(VDragEvent currentDrag) {
}
/**
* Default implementation does nothing.
*/
- public void dragLeave(DragEvent drag) {
+ public void dragLeave(VDragEvent drag) {
// TODO Auto-generated method stub
}
/**
* If transferrable is accepted (either via server visit or client side
- * rules) the default implementation calls {@link #dragAccepted(DragEvent)}
+ * rules) the default implementation calls {@link #dragAccepted(VDragEvent)}
* method.
*/
- public void dragEnter(final DragEvent drag) {
+ public void dragEnter(final VDragEvent drag) {
if (serverValidate) {
- DragAndDropManager.get().visitServer(DragEventType.ENTER,
- new AcceptCallback() {
+ VDragAndDropManager.get().visitServer(DragEventType.ENTER,
+ new VAcceptCallback() {
public void handleResponse(ValueMap responseData) {
if (responseData.containsKey("accepted")) {
dragAccepted(drag);
@@ -63,7 +63,7 @@ public abstract class AbstractDropHandler implements DropHandler {
}
}
- abstract protected void dragAccepted(DragEvent drag);
+ abstract protected void dragAccepted(VDragEvent drag);
/**
* Returns true if client side rules are met.
@@ -71,10 +71,10 @@ public abstract class AbstractDropHandler implements DropHandler {
* @param drag
* @return
*/
- protected boolean validates(DragEvent drag) {
+ protected boolean validates(VDragEvent drag) {
if (criterioUIDL != null) {
String criteriaName = criterioUIDL.getStringAttribute("name");
- AcceptCriteria acceptCriteria = AcceptCriterion.get(criteriaName);
+ VAcceptCriteria acceptCriteria = VAcceptCriterion.get(criteriaName);
if (acceptCriteria != null) {
// ApplicationConnection.getConsole().log(
// "Criteria : " + acceptCriteria.getClass().getName());
@@ -84,7 +84,7 @@ public abstract class AbstractDropHandler implements DropHandler {
return false;
}
- public boolean drop(DragEvent drag) {
+ public boolean drop(VDragEvent drag) {
if (serverValidate) {
return true;
} else {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/AcceptCallback.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCallback.java
index 913cda5a76..2366105853 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/dd/AcceptCallback.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCallback.java
@@ -2,14 +2,14 @@ package com.vaadin.terminal.gwt.client.ui.dd;
import com.vaadin.terminal.gwt.client.ValueMap;
-public interface AcceptCallback {
+public interface VAcceptCallback {
/**
- * This method is called by {@link DragAndDropManager} if the
- * {@link DragEvent} is still active. Developer can update for example drag
+ * This method is called by {@link VDragAndDropManager} if the
+ * {@link VDragEvent} is still active. Developer can update for example drag
* icon or target emphasis based on the information returned from server
* side. If the drag and drop operation ends or the
- * {@link AbstractDropHandler} has changed before response arrives, the
+ * {@link VAbstractDropHandler} has changed before response arrives, the
* method is never called.
*
* @param responseData
diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriteria.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriteria.java
new file mode 100644
index 0000000000..70f163c6d7
--- /dev/null
+++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriteria.java
@@ -0,0 +1,9 @@
+package com.vaadin.terminal.gwt.client.ui.dd;
+
+import com.vaadin.terminal.gwt.client.UIDL;
+
+public interface VAcceptCriteria {
+
+ public boolean accept(VDragEvent drag, UIDL configuration);
+
+}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriterion.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriterion.java
new file mode 100644
index 0000000000..f1b6d2de34
--- /dev/null
+++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriterion.java
@@ -0,0 +1,21 @@
+package com.vaadin.terminal.gwt.client.ui.dd;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.google.gwt.core.client.GWT;
+
+public class VAcceptCriterion {
+ protected static Map<String, VAcceptCriteria> criterion = new HashMap<String, VAcceptCriteria>();
+ private static VAcceptCriterionImpl impl;
+
+ static {
+ impl = GWT.create(VAcceptCriterionImpl.class);
+ impl.populateCriterionMap(criterion);
+ }
+
+ public static VAcceptCriteria get(String name) {
+ return criterion.get(name);
+ }
+
+}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/AcceptCriterionImpl.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriterionImpl.java
index e0e170bc19..71001d09d0 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/dd/AcceptCriterionImpl.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriterionImpl.java
@@ -7,10 +7,10 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.UIDL;
-public class AcceptCriterionImpl {
+public class VAcceptCriterionImpl {
- private final class OverTreeNode implements AcceptCriteria {
- public boolean accept(DragEvent drag, UIDL configuration) {
+ private final class OverTreeNode implements VAcceptCriteria {
+ public boolean accept(VDragEvent drag, UIDL configuration) {
Boolean containsKey = (Boolean) drag.getEventDetails().get(
"itemIdOverIsNode");
if (containsKey != null && containsKey.booleanValue()) {
@@ -20,8 +20,8 @@ public class AcceptCriterionImpl {
}
}
- private final class ComponentCriteria implements AcceptCriteria {
- public boolean accept(DragEvent drag, UIDL configuration) {
+ private final class ComponentCriteria implements VAcceptCriteria {
+ public boolean accept(VDragEvent drag, UIDL configuration) {
try {
Paintable component = drag.getTransferrable().getComponent();
String requiredPid = configuration
@@ -35,13 +35,13 @@ public class AcceptCriterionImpl {
}
}
- private final class And implements AcceptCriteria {
- public boolean accept(DragEvent drag, UIDL configuration) {
+ private final class And implements VAcceptCriteria {
+ public boolean accept(VDragEvent drag, UIDL configuration) {
UIDL childUIDL = configuration.getChildUIDL(0);
UIDL childUIDL2 = configuration.getChildUIDL(1);
- AcceptCriteria acceptCriteria = AcceptCriterion.get(childUIDL
+ VAcceptCriteria acceptCriteria = VAcceptCriterion.get(childUIDL
.getStringAttribute("name"));
- AcceptCriteria acceptCriteria2 = AcceptCriterion.get(childUIDL2
+ VAcceptCriteria acceptCriteria2 = VAcceptCriterion.get(childUIDL2
.getStringAttribute("name"));
if (acceptCriteria == null || acceptCriteria2 == null) {
ApplicationConnection.getConsole().log(
@@ -54,14 +54,14 @@ public class AcceptCriterionImpl {
}
}
- private final class AcceptAll implements AcceptCriteria {
- public boolean accept(DragEvent drag, UIDL configuration) {
+ private final class AcceptAll implements VAcceptCriteria {
+ public boolean accept(VDragEvent drag, UIDL configuration) {
return true;
}
}
- private final class HasItemId implements AcceptCriteria {
- public boolean accept(DragEvent drag, UIDL configuration) {
+ private final class HasItemId implements VAcceptCriteria {
+ public boolean accept(VDragEvent drag, UIDL configuration) {
return drag.getTransferrable().getItemId() != null;
}
}
@@ -73,8 +73,8 @@ public class AcceptCriterionImpl {
*
* TODO use fully qualified names of server side counterparts as keys
*/
- public void populateCriterionMap(Map<String, AcceptCriteria> map) {
- AcceptCriteria crit;
+ public void populateCriterionMap(Map<String, VAcceptCriteria> map) {
+ VAcceptCriteria crit;
crit = new HasItemId();
map.put("needsItemId", crit);
diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/DragAndDropManager.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VDragAndDropManager.java
index b97cad5da5..87887c6659 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/dd/DragAndDropManager.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VDragAndDropManager.java
@@ -27,7 +27,7 @@ import com.vaadin.terminal.gwt.client.ValueMap;
* {@link #get()} to get instance.
*
*/
-public class DragAndDropManager {
+public class VDragAndDropManager {
public enum DragEventType {
ENTER, LEAVE, OVER, DROP
@@ -35,40 +35,40 @@ public class DragAndDropManager {
private static final String DD_SERVICE = "DD";
- private static DragAndDropManager instance;
+ private static VDragAndDropManager instance;
private HandlerRegistration handlerRegistration;
- private DragEvent currentDrag;
+ private VDragEvent currentDrag;
/**
* If dragging is currently on a drophandler, this field has reference to it
*/
- private DropHandler currentDropHandler;
+ private VDropHandler currentDropHandler;
- public DropHandler getCurrentDropHandler() {
+ public VDropHandler getCurrentDropHandler() {
return currentDropHandler;
}
/**
- * If drag and drop operation is not handled by {@link DragAndDropManager}s
- * internal handler, this can be used to update current {@link DropHandler}.
+ * If drag and drop operation is not handled by {@link VDragAndDropManager}s
+ * internal handler, this can be used to update current {@link VDropHandler}.
*
* @param currentDropHandler
*/
- public void setCurrentDropHandler(DropHandler currentDropHandler) {
+ public void setCurrentDropHandler(VDropHandler currentDropHandler) {
this.currentDropHandler = currentDropHandler;
}
- private AcceptCallback acceptCallback;
+ private VAcceptCallback acceptCallback;
- public static DragAndDropManager get() {
+ public static VDragAndDropManager get() {
if (instance == null) {
- instance = new DragAndDropManager();
+ instance = new VDragAndDropManager();
}
return instance;
}
/* Singleton */
- private DragAndDropManager() {
+ private VDragAndDropManager() {
}
/**
@@ -78,26 +78,26 @@ public class DragAndDropManager {
* Cancels possible existing drag. TODO figure out if this is always a bug
* if one is active. Maybe a good and cheap lifesaver thought.
* <p>
- * If possible, method automatically detects current {@link DropHandler} and
- * fires {@link DropHandler#dragEnter(DragEvent)} event on it.
+ * If possible, method automatically detects current {@link VDropHandler} and
+ * fires {@link VDropHandler#dragEnter(VDragEvent)} event on it.
* <p>
* May also be used to control the drag and drop operation. If this option
- * is used, {@link DropHandler} is searched on mouse events and appropriate
+ * is used, {@link VDropHandler} is searched on mouse events and appropriate
* methods on it called automatically.
*
* @param transferable
* @param nativeEvent
* @param handleDragEvents
- * if true, {@link DragAndDropManager} handles the drag and drop
+ * if true, {@link VDragAndDropManager} handles the drag and drop
* operation GWT event preview.
* @return
*/
- public DragEvent startDrag(Transferable transferable,
+ public VDragEvent startDrag(VTransferable transferable,
NativeEvent startEvent, boolean handleDragEvents) {
interruptDrag();
- currentDrag = new DragEvent(transferable, startEvent);
- DropHandler dh = null;
+ currentDrag = new VDragEvent(transferable, startEvent);
+ VDropHandler dh = null;
if (startEvent != null) {
dh = findDragTarget((Element) startEvent.getEventTarget().cast());
}
@@ -135,7 +135,7 @@ public class DragAndDropManager {
case Event.ONMOUSEOVER:
ApplicationConnection.getConsole().log(
event.getNativeEvent().getType());
- DropHandler target = findDragTarget(targetElement);
+ VDropHandler target = findDragTarget(targetElement);
if (target != null && target != currentDrag) {
currentDropHandler = target;
target.dragEnter(currentDrag);
@@ -152,7 +152,7 @@ public class DragAndDropManager {
Element relatedTarget = (Element) nativeEvent
.getRelatedEventTarget().cast();
- DropHandler newDragHanler = findDragTarget(relatedTarget);
+ VDropHandler newDragHanler = findDragTarget(relatedTarget);
if (dragElement != null
&& dragElement
.isOrHasChild(relatedTarget)) {
@@ -221,7 +221,7 @@ public class DragAndDropManager {
* @param element
* @return
*/
- private DropHandler findDragTarget(Element element) {
+ private VDropHandler findDragTarget(Element element) {
EventListener eventListener = Event.getEventListener(element);
while (eventListener == null) {
@@ -237,7 +237,7 @@ public class DragAndDropManager {
return null;
} else {
Widget w = (Widget) eventListener;
- while (!(w instanceof HasDropHandler)) {
+ while (!(w instanceof VHasDropHandler)) {
w = w.getParent();
if (w == null) {
break;
@@ -248,7 +248,7 @@ public class DragAndDropManager {
"No suitable DropHandler found2");
return null;
} else {
- DropHandler dh = ((HasDropHandler) w).getDropHandler();
+ VDropHandler dh = ((VHasDropHandler) w).getDropHandler();
if (dh == null) {
ApplicationConnection.getConsole().log(
"No suitable DropHandler found3");
@@ -300,7 +300,7 @@ public class DragAndDropManager {
*
* @param acceptCallback
*/
- public void visitServer(DragEventType type, AcceptCallback acceptCallback) {
+ public void visitServer(DragEventType type, VAcceptCallback acceptCallback) {
doRequest(type);
this.acceptCallback = acceptCallback;
}
@@ -325,7 +325,7 @@ public class DragAndDropManager {
false);
client.updateVariable(DD_SERVICE, "dhowner", paintable, false);
- Transferable transferable = currentDrag.getTransferrable();
+ VTransferable transferable = currentDrag.getTransferrable();
if (transferable.getItemId() != null) {
client.updateVariable(DD_SERVICE, "itemId", transferable
diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/DragEvent.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VDragEvent.java
index a64a29925c..ee31f77b94 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/dd/DragEvent.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VDragEvent.java
@@ -13,11 +13,11 @@ import com.google.gwt.user.client.Element;
*
*
*/
-public class DragEvent {
+public class VDragEvent {
private static int eventId = 0;
- private Transferable transferable;
+ private VTransferable transferable;
NativeEvent currentGwtEvent;
@@ -29,14 +29,14 @@ public class DragEvent {
private HashMap<String, Object> dropDetails = new HashMap<String, Object>();
- DragEvent(Transferable t, NativeEvent startEvent) {
+ VDragEvent(VTransferable t, NativeEvent startEvent) {
transferable = t;
this.startEvent = startEvent;
id = eventId++;
start = new Date();
}
- public Transferable getTransferrable() {
+ public VTransferable getTransferrable() {
return transferable;
}
@@ -55,8 +55,8 @@ public class DragEvent {
/**
* Sets the element that will be used as "drag icon".
*
- * TODO decide if this method should be here or in {@link Transferable} (in
- * HTML5 it is in DataTransfer) or {@link DragAndDropManager}
+ * TODO decide if this method should be here or in {@link VTransferable} (in
+ * HTML5 it is in DataTransfer) or {@link VDragAndDropManager}
*
* TODO should be possible to override behaviour an set to HTML5
* DataTransfer
@@ -64,7 +64,7 @@ public class DragEvent {
* @param node
*/
public void setDragImage(Element node) {
- DragAndDropManager.get().setDragElement(node);
+ VDragAndDropManager.get().setDragElement(node);
}
/**
diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/DropHandler.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VDropHandler.java
index 45fbdb31df..5a4701fd9f 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/dd/DropHandler.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VDropHandler.java
@@ -4,24 +4,24 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.Paintable;
/**
- * Vaadin Widgets (TODO or Paintables, see {@link HasDropHandler}) that want to
+ * Vaadin Widgets (TODO or Paintables, see {@link VHasDropHandler}) that want to
* receive something via drag and drop implement this interface.
*/
-public interface DropHandler {
+public interface VDropHandler {
/**
* Called by D'D' manager when drag gets over this drop handler.
*
* @param drag
*/
- public void dragEnter(DragEvent drag);
+ public void dragEnter(VDragEvent drag);
/**
* Called by D'D' manager when drag gets out this drop handler.
*
* @param drag
*/
- public void dragLeave(DragEvent drag);
+ public void dragLeave(VDragEvent drag);
/**
* The actual drop happened on this drop handler.
@@ -31,18 +31,18 @@ public interface DropHandler {
* server, false if drop was finally canceled or no server visit is
* needed
*/
- public boolean drop(DragEvent drag);
+ public boolean drop(VDragEvent drag);
/**
* When drag is over current drag handler.
*
- * With drag implementation by {@link DragAndDropManager} will be called
+ * With drag implementation by {@link VDragAndDropManager} will be called
* when mouse is moved. HTML5 implementations call this continuously even
* though mouse is not moved.
*
* @param currentDrag
*/
- public void dragOver(DragEvent currentDrag);
+ public void dragOver(VDragEvent currentDrag);
/**
* Returns the Paintable into which this DragHandler is assosiated
@@ -50,7 +50,7 @@ public interface DropHandler {
public Paintable getPaintable();
/**
- * Returns the application connection to which this {@link DropHandler}
+ * Returns the application connection to which this {@link VDropHandler}
* belongs to. DragAndDropManager uses this fucction to send Transferable to
* server side.
*/
diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/HasDropHandler.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VHasDropHandler.java
index 9814a6f6b8..ea58757a36 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/dd/HasDropHandler.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VHasDropHandler.java
@@ -5,10 +5,10 @@ import com.vaadin.terminal.gwt.client.Paintable;
/**
* Used to detect Widget from widget tree that has {@link #getDropHandler()}
*
- * Decide whether to get rid of this class. If so, {@link AbstractDropHandler} must
+ * Decide whether to get rid of this class. If so, {@link VAbstractDropHandler} must
* extend {@link Paintable}.
*
*/
-public interface HasDropHandler {
- public DropHandler getDropHandler();
+public interface VHasDropHandler {
+ public VDropHandler getDropHandler();
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/Html5DragEvent.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent.java
index 230cda8a6f..6689fbe307 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/dd/Html5DragEvent.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent.java
@@ -3,8 +3,8 @@ package com.vaadin.terminal.gwt.client.ui.dd;
import com.google.gwt.core.client.JsArrayString;
import com.google.gwt.dom.client.NativeEvent;
-public class Html5DragEvent extends NativeEvent {
- protected Html5DragEvent() {
+public class VHtml5DragEvent extends NativeEvent {
+ protected VHtml5DragEvent() {
}
public final native JsArrayString getTypes()
diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/Transferable.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VTransferable.java
index dc0244ae24..f04a4d8e33 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/dd/Transferable.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VTransferable.java
@@ -11,7 +11,11 @@ import com.vaadin.terminal.gwt.client.Paintable;
* Client side counterpart for Transferable in com.vaadin.event.Transferable
*
*/
-public class Transferable {
+public class VTransferable {
+
+ private Paintable component;
+
+ private final Map<String, Object> variables = new HashMap<String, Object>();
/**
* @return the component
@@ -73,8 +77,6 @@ public class Transferable {
variables.put("itemId", itemId);
}
- private Paintable component;
-
public Object getData(String dataFlawor) {
return variables.get(dataFlawor);
}
@@ -87,10 +89,8 @@ public class Transferable {
return variables.keySet();
}
- private final Map<String, Object> variables = new HashMap<String, Object>();
-
/**
- * This method should only be called by {@link DragAndDropManager}.
+ * This method should only be called by {@link VDragAndDropManager}.
*
* @return data in this Transferable that needs to be moved to server.
*/