12.1. Creating a Preference Page
You need to contribute a preference page that will allow users to select the columns that will be visible to the Favorites product. To accomplish this, create an org.eclipse.ui.preferencePages extension in the plug-in manifest. Fortunately, Eclipse provides a wizard for creating preference pages.
Open the Favorites plugin.xml file and switch to the Extensions page. Click the Add... button to open the New Extension wizard, select org.eclipse.ui.preferencePages from the extension point list and Preference Page in the template list, and then click Next (see Figure 12-1). On the following page, modify the Page Class Name and Page Name to "FavoritesPreferencePage" and "Favorites," respectively (see Figure 12-2) and click Finish.
Figure 12-1. New Extension wizard.
Figure 12-2. Sample Preference Page wizard.
Click on the new Favorites (page) extension under the org.eclipse.ui.preferencePages extension on the Extensions page to reveal its properties. In the extension element details area, you'll see the following attributes as described in the Eclipse online help. Change the id attribute to "com.qualityeclipse.favorites.prefs.view".
If you launch the Runtime Workbench, open the workbench Preferences dialog, and select Favorites, you'll see the sample Favorites preference page created by the New Extension wizard (see Figure 12-3).
Figure 12-3. Sample Favorites preference page.