Skip Navigation

Contributing to Preference Pages

The org.eclipse.ui.preferencePages extension point allows you to contribute pages to the general preferences (Window > Preferences) dialog. The preferences dialog presents a hierarchical list of user preference entries. Each entry displays a corresponding preference page when selected.

A Red App is allowed to contribute to standard preference pages only in com.sabre.edge.cf.core.preferences.RedAppsSettings category or in its own categories defined in the same plug-in. It is strongly recommended to use the bundle name of your main plug-in as the page ID prefix. The preference page will be added to Red App Settings branch of the preference tree.

<extension point="org.eclipse.ui.preferencePages"> <page category="com.sabre.edge.cf.core.preferences.RedAppsSettings" class="com.sabre.redapp.example.editor.basic.settings.EditorSettings" id="com.sabre.redapp.example.editor.basic.EditorSettingsExample" name="Editor Settings Example" icon="images/sample_icon.png"> </page> </extension>

This markup defines a preference page named "Editor Settings Example" which is implemented by the class com.sabre.redapp.example.editor.basic.settings.EditorSettings.

The class must implement the IWorkbenchPreferencePage interface. The content of a page is defined by implementing a createContents() method that creates the SWT controls representing the page content.

The primary responsibility of a preference page is to retrieve display and save preferences. The page should override the doGetPreferenceStore() method to return a preference store for storing their values and react to the performOk, performDefaults and performApply messages performing actions accordingly.

More information about how to implement preference page can be found here: Implementing_a_preference_page.

Refer to com.sabre.redapp.example.editor.basic Sample for the example implementation of preference page in a Red App.