|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.gef.dnd.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
.
Constructor Summary | |
DelegatingDropAdapter()
|
Method Summary | |
void |
addDropTargetListener(TransferDropTargetListener listener)
Adds the given TransferDropTargetListener. |
void |
dragEnter(DropTargetEvent event)
The cursor has entered the drop target boundaries. |
void |
dragLeave(DropTargetEvent event)
The cursor has left the drop target boundaries. |
void |
dragOperationChanged(DropTargetEvent event)
The operation being performed has changed (usually due to the user changing the selected key while dragging). |
void |
dragOver(DropTargetEvent event)
The cursor is moving over the drop target. |
void |
drop(DropTargetEvent event)
Forwards this event to the current listener, if it is not null . |
void |
dropAccept(DropTargetEvent event)
Forwards this event to the current listener. |
Transfer[] |
getTransferTypes()
Adds the Transfer from each listener to an array and returns that array. |
boolean |
isEmpty()
Returns true if there are no listeners. |
void |
removeDropTargetListener(TransferDropTargetListener listener)
Removes the given TransferDropTargetListener . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DelegatingDropAdapter()
Method Detail |
public void addDropTargetListener(TransferDropTargetListener listener)
listener
- the listenerpublic void dragEnter(DropTargetEvent event)
dragEnter
in interface DropTargetListener
for more details
public void dragLeave(DropTargetEvent event)
dragLeave
in interface DropTargetListener
event
- the Eventfor more details
public void dragOperationChanged(DropTargetEvent event)
dragOperationChanged
in interface DropTargetListener
event
- the EventDropTargetListener.dragOperationChanged(DropTargetEvent)
public void dragOver(DropTargetEvent event)
null
,
event.detail
is set to DND.DROP_NONE
, which causes the NOT
cursor to appear.
dragOver
in interface DropTargetListener
event
- the EventDropTargetListener.dragOver(DropTargetEvent)
public void drop(DropTargetEvent event)
null
. Sets the
current listener to null
afterwards.
drop
in interface DropTargetListener
event
- the EventDropTargetListener.drop(DropTargetEvent)
public void dropAccept(DropTargetEvent event)
dropAccept
in interface DropTargetListener
event
- the EventDropTargetListener.dropAccept(DropTargetEvent)
public Transfer[] getTransferTypes()
public boolean isEmpty()
true
if there are no listeners.
public void removeDropTargetListener(TransferDropTargetListener listener)
TransferDropTargetListener
.
listener
- the listener
|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |