|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.swt.dnd.DropTargetAdapter
org.eclipse.jface.viewers.ViewerDropAdapter
org.eclipse.ui.part.PluginDropAdapter
org.eclipse.ui.navigator.CommonDropAdapter
public final class CommonDropAdapter
Provides an implementation of PluginDropAdapter which uses the
extensions provided by the associated INavigatorContentService.
Clients should not need to create an instance of this class unless they are
creating their own custom viewer. Otherwise, CommonViewer configures
its drop adapter automatically.
INavigatorDnDService,
CommonDragAdapter,
CommonDragAdapterAssistant,
CommonDropAdapterAssistant,
CommonViewer| Field Summary |
|---|
| Fields inherited from class org.eclipse.ui.part.PluginDropAdapter |
|---|
ATT_CLASS |
| Fields inherited from class org.eclipse.jface.viewers.ViewerDropAdapter |
|---|
LOCATION_AFTER, LOCATION_BEFORE, LOCATION_NONE, LOCATION_ON |
| Constructor Summary | |
|---|---|
CommonDropAdapter(INavigatorContentService aContentService,
StructuredViewer aStructuredViewer)
Create a DropAdapter that handles a drop based on the given content service and selection provider. |
|
| Method Summary | |
|---|---|
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. |
void |
dragLeave(DropTargetEvent event)
This implementation of dragLeave does nothing. |
Rectangle |
getBounds(Item item)
Returns the bounds of the given SWT tree or table item. |
int |
getCurrentLocation()
Returns a constant describing the position of the mouse relative to the target (before, on, or after the target. |
int |
getCurrentOperation()
Returns the current operation. |
Object |
getCurrentTarget()
Returns the target object currently under the mouse. |
TransferData |
getCurrentTransfer()
Returns the current transfer. |
Transfer[] |
getSupportedDropTransfers()
|
void |
overrideOperation(int operation)
Overrides the current operation for a drop that happens immediately after the current validateDrop. |
boolean |
performDrop(Object data)
Performs any work associated with the drop. |
boolean |
validateDrop(Object aDropTarget,
int theDropOperation,
TransferData theTransferData)
The PluginDropAdapter implementation of this
ViewerDropAdapter method is used to notify the action that some
aspect of the drop operation has changed. |
| Methods inherited from class org.eclipse.ui.part.PluginDropAdapter |
|---|
drop, getPluginAdapter |
| Methods inherited from class org.eclipse.jface.viewers.ViewerDropAdapter |
|---|
clearState, determineLocation, determineTarget, dragOperationChanged, dragOver, dropAccept, getCurrentEvent, getFeedbackEnabled, getSelectedObject, getViewer, handleException, setExpandEnabled, setFeedbackEnabled, setScrollEnabled, setScrollExpandEnabled, setSelectionFeedbackEnabled |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CommonDropAdapter(INavigatorContentService aContentService,
StructuredViewer aStructuredViewer)
aContentService - The content service this Drop Adapter is associated withaStructuredViewer - The viewer this DropAdapter is associated with.| Method Detail |
|---|
public Transfer[] getSupportedDropTransfers()
LocalSelectionTransfer.getTransfer(),
FileTransfer.getInstance(),
PluginTransfer.getInstance().LocalSelectionTransfer,
FileTransfer,
PluginTransferpublic 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 void dragLeave(DropTargetEvent event)
DropTargetAdapterdragLeave does nothing.
For additional information see DropTargetListener.dragOperationChanged.
dragLeave in interface DropTargetListenerdragLeave in class DropTargetAdapterevent - the information associated with the drag leave eventDropTargetEventpublic boolean performDrop(Object data)
ViewerDropAdapterSubclasses must implement this method to provide drop behavior.
performDrop in class PluginDropAdapterdata - the drop data
true if the drop was successful, and
false otherwiseViewerDropAdapter.performDrop(java.lang.Object)
public boolean validateDrop(Object aDropTarget,
int theDropOperation,
TransferData theTransferData)
PluginDropAdapterPluginDropAdapter 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 PluginDropAdapteraDropTarget - the object that the mouse is currently hovering over, or
null if the mouse is hovering over empty spacetheDropOperation - the current drag operation (copy, move, etc.)theTransferData - the current transfer type
true if the drop is valid, and false
otherwisepublic Rectangle getBounds(Item item)
ViewerDropAdapter
getBounds in class ViewerDropAdapteritem - the SWT Item
null if it is not a known type of itempublic int getCurrentLocation()
ViewerDropAdapter
getCurrentLocation in class ViewerDropAdapterLOCATION_* constants defined in this typepublic int getCurrentOperation()
ViewerDropAdapter
getCurrentOperation in class ViewerDropAdapterDROP_* constant from class DNDDND.DROP_COPY,
DND.DROP_MOVE,
DND.DROP_LINK,
DND.DROP_NONEpublic void overrideOperation(int operation)
ViewerDropAdapterViewerDropAdapter.validateDrop(Object, int, TransferData) method
overrideOperation in class ViewerDropAdapteroperation - the operation to be used for the drop.ViewerDropAdapter.overrideOperation(int)public Object getCurrentTarget()
ViewerDropAdapter
getCurrentTarget in class ViewerDropAdapterpublic TransferData getCurrentTransfer()
PluginDropAdapter
getCurrentTransfer in class PluginDropAdapter
|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2011. All rights reserved.