Package org.eclipse.jface.util
Interface TransferDropTargetListener
- All Superinterfaces:
DropTargetListener
,EventListener
,SWTEventListener
A
TransferDropTargetListener
is a DropTragetListener
that handles one type of SWT Transfer
.
The purpose of a TransferDropTargetListener
is to:
- Determine enablement for a drop operation. A
TransferDropTargetListener
will not be used ifisEnabled
returns false. - When enabled, optionally show feedback on the
DropTarget
. - Perform the actual drop
DelegatingDropAdapter
allows these functions to be implemented
separately for unrelated types of drags. DelegatingDropAdapter
then
combines the function of each TransferDropTargetListener
, while
allowing them to be implemented as if they were the only DragSourceListener
.- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns theTransfer
type that this listener can accept a drop operation for.boolean
isEnabled
(DropTargetEvent event) Returnstrue
if this listener can handle the drop based on the givenDropTargetEvent
.Methods inherited from interface org.eclipse.swt.dnd.DropTargetListener
dragEnter, dragLeave, dragOperationChanged, dragOver, drop, dropAccept
-
Method Details
-
getTransfer
Transfer getTransfer()Returns theTransfer
type that this listener can accept a drop operation for.- Returns:
- the
Transfer
for this listener
-
isEnabled
Returnstrue
if this listener can handle the drop based on the givenDropTargetEvent
.This method is called by the
DelegatingDropAdapter
only if theDropTargetEvent
contains a transfer data type supported by this listener. TheTransfer
returned by the#getTransfer()
method is used for this purpose.- Parameters:
event
- the drop target event- Returns:
true
if the listener is enabled for the given drop target event.
-