# Class TableLoadTransferHandler

java.lang.Object
javax.swing.TransferHandler
uk.ac.starlink.table.gui.TableLoadTransferHandler

All Implemented Interfaces:
  `Serializable`

public abstract class TableLoadTransferHandler extends 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 TransferHandler

`TransferHandler.DropLocation, TransferHandler.TransferSupport`

## Field Summary

### Fields inherited from class TransferHandler

`COPY, COPY_OR_MOVE, LINK, MOVE, NONE`

## Constructor Summary

Constructors
Constructor
Description
`TableLoadTransferHandler(StarTableFactory tfact)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`canImport(JComponent comp, DataFlavor[] flavors)`
`protected abstract TableLoadClient`
`getLoadClient()`
Returns a GUI consumer for any tables loaded by this panel.
`int`
`getSourceActions(JComponent comp)`
`boolean`
`importData(JComponent comp, Transferable trans)`

### Methods inherited from class TransferHandler

`canImport, createTransferable, exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getDragImage, getDragImageOffset, getPasteAction, getVisualRepresentation, importData, setDragImage, setDragImageOffset`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### TableLoadTransferHandler

public TableLoadTransferHandler(StarTableFactory tfact)
Constructor.

Parameters:
  `tfact` - factory to handle transferred-in tables

## Method Details

### 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(JComponent comp, DataFlavor[] flavors)

Overrides:
  `canImport` in class `TransferHandler`

### importData

public boolean importData(JComponent comp, Transferable trans)

Overrides:
  `importData` in class `TransferHandler`

### getSourceActions

public int getSourceActions(JComponent comp)

Overrides:
  `getSourceActions` in class `TransferHandler`