net.wotonomy.ui.swing.components
Class PropertyEditorTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by net.wotonomy.ui.swing.components.PropertyEditorTableModel
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.util.EventListener, javax.swing.table.TableModel

public class PropertyEditorTableModel
extends javax.swing.table.AbstractTableModel
implements java.awt.event.ActionListener

PropertyEditorTableModel introspects an object to facilitate editing it in a PropertyTable. Because the model always reflects the current state of the inspected object, it is useful to have a table update at automated intervals. By default, this feature is turned off. If you turn it on, you'll want to remember to turn it off when you're done with the table model.

Version:
$Revision: 904 $
Author:
michael@mpowers.net, $Author: cgruber $
See Also:
Serialized Form

Field Summary
protected  java.lang.Object inspectedObject
           
protected  javax.swing.Timer timer
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
PropertyEditorTableModel()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
           
 java.lang.Class getCellClass(int row, int col)
           
 java.lang.Class getColumnClass(int col)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int col)
           
 int getRowCount()
           
 int getUpdateInterval()
           
 java.lang.Object getValueAt(int row, int col)
           
 boolean isAutoUpdating()
           
 boolean isCellEditable(int row, int col)
           
protected  boolean lt(java.lang.String a, java.lang.String b)
           
 void setAutoUpdating(boolean shouldAutoUpdate)
           
 void setObject(java.lang.Object o)
           
 void setUpdateInterval(int anInterval)
           
 void setValueAt(java.lang.Object value, int row, int col)
           
protected  void sort(java.util.Vector v)
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inspectedObject

protected java.lang.Object inspectedObject

timer

protected javax.swing.Timer timer
Constructor Detail

PropertyEditorTableModel

public PropertyEditorTableModel()
Method Detail

setObject

public void setObject(java.lang.Object o)

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface javax.swing.table.TableModel

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface javax.swing.table.TableModel

getColumnName

public java.lang.String getColumnName(int col)
Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Specified by:
getValueAt in interface javax.swing.table.TableModel

getColumnClass

public java.lang.Class getColumnClass(int col)
Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel

getCellClass

public java.lang.Class getCellClass(int row,
                                    int col)

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

sort

protected void sort(java.util.Vector v)

lt

protected boolean lt(java.lang.String a,
                     java.lang.String b)

isAutoUpdating

public boolean isAutoUpdating()

setAutoUpdating

public void setAutoUpdating(boolean shouldAutoUpdate)

getUpdateInterval

public int getUpdateInterval()

setUpdateInterval

public void setUpdateInterval(int anInterval)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Specified by:
actionPerformed in interface java.awt.event.ActionListener


Copyright © 2006 null. All Rights Reserved.