Package com.iizigo.navigator
Class DragAdapterAssistant
java.lang.Object
org.eclipse.ui.navigator.CommonDragAdapterAssistant
org.eclipse.ui.navigator.resources.ResourceDragAdapterAssistant
com.iizigo.navigator.DragAdapterAssistant
Assist the CommonDragAdapter by providing new TransferTypes and the logic to handle setting up the transfer data. Clients must extend this class as part of the org.eclipse.ui.navigator.viewer/dragAssistant extension. By default, the Common Navigator supports LocalSelectionTransfer and PluginTransfer.
- Author:
- Christopher Mindus
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescription- void- dragFinished- (DragSourceEvent event, IStructuredSelection selection) Allows the drag assistant to do any necessary cleanup after the drop operation is done.- void- dragStart- (DragSourceEvent event, IStructuredSelection selection) Allows the drag assistant indicate it wants to participate in the drag operation.- Transfer[]Extra TransferTypes allow the Navigator to generate different kinds of payloads for DND clients.- boolean- setDragData- (DragSourceEvent event, IStructuredSelection selection) Set the value of the org.eclipse.swt.widgets.Event.data field using the given selection.- Methods inherited from class org.eclipse.ui.navigator.CommonDragAdapterAssistant- getContentService, getShell, setContentService
- Constructor Details- DragAdapterAssistantpublic DragAdapterAssistant()The Eclipse constructor.
 
- Method Details- getSupportedTransferTypesExtra TransferTypes allow the Navigator to generate different kinds of payloads for DND clients. By default, the 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 setDragData(DragSourceEvent, IStructuredSelection)} be called. If the drop event is cancelled, setDragData(DragSourceEvent, IStructuredSelection)} will not be called. - Overrides:
- getSupportedTransferTypesin class- ResourceDragAdapterAssistant
- Returns:
- The added transfer types: PropertiesTransfer.
 
- dragStartAllows the drag assistant indicate it wants to participate in the drag operation. This is called at DragSourceListener.dragStart(DragSourceEvent) time.- Overrides:
- dragStartin class- CommonDragAdapterAssistant
- Parameters:
- event- The event object should return doit=true if it wants to participate in the drag and set doit=false if it does not want to further participate.
- selection- The current selection from the viewer.
 
- setDragDataSet the value of the org.eclipse.swt.widgets.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 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. - Overrides:
- setDragDatain class- ResourceDragAdapterAssistant
- Parameters:
- event- The event object should have its Event.data field set to a value that matches a supported TransferData type.
- selection- The current selection from the viewer.
- Returns:
- True if the data could be set; false otherwise.
 
- dragFinishedAllows the drag assistant to do any necessary cleanup after the drop operation is done. This is called at DragSourceListener.dragFinished(DragSourceEvent) time. This is called on the same assistant that was called for the set data.- Overrides:
- dragFinishedin class- CommonDragAdapterAssistant
- Parameters:
- event- The event object should have its Event.data field set to a value that matches a supported TransferData type.
- selection- The current selection from the viewer.