Class PreferencesModule

  extended bynet.sf.genuine.organizer.AbstractModule
      extended bynet.sf.genuine.preferences.PreferencesModule
All Implemented Interfaces:

public class PreferencesModule
extends AbstractModule

The preferences module creates both the preferences service and the preferences dialog that may be used by all applications. In order to use the preferences infrastructure provided by Genuine, an application has to include this module in its application configuration file.

Example (taken from the example application):

   <module id="PreferencesModule" class="net.sf.genuine.preferences.PreferencesModule">
       <property key="PreferencesRoot" value="net/sf/genuine/example/crm/"/>
       <propertyset key="PreferencesPages">
         <propertysetvalue value="net.sf.genuine.preferences.general.AppearancePreferencesPage"/>
       <menu id="">
         <menuitem id="preferences" separator="infront"/>
       <service interface="net.sf.genuine.preferences.PreferencesService"/>
       <visualcomponent id="preferences.component" modal="true">
         <size width="600" height="400"/>

Both of the two properties shown in the example are mandatory:

Genuine supplies some preferences pages of its own that may be added to every application as it is done in the example above. These preferences pages are:

Genuine uses the default preferences storage mechanism of the Java plattform. In order to use a different preference storage mechanism, you need to set up this mechanism in your own application. You may create a sub class of this module in which you may set it up before you call the initialize method of this module.

See Also:
PreferencesService, PreferencesPage

Constructor Summary
Method Summary
 VisualComponent createVisualComponent(java.lang.String componentId, java.lang.String instanceId)
          Creates the preferences component.
 void initialize(java.lang.String moduleId, ModuleManager moduleManager, java.util.Map properties)
          Initializes both the service and the dialog.
Methods inherited from class net.sf.genuine.organizer.AbstractModule
getAction, getComponentManager, getHelperService, getId, getMessageBus, getModuleManager, getProperty, getService, getServiceBroker, postInitialize, registerAction, registerService
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public PreferencesModule()
Method Detail


public void initialize(java.lang.String moduleId,
                       ModuleManager moduleManager,
                       java.util.Map properties)
                throws ConfigurationException
Initializes both the service and the dialog. The properties map contains those properties that have been set in the application configuration file.

Specified by:
initialize in interface Module
initialize in class AbstractModule


public VisualComponent createVisualComponent(java.lang.String componentId,
                                             java.lang.String instanceId)
                                      throws ConfigurationException
Creates the preferences component.

Specified by:
createVisualComponent in interface Module
createVisualComponent in class AbstractModule