|
SalesPoint v3.3 API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.AbstractListModel
users.swing.UserListModel
public class UserListModel
A ListModel modelling the set or a subset of users managed by a UserManager.
UserManager,
User,
Serialized Form| Field Summary | |
|---|---|
protected Comparator<User> |
m_cmpComparator
A Comparator that orders the users. |
protected List<User> |
m_lUsers
A local copy of the list of users to provide easy and consistent access via an index. |
protected UserFilter |
m_ufFilter
A filter that defines the subset of users that are displayed. |
protected UserManager |
m_um
The UserManager that is being modelled. |
| Fields inherited from class javax.swing.AbstractListModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
UserListModel()
Create a new UserListModel modelling the global UserManager. |
|
UserListModel(UserFilter uf,
Comparator<User> cmp)
Create a new UserListModel modelling the global UserManager. |
|
UserListModel(UserManager um)
Create a new UserListModel modelling a given UserManager. |
|
UserListModel(UserManager um,
UserFilter uf,
Comparator<User> cmp)
Create a new UserListModel modelling a given UserManager. |
|
| Method Summary | |
|---|---|
Object |
getElementAt(int nIndex)
Get a user by index. |
int |
getSize()
Return the number of users in the model. |
void |
subscribe()
Subscribe to the UserManager to be informed of any changes in its set of users. |
void |
unsubscribe()
Unsubscribe from the UserManager as there is no need to listen to it anymore, as we are not listened to anymore. |
void |
updateModel()
Update the internal model. |
void |
userAdded(UserDataEvent e)
Respond to the userAdded event by updating the internal model
and forwarding a translated version of the event to anyone who listens to us. |
void |
userDeleted(UserDataEvent e)
Respond to the userDeleted event by updating the internal model
and forwarding a translated version of the event to anyone who listens to us. |
| Methods inherited from class javax.swing.AbstractListModel |
|---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected List<User> m_lUsers
protected Comparator<User> m_cmpComparator
protected UserFilter m_ufFilter
null no
filtering will occur.
protected UserManager m_um
| Constructor Detail |
|---|
public UserListModel()
public UserListModel(UserFilter uf,
Comparator<User> cmp)
uf - a filter that defines the set of users to be displayed. If null, no filtering will
occur.cmp - a Comparator that defines the order of the users to be displayed. The objects to be compared
by this comparator will be Users. If null, users will be ordered by their names.public UserListModel(UserManager um)
um - the UserManager to be modelled.
public UserListModel(UserManager um,
UserFilter uf,
Comparator<User> cmp)
um - the UserManager to be modelled.uf - a filter that defines the set of users to be displayed. If null, no filtering will
occur.cmp - a Comparator that defines the order of the users to be displayed. The objects to be compared
by this comparator will be Users. If null, users will be ordered by their names.| Method Detail |
|---|
public int getSize()
getSize in interface ListModelpublic Object getElementAt(int nIndex)
getElementAt in interface ListModelnIndex - the index of the user to be returned.
public void userAdded(UserDataEvent e)
userAdded event by updating the internal model
and forwarding a translated version of the event to anyone who listens to us.
userAdded in interface UserDataListenere - the event object describing the event.public void userDeleted(UserDataEvent e)
userDeleted event by updating the internal model
and forwarding a translated version of the event to anyone who listens to us.
userDeleted in interface UserDataListenere - the event object describing the event.public void updateModel()
updateModel in interface HelpableListenerpublic void subscribe()
subscribe in interface HelpableListenerpublic void unsubscribe()
unsubscribe in interface HelpableListener
|
SalesPoint v3.3 API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||