|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
PreferencesModel
The model where all modifications to the preferences store are done. Uses the Observer pattern to notify the views when the model changes. This singleton class effectively adds the idea of a 'current node' to the java preferences node heirarchy.
Method Summary | |
void |
childAdded(java.util.prefs.NodeChangeEvent evt)
|
void |
childRemoved(java.util.prefs.NodeChangeEvent evt)
|
java.util.prefs.Preferences |
deleteNode()
Deletes the current node and its children |
java.util.prefs.Preferences |
getCurrentNode()
Gets the current preferences node |
static PreferencesModel |
Instance()
Singleton accessor |
java.util.prefs.Preferences |
newNode(java.lang.String sNodeName)
Creates a new node as a child of the current node |
void |
preferenceChange(java.util.prefs.PreferenceChangeEvent evt)
|
void |
removeAttribute(java.lang.String sKey)
Removes the attribute sKey of the current node |
void |
renameAttribute(java.lang.String sOldKey,
java.lang.String sNewKey)
Renames the attribute sOldKey of the current node |
void |
setAttribute(java.lang.String sKey,
java.lang.String sValue)
Sets the attribute sKey of the current node |
void |
setCurrentNode(java.util.prefs.Preferences oNode)
Sets the current preferences node and notifies observers if the new node is not the same as the previous current node. |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static PreferencesModel Instance()
public java.util.prefs.Preferences getCurrentNode()
public void setCurrentNode(java.util.prefs.Preferences oNode)
oNode
- new current nodepublic void setAttribute(java.lang.String sKey, java.lang.String sValue)
sKey
- node key namesValue
- node key valuepublic void removeAttribute(java.lang.String sKey)
sKey
- node key to removepublic void renameAttribute(java.lang.String sOldKey, java.lang.String sNewKey)
sOldKey
- node key old namesNewKey
- node key new namepublic java.util.prefs.Preferences newNode(java.lang.String sNodeName)
sNodeName
- new node name
public java.util.prefs.Preferences deleteNode()
public void childAdded(java.util.prefs.NodeChangeEvent evt)
childAdded
in interface java.util.prefs.NodeChangeListener
NodeChangeListener.childAdded(java.util.prefs.NodeChangeEvent)
public void childRemoved(java.util.prefs.NodeChangeEvent evt)
childRemoved
in interface java.util.prefs.NodeChangeListener
NodeChangeListener.childRemoved(java.util.prefs.NodeChangeEvent)
public void preferenceChange(java.util.prefs.PreferenceChangeEvent evt)
preferenceChange
in interface java.util.prefs.PreferenceChangeListener
PreferenceChangeListener.preferenceChange(java.util.prefs.PreferenceChangeEvent)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |