Class DelegatingDragAdapter
- java.lang.Object
-
- org.eclipse.jface.util.DelegatingDragAdapter
-
- org.eclipse.gef.dnd.DelegatingDragAdapter
-
- All Implemented Interfaces:
java.util.EventListener,DragSourceListener,SWTEventListener
public class DelegatingDragAdapter extends DelegatingDragAdapter
A DragSourceListener that maintains and delegates to a set ofTransferDragSourceListeners. Each TransferDragSourceListener can then be implemented as if it were the DragSource's only DragSourceListener.When a native Drag is started, a subset of all
TransferDragSourceListenersis generated and stored in a list of active listeners. This subset is calculated by forwardingDragSourceListener.dragStart(DragSourceEvent)to every listener, and inspecting changes to thedoitfield. TheDragSource's set of supported Transfer types (DragSource.setTransfer(Transfer[])) is updated to reflect the Transfer types corresponding to the active listener subset.If and when
DelegatingDragAdapter.dragSetData(DragSourceEvent)is called, a singleTransferDragSourceListeneris chosen, and only it is allowed to set the drag data. The chosen listener is the first listener in the subset of active listeners whose Transfer supports (Transfer.isSupportedType(TransferData)) the dataType on theDragSourceEvent.
-
-
Constructor Summary
Constructors Constructor Description DelegatingDragAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddDragSourceListener(TransferDragSourceListener listener)Deprecated.Transfer[]getTransferTypes()Deprecated.call getTransfers() instead.voidremoveDragSourceListener(TransferDragSourceListener listener)Deprecated.-
Methods inherited from class org.eclipse.jface.util.DelegatingDragAdapter
addDragSourceListener, dragFinished, dragSetData, dragStart, getTransfers, isEmpty, removeDragSourceListener
-
-
-
-
Method Detail
-
addDragSourceListener
public void addDragSourceListener(TransferDragSourceListener listener)
Deprecated.Adds the given TransferDragSourceListener. The set of Transfer types is updated to reflect the change.- Parameters:
listener- the new listener
-
getTransferTypes
public Transfer[] getTransferTypes()
Deprecated.call getTransfers() instead.Combines theTransfers from every TransferDragSourceListener.- Returns:
- the combined
Transfers
-
removeDragSourceListener
public void removeDragSourceListener(TransferDragSourceListener listener)
Deprecated.Adds the given TransferDragSourceListener. The set of Transfer types is updated to reflect the change.- Parameters:
listener- the listener being removed
-
-