org.apache.jorphan.gui

Class ObjectTableModel


public class ObjectTableModel
extends DefaultTableModel

The ObjectTableModel is a TableModel whose rows are objects; columns are defined as Functors on the object.

Constructor Summary

ObjectTableModel(String[] headers, Class _objClass, Functor[] readFunctors, Functor[] writeFunctors, Class[] editorClasses)
The ObjectTableModel is a TableModel whose rows are objects; columns are defined as Functors on the object.
ObjectTableModel(String[] headers, Functor[] readFunctors, Functor[] writeFunctors, Class[] editorClasses)
The ObjectTableModel is a TableModel whose rows are objects; columns are defined as Functors on the object.

Method Summary

void
addRow(Object value)
boolean
checkFunctors(Object _value, Class caller)
Check all registered functors.
void
clearData()
Class
getColumnClass(int arg0)
int
getColumnCount()
String
getColumnName(int col)
int
getRowCount()
Object
getValueAt(int row, int col)
void
insertRow(Object value, int index)
boolean
isCellEditable(int arg0, int arg1)
Iterator
iterator()
void
moveRow(int start, int end, int to)
void
removeRow(int row)
void
setValueAt(Object cellValue, int row, int col)

Constructor Details

ObjectTableModel

public ObjectTableModel(String[] headers,
                        Class _objClass,
                        Functor[] readFunctors,
                        Functor[] writeFunctors,
                        Class[] editorClasses)
The ObjectTableModel is a TableModel whose rows are objects; columns are defined as Functors on the object.
Parameters:
headers - - Column names
_objClass - - Object class that will be used
readFunctors - - used to get the values
writeFunctors - - used to set the values
editorClasses - - class for each column

ObjectTableModel

public ObjectTableModel(String[] headers,
                        Functor[] readFunctors,
                        Functor[] writeFunctors,
                        Class[] editorClasses)
The ObjectTableModel is a TableModel whose rows are objects; columns are defined as Functors on the object.
Parameters:
headers - - Column names
readFunctors - - used to get the values
writeFunctors - - used to set the values
editorClasses - - class for each column

Method Details

addRow

public void addRow(Object value)

checkFunctors

public boolean checkFunctors(Object _value,
                             Class caller)
Check all registered functors.

** only for use in unit test code **

Parameters:
_value - - an instance of the table model row data item (if null, use the class passed to the constructor).
caller - - class of caller.
Returns:
false if at least one Functor cannot be found.

clearData

public void clearData()

getColumnClass

public Class getColumnClass(int arg0)

getColumnCount

public int getColumnCount()

getColumnName

public String getColumnName(int col)

getRowCount

public int getRowCount()

getValueAt

public Object getValueAt(int row,
                         int col)

insertRow

public void insertRow(Object value,
                      int index)

isCellEditable

public boolean isCellEditable(int arg0,
                              int arg1)

iterator

public Iterator iterator()

moveRow

public void moveRow(int start,
                    int end,
                    int to)

removeRow

public void removeRow(int row)

setValueAt

public void setValueAt(Object cellValue,
                       int row,
                       int col)

Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.