org.eclipse.cdt.internal.ui.dnd
Class DelegatingDropAdapter

java.lang.Object
  extended by org.eclipse.cdt.internal.ui.dnd.DelegatingDropAdapter
All Implemented Interfaces:
java.util.EventListener, org.eclipse.swt.dnd.DropTargetListener, org.eclipse.swt.internal.SWTEventListener

public class DelegatingDropAdapter
extends java.lang.Object
implements org.eclipse.swt.dnd.DropTargetListener

DelegatingDropAdapter


Constructor Summary
DelegatingDropAdapter(TransferDropTargetListener[] listeners)
          Creates a new delegating drop adapter.
 
Method Summary
 void dragEnter(org.eclipse.swt.dnd.DropTargetEvent event)
          The cursor has entered the drop target boundaries.
 void dragLeave(org.eclipse.swt.dnd.DropTargetEvent event)
          The cursor has left the drop target boundaries.
 void dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent event)
          The operation being performed has changed (usually due to the user changing a drag modifier key while dragging).
 void dragOver(org.eclipse.swt.dnd.DropTargetEvent event)
          The cursor is moving over the drop target.
 void drop(org.eclipse.swt.dnd.DropTargetEvent event)
          Forwards this event to the current listener, if there is one.
 void dropAccept(org.eclipse.swt.dnd.DropTargetEvent event)
          Forwards this event to the current listener if there is one.
 org.eclipse.swt.dnd.Transfer[] getTransfers()
          Returns the combined set of Transfer types of all TransferDropTargetListeners.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingDropAdapter

public DelegatingDropAdapter(TransferDropTargetListener[] listeners)
Creates a new delegating drop adapter.

Parameters:
listeners - an array of potential listeners
Method Detail

dragEnter

public void dragEnter(org.eclipse.swt.dnd.DropTargetEvent event)
The cursor has entered the drop target boundaries. The current listener is updated, and #dragEnter() is forwarded to the current listener.

Specified by:
dragEnter in interface org.eclipse.swt.dnd.DropTargetListener
Parameters:
event - the drop target event
See Also:
DropTargetListener.dragEnter(DropTargetEvent)

dragLeave

public void dragLeave(org.eclipse.swt.dnd.DropTargetEvent event)
The cursor has left the drop target boundaries. The event is forwarded to the current listener.

Specified by:
dragLeave in interface org.eclipse.swt.dnd.DropTargetListener
Parameters:
event - the drop target event
See Also:
DropTargetListener.dragLeave(DropTargetEvent)

dragOperationChanged

public void dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent event)
The operation being performed has changed (usually due to the user changing a drag modifier key while dragging). Updates the current listener and forwards this event to that listener.

Specified by:
dragOperationChanged in interface org.eclipse.swt.dnd.DropTargetListener
Parameters:
event - the drop target event
See Also:
DropTargetListener.dragOperationChanged(DropTargetEvent)

dragOver

public void dragOver(org.eclipse.swt.dnd.DropTargetEvent event)
The cursor is moving over the drop target. Updates the current listener and forwards this event to that listener. If no listener can handle the drag operation the event.detail field is set to DND.DROP_NONE to indicate an invalid drop.

Specified by:
dragOver in interface org.eclipse.swt.dnd.DropTargetListener
Parameters:
event - the drop target event
See Also:
DropTargetListener.dragOver(DropTargetEvent)

drop

public void drop(org.eclipse.swt.dnd.DropTargetEvent event)
Forwards this event to the current listener, if there is one. Sets the current listener to null afterwards.

Specified by:
drop in interface org.eclipse.swt.dnd.DropTargetListener
Parameters:
event - the drop target event
See Also:
DropTargetListener.drop(DropTargetEvent)

dropAccept

public void dropAccept(org.eclipse.swt.dnd.DropTargetEvent event)
Forwards this event to the current listener if there is one.

Specified by:
dropAccept in interface org.eclipse.swt.dnd.DropTargetListener
Parameters:
event - the drop target event
See Also:
DropTargetListener.dropAccept(DropTargetEvent)

getTransfers

public org.eclipse.swt.dnd.Transfer[] getTransfers()
Returns the combined set of Transfer types of all TransferDropTargetListeners.

Returns:
the combined set of Transfer types