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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTransfer[]Extra TransferTypes allow the Navigator to generate different kinds of payloads for DND clients.booleansetDragData(DragSourceEvent anEvent, IStructuredSelection aSelection) Set the value of theEvent.datafield using the given selection.Methods inherited from class CommonDragAdapterAssistant
dragFinished, dragStart, getContentService, getShell, setContentService
-
Constructor Details
-
ResourceDragAdapterAssistant
public ResourceDragAdapterAssistant()
-
-
Method Details
-
getSupportedTransferTypes
Description copied from class:CommonDragAdapterAssistantExtra TransferTypes allow the Navigator to generate different kinds of payloads for DND clients. By default, theCommonDragAdaptersupportsLocalSelectionTransferandPluginTransfer.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:
getSupportedTransferTypesin classCommonDragAdapterAssistant- Returns:
- The added transfer types. (e.g. FileTransfer.getInstance()).
-
setDragData
Description copied from class:CommonDragAdapterAssistantSet the value of theEvent.datafield 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:
setDragDatain classCommonDragAdapterAssistant- Parameters:
anEvent- The event object should have itsEvent.datafield set to a value that matches a supportedTransferDatatype.aSelection- The current selection from the viewer.- Returns:
- True if the data could be set; false otherwise.
-