Class GridDragSourceEffect

java.lang.Object
org.eclipse.swt.dnd.DragSourceAdapter
org.eclipse.swt.dnd.DragSourceEffect
org.eclipse.nebula.widgets.grid.GridDragSourceEffect
All Implemented Interfaces:
java.util.EventListener, org.eclipse.swt.dnd.DragSourceListener, org.eclipse.swt.internal.SWTEventListener

public class GridDragSourceEffect
extends org.eclipse.swt.dnd.DragSourceEffect
This class provides default implementations to display a source image when a drag is initiated from a Grid.

Classes that wish to provide their own source image for a Grid can extend DragSourceAdapter class and override the DragSourceAdapter.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 under effect implementation.
Since:
3.3
See Also:
DragSourceAdapter, DragSourceEvent
  • Field Summary

    Fields 
    Modifier and Type Field Description
    (package private) org.eclipse.swt.graphics.Image dragSourceImage  
  • Constructor Summary

    Constructors 
    Constructor Description
    GridDragSourceEffect​(Grid grid)  
  • Method Summary

    Modifier and Type Method Description
    void dragFinished​(org.eclipse.swt.dnd.DragSourceEvent event)
    This implementation of dragFinished disposes the image that was created in GridDragSourceEffect.dragStart.
    void dragStart​(org.eclipse.swt.dnd.DragSourceEvent event)
    This implementation of dragStart will create a default image that will be used during the drag.
    (package private) org.eclipse.swt.graphics.Image getDragSourceImage​(org.eclipse.swt.dnd.DragSourceEvent event)  

    Methods inherited from class org.eclipse.swt.dnd.DragSourceEffect

    getControl

    Methods inherited from class org.eclipse.swt.dnd.DragSourceAdapter

    dragSetData

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • dragFinished

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

      public void dragStart​(org.eclipse.swt.dnd.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 GridDragSourceEffect.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 org.eclipse.swt.dnd.DragSourceListener
      Overrides:
      dragStart in class org.eclipse.swt.dnd.DragSourceAdapter
      Parameters:
      event - the information associated with the drag start event
    • getDragSourceImage

      org.eclipse.swt.graphics.Image getDragSourceImage​(org.eclipse.swt.dnd.DragSourceEvent event)