Class 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 a List.

    Classes that wish to provide their own source image for a List can extend the ListDragSourceEffect class, override the ListDragSourceEffect.dragStart method and set the field DragSourceEvent.image with their own image.

    Subclasses that override any methods of this class must call the corresponding super method to get the default drag source effect implementation.
    See Also:
    DragSourceEffect, DragSourceEvent, Sample code and further information
    • Constructor Summary

      Constructors 
      Constructor Description
      ListDragSourceEffect​(List list)
      Creates a new ListDragSourceEffect to handle drag effect from the specified List.
    • Constructor Detail

      • ListDragSourceEffect

        public ListDragSourceEffect​(List list)
        Creates a new ListDragSourceEffect to handle drag effect from the specified List.
        Parameters:
        list - the List that the user clicks on to initiate the drag
    • Method Detail

      • dragFinished

        public void dragFinished​(DragSourceEvent event)
        This implementation of dragFinished disposes the image that was created in ListDragSourceEffect.dragStart. Subclasses that override this method should call super.dragFinished(event) to dispose the image in the default implementation.
        Specified by:
        dragFinished in interface DragSourceListener
        Overrides:
        dragFinished in class DragSourceAdapter
        Parameters:
        event - the information associated with the drag finished event
        See Also:
        DragSourceEvent
      • dragStart

        public void dragStart​(DragSourceEvent event)
        This implementation of 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 ListDragSourceEffect.dragFinished method. Subclasses that override this method should call super.dragStart(event) to use the image from the default implementation.
        Specified by:
        dragStart in interface DragSourceListener
        Overrides:
        dragStart in class DragSourceAdapter
        Parameters:
        event - the information associated with the drag start event
        See Also:
        DragSourceEvent