|
SalesPoint Framework v3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractListModel users.swing.UserListModel
A ListModel modelling the set or a subset of users managed by a UserManager.
UserManager
,
User
,
Serialized FormField Summary | |
protected Comparator |
m_cmpComparator
A Comparator that orders the users. |
protected List |
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 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 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 m_lUsers
protected Comparator m_cmpComparator
protected UserFilter m_ufFilter
null
no
filtering will occur.
protected UserManager m_um
Constructor Detail |
public UserListModel()
public UserListModel(UserFilter uf, Comparator 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 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 ListModel
public Object getElementAt(int nIndex)
getElementAt
in interface ListModel
nIndex
- 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 UserDataListener
e
- 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 UserDataListener
e
- the event object describing the event.public void updateModel()
updateModel
in interface HelpableListener
public void subscribe()
subscribe
in interface HelpableListener
public void unsubscribe()
unsubscribe
in interface HelpableListener
|
SalesPoint Framework v3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |