public class NavigatorDropAdapter extends PluginDropAdapter implements IOverwriteQuery
ATT_CLASSLOCATION_AFTER, LOCATION_BEFORE, LOCATION_NONE, LOCATION_ON| Constructor and Description |
|---|
NavigatorDropAdapter(StructuredViewer viewer)
Constructs a new drop adapter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dragEnter(DropTargetEvent event)
This implementation of
dragEnter permits the default
operation defined in event.detailto be performed on the current data type
defined in event.currentDataType. |
boolean |
performDrop(Object data)
Perform the drop.
|
String |
queryOverwrite(String pathString)
Returns one of the return code constants declared on this interface,
indicating whether the entity represented by the passed String should be overwritten.
|
boolean |
validateDrop(Object target,
int dragOperation,
TransferData transferType)
This method is used to notify the action that some aspect of
the drop operation has changed.
|
drop, getCurrentTransfer, getPluginAdapterdetermineLocation, determineTarget, dragOperationChanged, dragOver, dropAccept, getBounds, getCurrentLocation, getCurrentOperation, getCurrentTarget, getFeedbackEnabled, getSelectedObject, getViewer, handleException, setFeedbackEnabled, setScrollExpandEnabled, setSelectionFeedbackEnableddragLeavepublic NavigatorDropAdapter(StructuredViewer viewer)
viewer - the navigator's viewerpublic void dragEnter(DropTargetEvent event)
DropTargetAdapterdragEnter permits the default
operation defined in event.detailto be performed on the current data type
defined in event.currentDataType.
For additional information see DropTargetListener.dragEnter.dragEnter in interface DropTargetListenerdragEnter in class ViewerDropAdapterevent - the information associated with the drag enter eventDropTargetEventpublic boolean performDrop(Object data)
performDrop in class PluginDropAdapterdata - the drop datatrue if the drop was successful, and
false otherwiseDropTargetListener.drop(org.eclipse.swt.dnd.DropTargetEvent)public String queryOverwrite(String pathString)
IOverwriteQueryThis method may be called from a non-UI thread, in which case this method must run the query in a sync exec in the UI thread, if it needs to query the user.
queryOverwrite in interface IOverwriteQuerypathString - the path representing the entity to be overwrittenpublic boolean validateDrop(Object target, int dragOperation, TransferData transferType)
validateDrop in class PluginDropAdaptertarget - the object that the mouse is currently hovering over, or
null if the mouse is hovering over empty spacedragOperation - the current drag operation (copy, move, etc.)transferType - the current transfer typetrue if the drop is valid, and false
otherwiseGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.