Package org.eclipse.handly.ui.viewer
Class ViewerDropSupport
- java.lang.Object
-
- org.eclipse.handly.ui.viewer.ViewerDropSupport
-
public class ViewerDropSupport extends java.lang.ObjectSupport for dropping items into a structured viewer. This class is a wrapper aroundDelegatingDropAdapter.
-
-
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 voidaddDropTargetListener(org.eclipse.jface.util.TransferDropTargetListener listener)Adds the givenTransferDropTargetListener.protected intgetOperations()Returns a bitwise OR of the supported drag and drop operation types.voidsetFeedbackEnabled(boolean value)Sets whether visible insertion feedback should be presented to the user.voidstart()Adds drop support to the viewer.
-
-
-
Method Detail
-
addDropTargetListener
public void addDropTargetListener(org.eclipse.jface.util.TransferDropTargetListener listener)
Adds the givenTransferDropTargetListener.- Parameters:
listener- notnull- 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
setFeedbackEnabledfor everyTransferDropTargetListenerthat is aViewerDropAdapter.- Parameters:
value-trueif visual feedback is desired, andfalseif 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
-
-