public class VDragAndDropWrapper.CustomDropHandler extends VAbstractDropHandler
| Constructor and Description |
|---|
CustomDropHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
dragAccepted(VDragEvent drag)
This method is called when a valid drop location was found with
AcceptCriterion either via client or server side check. |
void |
dragEnter(VDragEvent drag)
The default implementation in
VAbstractDropHandler checks if the
Transferable is accepted. |
void |
dragLeave(VDragEvent drag)
Default implementation does nothing.
|
void |
dragOver(VDragEvent drag)
Default implementation does nothing.
|
boolean |
drop(VDragEvent drag)
The default implemmentation visits server if
AcceptCriterion
can't be verified on client or if AcceptCriterion are met on
client. |
ApplicationConnection |
getApplicationConnection()
Returns the application connection to which this
VDropHandler
belongs to. |
ComponentConnector |
getConnector()
Returns the Paintable who owns this
VAbstractDropHandler. |
updateAcceptRules, validatepublic void dragEnter(VDragEvent drag)
VAbstractDropHandlerVAbstractDropHandler checks if the
Transferable is accepted.
If transferable is accepted (either via server visit or client side
rules) the default implementation calls abstract
VAbstractDropHandler.dragAccepted(VDragEvent) method.
If drop handler has distinct places where some parts may accept the
Transferable and others don't, one should use similar validation
logic in dragOver method and replace this method with empty
implementation.
dragEnter in interface VDropHandlerdragEnter in class VAbstractDropHandlerdrag - DragEvent which contains the transferable and other
information for the operationpublic void dragLeave(VDragEvent drag)
VAbstractDropHandlerdragLeave in interface VDropHandlerdragLeave in class VAbstractDropHandlerdrag - DragEvent which contains the transferable and other
information for the operationpublic void dragOver(VDragEvent drag)
VAbstractDropHandlerdragOver in interface VDropHandlerdragOver in class VAbstractDropHandlerdrag - the latest drag eventpublic boolean drop(VDragEvent drag)
VAbstractDropHandlerAcceptCriterion
can't be verified on client or if AcceptCriterion are met on
client.drop in interface VDropHandlerdrop in class VAbstractDropHandlerdrag - VDragEvent which contains the transferable and other
information for the operationprotected void dragAccepted(VDragEvent drag)
VAbstractDropHandlerAcceptCriterion either via client or server side check.
Implementations can set some hints for users here to highlight that the drag is on a valid drop location.
dragAccepted in class VAbstractDropHandlerdrag - the drag eventpublic ComponentConnector getConnector()
VAbstractDropHandlerVAbstractDropHandler. Server
side counterpart of the Paintable is expected to implement
DropTarget interface.getConnector in interface VDropHandlergetConnector in class VAbstractDropHandlerpublic ApplicationConnection getApplicationConnection()
VDropHandlerVDropHandler
belongs to. DragAndDropManager uses this function to send Transferable to
server side.Copyright © 2021 Vaadin Ltd. All rights reserved.