public class TableDragSourceEffect extends DragSourceEffect
Table
.
Classes that wish to provide their own source image for a Table
can
extend the TableDragSourceEffect
class, override the
TableDragSourceEffect.dragStart
method and set the field
DragSourceEvent.image
with their own image.
super
method to get the default drag source effect implementation.DragSourceEffect
,
DragSourceEvent
,
Sample code and further informationModifier and Type | Field and Description |
---|---|
(package private) Image |
dragSourceImage |
control
Constructor and Description |
---|
TableDragSourceEffect(Table table)
Creates a new
TableDragSourceEffect to handle drag effect
from the specified Table . |
Modifier and Type | Method and Description |
---|---|
void |
dragFinished(DragSourceEvent event)
This implementation of
dragFinished disposes the image
that was created in TableDragSourceEffect.dragStart . |
void |
dragStart(DragSourceEvent event)
This implementation of
dragStart will create a default
image that will be used during the drag. |
(package private) Image |
getDragSourceImage(DragSourceEvent event) |
getControl
dragSetData
Image dragSourceImage
public TableDragSourceEffect(Table table)
TableDragSourceEffect
to handle drag effect
from the specified Table
.table
- the Table
that the user clicks on to initiate the dragpublic void dragFinished(DragSourceEvent event)
dragFinished
disposes the image
that was created in TableDragSourceEffect.dragStart
.
Subclasses that override this method should call super.dragFinished(event)
to dispose the image in the default implementation.dragFinished
in interface DragSourceListener
dragFinished
in class DragSourceAdapter
event
- the information associated with the drag finished eventDragSourceEvent
public void dragStart(DragSourceEvent event)
dragStart
will create a default
image that will be used during the drag. The image should be disposed
when the drag is completed in the TableDragSourceEffect.dragFinished
method.
Subclasses that override this method should call super.dragStart(event)
to use the image from the default implementation.dragStart
in interface DragSourceListener
dragStart
in class DragSourceAdapter
event
- the information associated with the drag start eventDragSourceEvent
Image getDragSourceImage(DragSourceEvent event)