org.springframework.richclient.settings.j2seprefs
Class PreferencesSettings

java.lang.Object
  extended by org.springframework.richclient.settings.AbstractSettings
      extended by org.springframework.richclient.settings.j2seprefs.PreferencesSettings
All Implemented Interfaces:
Settings

public class PreferencesSettings
extends AbstractSettings

Settings implementation using the J2SE Preferences API.
Not using the PreferenceChangeListener to implement PropertyChangeListener support, because we also need the old value.

Author:
Peter De Bruycker

Constructor Summary
PreferencesSettings(Preferences preferences)
           
PreferencesSettings(PreferencesSettings parent, String name)
          Create a child with the given name.
PreferencesSettings(String name)
          Create the root.
 
Method Summary
 String[] getKeys()
          Returns the keys in this Settings.
 Preferences getPreferences()
           
 boolean internalContains(String key)
           
protected  Settings internalCreateChild(String key)
           
protected  String internalGet(String key)
          Return null if no value found for key
protected  String[] internalGetChildSettings()
          Should return the names of the child settings initially in this settings instance, i.e.
protected  void internalRemove(String key)
           
protected  void internalRemoveSettings()
           
protected  void internalSet(String key, String value)
           
 void load()
           
 void save()
           
 
Methods inherited from class org.springframework.richclient.settings.AbstractSettings
addPropertyChangeListener, addPropertyChangeListener, contains, getAllKeys, getBoolean, getChildSettings, getDefaultBoolean, getDefaultDouble, getDefaultFloat, getDefaultInt, getDefaultKeys, getDefaultLabeledEnum, getDefaultLong, getDefaultString, getDouble, getFloat, getInt, getLabeledEnum, getLong, getName, getParent, getSettings, getString, isDefault, isRoot, remove, removePropertyChangeListener, removePropertyChangeListener, removeSettings, setBoolean, setDefaultBoolean, setDefaultDouble, setDefaultFloat, setDefaultInt, setDefaultLabeledEnum, setDefaultLong, setDefaultString, setDouble, setFloat, setInt, setLabeledEnum, setLong, setString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreferencesSettings

public PreferencesSettings(String name)
Create the root.


PreferencesSettings

public PreferencesSettings(PreferencesSettings parent,
                           String name)
Create a child with the given name.


PreferencesSettings

public PreferencesSettings(Preferences preferences)
Parameters:
preferences -
Method Detail

getPreferences

public Preferences getPreferences()

save

public void save()
          throws IOException
Throws:
IOException

load

public void load()
          throws IOException
Throws:
IOException

internalGet

protected String internalGet(String key)
Description copied from class: AbstractSettings
Return null if no value found for key

Specified by:
internalGet in class AbstractSettings

internalCreateChild

protected Settings internalCreateChild(String key)
Specified by:
internalCreateChild in class AbstractSettings

internalSet

protected void internalSet(String key,
                           String value)
Specified by:
internalSet in class AbstractSettings

getKeys

public String[] getKeys()
Description copied from interface: Settings
Returns the keys in this Settings.

Returns:
the keys

internalRemove

protected void internalRemove(String key)
Specified by:
internalRemove in class AbstractSettings

internalContains

public boolean internalContains(String key)
Specified by:
internalContains in class AbstractSettings

internalGetChildSettings

protected String[] internalGetChildSettings()
Description copied from class: AbstractSettings
Should return the names of the child settings initially in this settings instance, i.e. the children that were stored in the backend.

Specified by:
internalGetChildSettings in class AbstractSettings
Returns:
the names of the child settings

internalRemoveSettings

protected void internalRemoveSettings()
Specified by:
internalRemoveSettings in class AbstractSettings


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.