Runtime

org.eclipse.gmf.runtime.common.ui.services.dnd.drop
Interface IDropTargetListener

All Superinterfaces:
DropTargetListener, java.util.EventListener, org.eclipse.swt.internal.SWTEventListener
All Known Implementing Classes:
AbstractDropTargetListener, ResourceDropTargetListener

public interface IDropTargetListener
extends DropTargetListener

Interface to be implemented by providers to handle drop target events


Method Summary
 boolean canSupport(IDropTargetContext context, IDropTargetEvent currentEvent, ITransferAgent currentAgent)
          Returns a boolean indicating whether the listener can support drop operations on the current target.
 ICommand getExecutableContext(DropTargetEvent event)
          Returns a command for dropping the event data on the drop target.
 java.lang.String[] getSupportingTransferIds()
          Returns the supporting transfer agent ids.
 void setFeedback(DropTargetEvent event)
          Provides the listener an opportunity to set the feedback when hovering over a target.
 
Methods inherited from interface org.eclipse.swt.dnd.DropTargetListener
dragEnter, dragLeave, dragOperationChanged, dragOver, drop, dropAccept
 

Method Detail

getExecutableContext

ICommand getExecutableContext(DropTargetEvent event)
Returns a command for dropping the event data on the drop target. The event passed in corresponds to the drop event. The listener can get the current target from the context.

Parameters:
event - the event associated with the drop event
Returns:
Returns a command for dropping the event data on the drop target.

canSupport

boolean canSupport(IDropTargetContext context,
                   IDropTargetEvent currentEvent,
                   ITransferAgent currentAgent)
Returns a boolean indicating whether the listener can support drop operations on the current target. The target context, current event and current transfer agent information is passed to the listener. This method is invoked whenever the target changes.

Parameters:
context - The drop action context
currentEvent - The current drop event
currentAgent - the current transfer agent
Returns:
Returns true or false

setFeedback

void setFeedback(DropTargetEvent event)
Provides the listener an opportunity to set the feedback when hovering over a target. The listener can decide whether drag under effect is enabled for the current target.

Parameters:
event - The drop target event

getSupportingTransferIds

java.lang.String[] getSupportingTransferIds()
Returns the supporting transfer agent ids.

Returns:
return the supporting transfer agent ids

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.