public class NavigatorDropAdapter extends PluginDropAdapter implements IOverwriteQuery
ATT_CLASS
LOCATION_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.detail to 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, getPluginAdapter
determineLocation, determineTarget, dragOperationChanged, dragOver, dropAccept, getBounds, getCurrentLocation, getCurrentOperation, getCurrentTarget, getFeedbackEnabled, getSelectedObject, getViewer, handleException, setFeedbackEnabled, setScrollExpandEnabled, setSelectionFeedbackEnabled
dragLeave
public NavigatorDropAdapter(StructuredViewer viewer)
viewer
- the navigator's viewerpublic void dragEnter(DropTargetEvent event)
DropTargetAdapter
dragEnter
permits the default
operation defined in event.detail
to be performed on the current data type
defined in event.currentDataType
.
For additional information see DropTargetListener.dragEnter
.dragEnter
in interface DropTargetListener
dragEnter
in class ViewerDropAdapter
event
- the information associated with the drag enter eventDropTargetEvent
public boolean performDrop(Object data)
performDrop
in class PluginDropAdapter
data
- the drop datatrue
if the drop was successful, and
false
otherwiseDropTargetListener.drop(org.eclipse.swt.dnd.DropTargetEvent)
public String queryOverwrite(String pathString)
IOverwriteQuery
This 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 IOverwriteQuery
pathString
- the path representing the entity to be overwrittenpublic boolean validateDrop(Object target, int dragOperation, TransferData transferType)
validateDrop
in class PluginDropAdapter
target
- 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.