Class TableLoadTransferHandler

  • All Implemented Interfaces:
    java.io.Serializable

    public abstract class TableLoadTransferHandler
    extends javax.swing.TransferHandler
    TransferHandler which will load a table if it is dragged onto its owner component.

    Concrete implementations of this abstract class must implement the getLoadClient() method to determine how loaded tables will be consumed.

    Since:
    16 Sep 2010
    Author:
    Mark Taylor
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.TransferHandler

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

      • Fields inherited from class javax.swing.TransferHandler

        COPY, COPY_OR_MOVE, LINK, MOVE, NONE
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canImport​(javax.swing.JComponent comp, java.awt.datatransfer.DataFlavor[] flavors)  
      protected abstract TableLoadClient getLoadClient()
      Returns a GUI consumer for any tables loaded by this panel.
      int getSourceActions​(javax.swing.JComponent comp)  
      boolean importData​(javax.swing.JComponent comp, java.awt.datatransfer.Transferable trans)  
      • Methods inherited from class javax.swing.TransferHandler

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

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

      • TableLoadTransferHandler

        public TableLoadTransferHandler​(StarTableFactory tfact)
        Constructor.
        Parameters:
        tfact - factory to handle transferred-in tables
    • Method Detail

      • getLoadClient

        protected abstract TableLoadClient getLoadClient()
        Returns a GUI consumer for any tables loaded by this panel. It will be called once for each load sequence; the returned object may or may not be the same one each time.
        Returns:
        load client ready to accept tables
      • canImport

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

        public boolean importData​(javax.swing.JComponent comp,
                                  java.awt.datatransfer.Transferable trans)
        Overrides:
        importData in class javax.swing.TransferHandler
      • getSourceActions

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