SalesPoint Framework v3.1

users.swing
Class UserComboBoxModel

java.lang.Object
  extended byjavax.swing.AbstractListModel
      extended byusers.swing.UserListModel
          extended byusers.swing.UserComboBoxModel
All Implemented Interfaces:
ComboBoxModel, EventListener, HelpableListener, ListModel, Serializable, UserDataListener

public class UserComboBoxModel
extends UserListModel
implements ComboBoxModel

A ComboBoxModel modelling a UserManager.

Since:
v2.0
Author:
Steffen Zschaler
See Also:
UserManager, User, Serialized Form

Field Summary
protected  User m_usrSelection
          The currently selected user.
 
Fields inherited from class users.swing.UserListModel
m_cmpComparator, m_lUsers, m_ufFilter, m_um
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
UserComboBoxModel()
          Create a new UserComboBoxModel modelling the global UserManager.
UserComboBoxModel(UserFilter uf, Comparator cmp)
          Create a new UserComboBoxModel modelling the global UserManager.
UserComboBoxModel(UserManager um)
          Create a new UserComboBoxModel modelling a given UserManager.
UserComboBoxModel(UserManager um, UserFilter uf, Comparator cmp)
          Create a new UserComboBoxModel modelling a given UserManager.
 
Method Summary
 Object getSelectedItem()
          Return the currently selected user.
 void setSelectedItem(Object oSelectedItem)
          Set the currently selected user, making sure that it is known to the UserManager.
 void updateModel()
          Update the local model.
 
Methods inherited from class users.swing.UserListModel
getElementAt, getSize, subscribe, unsubscribe, userAdded, userDeleted
 
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
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, getElementAt, getSize, removeListDataListener
 

Field Detail

m_usrSelection

protected User m_usrSelection
The currently selected user.

Constructor Detail

UserComboBoxModel

public UserComboBoxModel()
Create a new UserComboBoxModel modelling the global UserManager.


UserComboBoxModel

public UserComboBoxModel(UserFilter uf,
                         Comparator cmp)
Create a new UserComboBoxModel modelling the global UserManager.

Parameters:
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.

UserComboBoxModel

public UserComboBoxModel(UserManager um)
Create a new UserComboBoxModel modelling a given UserManager.

Parameters:
um - the UserManager to be modelled.

UserComboBoxModel

public UserComboBoxModel(UserManager um,
                         UserFilter uf,
                         Comparator cmp)
Create a new UserComboBoxModel modelling a given UserManager.

Parameters:
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

getSelectedItem

public Object getSelectedItem()
Return the currently selected user.

Specified by:
getSelectedItem in interface ComboBoxModel
Returns:
the currently selected user.
Override:
Never

setSelectedItem

public void setSelectedItem(Object oSelectedItem)
Set the currently selected user, making sure that it is known to the UserManager. If the given User is not known to the UserManager, the selection is not altered.

Specified by:
setSelectedItem in interface ComboBoxModel
Parameters:
oSelectedItem - the new selection.
Override:
Never

updateModel

public void updateModel()
Update the local model.

Specified by:
updateModel in interface HelpableListener
Overrides:
updateModel in class UserListModel
Override:
Never

SalesPoint Framework v3.1