org.eclipse.gef.dnd
Class DelegatingDropAdapter
java.lang.Object
org.eclipse.jface.util.DelegatingDropAdapter
org.eclipse.gef.dnd.DelegatingDropAdapter
-
All Implemented Interfaces:
-
DropTargetListener
- public class DelegatingDropAdapter
- extends
DelegatingDropAdapter
A DropTargetListener
that manages and delegates to a set of
TransferDropTargetListener
s. Each TransferDropTargetListener
can then be
implemented as if it were the DropTarget's only DropTargetListener.
On each DropTargetEvent, a current listener is obtained from the set of all
TransferDropTargetListers. The current listener is the first listener to return
true
for TransferDropTargetListener#isEnabled(DropTargetEvent)
.
The current listener is forwarded all DropTargetEvents
until some other
listener becomes the current listener, or the Drop terminates.
As listeners are added and removed, the combined set of Transfers is updated to contain
the Tranfer
from each listener.
getTransferTypes()
provides the
merged transfers. This set of Transfers should be set on the SWT
DropTarget
.
-
See Also:
-
Serialized Form
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
|
DelegatingDropAdapter
public DelegatingDropAdapter()
addDropTargetListener
public void addDropTargetListener(
TransferDropTargetListener listener)
-
Deprecated.
- Adds the given TransferDropTargetListener.
-
-
Parameters:
-
listener
- the listener
getTransferTypes
public Transfer[] getTransferTypes()
-
Deprecated. use getTransfers() instead
- Adds the Transfer from each listener to an array and returns that array.
-
-
Returns:
- the merged Transfers from all listeners
removeDropTargetListener
public void removeDropTargetListener(
TransferDropTargetListener listener)
- Removes the given
TransferDropTargetListener
.
-
-
Parameters:
-
listener
- the listener
Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.