public class ResourceDragAdapterAssistant extends CommonDragAdapterAssistant
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.
Constructor and Description |
---|
ResourceDragAdapterAssistant() |
Modifier and Type | Method and Description |
---|---|
Transfer[] |
getSupportedTransferTypes()
Extra TransferTypes allow the Navigator to generate different kinds of
payloads for DND clients.
|
boolean |
setDragData(DragSourceEvent anEvent,
IStructuredSelection aSelection)
Set the value of the
Event.data field using the given selection. |
dragFinished, dragStart, getContentService, getShell, setContentService
public Transfer[] getSupportedTransferTypes()
CommonDragAdapterAssistant
CommonDragAdapter
supports LocalSelectionTransfer
and PluginTransfer
.
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 will
CommonDragAdapterAssistant.setDragData(DragSourceEvent, IStructuredSelection)
be called. If
the drop event is cancelled,
CommonDragAdapterAssistant.setDragData(DragSourceEvent, IStructuredSelection)
will not be
called.
getSupportedTransferTypes
in class CommonDragAdapterAssistant
public boolean setDragData(DragSourceEvent anEvent, IStructuredSelection aSelection)
CommonDragAdapterAssistant
Event.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 from
CommonDragAdapterAssistant.getSupportedTransferTypes()
for the
DragSourceEvent.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.
setDragData
in class CommonDragAdapterAssistant
anEvent
- The event object should have its Event.data
field set
to a value that matches a supported TransferData
type.aSelection
- The current selection from the viewer.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.