com.vaadin.client.ui.dd
Class DragAndDropHandler

java.lang.Object
  extended by com.vaadin.client.ui.dd.DragAndDropHandler

public class DragAndDropHandler
extends java.lang.Object

A simple event handler for elements that can be drag and dropped. Properly handles drag start, cancel and end. For example, used in Grid column header reordering.

The showing of the dragged element, drag hints and reacting to drop/cancel is delegated to DragAndDropHandler.DragAndDropCallback implementation.

Since:
7.5.0
Author:
Vaadin Ltd

Nested Class Summary
static interface DragAndDropHandler.DragAndDropCallback
          Callback interface for drag and drop.
 
Constructor Summary
DragAndDropHandler()
           
 
Method Summary
 void onDragStartOnDraggableElement(NativeEvent dragStartingEvent, DragAndDropHandler.DragAndDropCallback callback)
          This method can be called to trigger drag and drop on any grid element that can be dragged and dropped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DragAndDropHandler

public DragAndDropHandler()
Method Detail

onDragStartOnDraggableElement

public void onDragStartOnDraggableElement(NativeEvent dragStartingEvent,
                                          DragAndDropHandler.DragAndDropCallback callback)
This method can be called to trigger drag and drop on any grid element that can be dragged and dropped.

Parameters:
dragStartingEvent - the drag triggering event, usually a Event#ONMOUSEDOWN or Event#ONTOUCHSTART event on the draggable element
callback - the callback that will handle actual drag and drop related operations


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.