Preferences

The workbench provides additional extension points for contributing specialized dialog pages. Preference pages allow the user to customize a plug-in by selecting values for a plug-in defined set of preferences.

Contributing a preference page

The org.jlense.uiworks.preferencePages extension point allows you to contribute pages to the workbench preferences (Tools->Options) dialog. The preferences dialog presents a hierarchical list of user preference entries. Each entry displays a corresponding preference page when selected.

JLedger uses this extension point to add the General preferences page.

<extension point="org.jlense.uiworks.preferencePages">
   <page name="General"
       class="org.jledger.ui.GeneralPreferencePage"
         id="org.jledger.ui.GeneralPreferencePage" />
</extension>

This markup defines a preference page named "General" which is implemented by the class org.jledger.ui.GeneralPreferencePage. The class must implement the IWorkbenchPreferencePage interface.

The workbench uses a PreferenceManager to keep a list of all nodes in the preference tree and their corresponding pages. This list can be initialized from information in the plug-in registry without running any plug-in code. Your plug-in's contribution to the preferences dialog is shown before any of your code is run.