Class StyledTextDropTargetEffect

All Implemented Interfaces:
EventListener, DropTargetListener, SWTEventListener

public class StyledTextDropTargetEffect extends DropTargetEffect
This adapter class provides a default drag under effect (eg. select and scroll) when a drag occurs over a StyledText.

Classes that wish to provide their own drag under effect for a StyledText can extend this class, override the StyledTextDropTargetEffect.dragOver method and override any other applicable methods in StyledTextDropTargetEffect to display their own drag under effect.

Subclasses that override any methods of this class should call the corresponding super method to get the default drag under effect implementation.

The feedback value is either one of the FEEDBACK constants defined in class DND which is applicable to instances of this class, or it must be built by bitwise OR'ing together (that is, using the int "|" operator) two or more of those DND effect constants.

Feedback:
FEEDBACK_SELECT, FEEDBACK_SCROLL
Since:
3.3
See Also:
  • Constructor Details

    • StyledTextDropTargetEffect

      public StyledTextDropTargetEffect(StyledText styledText)
      Creates a new StyledTextDropTargetEffect to handle the drag under effect on the specified StyledText.
      Parameters:
      styledText - the StyledText over which the user positions the cursor to drop the data
  • Method Details

    • dragEnter

      public void dragEnter(DropTargetEvent event)
      This implementation of dragEnter provides a default drag under effect for the feedback specified in event.feedback. For additional information see DropTargetAdapter.dragEnter. Subclasses that override this method should call super.dragEnter(event) to get the default drag under effect implementation.
      Specified by:
      dragEnter in interface DropTargetListener
      Overrides:
      dragEnter in class DropTargetAdapter
      Parameters:
      event - the information associated with the drag start event
      See Also:
    • dragLeave

      public void dragLeave(DropTargetEvent event)
      This implementation of dragLeave provides a default drag under effect for the feedback specified in event.feedback. For additional information see DropTargetAdapter.dragLeave. Subclasses that override this method should call super.dragLeave(event) to get the default drag under effect implementation.
      Specified by:
      dragLeave in interface DropTargetListener
      Overrides:
      dragLeave in class DropTargetAdapter
      Parameters:
      event - the information associated with the drag leave event
      See Also:
    • dragOver

      public void dragOver(DropTargetEvent event)
      This implementation of dragOver provides a default drag under effect for the feedback specified in event.feedback. For additional information see DropTargetAdapter.dragOver. Subclasses that override this method should call super.dragOver(event) to get the default drag under effect implementation.
      Specified by:
      dragOver in interface DropTargetListener
      Overrides:
      dragOver in class DropTargetAdapter
      Parameters:
      event - the information associated with the drag over event
      See Also:
    • dropAccept

      public void dropAccept(DropTargetEvent event)
      This implementation of dropAccept provides a default drag under effect for the feedback specified in event.feedback. For additional information see DropTargetAdapter.dropAccept. Subclasses that override this method should call super.dropAccept(event) to get the default drag under effect implementation.
      Specified by:
      dropAccept in interface DropTargetListener
      Overrides:
      dropAccept in class DropTargetAdapter
      Parameters:
      event - the information associated with the drop accept event
      See Also: