Eclipse Platform
Release 3.2

org.eclipse.ui.navigator.resources
Class ResourceDropAdapterAssistant

java.lang.Object
  extended byorg.eclipse.ui.navigator.CommonDropAdapterAssistant
      extended byorg.eclipse.ui.navigator.resources.ResourceDropAdapterAssistant

public class ResourceDropAdapterAssistant
extends CommonDropAdapterAssistant

Clients may reference this class in the dropAssistant element of a org.eclipse.ui.navigator.navigatorContent extension point.

Clients may not extend or instantiate this class for any purpose. Clients may have no direct dependencies on the contract of this class.

Since:
3.2

Constructor Summary
ResourceDropAdapterAssistant()
           
 
Method Summary
 IStatus handleDrop(CommonDropAdapter aDropAdapter, DropTargetEvent aDropTargetEvent, Object aTarget)
          Carry out the DND operation.
 IStatus handlePluginTransferDrop(IStructuredSelection aDragSelection, Object aDropTarget)
          Handle the drop operation for the target viewer.
 boolean isSupportedType(TransferData aTransferType)
          Clients may extend the supported transfer types beyond the default LocalSelectionTransfer.getTransfer() and PluginTransfer.getInstance() transfer types.
 IStatus validateDrop(Object target, int aDropOperation, TransferData transferType)
          Validates dropping on the given object.
 IStatus validatePluginTransferDrop(IStructuredSelection aDragSelection, Object aDropTarget)
          Return true if the client can handle the drop onto the target viewer of the drop operation.
 
Methods inherited from class org.eclipse.ui.navigator.CommonDropAdapterAssistant
doInit, getContentService, getShell, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceDropAdapterAssistant

public ResourceDropAdapterAssistant()
Method Detail

isSupportedType

public boolean isSupportedType(TransferData aTransferType)
Description copied from class: CommonDropAdapterAssistant
Clients may extend the supported transfer types beyond the default LocalSelectionTransfer.getTransfer() and PluginTransfer.getInstance() transfer types. When a transfer type other than one of these is encountered, the DND Service will query the visible and active descriptors that are enabled for the drop target of the current operation.

Overrides:
isSupportedType in class CommonDropAdapterAssistant
Parameters:
aTransferType - The transfer data from the drop operation
Returns:
True if the given TransferData can be understood by this assistant.

validateDrop

public IStatus validateDrop(Object target,
                            int aDropOperation,
                            TransferData transferType)
Description copied from class: CommonDropAdapterAssistant
Validates dropping on the given object. This method is called whenever some aspect of the drop operation changes.

Subclasses must implement this method to define which drops make sense. If clients return true, then they will be allowed to handle the drop in CommonDropAdapterAssistant.handleDrop(CommonDropAdapter, DropTargetEvent, Object).

Specified by:
validateDrop in class CommonDropAdapterAssistant
Parameters:
target - the object that the mouse is currently hovering over, or null if the mouse is hovering over empty space
aDropOperation - the current drag operation (copy, move, etc.)
transferType - the current transfer type
Returns:
A status indicating whether the drop is valid.

handleDrop

public IStatus handleDrop(CommonDropAdapter aDropAdapter,
                          DropTargetEvent aDropTargetEvent,
                          Object aTarget)
Description copied from class: CommonDropAdapterAssistant
Carry out the DND operation.

Specified by:
handleDrop in class CommonDropAdapterAssistant
Parameters:
aDropAdapter - The Drop Adapter contains information that has already been parsed from the drop event.
aDropTargetEvent - The drop target event.
aTarget - The object being dragged onto
Returns:
A status indicating whether the drop completed OK.

validatePluginTransferDrop

public IStatus validatePluginTransferDrop(IStructuredSelection aDragSelection,
                                          Object aDropTarget)
Description copied from class: CommonDropAdapterAssistant
Return true if the client can handle the drop onto the target viewer of the drop operation.

The default behavior of this method is to return Status.CANCEL_STATUS.

Overrides:
validatePluginTransferDrop in class CommonDropAdapterAssistant
Parameters:
aDragSelection - The selection dragged from the viewer.
aDropTarget - The target of the drop operation.
Returns:
OK if the plugin transfer can be handled by this assistant.

handlePluginTransferDrop

public IStatus handlePluginTransferDrop(IStructuredSelection aDragSelection,
                                        Object aDropTarget)
Description copied from class: CommonDropAdapterAssistant
Handle the drop operation for the target viewer.

The default behavior of this method is to return Status.CANCEL_STATUS.

Overrides:
handlePluginTransferDrop in class CommonDropAdapterAssistant
Parameters:
aDragSelection - The selection dragged from the viewer.
aDropTarget - The target of the drop operation.
Returns:
OK if the drop operation succeeded.

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.