org.springframework.richclient.settings
Class SettingsManager

java.lang.Object
  extended by org.springframework.richclient.settings.SettingsManager

public class SettingsManager
extends Object

Facade for working with Settings. Provides methods for Settings creation, export, import, ...

Creation of Settings is delegated to a SettingsFactory.

The export and import of Settings is done with xml files

Author:
Peter De Bruycker

Field Summary
static String INTERNAL
           
static String USER
           
 
Constructor Summary
SettingsManager()
           
 
Method Summary
 Settings createSettings(String key)
          Returns the Settings for the given key.
 void exportSettings(Settings settings, OutputStream out)
          Export settings to an OutputStream
 Settings getInternalSettings()
          Returns the internal settings, i.e.
 SettingsFactory getSettingsFactory()
          Returns the settings factory.
 Settings getUserSettings()
          Returns the user settings, i.e.
 void importSettings(Settings settings, InputStream in)
          Import settings from an InputStream
 void setSettingsFactory(SettingsFactory factory)
          Set the settings factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTERNAL

public static final String INTERNAL
See Also:
Constant Field Values

USER

public static final String USER
See Also:
Constant Field Values
Constructor Detail

SettingsManager

public SettingsManager()
Method Detail

getInternalSettings

public Settings getInternalSettings()
                             throws SettingsException
Returns the internal settings, i.e. the settings used for storing ui state, and other settings normally not visible and configurable to the user.

Returns:
the internal Settings
Throws:
SettingsException

getUserSettings

public Settings getUserSettings()
                         throws SettingsException
Returns the user settings, i.e. the settings used for the user preferences, normally these settings can be changed by the user, and affect the applications appearance and behaviour. These settings can also be exported/imported.

Returns:
the user Settings
Throws:
SettingsException

createSettings

public Settings createSettings(String key)
                        throws SettingsException
Returns the Settings for the given key. This method should not be called directly, use getInternalSettings() or getUserSettings() instead.

Parameters:
key - the key
Returns:
the Settings
Throws:
SettingsException - if the Settings could not be created

setSettingsFactory

public void setSettingsFactory(SettingsFactory factory)
Set the settings factory. If the factory is set to null, the TransientSettingsFactory will be used.

Parameters:
factory - the factory

getSettingsFactory

public SettingsFactory getSettingsFactory()
Returns the settings factory.

Returns:
the factory

exportSettings

public void exportSettings(Settings settings,
                           OutputStream out)
                    throws IOException
Export settings to an OutputStream

Parameters:
settings - the settings
out - the OutputStream
Throws:
IOException - if the settings could not be exported

importSettings

public void importSettings(Settings settings,
                           InputStream in)
                    throws IOException
Import settings from an InputStream

Parameters:
settings - the settings
in - the InputStream
Throws:
IOException - if the settings could not be imported


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