Package com.illumon.iris.console.events
Class ViewportTransferHandler
java.lang.Object
javax.swing.TransferHandler
com.illumon.iris.gui.widget.FreezeColumnsTransferHandler
com.illumon.iris.console.events.ViewportTransferHandler
- All Implemented Interfaces:
Serializable
public class ViewportTransferHandler extends FreezeColumnsTransferHandler
We need our own transfer handler for viewport tables, so that we can fetch the right rows/columns.
If we have no transfer handler, then things outside our viewport will be stale; and just get populated from the
table model's empty cells.
The exportToClipboard function is overridden, because we don't want to wait for population on the Swing thread. If
a user copies a significant section of a table (apparently a use case is "all of it"), then we can hang waiting
for that data to come from the server. Instead we popup a modal progress dialog, so at least the user will
see what is going on (there is a 100ms delay so that it isn't annoying when copying just a small number of rows).
We also warn over 10K rows, so that you don't end up copying and pasting without being aware.
This was lifted from the TableTransferHandler in BasicUITable
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.TransferHandler
TransferHandler.DropLocation, TransferHandler.TransferSupport
-
Field Summary
Fields inherited from class com.illumon.iris.gui.widget.FreezeColumnsTransferHandler
COPY_HEADERS, rawObjectFlavor
-
Method Summary
Modifier and Type Method Description void
exportExpandedToClipboard(JComponent comp, Clipboard clip, int action)
void
exportToClipboard(JComponent comp, Clipboard clip, int action)
Methods inherited from class com.illumon.iris.gui.widget.FreezeColumnsTransferHandler
buildTransferable, getSelectedColumnSet, getSourceActions
Methods inherited from class javax.swing.TransferHandler
canImport, canImport, createTransferable, exportAsDrag, exportDone, getCopyAction, getCutAction, getDragImage, getDragImageOffset, getPasteAction, getVisualRepresentation, importData, importData, setDragImage, setDragImageOffset
-
Method Details
-
exportToClipboard
public void exportToClipboard(JComponent comp, Clipboard clip, int action) throws IllegalStateException- Overrides:
exportToClipboard
in classFreezeColumnsTransferHandler
- Throws:
IllegalStateException
-
exportExpandedToClipboard
public void exportExpandedToClipboard(JComponent comp, Clipboard clip, int action) throws IllegalStateException- Throws:
IllegalStateException
-