public class TemplateTransferDropTargetListener extends AbstractTransferDropTargetListener
TemplateTransfer
. The Drop is
performed by using a CreateRequest
to obtain a Command
from the targeted EditPart
.
This class is abstract
. Subclasses are responsible for providing
the appropriate Factory
object based on the template that is
being dragged.
Constructor and Description |
---|
TemplateTransferDropTargetListener(EditPartViewer viewer)
Constructs a listener on the specified viewer.
|
Modifier and Type | Method and Description |
---|---|
protected Request |
createTargetRequest()
Creates and returns the
Request that will be sent to the
targeted EditPart. |
protected CreateRequest |
getCreateRequest()
A helper method that casts the target Request to a CreateRequest.
|
protected CreationFactory |
getFactory(java.lang.Object template)
Returns the appropriate Factory object to be used for the specified
template.
|
protected void |
handleDragOperationChanged()
The purpose of a template is to be copied.
|
protected void |
handleDragOver()
The purpose of a template is to be copied.
|
protected void |
handleDrop()
Overridden to select the created object.
|
protected void |
updateTargetRequest()
Assumes that the target request is a
CreateRequest . |
dragEnter, dragLeave, dragOperationChanged, dragOver, drop, dropAccept, eraseTargetFeedback, getCommand, getCurrentEvent, getDropLocation, getExclusionSet, getTargetEditPart, getTargetRequest, getTransfer, getViewer, handleEnteredEditPart, handleExitingEditPart, handleHover, handleHoverStop, isEnabled, isEnablementDeterminedByCommand, setAutoexposeHelper, setCurrentEvent, setEnablementDeterminedByCommand, setTargetEditPart, setTransfer, setViewer, showTargetFeedback, unload, updateAutoexposeHelper, updateTargetEditPart
public TemplateTransferDropTargetListener(EditPartViewer viewer)
viewer
- the EditPartViewerprotected Request createTargetRequest()
AbstractTransferDropTargetListener
Request
that will be sent to the
targeted EditPart. Subclasses can override to create specialized
requests.createTargetRequest
in class AbstractTransferDropTargetListener
Request
to be used with the target
EditPartAbstractTransferDropTargetListener.createTargetRequest()
protected final CreateRequest getCreateRequest()
protected CreationFactory getFactory(java.lang.Object template)
template
- the template Objectprotected void handleDragOperationChanged()
DND.DROP_COPY
.handleDragOperationChanged
in class AbstractTransferDropTargetListener
AbstractTransferDropTargetListener.handleDragOperationChanged()
protected void handleDragOver()
DND.DROP_COPY
by default.handleDragOver
in class AbstractTransferDropTargetListener
AbstractTransferDropTargetListener.handleDragOver()
protected void handleDrop()
handleDrop
in class AbstractTransferDropTargetListener
AbstractTransferDropTargetListener.handleDrop()
protected void updateTargetRequest()
CreateRequest
.updateTargetRequest
in class AbstractTransferDropTargetListener
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.