Package org.eclipse.ui.navigator
Class CommonDropAdapter
java.lang.Object
org.eclipse.swt.dnd.DropTargetAdapter
org.eclipse.jface.viewers.ViewerDropAdapter
org.eclipse.ui.part.PluginDropAdapter
org.eclipse.ui.navigator.CommonDropAdapter
- All Implemented Interfaces:
- EventListener,- DropTargetListener
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.
 
- Since:
- 3.2
- See Also:
- 
Field SummaryFields inherited from class org.eclipse.ui.part.PluginDropAdapterATT_CLASSFields inherited from class org.eclipse.jface.viewers.ViewerDropAdapterLOCATION_AFTER, LOCATION_BEFORE, LOCATION_NONE, LOCATION_ON
- 
Constructor SummaryConstructorsConstructorDescriptionCommonDropAdapter(INavigatorContentService aContentService, StructuredViewer aStructuredViewer) Create a DropAdapter that handles a drop based on the given content service and selection provider.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddragEnter(DropTargetEvent event) This implementation ofdragEnterpermits the default operation defined inevent.detailto be performed on the current data type defined inevent.currentDataType.voiddragLeave(DropTargetEvent event) This implementation ofdragLeavedoes nothing.Returns the bounds of the given SWT tree or table item.intReturns a constant describing the position of the mouse relative to the target (before, on, or after the target.intReturns the current operation.Returns the target object currently under the mouse.Returns the current transfer.Transfer[]voidoverrideOperation(int operation) Overrides the current operation for a drop that happens immediately after the current validateDrop.booleanperformDrop(Object data) Performs any work associated with the drop.booleanvalidateDrop(Object aDropTarget, int theDropOperation, TransferData theTransferData) ThePluginDropAdapterimplementation of thisViewerDropAdaptermethod is used to notify the action that some aspect of the drop operation has changed.Methods inherited from class org.eclipse.ui.part.PluginDropAdapterdrop, getPluginAdapterMethods inherited from class org.eclipse.jface.viewers.ViewerDropAdapterclearState, determineLocation, determineTarget, dragOperationChanged, dragOver, dropAccept, getCurrentEvent, getFeedbackEnabled, getSelectedObject, getThreshold, getViewer, handleException, setExpandEnabled, setFeedbackEnabled, setScrollEnabled, setScrollExpandEnabled, setSelectionFeedbackEnabled
- 
Constructor Details
- 
Method Details- 
getSupportedDropTransfers- Returns:
- An array of Transfers allowed by the CommonDropAdapter. Includes
         LocalSelectionTransfer.getTransfer(),FileTransfer.getInstance(),PluginTransfer.getInstance().
- See Also:
 
- 
dragEnterDescription copied from class:DropTargetAdapterThis implementation ofdragEnterpermits the default operation defined inevent.detailto be performed on the current data type defined inevent.currentDataType. For additional information seeDropTargetListener.dragEnter.- Specified by:
- dragEnterin interface- DropTargetListener
- Overrides:
- dragEnterin class- ViewerDropAdapter
- Parameters:
- event- the information associated with the drag enter event
- See Also:
 
- 
dragLeaveDescription copied from class:DropTargetAdapterThis implementation ofdragLeavedoes nothing. For additional information seeDropTargetListener.dragOperationChanged.- Specified by:
- dragLeavein interface- DropTargetListener
- Overrides:
- dragLeavein class- DropTargetAdapter
- Parameters:
- event- the information associated with the drag leave event
- See Also:
 
- 
performDropDescription copied from class:ViewerDropAdapterPerforms any work associated with the drop.Subclasses must implement this method to provide drop behavior. - Overrides:
- performDropin class- PluginDropAdapter
- Parameters:
- data- the drop data
- Returns:
- trueif the drop was successful, and- falseotherwise
- See Also:
 
- 
validateDropDescription copied from class:PluginDropAdapterThePluginDropAdapterimplementation of thisViewerDropAdaptermethod is used to notify the action that some aspect of the drop operation has changed. Subclasses may override.- Overrides:
- validateDropin class- PluginDropAdapter
- Parameters:
- aDropTarget- the object that the mouse is currently hovering over, or- nullif the mouse is hovering over empty space
- theDropOperation- the current drag operation (copy, move, etc.)
- theTransferData- the current transfer type
- Returns:
- trueif the drop is valid, and- falseotherwise
 
- 
getBoundsDescription copied from class:ViewerDropAdapterReturns the bounds of the given SWT tree or table item.- Overrides:
- getBoundsin class- ViewerDropAdapter
- Parameters:
- item- the SWT Item
- Returns:
- the bounds, or nullif it is not a known type of item
 
- 
getCurrentLocationpublic int getCurrentLocation()Description copied from class:ViewerDropAdapterReturns a constant describing the position of the mouse relative to the target (before, on, or after the target.- Overrides:
- getCurrentLocationin class- ViewerDropAdapter
- Returns:
- one of the LOCATION_*constants defined in this type
 
- 
getCurrentOperationpublic int getCurrentOperation()Description copied from class:ViewerDropAdapterReturns the current operation.- Overrides:
- getCurrentOperationin class- ViewerDropAdapter
- Returns:
- a DROP_*constant from classDND
- See Also:
 
- 
overrideOperationpublic void overrideOperation(int operation) Description copied from class:ViewerDropAdapterOverrides the current operation for a drop that happens immediately after the current validateDrop. This maybe called only from within aViewerDropAdapter.validateDrop(Object, int, TransferData)method- Overrides:
- overrideOperationin class- ViewerDropAdapter
- Parameters:
- operation- the operation to be used for the drop.
- Since:
- 3.4
- See Also:
 
- 
getCurrentTargetDescription copied from class:ViewerDropAdapterReturns the target object currently under the mouse.- Overrides:
- getCurrentTargetin class- ViewerDropAdapter
- Returns:
- the current target object
 
- 
getCurrentTransferDescription copied from class:PluginDropAdapterReturns the current transfer.- Overrides:
- getCurrentTransferin class- PluginDropAdapter
 
 
-