Package org.eclipse.handly.ui.viewer

# Class ViewerDropSupport

java.lang.Object
org.eclipse.handly.ui.viewer.ViewerDropSupport

public class ViewerDropSupport extends 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

  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 Details

  - ### ViewerDropSupport

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

- ## Method Details

  - ### addDropTargetListener

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

  - ### start

    public void start()
    Adds drop support to the viewer.
    Throws:
      `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