|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.table.AbstractTableModel | +--ix.iface.ui.table.AbstractIXTableModel
An abstract class for table models. Keeps track of the base objects that are shown in the table. Implements most functions required by JTable and IXTable objects to work. Implement the following functions (see documentation below):
Field Summary | |
protected java.util.ArrayList |
columnClasses
|
protected java.util.ArrayList |
columnFields
|
protected java.util.ArrayList |
columnNames
|
protected java.lang.Class |
objectClass
|
protected java.util.List |
rows
a list of objects that appear in the table |
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
AbstractIXTableModel()
Makes an empty model. |
|
AbstractIXTableModel(java.lang.Class theClass,
java.lang.Object[] theRows)
Makes a model that contains the given nodes and derives which fields to use. |
|
AbstractIXTableModel(java.lang.Object[] theRows)
Makes a model that contains the given nodes. |
|
AbstractIXTableModel(java.lang.Object[] theRows,
java.lang.String[] columns)
Makes a model as above but with the given strings as column names. |
Method Summary | |
void |
addData(java.lang.Object data)
Adds the given data object to the table's rows if it is not already there and notifies listeners. |
void |
clearData()
Removes all data objects from the table's rows and notifies listeners. |
protected java.lang.Object |
defaultGetCellValueAt(java.lang.Object o,
int columnIndex)
Looks up the value in the columnField of the given index. |
protected void |
defaultSetColumnFields(java.lang.String[] fieldNames)
Sets the fields to be used as table columns |
protected void |
deriveColumnFields()
Collects usable fields from the objectClass |
abstract java.lang.Object |
getCellValueAt(java.lang.Object baseObject,
int columnIndex)
Gets the object's value for the given column index. |
java.lang.Class |
getColumnClass(int index)
JTable required TableModel function (default is Object). |
int |
getColumnCount()
JTable required TableModel function. |
java.lang.String |
getColumnName(int index)
JTable required TableModel function. |
protected java.lang.String[] |
getColumnNames()
Gets the strings to use as column names. |
int |
getObjectRow(java.lang.Object object)
Gets the row index of the given object |
int |
getRowCount()
JTable required TableModel function. |
java.lang.Object |
getRowObject(int rowIndex)
Gets the object that is in the given row. |
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
Gets the value for a cell in the table defined by the given indices. |
void |
removeData(java.lang.Object data)
Removes the given data object from the table's rows and notifies listeners if it worked. |
void |
setColumnClasses(java.lang.Class[] fieldClasses)
Sets the column classes of the table |
void |
setColumnFields(java.lang.Class objectClass,
java.lang.String[] fieldNames)
Sets the fields to be used as columns in the table |
void |
setColumnNames(java.lang.String[] fieldNames)
Sets the column titles to be used in the table |
void |
setData(java.lang.Object[] data)
Sets the table's rows to the given data objects and notifies listeners. |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, isCellEditable, removeTableModelListener, setValueAt |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected java.util.ArrayList columnFields
protected java.util.ArrayList columnNames
protected java.util.ArrayList columnClasses
protected java.lang.Class objectClass
protected java.util.List rows
Constructor Detail |
public AbstractIXTableModel()
public AbstractIXTableModel(java.lang.Object[] theRows)
public AbstractIXTableModel(java.lang.Object[] theRows, java.lang.String[] columns)
public AbstractIXTableModel(java.lang.Class theClass, java.lang.Object[] theRows)
Method Detail |
public void setData(java.lang.Object[] data)
public void addData(java.lang.Object data)
public void removeData(java.lang.Object data)
public void clearData()
public java.lang.Object getRowObject(int rowIndex)
public int getObjectRow(java.lang.Object object)
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in class javax.swing.table.AbstractTableModel
public int getRowCount()
getRowCount
in class javax.swing.table.AbstractTableModel
public int getColumnCount()
getColumnCount
in class javax.swing.table.AbstractTableModel
public java.lang.String getColumnName(int index)
getColumnName
in class javax.swing.table.AbstractTableModel
public java.lang.Class getColumnClass(int index)
getColumnClass
in class javax.swing.table.AbstractTableModel
public abstract java.lang.Object getCellValueAt(java.lang.Object baseObject, int columnIndex)
public void setColumnNames(java.lang.String[] fieldNames)
public void setColumnClasses(java.lang.Class[] fieldClasses)
protected java.lang.String[] getColumnNames()
public void setColumnFields(java.lang.Class objectClass, java.lang.String[] fieldNames)
protected void deriveColumnFields()
protected void defaultSetColumnFields(java.lang.String[] fieldNames)
protected java.lang.Object defaultGetCellValueAt(java.lang.Object o, int columnIndex)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |