public class PluginDropAdapter extends ViewerDropAdapter
PluginTransfer
drag and drop
transfer type to a drop action.
This class may be instantiated or subclassed.
Modifier and Type | Field and Description |
---|---|
static String |
ATT_CLASS
The extension point attribute that defines the drop action class.
|
LOCATION_AFTER, LOCATION_BEFORE, LOCATION_NONE, LOCATION_ON
Constructor and Description |
---|
PluginDropAdapter(StructuredViewer viewer)
Creates a plug-in drop adapter for the given viewer.
|
Modifier and Type | Method and Description |
---|---|
void |
drop(DropTargetEvent event)
This implementation of
drop does nothing. |
protected TransferData |
getCurrentTransfer()
Returns the current transfer.
|
protected static IDropActionDelegate |
getPluginAdapter(PluginTransferData data)
Loads the class that will perform the action associated with the given drop
data.
|
boolean |
performDrop(Object data)
Performs any work associated with the drop.
|
boolean |
validateDrop(Object target,
int operation,
TransferData transferType)
The
PluginDropAdapter implementation of this
ViewerDropAdapter method is used to notify the action that some
aspect of the drop operation has changed. |
clearState, determineLocation, determineTarget, dragEnter, dragOperationChanged, dragOver, dropAccept, getBounds, getCurrentEvent, getCurrentLocation, getCurrentOperation, getCurrentTarget, getFeedbackEnabled, getSelectedObject, getViewer, handleException, overrideOperation, setExpandEnabled, setFeedbackEnabled, setScrollEnabled, setScrollExpandEnabled, setSelectionFeedbackEnabled
dragLeave
public static final String ATT_CLASS
public PluginDropAdapter(StructuredViewer viewer)
viewer
- the viewerpublic void drop(DropTargetEvent event)
DropTargetAdapter
drop
does nothing.
For additional information see DropTargetListener.drop
.drop
in interface DropTargetListener
drop
in class ViewerDropAdapter
event
- the information associated with the drop eventDropTargetEvent
protected TransferData getCurrentTransfer()
protected static IDropActionDelegate getPluginAdapter(PluginTransferData data) throws CoreException
data
- the drop dataCoreException
public boolean performDrop(Object data)
ViewerDropAdapter
Subclasses must implement this method to provide drop behavior.
performDrop
in class ViewerDropAdapter
data
- the drop datatrue
if the drop was successful, and
false
otherwiseViewerDropAdapter.performDrop(java.lang.Object)
public boolean validateDrop(Object target, int operation, TransferData transferType)
PluginDropAdapter
implementation of this
ViewerDropAdapter
method is used to notify the action that some
aspect of the drop operation has changed. Subclasses may override.validateDrop
in class ViewerDropAdapter
target
- the object that the mouse is currently hovering over, or
null
if the mouse is hovering over empty spaceoperation
- the current drag operation (copy, move, etc.)transferType
- the current transfer typetrue
if the drop is valid, and false
otherwise
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.