Interface ProgramDropProvider


  • public interface ProgramDropProvider
    Generic interface to handle drag and drop.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void add​(java.lang.Object contextObj, java.lang.Object data, java.awt.datatransfer.DataFlavor flavor)
      Adds the dropped data to this drop service.
      java.awt.datatransfer.DataFlavor[] getDataFlavors()
      Get the data flavors that this drop service accepts.
      int getPriority()
      Returns the priority of this provider.
      boolean isDropOk​(java.lang.Object contextObj, java.awt.dnd.DropTargetDragEvent evt)
      Returns true if this service can accept a drop with the specified context.
    • Method Detail

      • getPriority

        int getPriority()
        Returns the priority of this provider. Higher priority services will be chosen if there are multiple services that accept the same type in the same context.
      • getDataFlavors

        java.awt.datatransfer.DataFlavor[] getDataFlavors()
        Get the data flavors that this drop service accepts.
        Returns:
        an array of all DataFlavors that this drop service supports
      • isDropOk

        boolean isDropOk​(java.lang.Object contextObj,
                         java.awt.dnd.DropTargetDragEvent evt)
        Returns true if this service can accept a drop with the specified context.
        Parameters:
        contextObj - The object where the drop will occur
        evt - The event associated with the drop that includes the dropped DataFlavors
      • add

        void add​(java.lang.Object contextObj,
                 java.lang.Object data,
                 java.awt.datatransfer.DataFlavor flavor)
        Adds the dropped data to this drop service.
        Parameters:
        contextObj - The object where the drop occurred
        data - The actual data dropped
        flavor - The selected data flavor