Package org.eclipse.gef.dnd
Class TemplateTransferDropTargetListener
java.lang.Object
org.eclipse.gef.dnd.AbstractTransferDropTargetListener
org.eclipse.gef.dnd.TemplateTransferDropTargetListener
- All Implemented Interfaces:
- EventListener,- TransferDropTargetListener,- TransferDropTargetListener,- DropTargetListener
Performs a native Drop using the 
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.
- Since:
- 2.1
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a listener on the specified viewer.
- 
Method SummaryModifier and TypeMethodDescriptionprotected RequestCreates and returns theRequestthat will be sent to the targeted EditPart.protected final CreateRequestA helper method that casts the target Request to a CreateRequest.protected CreationFactorygetFactory(Object template) Returns the appropriate Factory object to be used for the specified template.protected voidThe purpose of a template is to be copied.protected voidThe purpose of a template is to be copied.protected voidOverridden to select the created object.protected voidAssumes that the target request is aCreateRequest.Methods inherited from class org.eclipse.gef.dnd.AbstractTransferDropTargetListenerdragEnter, 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
- 
Constructor Details- 
TemplateTransferDropTargetListenerConstructs a listener on the specified viewer.- Parameters:
- viewer- the EditPartViewer
 
 
- 
- 
Method Details- 
createTargetRequestDescription copied from class:AbstractTransferDropTargetListenerCreates and returns theRequestthat will be sent to the targeted EditPart. Subclasses can override to create specialized requests.- Overrides:
- createTargetRequestin class- AbstractTransferDropTargetListener
- Returns:
- the Requestto be used with the target EditPart
- See Also:
 
- 
getCreateRequestA helper method that casts the target Request to a CreateRequest.- Returns:
- CreateRequest
 
- 
getFactoryReturns the appropriate Factory object to be used for the specified template. This Factory is used on the CreateRequest that is sent to the target EditPart.- Parameters:
- template- the template Object
- Returns:
- a Factory
 
- 
handleDragOperationChangedprotected void handleDragOperationChanged()The purpose of a template is to be copied. Therefore, the drop operation can't be anything butDND.DROP_COPY.- Overrides:
- handleDragOperationChangedin class- AbstractTransferDropTargetListener
- See Also:
 
- 
handleDragOverprotected void handleDragOver()The purpose of a template is to be copied. Therefore, the Drop operation is set toDND.DROP_COPYby default.- Overrides:
- handleDragOverin class- AbstractTransferDropTargetListener
- See Also:
 
- 
handleDropprotected void handleDrop()Overridden to select the created object.- Overrides:
- handleDropin class- AbstractTransferDropTargetListener
- See Also:
 
- 
updateTargetRequestprotected void updateTargetRequest()Assumes that the target request is aCreateRequest.- Specified by:
- updateTargetRequestin class- AbstractTransferDropTargetListener
 
 
-