Class PluginDropAdapter

All Implemented Interfaces:
EventListener, DropTargetListener, SWTEventListener
Direct Known Subclasses:

public class PluginDropAdapter extends ViewerDropAdapter
Adapter for adding handling of the PluginTransfer drag and drop transfer type to a drop action.

This class may be instantiated or subclassed.

  • Field Details


      public static final String ATT_CLASS
      The extension point attribute that defines the drop action class.
      See Also:
  • Constructor Details

    • PluginDropAdapter

      public PluginDropAdapter(StructuredViewer viewer)
      Creates a plug-in drop adapter for the given viewer.
      viewer - the viewer
  • Method Details

    • drop

      public void drop(DropTargetEvent event)
      Description copied from class: DropTargetAdapter
      This implementation of drop does nothing. For additional information see DropTargetListener.drop.
      Specified by:
      drop in interface DropTargetListener
      drop in class ViewerDropAdapter
      event - the information associated with the drop event
      See Also:
    • getCurrentTransfer

      protected TransferData getCurrentTransfer()
      Returns the current transfer.
    • getPluginAdapter

      protected static IDropActionDelegate getPluginAdapter(PluginTransferData data) throws CoreException
      Loads the class that will perform the action associated with the given drop data.
      data - the drop data
      the viewer drop adapter
    • performDrop

      public boolean performDrop(Object data)
      Description copied from class: ViewerDropAdapter
      Performs any work associated with the drop.

      Subclasses must implement this method to provide drop behavior.

      Specified by:
      performDrop in class ViewerDropAdapter
      data - the drop data
      true if the drop was successful, and false otherwise
      See Also:
    • validateDrop

      public boolean validateDrop(Object target, int operation, TransferData transferType)
      The PluginDropAdapter implementation of this ViewerDropAdapter method is used to notify the action that some aspect of the drop operation has changed. Subclasses may override.
      Specified by:
      validateDrop in class ViewerDropAdapter
      target - the object that the mouse is currently hovering over, or null if the mouse is hovering over empty space
      operation - the current drag operation (copy, move, etc.)
      transferType - the current transfer type
      true if the drop is valid, and false otherwise