|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.swt.dnd.DropTargetAdapter org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter
public class EditingDomainViewerDropAdapter
This implementation of a drop target listener is designed to turn a drag and drop
operation into a Command
based on the model objects of an
EditingDomain
and created by DragAndDropCommand.create(org.eclipse.emf.edit.domain.EditingDomain, java.lang.Object, float, int, int, java.util.Collection>)
. 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(org.eclipse.swt.dnd.DropTargetEvent)
can be overridden to change the behaviour.
The implementation also only handles an IStructuredSelection
,
but the method extractDragSource(java.lang.Object)
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.
Constructor Summary | |
---|---|
EditingDomainViewerDropAdapter(org.eclipse.emf.edit.domain.EditingDomain domain,
org.eclipse.jface.viewers.Viewer viewer)
This creates an instance with the given domain and viewer. |
Method Summary | |
---|---|
void |
dragEnter(org.eclipse.swt.dnd.DropTargetEvent event)
This is called when the mouse first enters or starts dragging in the viewer. |
void |
dragLeave(org.eclipse.swt.dnd.DropTargetEvent event)
This is called when the mouse leaves or stops dragging in the viewer, whether the operation was aborted or is about to do a dropAccept and drop. |
void |
dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent event)
This is called when the operation has changed in some way, typically because the user changes keyboard modifiers. |
void |
dragOver(org.eclipse.swt.dnd.DropTargetEvent event)
This is called repeatedly, as the mouse moves over the viewer. |
void |
drop(org.eclipse.swt.dnd.DropTargetEvent event)
This is called to indicate that the drop action should be invoked. |
void |
dropAccept(org.eclipse.swt.dnd.DropTargetEvent event)
This is called when the mouse is released over the viewer to initiate a drop, between dragLeave and drop. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EditingDomainViewerDropAdapter(org.eclipse.emf.edit.domain.EditingDomain domain, org.eclipse.jface.viewers.Viewer viewer)
Method Detail |
---|
public void dragEnter(org.eclipse.swt.dnd.DropTargetEvent event)
dragEnter
in interface org.eclipse.swt.dnd.DropTargetListener
dragEnter
in class org.eclipse.swt.dnd.DropTargetAdapter
public void dragLeave(org.eclipse.swt.dnd.DropTargetEvent event)
dragLeave
in interface org.eclipse.swt.dnd.DropTargetListener
dragLeave
in class org.eclipse.swt.dnd.DropTargetAdapter
public void dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent event)
dragOperationChanged
in interface org.eclipse.swt.dnd.DropTargetListener
dragOperationChanged
in class org.eclipse.swt.dnd.DropTargetAdapter
public void dragOver(org.eclipse.swt.dnd.DropTargetEvent event)
dragOver
in interface org.eclipse.swt.dnd.DropTargetListener
dragOver
in class org.eclipse.swt.dnd.DropTargetAdapter
public void dropAccept(org.eclipse.swt.dnd.DropTargetEvent event)
dropAccept
in interface org.eclipse.swt.dnd.DropTargetListener
dropAccept
in class org.eclipse.swt.dnd.DropTargetAdapter
public void drop(org.eclipse.swt.dnd.DropTargetEvent event)
drop
in interface org.eclipse.swt.dnd.DropTargetListener
drop
in class org.eclipse.swt.dnd.DropTargetAdapter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |