Interface PreferencesService

All Superinterfaces:
All Known Implementing Classes:

public interface PreferencesService
extends Service

The preference service provides the means to retrieve a Preferences object to store and query its preference values. In order to use this service, the PreferencesModule has to include it in the application configuration file. Otherwise, this service is not available.

Method Summary
 java.util.prefs.Preferences getPreferences(java.lang.String identificationPath)
          Returns a Preferences object using which the preference settings for a PreferencesPage may be retrieved and stored.
Methods inherited from interface net.sf.genuine.organizer.Service

Method Detail


public java.util.prefs.Preferences getPreferences(java.lang.String identificationPath)
Returns a Preferences object using which the preference settings for a PreferencesPage may be retrieved and stored. As parameter the identification path of the preference page has to be passed (see PreferencesPage.getIdentificationPath(). The Preferences object that is returned is the preferences node you get if you concatenate the preferences root node of the application (set by configuration properties of the preferences module) and the identification path.

Example: The following property is set as part of the configuration data for the preferences module:

   <property key="PreferencesRoot" value="net/sf/genuine/example/crm/"/>
If you would like to get the Preferences object for general appearance preferences, these values are handled by the class AppearancePreferencesPage that is provided by Genuine itself. Its method getIdentificationPath looks as follows:
   public String getIdentificationPath() {
     return "general/appearance";
You should therefore call this method passing the parameter "general/appearance". You retrieve the same preference node as if you call

Every application class may retrieve a Preferences object using the identification path of any preference page to check its preferences settings.

Genuine uses the default preferences means of the Java plattform. To use a different preferences storage mechanism, you need to set up this mechanism in your own application. See the JavaDoc comment of PreferencesModule.