summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/src/main/java/com/vaadin/event/dnd/DragSourceExtension.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/event/dnd/DragSourceExtension.java b/server/src/main/java/com/vaadin/event/dnd/DragSourceExtension.java
index 88b3133b2b..7ff84757d9 100644
--- a/server/src/main/java/com/vaadin/event/dnd/DragSourceExtension.java
+++ b/server/src/main/java/com/vaadin/event/dnd/DragSourceExtension.java
@@ -18,6 +18,7 @@ package com.vaadin.event.dnd;
import java.util.Objects;
import com.vaadin.server.AbstractExtension;
+import com.vaadin.server.Resource;
import com.vaadin.shared.Registration;
import com.vaadin.shared.ui.dnd.DragSourceRpc;
import com.vaadin.shared.ui.dnd.DragSourceState;
@@ -220,6 +221,16 @@ public class DragSourceExtension<T extends AbstractComponent> extends
listener, DragEndListener.DRAGEND_METHOD);
}
+ /**
+ * Set a custom drag image for the current drag source.
+ *
+ * @param imageResource
+ * Resource of the image to be displayed as drag image.
+ */
+ public void setDragImage(Resource imageResource) {
+ setResource(DragSourceState.RESOURCE_DRAG_IMAGE, imageResource);
+ }
+
@Override
protected DragSourceState getState() {
return (DragSourceState) super.getState();