Class ResourceDragAdapterAssistant
Clients may not extend or instantiate this class for any purpose other than
INavigatorDnDService.bindDragAssistant(CommonDragAdapterAssistant)
.
Clients may have no direct dependencies on the contract of this class.
- Since:
- 3.2
- Restriction:
- This class is not intended to be subclassed by clients.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionTransfer[]
Extra TransferTypes allow the Navigator to generate different kinds of payloads for DND clients.boolean
setDragData
(DragSourceEvent anEvent, IStructuredSelection aSelection) Set the value of theEvent.data
field using the given selection.Methods inherited from class org.eclipse.ui.navigator.CommonDragAdapterAssistant
dragFinished, dragStart, getContentService, getShell, setContentService
-
Constructor Details
-
ResourceDragAdapterAssistant
public ResourceDragAdapterAssistant()
-
-
Method Details
-
getSupportedTransferTypes
Description copied from class:CommonDragAdapterAssistant
Extra TransferTypes allow the Navigator to generate different kinds of payloads for DND clients. By default, theCommonDragAdapter
supportsLocalSelectionTransfer
andPluginTransfer
.CommonDragAdapterAssistants can extend the available TransferTypes that a Common Navigator Viewer can generate. Clients should return the set of Transfer Types they support. When a drop event occurs, the available drag assistants will be searched for a enabled assistants for the
DragSourceEvent
. Only if the drop event occurs willCommonDragAdapterAssistant.setDragData(DragSourceEvent, IStructuredSelection)
be called. If the drop event is cancelled,CommonDragAdapterAssistant.setDragData(DragSourceEvent, IStructuredSelection)
will not be called.- Specified by:
getSupportedTransferTypes
in classCommonDragAdapterAssistant
- Returns:
- The added transfer types. (e.g. FileTransfer.getInstance()).
-
setDragData
Description copied from class:CommonDragAdapterAssistant
Set the value of theEvent.data
field using the given selection. Clients will only have an opportunity to set the drag data if they have returned a matching Transfer Type fromCommonDragAdapterAssistant.getSupportedTransferTypes()
for theDragSourceEvent.dataType
.Clients will only have an opportunity to set the data when the drop event occurs. If the drop operation is cancelled, then this method will not be called.
- Specified by:
setDragData
in classCommonDragAdapterAssistant
- Parameters:
anEvent
- The event object should have itsEvent.data
field set to a value that matches a supportedTransferData
type.aSelection
- The current selection from the viewer.- Returns:
- True if the data could be set; false otherwise.
-