com.atomikos.swing
Class AbstractPropertiesTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.atomikos.swing.AbstractPropertiesTableModel
All Implemented Interfaces:
PropertiesTableModel, Serializable, TableModel

public abstract class AbstractPropertiesTableModel
extends AbstractTableModel
implements PropertiesTableModel

An abstract implementation of a properties table model. Subclasses need to override the getValueAt method.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
AbstractPropertiesTableModel(Vector data, String[] columnNames)
          Creates a new instance for a given data set and a number of column names.
 
Method Summary
 int getColumnCount()
           
 String getColumnName(int col)
           
protected  Vector getData()
           
 int getRowCount()
           
 TableModel getTableModel()
          Gets the Swing table model for this one.
abstract  Object getValueAt(int row, int column)
           
 boolean isCellEditable(int row, int col)
           
 void refresh()
          Indicates that one or more rows have changed, and the table view needs an update.
 void rowDeleted(int row)
          Indicates that a row was deleted.
 void rowInserted()
          Indicates that a new row has been inserted.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPropertiesTableModel

public AbstractPropertiesTableModel(Vector data,
                                    String[] columnNames)
Creates a new instance for a given data set and a number of column names.

Parameters:
data - The data; each element in the vector is a row.
columnNames - The column names to use. The size determines the number of columns.
Method Detail

getData

protected Vector getData()

getTableModel

public TableModel getTableModel()
Description copied from interface: PropertiesTableModel
Gets the Swing table model for this one.

Specified by:
getTableModel in interface PropertiesTableModel
Returns:
TableModel The swing table model.
See Also:
PropertiesTableModel

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

getValueAt

public abstract Object getValueAt(int row,
                                  int column)
Specified by:
getValueAt in interface TableModel

getColumnName

public String getColumnName(int col)
Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel

isCellEditable

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

rowDeleted

public void rowDeleted(int row)
Description copied from interface: PropertiesTableModel
Indicates that a row was deleted.

Specified by:
rowDeleted in interface PropertiesTableModel
Parameters:
row - The row's index.
See Also:
PropertiesTableModel

refresh

public void refresh()
Description copied from interface: PropertiesTableModel
Indicates that one or more rows have changed, and the table view needs an update.

Specified by:
refresh in interface PropertiesTableModel
See Also:
PropertiesTableModel

rowInserted

public void rowInserted()
Description copied from interface: PropertiesTableModel
Indicates that a new row has been inserted.

Specified by:
rowInserted in interface PropertiesTableModel
See Also:
PropertiesTableModel


Copyright © 2011. All Rights Reserved.