Package com.illumon.iris.gui.widget
Class FreezeColumnsTransferHandler
java.lang.Object
javax.swing.TransferHandler
com.illumon.iris.gui.widget.FreezeColumnsTransferHandler
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ViewportTransferHandler
public class FreezeColumnsTransferHandler extends TransferHandler
A Transfer Handler that takes into account freeze tables. This transfer handler will copy columns from both
the Freeze Table and Main Table. It leans heavily on FreezeColumnManager to do this.
This was lifted from the TableTransferHandler in BasicUITable; the BasicTransferable is also from the swing platform
but is not public so is copied as an inner class here.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.TransferHandler
TransferHandler.DropLocation, TransferHandler.TransferSupport
-
Field Summary
Fields Modifier and Type Field Description static int
COPY_HEADERS
static DataFlavor
rawObjectFlavor
-
Constructor Summary
Constructors Constructor Description FreezeColumnsTransferHandler()
-
Method Summary
Modifier and Type Method Description protected Transferable
buildTransferable(Collection<String> columnNames, BitSet columns, PrimitiveIterator.OfLong selectedRows, com.fishlib.base.Function.Binary<Object,Integer,Integer> getValueAt)
Build a Transferable based on the input table and set of rows optionally including the table headersvoid
exportToClipboard(JComponent comp, Clipboard clip, int action)
protected BitSet
getSelectedColumnSet(GuiTable table)
Get a BitSet of the selected columns from the tableint
getSourceActions(JComponent c)
Methods inherited from class javax.swing.TransferHandler
canImport, canImport, createTransferable, exportAsDrag, exportDone, getCopyAction, getCutAction, getDragImage, getDragImageOffset, getPasteAction, getVisualRepresentation, importData, importData, setDragImage, setDragImageOffset
-
Field Details
-
COPY_HEADERS
public static final int COPY_HEADERS- See Also:
- Constant Field Values
-
rawObjectFlavor
-
-
Constructor Details
-
FreezeColumnsTransferHandler
public FreezeColumnsTransferHandler()
-
-
Method Details
-
exportToClipboard
public void exportToClipboard(JComponent comp, Clipboard clip, int action) throws IllegalStateException- Overrides:
exportToClipboard
in classTransferHandler
- Throws:
IllegalStateException
-
getSelectedColumnSet
Get a BitSet of the selected columns from the table- Parameters:
table
- The table to get the selected columns from- Returns:
- A BitSet
-
buildTransferable
protected Transferable buildTransferable(Collection<String> columnNames, BitSet columns, PrimitiveIterator.OfLong selectedRows, com.fishlib.base.Function.Binary<Object,Integer,Integer> getValueAt)Build a Transferable based on the input table and set of rows optionally including the table headers- Parameters:
columnNames
- optional collection of column names for writing out headerscolumns
- The set of columns to copyselectedRows
- The selected rows to copygetValueAt
- A binary method to get the actual value at the [row][col]- Returns:
- A Transferable containing the data to be transferred.
-
getSourceActions
- Overrides:
getSourceActions
in classTransferHandler
-