SalesPoint Framework v3.0

users.swing
Class UserTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--util.swing.AbstractTableModel
              |
              +--users.swing.UserTableModel

public class UserTableModel
extends AbstractTableModel
implements UserDataListener, HelpableListener, Serializable

A TableModel that models the contents of a UserManager.

Since:
v3.0
Version:
3.0 12/06/2001
Author:
Thomas Medack
See Also:
Serialized Form

Inner Class Summary
static class UserTableModel.UserComparator
          This abstract class is a special Comparator, which compares Users.
 
Field Summary
protected  UserTableModel.UserComparator m_cmpComparator
          The Comparator that defines the sorting order of records in the model.
protected  List m_lKeys
          The internal model.
protected  UserManager m_umManager
          The UserManager that is being modelled.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
UserTableModel(UserManager u, UserTableModel.UserComparator cmp, TableEntryDescriptor ted)
          Create a new UserTableModel.
 
Method Summary
 Object getRecord(int row)
          Get the record at the given index.
 int getRowCount()
          Get the number of records in this model.
 void subscribe()
          Subscribe as a listener to the model.
 void unsubscribe()
          Un-Subscribe as a listener from the model.
 void updateModel()
          Update the internal model based on the modelled UserManager.
 void userAdded(UserDataEvent e)
           
 void userDeleted(UserDataEvent e)
           
 
Methods inherited from class util.swing.AbstractTableModel
getColumnClass, getColumnCount, getColumnName, getEntryDescriptor, getValueAt, isCellEditable, orderByColumn, reOrderBy, setValueAt
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_umManager

protected UserManager m_umManager
The UserManager that is being modelled.

m_cmpComparator

protected UserTableModel.UserComparator m_cmpComparator
The Comparator that defines the sorting order of records in the model. It compares CatalogItems.

m_lKeys

protected List m_lKeys
The internal model. A list of the Users' names.
Constructor Detail

UserTableModel

public UserTableModel(UserManager u,
                      UserTableModel.UserComparator cmp,
                      TableEntryDescriptor ted)
Create a new UserTableModel.
Parameters:
u - the UserManager to be modelled.
cmp - a Comparator defining the sort order of the records. If null, records are ordered according to the natural ordering of the Users.
ted - a TableEntryDescriptor that can split individual Users into a table's cells.
Method Detail

getRecord

public Object getRecord(int row)
Get the record at the given index.
Override:
Never.
Parameters:
row - the index for which to retrieve the record. Element of [0, getRowCount()).
Returns:
the User to be displayed at the given index. May return null if either there is no record at the indicated position or an exception occurs.
Overrides:
getRecord in class AbstractTableModel

getRowCount

public int getRowCount()
Get the number of records in this model.
Override:
Never.
Overrides:
getRowCount in class AbstractTableModel

subscribe

public void subscribe()
Subscribe as a listener to the model.
Override:
Never.
Specified by:
subscribe in interface HelpableListener

unsubscribe

public void unsubscribe()
Un-Subscribe as a listener from the model.
Override:
Never.
Specified by:
unsubscribe in interface HelpableListener

updateModel

public void updateModel()
Update the internal model based on the modelled UserManager.
Override:
Never.
Specified by:
updateModel in interface HelpableListener

userAdded

public void userAdded(UserDataEvent e)
Specified by:
userAdded in interface UserDataListener

userDeleted

public void userDeleted(UserDataEvent e)
Specified by:
userDeleted in interface UserDataListener

SalesPoint Framework v3.0