Package org.eclipse.swt.internal.dnd.gtk
Class ListDragSourceEffect
- java.lang.Object
-
- org.eclipse.swt.dnd.DragSourceAdapter
-
- org.eclipse.swt.dnd.DragSourceEffect
-
- org.eclipse.swt.internal.dnd.gtk.ListDragSourceEffect
-
- All Implemented Interfaces:
java.util.EventListener
,DragSourceListener
,SWTEventListener
public class ListDragSourceEffect extends DragSourceEffect
This class provides default implementations to display a source image when a drag is initiated from aList
.Classes that wish to provide their own source image for a
Subclasses that override any methods of this class must call the correspondingList
can extend theListDragSourceEffect
class, override theListDragSourceEffect.dragStart
method and set the fieldDragSourceEvent.image
with their own image.super
method to get the default drag source effect implementation.
-
-
Constructor Summary
Constructors Constructor Description ListDragSourceEffect(List list)
Creates a newListDragSourceEffect
to handle drag effect from the specifiedList
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dragFinished(DragSourceEvent event)
This implementation ofdragFinished
disposes the image that was created inListDragSourceEffect.dragStart
.void
dragStart(DragSourceEvent event)
This implementation ofdragStart
will create a default image that will be used during the drag.-
Methods inherited from class org.eclipse.swt.dnd.DragSourceEffect
getControl
-
Methods inherited from class org.eclipse.swt.dnd.DragSourceAdapter
dragSetData
-
-
-
-
Constructor Detail
-
ListDragSourceEffect
public ListDragSourceEffect(List list)
Creates a newListDragSourceEffect
to handle drag effect from the specifiedList
.- Parameters:
list
- theList
that the user clicks on to initiate the drag
-
-
Method Detail
-
dragFinished
public void dragFinished(DragSourceEvent event)
This implementation ofdragFinished
disposes the image that was created inListDragSourceEffect.dragStart
. Subclasses that override this method should callsuper.dragFinished(event)
to dispose the image in the default implementation.- Specified by:
dragFinished
in interfaceDragSourceListener
- Overrides:
dragFinished
in classDragSourceAdapter
- Parameters:
event
- the information associated with the drag finished event- See Also:
DragSourceEvent
-
dragStart
public void dragStart(DragSourceEvent event)
This implementation ofdragStart
will create a default image that will be used during the drag. The image should be disposed when the drag is completed in theListDragSourceEffect.dragFinished
method. Subclasses that override this method should callsuper.dragStart(event)
to use the image from the default implementation.- Specified by:
dragStart
in interfaceDragSourceListener
- Overrides:
dragStart
in classDragSourceAdapter
- Parameters:
event
- the information associated with the drag start event- See Also:
DragSourceEvent
-
-