org.eclipse.ui.part
Class PluginDropAdapter
java.lang.Object
|
+--org.eclipse.swt.dnd.DropTargetAdapter
|
+--org.eclipse.jface.viewers.ViewerDropAdapter
|
+--org.eclipse.ui.part.PluginDropAdapter
- All Implemented Interfaces:
- DropTargetListener, EventListener, org.eclipse.swt.internal.SWTEventListener
- Direct Known Subclasses:
- NavigatorDropAdapter
- public class PluginDropAdapter
- extends ViewerDropAdapter
Adapter for adding handling of the PluginTransfer
drag and drop
transfer type to a drop action.
This class may be instantiated or subclassed.
Field Summary |
static String |
ATT_CLASS
The extension point attribute that defines the drop action class. |
Methods inherited from class org.eclipse.jface.viewers.ViewerDropAdapter |
determineLocation, determineTarget, dragEnter, dragOperationChanged, dragOver, dropAccept, getBounds, getCurrentLocation, getCurrentOperation, getCurrentTarget, getFeedbackEnabled, getSelectedObject, getViewer, handleException, setFeedbackEnabled, setScrollExpandEnabled |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ATT_CLASS
public static final String ATT_CLASS
- The extension point attribute that defines the drop action class.
PluginDropAdapter
public PluginDropAdapter(StructuredViewer viewer)
- Creates a plug-in drop adapter for the given viewer.
- Parameters:
viewer
- the viewer
drop
public void drop(DropTargetEvent event)
- Description copied from class:
DropTargetAdapter
- This implementation of
drop
does nothing.
For additional information see DropTargetListener.drop
.
- Overrides:
drop
in class ViewerDropAdapter
- Following copied from interface:
org.eclipse.swt.dnd.DropTargetListener
- Parameters:
event
- the information associated with the drop event- See Also:
DropTargetEvent
getCurrentTransfer
protected TransferData getCurrentTransfer()
- Returns the current transfer.
getPluginAdapter
protected static IDropActionDelegate getPluginAdapter(PluginTransferData data)
throws CoreException
- Loads the class that will perform the action associated with the given drop
data.
- Parameters:
data
- the drop data- Returns:
- the viewer drop adapter
performDrop
public boolean performDrop(Object data)
- Description copied from class:
ViewerDropAdapter
- Performs any work associated with the drop.
Subclasses must implement this method to provide drop behavior.
- Overrides:
performDrop
in class ViewerDropAdapter
- See Also:
ViewerDropAdapter.performDrop(java.lang.Object)
validateDrop
public 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. Subclasses may override.
- Overrides:
validateDrop
in class ViewerDropAdapter
- Following copied from class:
org.eclipse.jface.viewers.ViewerDropAdapter
- Parameters:
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 type- Returns:
true
if the drop is valid, and false
otherwise
Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.