butler.swing.record
Class RecordListTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by butler.swing.record.RecordListTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class RecordListTableModel
extends javax.swing.table.AbstractTableModel

Author:
Fredrik Bertilsson
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
RecordListTableModel()
           
RecordListTableModel(boolean editable)
           
RecordListTableModel(java.util.List columns)
           
 
Method Summary
 void addRecord(int pos, Record rec)
           
 void addRecord(Record rec)
           
 void delete(int row)
           
 java.lang.Class getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int columnIndex)
           
 java.util.List getColumns()
           
 boolean getEditable()
           
 int getIndex(Record rec)
           
 Record getRecord(int rowIndex)
           
 RecordList getRecordList()
           
 int getRowCount()
           
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 boolean isDirty()
           
 void setColumns(java.util.List cols)
           
 void setDirty(boolean dirty)
           
 void setEditable(boolean flag)
           
 void setEditController(EditController controller)
           
 void setRecordList(RecordList recList)
           
 void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
           
 void sort(RecordComparator comparator)
           
 
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

RecordListTableModel

public RecordListTableModel(java.util.List columns)
                     throws java.lang.Exception
Throws:
java.lang.Exception

RecordListTableModel

public RecordListTableModel()

RecordListTableModel

public RecordListTableModel(boolean editable)
Method Detail

setRecordList

public void setRecordList(RecordList recList)
                   throws java.lang.Exception
Throws:
java.lang.Exception

setColumns

public void setColumns(java.util.List cols)

setEditable

public void setEditable(boolean flag)

getEditable

public boolean getEditable()

getRowCount

public int getRowCount()

getColumnCount

public int getColumnCount()

getColumnName

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

getColumnClass

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

isCellEditable

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

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)

getIndex

public int getIndex(Record rec)
             throws java.lang.Exception
Throws:
java.lang.Exception

getRecord

public Record getRecord(int rowIndex)

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

getColumns

public java.util.List getColumns()

getRecordList

public RecordList getRecordList()

isDirty

public boolean isDirty()

setDirty

public void setDirty(boolean dirty)

delete

public void delete(int row)
            throws java.lang.Exception
Throws:
java.lang.Exception

addRecord

public void addRecord(Record rec)

addRecord

public void addRecord(int pos,
                      Record rec)

sort

public void sort(RecordComparator comparator)

setEditController

public void setEditController(EditController controller)