Package org.jdesktop.swingx.auth
Class DefaultUserNameStore
java.lang.Object
org.jdesktop.beans.AbstractBean
org.jdesktop.swingx.auth.UserNameStore
org.jdesktop.swingx.auth.DefaultUserNameStore
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.
- Author:
- Bino George, rbair
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUserName(String name) Add a username to the store.booleancontainsUserName(String name) TODO maven-javadoc-plugin 3.3.2 needs a doc hereString[]Gets the current list of users.voidLoads the user names from PreferencesvoidremoveUserName(String name) Removes a username from the list.voidSaves the user names to PreferencesvoidsetPreferences(Preferences prefs) voidsetUserNames(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
-
Constructor Details
-
DefaultUserNameStore
public DefaultUserNameStore()Creates a new instance of DefaultUserNameStore
-
-
Method Details
-
loadUserNames
public void loadUserNames()Loads the user names from Preferences- Specified by:
loadUserNamesin classUserNameStore
-
saveUserNames
public void saveUserNames()Saves the user names to Preferences- Specified by:
saveUserNamesin classUserNameStore
-
getUserNames
Gets the current list of users.- Specified by:
getUserNamesin classUserNameStore- Returns:
- array of current users
-
setUserNames
- Specified by:
setUserNamesin classUserNameStore- Parameters:
userNames- user names to set
-
addUserName
Add a username to the store.- Specified by:
addUserNamein classUserNameStore- Parameters:
name- username
-
removeUserName
Removes a username from the list.- Specified by:
removeUserNamein classUserNameStore- Parameters:
name- username
-
containsUserName
TODO maven-javadoc-plugin 3.3.2 needs a doc here- Specified by:
containsUserNamein classUserNameStore- Parameters:
name- user name- Returns:
- true if user name is in the list
-
getPreferences
- Returns:
- Returns Preferences node in which the user names will be stored
-
setPreferences
- 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.
-