Package org.eclipse.gef.dnd
Class TemplateTransferDragSourceListener
java.lang.Object
org.eclipse.gef.dnd.AbstractTransferDragSourceListener
org.eclipse.gef.dnd.TemplateTransferDragSourceListener
- All Implemented Interfaces:
- EventListener,- TransferDragSourceListener,- TransferDragSourceListener,- DragSourceListener
Allows a single 
PaletteTemplateEntry to be
 dragged from an EditPartViewer. The PaletteTemplateEntry's template
 object is the data that is being transfered to the DropTarget.- Since:
- 2.1
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a new listener for the specified EditPartViewer.TemplateTransferDragSourceListener(EditPartViewer viewer, Transfer xfer) Deprecated, for removal: This API element is subject to removal in a future version.Use the constructor without the transfer specified.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddragFinished(DragSourceEvent event) voiddragSetData(DragSourceEvent event) Get the template from the selectedPaletteTemplateEntryand sets it as the event data to be dropped.voiddragStart(DragSourceEvent event) Cancels the drag if the selected item does not represent a PaletteTemplateEntry.protected ObjectA helper method that returnsnullor the template Object from the currently selected EditPart.Methods inherited from class org.eclipse.gef.dnd.AbstractTransferDragSourceListenergetTransfer, getViewer, setTransfer, setViewer
- 
Constructor Details- 
TemplateTransferDragSourceListener@Deprecated(since="3.0", forRemoval=true) public TemplateTransferDragSourceListener(EditPartViewer viewer, Transfer xfer) Deprecated, for removal: This API element is subject to removal in a future version.Use the constructor without the transfer specified. This constructor will be removed after the 2027-03 release.- Parameters:
- viewer- viewer
- xfer- xfer
 
- 
TemplateTransferDragSourceListenerConstructs a new listener for the specified EditPartViewer. The provided Viewer should be one that is displaying a Palette. The TemplateTransferDragSourceListener will only be enabled when a single EditPart is selected, and the EditPart's model is aPaletteTemplateEntry.- Parameters:
- viewer- the EditPartViewer that is the drag source
 
 
- 
- 
Method Details- 
dragFinished- Specified by:
- dragFinishedin interface- DragSourceListener
- Overrides:
- dragFinishedin class- AbstractTransferDragSourceListener
- See Also:
 
- 
dragSetDataGet the template from the selectedPaletteTemplateEntryand sets it as the event data to be dropped.- Parameters:
- event- the DragSourceEvent
 
- 
dragStartCancels the drag if the selected item does not represent a PaletteTemplateEntry.- Specified by:
- dragStartin interface- DragSourceListener
- Overrides:
- dragStartin class- AbstractTransferDragSourceListener
- See Also:
 
- 
getTemplateA helper method that returnsnullor the template Object from the currently selected EditPart.- Returns:
- the template
 
 
-