org.statcato.spreadsheet
Class ExcelAdapter
- java.lang.Object
-
- org.statcato.spreadsheet.ExcelAdapter
-
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.util.EventListener
public class ExcelAdapter extends java.lang.Object implements java.awt.event.ActionListenerExcelAdapter enables Copy-Paste Clipboard functionality on JTables. The clipboard data format used by the adapter is compatible with the clipboard format used by Excel. This provides for clipboard interoperability between enabled JTables and Excel. Modified to work with Cut in a spreadsheet. Java Tip 77: Enable copy and paste functionality between Swing's JTables and Excel This adapter makes it easy to transfer data from one type of spreadsheet to the other By Ashok Banerjee and Jignesh Mehta
-
-
Constructor Summary
Constructors Constructor and Description ExcelAdapter(Spreadsheet myJTable)The Excel Adapter is constructed with a JTable on which it enables Copy-Paste and acts as a Clipboard listener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidactionPerformed(java.awt.event.ActionEvent e)This method is activated on the Keystrokes we are listening to in this implementation.javax.swing.JTablegetJTable()Public Accessor methods for the Table on which this adapter acts.voidsetJTable(Spreadsheet jTable1)
-
-
-
Constructor Detail
-
ExcelAdapter
public ExcelAdapter(Spreadsheet myJTable)
The Excel Adapter is constructed with a JTable on which it enables Copy-Paste and acts as a Clipboard listener.
-
-
Method Detail
-
getJTable
public javax.swing.JTable getJTable()
Public Accessor methods for the Table on which this adapter acts.
-
setJTable
public void setJTable(Spreadsheet jTable1)
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
This method is activated on the Keystrokes we are listening to in this implementation. Here it listens for Copy and Paste ActionCommands. Selections comprising non-adjacent cells result in invalid selection and then copy action cannot be performed. Paste is done by aligning the upper left corner of the selection with the 1st element in the current selection of the JTable.- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener
-
-
DMelt 3.0 © DataMelt by jWork.ORG