public class TemplateTransferDragSourceListener extends AbstractTransferDragSourceListener
PaletteTemplateEntry
to be
dragged from an EditPartViewer. The PaletteTemplateEntry's template
object is the data that is being transfered to the DropTarget
.Constructor and Description |
---|
TemplateTransferDragSourceListener(EditPartViewer viewer)
Constructs a new listener for the specified EditPartViewer.
|
TemplateTransferDragSourceListener(EditPartViewer viewer,
Transfer xfer)
Deprecated.
Use the constructor without the transfer specified.
|
Modifier and Type | Method and Description |
---|---|
void |
dragFinished(DragSourceEvent event) |
void |
dragSetData(DragSourceEvent event)
Get the template from the selected
PaletteTemplateEntry
and sets it as the event data to be dropped. |
void |
dragStart(DragSourceEvent event)
Cancels the drag if the selected item does not represent a
PaletteTemplateEntry.
|
protected java.lang.Object |
getTemplate()
A helper method that returns
null or the template
Object from the currently selected EditPart. |
getTransfer, getViewer, setTransfer, setViewer
public TemplateTransferDragSourceListener(EditPartViewer viewer, Transfer xfer)
viewer
- viewerxfer
- xferpublic TemplateTransferDragSourceListener(EditPartViewer viewer)
PaletteTemplateEntry
.viewer
- the EditPartViewer that is the drag sourcepublic void dragFinished(DragSourceEvent event)
dragFinished
in interface DragSourceListener
dragFinished
in class AbstractTransferDragSourceListener
AbstractTransferDragSourceListener.dragFinished(DragSourceEvent)
public void dragSetData(DragSourceEvent event)
PaletteTemplateEntry
and sets it as the event data to be dropped.event
- the DragSourceEventpublic void dragStart(DragSourceEvent event)
dragStart
in interface DragSourceListener
dragStart
in class AbstractTransferDragSourceListener
DragSourceListener.dragStart(DragSourceEvent)
protected java.lang.Object getTemplate()
null
or the template
Object from the currently selected EditPart.Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.