net.sf.doolin.gui.service.support
Class DefaultGUIPreferences

java.lang.Object
  extended by net.sf.doolin.gui.service.support.AbstractGUIPreferences
      extended by net.sf.doolin.gui.service.support.DefaultGUIPreferences
All Implemented Interfaces:
GUIPreferences

public class DefaultGUIPreferences
extends AbstractGUIPreferences

Implementation of preferences based on default JDK preferences implementation.

Author:
Damien Coraboeuf
See Also:
GUIPreferences

Constructor Summary
DefaultGUIPreferences()
           
 
Method Summary
 void delete(String key)
          Deletes a preference entry.
 Boolean getBoolean(String key, Boolean defaultValue)
          Get a preference value as a boolean
 File getFile(String key)
          Gets a preference value as a file.
 Integer getInt(String key, Integer defaultValue)
          Get a preference value as an integer
 Long getLong(String key, Long defaultValue)
          Get a preference value as a long
 String getString(String key, String defaultValue)
          Get a preference value as a string
protected  void init()
          Initializes the preferences.
 void save()
          Saves the preferences in the back store
 void setBoolean(String key, Boolean value)
          Sets a preference value as a string
 void setFile(String key, File file)
          Sets a preference value as a file.
 void setInt(String key, Integer value)
          Sets a preference value as an integer
 void setLong(String key, Long value)
          Sets a preference value as a long
 void setString(String key, String value)
          Sets a preference value as a string
protected  void syncInit()
          Actual initialization.
 
Methods inherited from class net.sf.doolin.gui.service.support.AbstractGUIPreferences
restoreMemento, saveMemento
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultGUIPreferences

public DefaultGUIPreferences()
Method Detail

init

protected void init()
Initializes the preferences.


syncInit

protected void syncInit()
Actual initialization. This method is called only once in the life-cycle of the preferences and is synchronized.


getBoolean

public Boolean getBoolean(String key,
                          Boolean defaultValue)
Description copied from interface: GUIPreferences
Get a preference value as a boolean

Parameters:
key - Preference key
defaultValue - Default value if the key is not defined
Returns:
Preference value

getInt

public Integer getInt(String key,
                      Integer defaultValue)
Description copied from interface: GUIPreferences
Get a preference value as an integer

Parameters:
key - Preference key
defaultValue - Default value if the key is not defined
Returns:
Preference value

getLong

public Long getLong(String key,
                    Long defaultValue)
Description copied from interface: GUIPreferences
Get a preference value as a long

Parameters:
key - Preference key
defaultValue - Default value if the key is not defined
Returns:
Preference value

getString

public String getString(String key,
                        String defaultValue)
Description copied from interface: GUIPreferences
Get a preference value as a string

Parameters:
key - Preference key
defaultValue - Default value if the key is not defined
Returns:
Preference value

save

public void save()
Description copied from interface: GUIPreferences
Saves the preferences in the back store


setBoolean

public void setBoolean(String key,
                       Boolean value)
Description copied from interface: GUIPreferences
Sets a preference value as a string

Parameters:
key - Preference key
value - Value to store

setInt

public void setInt(String key,
                   Integer value)
Description copied from interface: GUIPreferences
Sets a preference value as an integer

Parameters:
key - Preference key
value - Value to store

setLong

public void setLong(String key,
                    Long value)
Description copied from interface: GUIPreferences
Sets a preference value as a long

Parameters:
key - Preference key
value - Value to store

setString

public void setString(String key,
                      String value)
Description copied from interface: GUIPreferences
Sets a preference value as a string

Parameters:
key - Preference key
value - Value to store

getFile

public File getFile(String key)
Description copied from interface: GUIPreferences
Gets a preference value as a file.

Parameters:
key - Preference key
Returns:
File or null if not found

setFile

public void setFile(String key,
                    File file)
Description copied from interface: GUIPreferences
Sets a preference value as a file.

Parameters:
key - Preference key
file - File to store

delete

public void delete(String key)
Description copied from interface: GUIPreferences
Deletes a preference entry.

Parameters:
key - Preference entry key


Copyright © 2011. All Rights Reserved.