Class CommonDragAdapterAssistant

    • Constructor Detail

      • CommonDragAdapterAssistant

        public CommonDragAdapterAssistant()
    • Method Detail

      • setDragData

        public abstract boolean setDragData​(DragSourceEvent anEvent,
                                            IStructuredSelection aSelection)
        Set the value of the 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.

        Parameters:
        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.
        Returns:
        True if the data could be set; false otherwise.
      • dragStart

        public void dragStart​(DragSourceEvent anEvent,
                              IStructuredSelection aSelection)
        Allows the drag assistant indicate it wants to participate in the drag operation. This is called at DragSourceListener.dragStart(DragSourceEvent) time.
        Parameters:
        anEvent - 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.
        aSelection - The current selection from the viewer.
        Since:
        3.4
      • dragFinished

        public void dragFinished​(DragSourceEvent anEvent,
                                 IStructuredSelection aSelection)
        Allows 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.
        Parameters:
        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.
        Since:
        3.4
      • setContentService

        public final void setContentService​(INavigatorContentService aContentService)
        Accept and remember the content service this assistant is associated with.
        Parameters:
        aContentService -
      • getShell

        public final Shell getShell()
        Returns:
        The shell for the viewer this assistant is associated with or the shell of the active workbench window.