|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.wordpress.tipsforjava.swing.table.TableCellListener
public class TableCellListener extends Object
This class listens for changes made to the data in the table via the TableCellEditor. When editing is started, the value of the cell is saved When editing is stopped the new value is saved. When the oold and new values are different, then the provided Action is invoked. The source of the Action is a TableCellListener instance.
| Field Summary | |
|---|---|
private Action |
action
|
private int |
column
|
private Object |
newValue
|
private Object |
oldValue
|
private int |
row
|
private JTable |
table
|
| Constructor Summary | |
TableCellListener(JTable table, Action action)
Create a TableCellListener. |
|
private TableCellListener(JTable table, int row, int column, Object oldValue, Object newValue)
Create a TableCellListener with a copy of all the data relevant to the change of data for a given cell. |
|
| Method Summary | |
|---|---|
int
|
getColumn()
Get the column that was last edited |
Object
|
getNewValue()
Get the new value in the cell |
Object
|
getOldValue()
Get the old value of the cell |
int
|
getRow()
Get the row that was last edited |
JTable
|
getTable()
Get the table of the cell that was changed |
private void
|
processEditingStarted()
|
private void
|
processEditingStopped()
|
void
|
propertyChange(PropertyChangeEvent e)
|
void
|
run()
|
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private Action action
private int column
private Object newValue
private Object oldValue
private int row
private JTable table
| Constructor Detail |
|---|
public TableCellListener(JTable table, Action action)
table - the table to be monitored for data changesaction - the Action to invoke when cell data is changed
private TableCellListener(JTable table, int row, int column, Object oldValue, Object newValue)
row - the row of the changed cellcolumn - the column of the changed celloldValue - the old data of the changed cellnewValue - the new data of the changed cell
| Method Detail |
|---|
public int getColumn()
public Object getNewValue()
public Object getOldValue()
public int getRow()
public JTable getTable()
private void processEditingStarted()
private void processEditingStopped()
de public public void propertyChange(PropertyChangeEvent e)
de public public void run()
Groovy Documentation