public static class EditingDomainViewerDropAdapter
extends java.lang.Object
Command
based on the model objects of an
EditingDomain
and created by DragAndDropCommand#create
. It is
designed to do early data transfer so the the enablement and feedback of the
drag and drop interaction can intimately depend on the state of the model objects
involved. On some platforms, however, early data transfer is not available, so this
feedback cannot be provided.
The base implementation of this class should be sufficient for most applications.
Any change in behaviour is typically accomplished by overriding
ItemProviderAdapter
.createDragAndDropCommand
to return a derived implementation of DragAndDropCommand
.
This is how one these adapters is typically hooked up:
viewer.addDropSupport (DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK, new Transfer [] { LocalTransfer.getInstance() }, EditingDomainViewerDropAdapter(viewer));
This implementation prefers to use a LocalTransfer
,
which short-circuits the transfer process for simple transfers within the workbench,
the method #getDragSource
can be overridden to change the behaviour.
The implementation also only handles an IStructuredSelection
,
but the method #extractDragSource
can be overridden to change the behaviour.
SWT's auto-scroll
and auto-expand
(hover) are enabled by default. The method #getAutoFeedback
can be overridden
to change this behaviour.