VdexReload 1.1.3 API

uk.ac.reload.dweezil.prefs
Class UserPrefs

java.lang.Object
  extended byuk.ac.reload.dweezil.prefs.UserPrefs
Direct Known Subclasses:
LDEditorPrefs, ReloadEditorPrefs

public abstract class UserPrefs
extends java.lang.Object

The User Prefs file. Implementers will have to fulfil the abstract methods


Field Summary
protected  org.jdom.Document _doc
          The JDOM Document
 
Constructor Summary
UserPrefs()
          Default constructor
 
Method Summary
protected  org.jdom.Document createNewPrefsFile()
          Create a new JDOM Prefs Document with root element
 boolean getBooleanValue(java.lang.String key)
          Get a boolean value given a key, if it doesn't exist the default is false.
abstract  java.lang.String getElementRootName()
           
abstract  java.io.File getPrefsFile()
          Get the Preferences File (for example from, c:/winnt/profiles/user/reload/reload_prefs.xml)
 java.lang.String getValue(java.lang.String key)
          Get a value string given a key
protected  org.jdom.Document load()
          Load the Preferences File
 void putBooleanValue(java.lang.String key, boolean value)
          Add a Boolean value
 void putValue(java.lang.String key, java.lang.String value)
          Put a key and value
 void removeValue(java.lang.String key)
          Remove a value
 void save()
          Save the Prefs file
protected abstract  void setDefaultValues()
          Set some default values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_doc

protected org.jdom.Document _doc
The JDOM Document

Constructor Detail

UserPrefs

public UserPrefs()
Default constructor

Method Detail

load

protected org.jdom.Document load()
Load the Preferences File

Returns:
the JDOM Document

save

public void save()
          throws DweezilXMLException
Save the Prefs file

Throws:
DweezilXMLException

createNewPrefsFile

protected org.jdom.Document createNewPrefsFile()
Create a new JDOM Prefs Document with root element

Returns:
the JDOM Document

getValue

public java.lang.String getValue(java.lang.String key)
Get a value string given a key

Parameters:
key - the search key concerned
Returns:
a value string given a key

getBooleanValue

public boolean getBooleanValue(java.lang.String key)
Get a boolean value given a key, if it doesn't exist the default is false.

Parameters:
key - the search key concerned
Returns:
a boolean value given a key, if it doesn't exist the default is false

putBooleanValue

public void putBooleanValue(java.lang.String key,
                            boolean value)
Add a Boolean value

Parameters:
key - the search key concerned value the boolean value to assign for this key

putValue

public void putValue(java.lang.String key,
                     java.lang.String value)
Put a key and value

Parameters:
key - the search key concerned value the value to assign for this key

removeValue

public void removeValue(java.lang.String key)
Remove a value

Parameters:
key - the search key to be removed

getPrefsFile

public abstract java.io.File getPrefsFile()
Get the Preferences File (for example from, c:/winnt/profiles/user/reload/reload_prefs.xml)

Returns:
the Preferences File

setDefaultValues

protected abstract void setDefaultValues()
Set some default values


getElementRootName

public abstract java.lang.String getElementRootName()
Returns:
the root Element name

VdexReload 1.1.3 API