org.base.apps.beans.view.swing
Class BaseTableModel<T>

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.base.apps.beans.view.swing.BaseTableModel<T>
All Implemented Interfaces:
Serializable, TableModel

public class BaseTableModel<T>
extends AbstractTableModel

Author:
Kevan Simpson
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
BaseTableModel()
           
BaseTableModel(boolean sortable)
           
 
Method Summary
 void addColumnInfo(ColumnInfo info)
           
 Class<?> getColumnClass(int column)
           
 int getColumnCount()
           
 ColumnInfo getColumnInfo(int index)
           
 String getColumnName(int column)
           
protected  List<ColumnInfo> getColumnsInfo()
           
protected  Evaluator getEvaluator()
           
 List<T> getItems()
          Returns this model's list of items.
 int getRowCount()
           
 Object getValueAt(int row, int col)
           
protected  boolean inRange(int index)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 boolean isSortable()
          Returns true if this table's data is sortable.
 T itemAt(int index)
          Returns the item at the given index or null if the index is out of bounds.
protected  org.apache.commons.logging.Log log()
           
 ColumnInfo setColumnInfo(int index, ColumnInfo info)
           
protected  void setColumnsInfo(List<ColumnInfo> columnsInfo)
           
protected  void setEvaluator(Evaluator evaluator)
           
 void setItems(List<T> items)
          Sets this model's list of items.
 void setSortable(boolean sortable)
           
 void setValueAt(Object value, int row, int col)
           
 
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
 

Constructor Detail

BaseTableModel

public BaseTableModel()

BaseTableModel

public BaseTableModel(boolean sortable)
Method Detail

isSortable

public boolean isSortable()
Returns true if this table's data is sortable.

Returns:
true if this table's data is sortable, else false..

setSortable

public void setSortable(boolean sortable)
Parameters:
sortable - the sortable to set

getRowCount

public int getRowCount()
See Also:
TableModel.getRowCount()

getColumnCount

public int getColumnCount()
See Also:
TableModel.getColumnCount()

getColumnName

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

getColumnClass

public Class<?> getColumnClass(int column)
Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel

isCellEditable

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

getValueAt

public Object getValueAt(int row,
                         int col)
See Also:
TableModel.getValueAt(int, int)

setValueAt

public void setValueAt(Object value,
                       int row,
                       int col)
Specified by:
setValueAt in interface TableModel
Overrides:
setValueAt in class AbstractTableModel

getItems

public List<T> getItems()
Returns this model's list of items.

Returns:
this model's list of items.

itemAt

public T itemAt(int index)
Returns the item at the given index or null if the index is out of bounds.

Parameters:
index - The given index.
Returns:
An item or null.

setItems

public void setItems(List<T> items)
Sets this model's list of items.

Parameters:
items - The list of items.

addColumnInfo

public void addColumnInfo(ColumnInfo info)

getColumnInfo

public ColumnInfo getColumnInfo(int index)

setColumnInfo

public ColumnInfo setColumnInfo(int index,
                                ColumnInfo info)

getColumnsInfo

protected List<ColumnInfo> getColumnsInfo()
Returns:
the columnsInfo

setColumnsInfo

protected void setColumnsInfo(List<ColumnInfo> columnsInfo)
Parameters:
columnsInfo - the columnsInfo to set

getEvaluator

protected Evaluator getEvaluator()
Returns:
the evaluator

setEvaluator

protected void setEvaluator(Evaluator evaluator)
Parameters:
evaluator - the evaluator to set

log

protected org.apache.commons.logging.Log log()

inRange

protected boolean inRange(int index)

Please visit Base Apps, hosted on Sourceforge.net.

Copyright 2011, Blue Agate Software Entity (BASE)