Class ViewerDropSupport


  • public class ViewerDropSupport
    extends java.lang.Object
    Support for dropping items into a structured viewer. This class is a wrapper around DelegatingDropAdapter.
    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDropTargetListener​(org.eclipse.jface.util.TransferDropTargetListener listener)
      Adds the given TransferDropTargetListener.
      protected int getOperations()
      Returns a bitwise OR of the supported drag and drop operation types.
      void setFeedbackEnabled​(boolean value)
      Sets whether visible insertion feedback should be presented to the user.
      void start()
      Adds drop support to the viewer.
      • Methods inherited from class java.lang.Object

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

      • ViewerDropSupport

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

      • addDropTargetListener

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

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

        public void setFeedbackEnabled​(boolean value)
        Sets whether visible insertion feedback should be presented to the user. Typical insertion feedback is the horizontal insertion bar that appears between adjacent items while dragging.

        This implementation calls setFeedbackEnabled for every TransferDropTargetListener that is a ViewerDropAdapter.

        Parameters:
        value - true if visual feedback is desired, and false if not
      • 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 | DND.DROP_DEFAULT.

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