org.jdesktop.swingx.auth
Class DefaultUserNameStore

java.lang.Object
  extended by org.jdesktop.beans.AbstractBean
      extended by org.jdesktop.swingx.auth.UserNameStore
          extended by org.jdesktop.swingx.auth.DefaultUserNameStore

public class DefaultUserNameStore
extends UserNameStore

Saves the user names in Preferences. Because any string could be part of the user name, for every user name that must be saved a new Preferences key/value pair must be stored.


Constructor Summary
DefaultUserNameStore()
          Creates a new instance of DefaultUserNameStore
 
Method Summary
 void addUserName(String name)
          Add a username to the store.
 boolean containsUserName(String name)
          
 Preferences getPreferences()
           
 String[] getUserNames()
          Gets the current list of users.
 void loadUserNames()
          Loads the user names from Preferences
 void removeUserName(String name)
          Removes a username from the list.
 void saveUserNames()
          Saves the user names to Preferences
 void setPreferences(Preferences prefs)
           
 void setUserNames(String[] userNames)
          
 
Methods inherited from class org.jdesktop.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultUserNameStore

public DefaultUserNameStore()
Creates a new instance of DefaultUserNameStore

Method Detail

loadUserNames

public void loadUserNames()
Loads the user names from Preferences

Specified by:
loadUserNames in class UserNameStore

saveUserNames

public void saveUserNames()
Saves the user names to Preferences

Specified by:
saveUserNames in class UserNameStore

getUserNames

public String[] getUserNames()
Gets the current list of users.

Specified by:
getUserNames in class UserNameStore

setUserNames

public void setUserNames(String[] userNames)

Specified by:
setUserNames in class UserNameStore

addUserName

public void addUserName(String name)
Add a username to the store.

Specified by:
addUserName in class UserNameStore
Parameters:
name -

removeUserName

public void removeUserName(String name)
Removes a username from the list.

Specified by:
removeUserName in class UserNameStore
Parameters:
name -

containsUserName

public boolean containsUserName(String name)

Specified by:
containsUserName in class UserNameStore

getPreferences

public Preferences getPreferences()
Returns:
Returns Preferences node in which the user names will be stored

setPreferences

public void setPreferences(Preferences prefs)
Parameters:
prefs - the Preferences node to store the user names in. If null, or undefined, then they are stored in /org/jdesktop/swingx/auth/DefaultUserNameStore.