net.curre.prefcount.service
Class SettingsService

java.lang.Object
  extended by net.curre.prefcount.service.SettingsService

public class SettingsService
extends java.lang.Object

This is a service bean that assists with handling application settings.

Created date: Jun 22, 2007

Author:
Yevgeny Nyden

Constructor Summary
SettingsService()
           
 
Method Summary
static Settings getSettings()
          Returns application settings (current settings).
static Settings loadSettings()
          Method to load settings stored on disk.
static void resetSettings()
          Method to reset user settings.
static void saveSettings()
          Method to save user settings.
static void updateSkin(PrefSkin skin)
          Updates the skin on the current settings object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SettingsService

public SettingsService()
Method Detail

getSettings

public static Settings getSettings()
Returns application settings (current settings).

Returns:
Reference to the application settings bean.

loadSettings

public static Settings loadSettings()
Method to load settings stored on disk.

Returns:
Settings, loaded from the settings file, or a new Settings object if no settings file is found.

updateSkin

public static void updateSkin(PrefSkin skin)
Updates the skin on the current settings object.

Parameters:
skin - PrefSkin to set.

saveSettings

public static void saveSettings()
                         throws ServiceException
Method to save user settings. Application settings are saved in the place and under the name specified in the PrefCountRegistry bean.

Throws:
ServiceException - If there was an error when saving settings.

resetSettings

public static void resetSettings()
                          throws ServiceException
Method to reset user settings. The settings are recreated and saved.

Throws:
ServiceException - If there was an error when resetting settings.


Copyright © 2008. All Rights Reserved.