Class ListTransferHandler

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    ListTransferHandler.RubbishTransferHandler

    public class ListTransferHandler
    extends javax.swing.TransferHandler
    A transfer handler for moving items between lists.
    Author:
    Chris Jennings
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  ListTransferHandler.ListTransferable  
      static class  ListTransferHandler.RubbishTransferHandler
      This can be used as the transfer handler for a "rubbish can".
      • Nested classes/interfaces inherited from class javax.swing.TransferHandler

        javax.swing.TransferHandler.DropLocation, javax.swing.TransferHandler.TransferSupport
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canImport​(javax.swing.JComponent c, java.awt.datatransfer.DataFlavor[] flavors)  
      protected java.awt.datatransfer.Transferable createTransferable​(javax.swing.JComponent c)  
      protected void exportDone​(javax.swing.JComponent c, java.awt.datatransfer.Transferable data, int action)  
      int getSourceActions​(javax.swing.JComponent c)  
      protected java.util.ArrayList<?> getTransferData​(java.awt.datatransfer.Transferable t)  
      javax.swing.Icon getVisualRepresentation​(java.awt.datatransfer.Transferable t)  
      boolean importData​(javax.swing.TransferHandler.TransferSupport transfer)  
      • Methods inherited from class javax.swing.TransferHandler

        canImport, exportAsDrag, exportToClipboard, getCopyAction, getCutAction, getDragImage, getDragImageOffset, getPasteAction, importData, setDragImage, setDragImageOffset
      • Methods inherited from class java.lang.Object

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

      • localArrayListFlavor

        protected java.awt.datatransfer.DataFlavor localArrayListFlavor
      • serialArrayListFlavor

        protected java.awt.datatransfer.DataFlavor serialArrayListFlavor
      • localArrayListType

        protected java.lang.String localArrayListType
      • indices

        protected int[] indices
      • addIndex

        protected int addIndex
      • addCount

        protected int addCount
    • Constructor Detail

      • ListTransferHandler

        public ListTransferHandler()
      • ListTransferHandler

        public ListTransferHandler​(java.lang.Class<?> contentClass)
    • Method Detail

      • getVisualRepresentation

        public javax.swing.Icon getVisualRepresentation​(java.awt.datatransfer.Transferable t)
        Overrides:
        getVisualRepresentation in class javax.swing.TransferHandler
      • getTransferData

        protected java.util.ArrayList<?> getTransferData​(java.awt.datatransfer.Transferable t)
      • importData

        public boolean importData​(javax.swing.TransferHandler.TransferSupport transfer)
        Overrides:
        importData in class javax.swing.TransferHandler
      • exportDone

        protected void exportDone​(javax.swing.JComponent c,
                                  java.awt.datatransfer.Transferable data,
                                  int action)
        Overrides:
        exportDone in class javax.swing.TransferHandler
      • canImport

        public boolean canImport​(javax.swing.JComponent c,
                                 java.awt.datatransfer.DataFlavor[] flavors)
        Overrides:
        canImport in class javax.swing.TransferHandler
      • createTransferable

        protected java.awt.datatransfer.Transferable createTransferable​(javax.swing.JComponent c)
        Overrides:
        createTransferable in class javax.swing.TransferHandler
      • getSourceActions

        public int getSourceActions​(javax.swing.JComponent c)
        Overrides:
        getSourceActions in class javax.swing.TransferHandler