Package com.vaadin.flow.component.dnd
Class DragStartEvent<T extends Component>
- java.lang.Object
-
- java.util.EventObject
-
- com.vaadin.flow.component.ComponentEvent<T>
-
- com.vaadin.flow.component.dnd.DragStartEvent<T>
-
- Type Parameters:
T
- Type of the component that is dragged.
- All Implemented Interfaces:
Serializable
@DomEvent("dragstart") public class DragStartEvent<T extends Component> extends ComponentEvent<T>
HTML5 drag start event, fired when the user starts dragging a drag source.- Since:
- 2.0
- Author:
- Vaadin Ltd, Vaadin Ltd
- See Also:
DragSource.addDragStartListener(com.vaadin.flow.component.ComponentEventListener)
, Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description DragStartEvent(T source, boolean fromClient)
Creates a drag start event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getComponent()
Returns the drag source component where the dragstart event occurred.void
setDragData(Object data)
Set server side drag data for this started drag operation.-
Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListener
-
Methods inherited from class java.util.EventObject
toString
-
-
-
-
Constructor Detail
-
DragStartEvent
public DragStartEvent(T source, boolean fromClient)
Creates a drag start event.- Parameters:
source
- Component that is dragged.fromClient
-true
if the event originated from the client side,false
otherwise
-
-
Method Detail
-
getComponent
public T getComponent()
Returns the drag source component where the dragstart event occurred.- Returns:
- Component which is dragged.
-
setDragData
public void setDragData(Object data)
Set server side drag data for this started drag operation. This data is available in the drop event and can be used to transfer data between drag source andDropTarget
if they are in the same UI.This method is a shorthand for
DragSource.setDragData(Object)
and overrides any previously set drag data.- Parameters:
data
- Data to transfer to drop event.- See Also:
DropEvent.getDragData()
,DragEndEvent.clearDragData()
-
-