Class DnDListItemsTransferable<T>

Object
DnDListItemsTransferable<T>
All Implemented Interfaces:
Transferable

public class DnDListItemsTransferable<T> extends Object implements Transferable
Implements the Transferable interface to carry list item data during drag and drop actions. This class is used by DnDList. Client code will not normally need to refer to it.
Since:
2.6
Author:
Michael Bedward
See Also:
  • Constructor Details

    • DnDListItemsTransferable

      public DnDListItemsTransferable(Collection<T> stuff)
      Constructor
      Parameters:
      stuff - a Collection of list item data
  • Method Details

    • getTransferDataFlavors

      public DataFlavor[] getTransferDataFlavors()
      Description copies from interface:
      Returns an array of DataFlavor objects indicating the flavors the data can be provided in. The array should be ordered according to preference for providing the data (from most richly descriptive to least descriptive).
      Specified by:
      getTransferDataFlavors in interface Transferable
    • isDataFlavorSupported

      public boolean isDataFlavorSupported(DataFlavor flavor)
      Description copies from interface:
      Returns whether or not the specified data flavor is supported for this object.
      Specified by:
      isDataFlavorSupported in interface Transferable
    • getTransferData

      public List<T> getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
      Returns a List of items to be transferred.
      Specified by:
      getTransferData in interface Transferable
      Parameters:
      flavor - - required by the interface but ignored here
      Throws:
      IOException - if the data is no longer available in the requested flavor.
      UnsupportedFlavorException - if the requested data flavor is not supported.