org.wcb.util
Class ExcelAdapter

java.lang.Object
  extended byorg.wcb.util.ExcelAdapter
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class ExcelAdapter
extends java.lang.Object
implements java.awt.event.ActionListener

ExcelAdapter 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.


Constructor Summary
ExcelAdapter(javax.swing.JTable myJTable)
          The Excel Adapter is constructed with a JTable on which it enables Copy-Paste and acts as a Clipboard listener.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          This method is activated on the Keystrokes we are listening to in this implementation.
 javax.swing.JTable getJTable()
          Public Accessor methods for the Table on which this adapter acts.
 void setJTable(javax.swing.JTable jtTable)
          Allows setting of the JTable component
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExcelAdapter

public ExcelAdapter(javax.swing.JTable myJTable)
The Excel Adapter is constructed with a JTable on which it enables Copy-Paste and acts as a Clipboard listener.

Parameters:
myJTable - the table to apply the ExcelAdapter.
Method Detail

getJTable

public javax.swing.JTable getJTable()
Public Accessor methods for the Table on which this adapter acts.

Returns:
the JTable component

setJTable

public void setJTable(javax.swing.JTable jtTable)
Allows setting of the JTable component

Parameters:
jtTable - The component to allow excel cut and paste

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:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - The action event


Copyright © 1999-2004 Walter Bogaardt. All Rights Reserved.