|
SalesPoint Framework v3.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
util.swing.AbstractTableModel
users.swing.UserTableModel
public class UserTableModel
A TableModel
that models the contents of a UserManager
.
Nested Class Summary | |
---|---|
static class |
UserTableModel.UserComparator
This abstract class is a special Comparator, which compares Users. |
Field Summary | |
---|---|
protected Comparator<User> |
m_cmpComparator
The Comparator that defines the sorting order of records in the model. |
protected List<User> |
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,
Comparator<User> 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 |
setData(Object n_umManager)
Set the table's data. |
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)
Called whenever a user was added to the source. |
void |
userDeleted(UserDataEvent e)
Called whenever a user was deleted from the source. |
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, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected UserManager m_umManager
protected Comparator<User> m_cmpComparator
Users
.
protected List<User> m_lKeys
Constructor Detail |
---|
public UserTableModel(UserManager u, Comparator<User> cmp, TableEntryDescriptor ted)
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 |
---|
public void setData(Object n_umManager)
UserManager
setData
in class AbstractTableModel
n_umManager
- the new datapublic Object getRecord(int row)
getRecord
in class AbstractTableModel
row
- the index for which to retrieve the record. Element of [0, getRowCount()
).
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.public int getRowCount()
getRowCount
in interface TableModel
public void subscribe()
subscribe
in interface HelpableListener
public void unsubscribe()
unsubscribe
in interface HelpableListener
public void updateModel()
UserManager
.
updateModel
in interface HelpableListener
public void userAdded(UserDataEvent e)
UserDataListener
userAdded
in interface UserDataListener
e
- the event object describing the event.public void userDeleted(UserDataEvent e)
UserDataListener
userDeleted
in interface UserDataListener
e
- the event object describing the event.
|
SalesPoint Framework v3.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |