public class VLayoutDragDropMouseHandler extends java.lang.Object implements com.google.gwt.event.dom.client.MouseDownHandler, com.google.gwt.event.dom.client.TouchStartHandler, VHasDragImageReferenceSupport
Modifier and Type | Class and Description |
---|---|
static interface |
VLayoutDragDropMouseHandler.DragStartListener
A listener to listen for drag start events
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTIVE_DRAG_CUSTOM_IMAGE_STYLENAME |
static java.lang.String |
ACTIVE_DRAG_SOURCE_STYLENAME |
Constructor and Description |
---|
VLayoutDragDropMouseHandler(com.google.gwt.user.client.ui.Widget root,
LayoutDragMode dragMode)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addDragStartListener(VLayoutDragDropMouseHandler.DragStartListener listener)
Add a drag start listener to monitor drag starts
|
com.google.gwt.user.client.ui.Widget |
getAttachTarget() |
LayoutDragMode |
getDragMode() |
protected void |
initiateDrag(com.google.gwt.dom.client.NativeEvent event)
Called when the dragging a component should be initiated by both a mouse
down event as well as a touch start event
FIXME This method is a BIG hack to circumvent Vaadin's very poor client
side API's.
|
protected void |
initiateDragOnMove(com.google.gwt.dom.client.NativeEvent originalEvent)
Initiates the drag only on the first move event
|
boolean |
isStartDragOnMove() |
void |
onMouseDown(com.google.gwt.event.dom.client.MouseDownEvent event) |
void |
onTouchStart(com.google.gwt.event.dom.client.TouchStartEvent event) |
void |
removeDragStartListener(VLayoutDragDropMouseHandler.DragStartListener listener)
Remove a drag start listener
|
void |
setAttachTarget(com.google.gwt.user.client.ui.Widget attachTarget) |
void |
setDragImageProvider(VDragImageProvider provider) |
void |
setStartDragOnMove(boolean startDragOnMove) |
void |
updateDragMode(LayoutDragMode dragMode)
Set the current drag mode
|
public static final java.lang.String ACTIVE_DRAG_SOURCE_STYLENAME
public static final java.lang.String ACTIVE_DRAG_CUSTOM_IMAGE_STYLENAME
public VLayoutDragDropMouseHandler(com.google.gwt.user.client.ui.Widget root, LayoutDragMode dragMode)
root
- The root elementdragMode
- The drag mode of the layoutpublic void onTouchStart(com.google.gwt.event.dom.client.TouchStartEvent event)
onTouchStart
in interface com.google.gwt.event.dom.client.TouchStartHandler
public void onMouseDown(com.google.gwt.event.dom.client.MouseDownEvent event)
onMouseDown
in interface com.google.gwt.event.dom.client.MouseDownHandler
protected void initiateDragOnMove(com.google.gwt.dom.client.NativeEvent originalEvent)
originalEvent
- the original Mouse Down event. Only events on elements are
passed in here (Element.as() is safe without check here)protected void initiateDrag(com.google.gwt.dom.client.NativeEvent event)
event
- public void updateDragMode(LayoutDragMode dragMode)
dragMode
- The drag mode to usepublic void addDragStartListener(VLayoutDragDropMouseHandler.DragStartListener listener)
listener
- public void removeDragStartListener(VLayoutDragDropMouseHandler.DragStartListener listener)
listener
- public com.google.gwt.user.client.ui.Widget getAttachTarget()
public void setAttachTarget(com.google.gwt.user.client.ui.Widget attachTarget)
public LayoutDragMode getDragMode()
public void setDragImageProvider(VDragImageProvider provider)
setDragImageProvider
in interface VHasDragImageReferenceSupport
public boolean isStartDragOnMove()
public void setStartDragOnMove(boolean startDragOnMove)