net.sf.genuine.preferences
Class PreferencesModule

java.lang.Object
  extended bynet.sf.genuine.organizer.AbstractModule
      extended bynet.sf.genuine.preferences.PreferencesModule
All Implemented Interfaces:
Module

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">
     <properties>
       <property key="PreferencesRoot" value="net/sf/genuine/example/crm/"/>
       <propertyset key="PreferencesPages">
         <propertysetvalue value="net.sf.genuine.preferences.general.AppearancePreferencesPage"/>
       </propertyset>
     </properties>
     <menubar>
       <menu id="edit.menu">
         <menuitem id="preferences" separator="infront"/>
       </menu>
     </menubar>
     <services>
       <service interface="net.sf.genuine.preferences.PreferencesService"/>
     </services>
     <visualcomponents>
       <visualcomponent id="preferences.component" modal="true">
         <size width="600" height="400"/>
       </visualcomponent>
     </visualcomponents>
   </module>
 

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
PreferencesModule()
           
 
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

PreferencesModule

public PreferencesModule()
Method Detail

initialize

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
Overrides:
initialize in class AbstractModule
Throws:
ConfigurationException

createVisualComponent

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

Specified by:
createVisualComponent in interface Module
Overrides:
createVisualComponent in class AbstractModule
Throws:
ConfigurationException