Class ResourceDragAdapterAssistant
- java.lang.Object
-
- org.eclipse.ui.navigator.CommonDragAdapterAssistant
-
- org.eclipse.ui.navigator.resources.ResourceDragAdapterAssistant
-
public class ResourceDragAdapterAssistant extends CommonDragAdapterAssistant
Clients may reference this class in the dragAssistant element of a org.eclipse.ui.navigator.viewer extension point.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 Constructor Description ResourceDragAdapterAssistant()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Transfer[]getSupportedTransferTypes()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 org.eclipse.ui.navigator.CommonDragAdapterAssistant
dragFinished, dragStart, getContentService, getShell, setContentService
-
-
-
-
Method Detail
-
getSupportedTransferTypes
public Transfer[] 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
public boolean setDragData(DragSourceEvent anEvent, IStructuredSelection aSelection)
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.
-
-