Class ViewerDragSupport


  • public class ViewerDragSupport
    extends java.lang.Object
    Support for dragging items out of a structured viewer. This class is a wrapper around DelegatingDragAdapter.
    • Constructor Summary

      Constructors 
      Constructor Description
      ViewerDragSupport​(org.eclipse.jface.viewers.StructuredViewer viewer)
      Creates a drag support for the given viewer.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDragSourceListener​(org.eclipse.jface.util.TransferDragSourceListener listener)
      Adds the given TransferDragSourceListener.
      protected int getOperations()
      Returns a bitwise OR of the supported drag and drop operation types.
      void start()
      Adds drag support to the viewer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ViewerDragSupport

        public ViewerDragSupport​(org.eclipse.jface.viewers.StructuredViewer viewer)
        Creates a drag support for the given viewer.
        Parameters:
        viewer - not null
    • Method Detail

      • addDragSourceListener

        public void addDragSourceListener​(org.eclipse.jface.util.TransferDragSourceListener listener)
        Adds the given TransferDragSourceListener.
        Parameters:
        listener - not null
        Throws:
        java.lang.IllegalStateException - if already started
      • start

        public void start()
        Adds drag support to the viewer.
        Throws:
        java.lang.IllegalStateException - if already started
        See Also:
        StructuredViewer.addDragSupport(int, org.eclipse.swt.dnd.Transfer[], org.eclipse.swt.dnd.DragSourceListener)
      • getOperations

        protected int getOperations()
        Returns a bitwise OR of the supported drag and drop operation types.

        Default implementation returns DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK.

        Returns:
        a bitwise OR of the supported drag and drop operation types