|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.terminal.gwt.client.ui.dd.VDragAndDropManager
public class VDragAndDropManager
Helper class to manage the state of drag and drop event on Vaadin client side. Can be used to implement most of the drag and drop operation automatically via cross-browser event preview method or just as a helper when implementing own low level drag and drop operation (like with HTML5 api).
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 !?
Nested Class Summary | |
---|---|
static class |
VDragAndDropManager.DragEventType
|
Field Summary | |
---|---|
static String |
ACTIVE_DRAG_SOURCE_STYLENAME
|
Constructor Summary | |
---|---|
protected |
VDragAndDropManager()
|
Method Summary | |
---|---|
void |
endDrag()
Drag is ended (drop happened) on current drop handler. |
void |
executeWhenReady(com.google.gwt.user.client.Command command)
Method to execute commands when all existing dd related tasks are completed (some may require server visit). |
static VDragAndDropManager |
get()
|
VDropHandler |
getCurrentDropHandler()
|
void |
handleServerResponse(ValueMap valueMap)
|
void |
interruptDrag()
The drag and drop operation is ended, but drop did not happen. |
void |
setCurrentDropHandler(VDropHandler currentDropHandler)
If drag and drop operation is not handled by VDragAndDropManager s
internal handler, this can be used to update current VDropHandler
. |
VDragEvent |
startDrag(VTransferable transferable,
com.google.gwt.dom.client.NativeEvent startEvent,
boolean handleDragEvents)
This method is used to start Vaadin client side drag and drop operation. |
void |
visitServer(VDragEventServerCallback acceptCallback)
Visits server during drag and drop procedure. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ACTIVE_DRAG_SOURCE_STYLENAME
Constructor Detail |
---|
protected VDragAndDropManager()
Method Detail |
---|
public VDropHandler getCurrentDropHandler()
public void setCurrentDropHandler(VDropHandler currentDropHandler)
VDragAndDropManager
s
internal handler, this can be used to update current VDropHandler
.
currentDropHandler
- public 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
- nativeEvent
- handleDragEvents
- if true, VDragAndDropManager
handles the drag and drop
operation GWT event preview.
public void endDrag()
public void interruptDrag()
public void visitServer(VDragEventServerCallback acceptCallback)
acceptCallback
- public void handleServerResponse(ValueMap valueMap)
public 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
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |