public class DefaultUserNameStore extends UserNameStore
Modifier and Type | Field and Description |
---|---|
private static String |
NUM_KEY |
private Preferences |
prefs
The preferences node
|
private static String |
USER_KEY
The key for one of the preferences
|
private String[] |
userNames
Contains the user names.
|
Constructor and Description |
---|
DefaultUserNameStore()
Creates a new instance of DefaultUserNameStore
|
Modifier and Type | Method and Description |
---|---|
void |
addUserName(String name)
Add a username to the store.
|
boolean |
containsUserName(String name) |
Preferences |
getPreferences() |
String[] |
getUserNames()
Gets the current list of users.
|
private void |
initPrefs()
Creates the default prefs node
|
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) |
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
private static final String USER_KEY
private static final String NUM_KEY
private Preferences prefs
public DefaultUserNameStore()
public void loadUserNames()
loadUserNames
in class UserNameStore
public void saveUserNames()
saveUserNames
in class UserNameStore
public String[] getUserNames()
getUserNames
in class UserNameStore
public void setUserNames(String[] userNames)
setUserNames
in class UserNameStore
public void addUserName(String name)
addUserName
in class UserNameStore
name
- public void removeUserName(String name)
removeUserName
in class UserNameStore
name
- public boolean containsUserName(String name)
containsUserName
in class UserNameStore
public Preferences getPreferences()
public void setPreferences(Preferences prefs)
prefs
- the Preferences node to store the user names in. If null,
or undefined, then they are stored in /org/jdesktop/swingx/auth/DefaultUserNameStore.private void initPrefs()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses