T
- Type of the drop target component.@DomEvent(value="drop") public class DropEvent<T extends Component> extends ComponentEvent<T>
DropTarget.addDropListener(com.vaadin.flow.component.ComponentEventListener)
,
Serialized Formsource
Constructor and Description |
---|
DropEvent(T source,
boolean fromClient,
String effectAllowed)
Creates a server side drop event.
|
Modifier and Type | Method and Description |
---|---|
T |
getComponent()
Returns the drop target component where the drop event occurred.
|
Optional<Object> |
getDragData()
Gets the server side drag data.
|
Optional<Component> |
getDragSourceComponent()
Returns the drag source component if the drag originated from a component
in the same UI as the drop target component, or an empty optional.
|
DropEffect |
getDropEffect()
Get the desired
dropEffect for the drop event. |
EffectAllowed |
getEffectAllowed()
Get the
effectAllowed set by the drag source. |
getSource, isFromClient, unregisterListener
toString
public DropEvent(T source, boolean fromClient, @EventData(value="event.dataTransfer.effectAllowed") String effectAllowed)
source
- Component that received the drop.fromClient
- true
if the event originated from the client
side, false
otherwiseeffectAllowed
- the effect allowed by the drag sourcepublic Optional<Object> getDragData()
Optional
.public DropEffect getDropEffect()
dropEffect
for the drop event.DropTarget.setDropEffect(DropEffect)
public EffectAllowed getEffectAllowed()
effectAllowed
set by the drag source.DragSource.setEffectAllowed(EffectAllowed)
public Optional<Component> getDragSourceComponent()
public T getComponent()
Copyright © 2025. All rights reserved.