Package com.cosylab.vdct.inspector
Class InspectorTableClipboardAdapter
- java.lang.Object
-
- javax.swing.TransferHandler
-
- com.cosylab.vdct.inspector.InspectorTableClipboardAdapter
-
- All Implemented Interfaces:
ActionListener
,Serializable
,EventListener
public class InspectorTableClipboardAdapter extends TransferHandler implements ActionListener
TableClipboardAdapter enables Cut-Copy-Paste Clipboard functionality on JTables. The clipboard data format used by the adapter is compatible with the clipboard format used by Excel/OpenOffice Calc. This provides for clipboard interoperability between enabled JTables and Excel/OpenOffice Calc.- Version:
- $id$
- Author:
- Matej Sekoranja
- 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 javax.swing.TransferHandler
COPY, COPY_OR_MOVE, LINK, MOVE, NONE
-
-
Constructor Summary
Constructors Constructor Description InspectorTableClipboardAdapter(Object dsId, JTable table)
The adapter is constructed with a JTable on which it enables Cut-Copy-Paste and acts as a clipboard listener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent e)
This method is activated on the keystrokes we are listening to in this implementation.boolean
canImport(JComponent c, DataFlavor[] flavors)
protected Transferable
createTransferable(JComponent c)
int
getSourceActions(JComponent c)
JTable
getTable()
Accessor to the table on which this adapter acts.boolean
importData(JComponent c, Transferable t)
-
Methods inherited from class javax.swing.TransferHandler
canImport, exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getDragImage, getDragImageOffset, getPasteAction, getVisualRepresentation, importData, setDragImage, setDragImageOffset
-
-
-
-
Method Detail
-
getTable
public JTable getTable()
Accessor to the table on which this adapter acts.- Returns:
- managed table
-
actionPerformed
public void actionPerformed(ActionEvent e)
This method is activated on the keystrokes we are listening to in this implementation. Here it listens for Copy and Paste, and Cut commands.- Specified by:
actionPerformed
in interfaceActionListener
- Parameters:
e
- e- See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)
-
createTransferable
protected Transferable createTransferable(JComponent c)
- Overrides:
createTransferable
in classTransferHandler
-
getSourceActions
public int getSourceActions(JComponent c)
- Overrides:
getSourceActions
in classTransferHandler
-
importData
public boolean importData(JComponent c, Transferable t)
- Overrides:
importData
in classTransferHandler
-
canImport
public boolean canImport(JComponent c, DataFlavor[] flavors)
- Overrides:
canImport
in classTransferHandler
-
-