Package org.eclipse.jface.util
Interface TransferDropTargetListener
-
- All Superinterfaces:
DropTargetListener,EventListener,SWTEventListener
public interface TransferDropTargetListener extends DropTargetListener
ATransferDropTargetListeneris aDropTragetListenerthat handles one type of SWTTransfer. The purpose of aTransferDropTargetListeneris to:- Determine enablement for a drop operation. A
TransferDropTargetListenerwill not be used ifisEnabledreturns false. - When enabled, optionally show feedback on the
DropTarget. - Perform the actual drop
DelegatingDropAdapterallows these functions to be implemented separately for unrelated types of drags.DelegatingDropAdapterthen combines the function of eachTransferDropTargetListener, while allowing them to be implemented as if they were the onlyDragSourceListener.- Since:
- 3.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TransfergetTransfer()Returns theTransfertype that this listener can accept a drop operation for.booleanisEnabled(DropTargetEvent event)Returnstrueif 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 Detail
-
getTransfer
Transfer getTransfer()
Returns theTransfertype that this listener can accept a drop operation for.- Returns:
- the
Transferfor this listener
-
isEnabled
boolean isEnabled(DropTargetEvent event)
Returnstrueif this listener can handle the drop based on the givenDropTargetEvent.This method is called by the
DelegatingDropAdapteronly if theDropTargetEventcontains a transfer data type supported by this listener. TheTransferreturned by the#getTransfer()method is used for this purpose.- Parameters:
event- the drop target event- Returns:
trueif the listener is enabled for the given drop target event.
-
-