DropTargetExtensionConnector and
DragSourceExtensionConnector@Deprecated public class VDragAndDropManager extends Object
Singleton. Only one drag and drop operation can be active anyways. Use
get() to get instance.
TODO cancel drag and drop if more than one touches !?
| Modifier and Type | Class and Description |
|---|---|
static interface |
VDragAndDropManager.DDManagerMediator
Deprecated.
Implementation if this interface is provided as a parameter to
DDEventHandleStrategy methods.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
ACTIVE_DRAG_SOURCE_STYLENAME
Deprecated.
Style name for the active drag source.
|
static int |
MINIMUM_DISTANCE_TO_START_DRAG
Deprecated.
#13381, #14796.
|
| Modifier | Constructor and Description |
|---|---|
protected |
VDragAndDropManager()
Deprecated.
Singleton.
|
| Modifier and Type | Method and Description |
|---|---|
void |
endDrag()
Deprecated.
Drag is ended (drop happened) on current drop handler.
|
void |
executeWhenReady(com.google.gwt.user.client.Command command)
Deprecated.
Method to execute commands when all existing dd related tasks are
completed (some may require server visit).
|
protected VDropHandler |
findDragTarget(com.google.gwt.dom.client.Element element)
Deprecated.
First seeks the widget from this element, then iterates widgets until one
implement HasDropHandler.
|
static VDragAndDropManager |
get()
Deprecated.
Returns the current drag and drop manager instance.
|
protected ApplicationConnection |
getCurrentDragApplicationConnection()
Deprecated.
Returns the application connection for the current drag source.
|
VDropHandler |
getCurrentDropHandler()
Deprecated.
Returns the current drop handler.
|
protected DDEventHandleStrategy |
getEventHandleStrategy()
Deprecated.
Returns DnD strategy to handle native preview events used by the manager.
|
void |
handleServerResponse(ValueMap valueMap)
Deprecated.
Handle the server response for drag and drop.
|
void |
interruptDrag()
Deprecated.
The drag and drop operation is ended, but drop did not happen.
|
void |
setCurrentDropHandler(VDropHandler currentDropHandler)
Deprecated.
If drag and drop operation is not handled by
VDragAndDropManagers
internal handler, this can be used to update current VDropHandler
. |
VDragEvent |
startDrag(VTransferable transferable,
com.google.gwt.dom.client.NativeEvent startEvent,
boolean handleDragEvents)
Deprecated.
This method is used to start Vaadin client side drag and drop operation.
|
protected void |
updateDragImagePosition(com.google.gwt.dom.client.NativeEvent gwtEvent,
com.google.gwt.dom.client.Element dragImage)
Deprecated.
Updates drag image position.
|
void |
visitServer(VDragEventServerCallback acceptCallback)
Deprecated.
Visits server during drag and drop procedure.
|
public static final String ACTIVE_DRAG_SOURCE_STYLENAME
public static final int MINIMUM_DISTANCE_TO_START_DRAG
public VDropHandler getCurrentDropHandler()
null if one doesn't existpublic void setCurrentDropHandler(VDropHandler currentDropHandler)
VDragAndDropManagers
internal handler, this can be used to update current VDropHandler
.currentDropHandler - the current drop handlerpublic static VDragAndDropManager get()
public VDragEvent startDrag(VTransferable transferable, com.google.gwt.dom.client.NativeEvent startEvent, boolean handleDragEvents)
Cancels possible existing drag. TODO figure out if this is always a bug if one is active. Maybe a good and cheap lifesaver thought.
If possible, method automatically detects current VDropHandler
and fires VDropHandler.dragEnter(VDragEvent) event on it.
May also be used to control the drag and drop operation. If this option
is used, VDropHandler is searched on mouse events and appropriate
methods on it called automatically.
transferable - the VTransferable instance that represents the original
dragged elementstartEvent - the native event that starts the draghandleDragEvents - if true, VDragAndDropManager handles the drag and drop
operation GWT event preview.protected void updateDragImagePosition(com.google.gwt.dom.client.NativeEvent gwtEvent,
com.google.gwt.dom.client.Element dragImage)
gwtEvent - the event whose coordinates should be useddragImage - the image to positionprotected VDropHandler findDragTarget(com.google.gwt.dom.client.Element element)
element - the topmost element that is a potential drag targetnull if there is no such thingpublic void endDrag()
public void interruptDrag()
public void visitServer(VDragEventServerCallback acceptCallback)
acceptCallback - the callback that should handle the matching server response
when it arrivespublic void handleServerResponse(ValueMap valueMap)
valueMap - DnD value map from the responseprotected DDEventHandleStrategy getEventHandleStrategy()
protected ApplicationConnection getCurrentDragApplicationConnection()
null instead.null if not foundpublic void executeWhenReady(com.google.gwt.user.client.Command command)
Using this method may be handy if criterion that uses lazy initialization are used. Check
TODO Optimization: consider if we actually only need to keep the last command in queue here.
command - the command to executeCopyright © 2023 Vaadin Ltd. All rights reserved.