01: package net.refractions.udig.catalog.ui.preferences;
02:
03: import net.refractions.udig.catalog.CatalogPlugin;
04: import net.refractions.udig.catalog.internal.PreferenceConstants;
05: import net.refractions.udig.catalog.ui.internal.Messages;
06:
07: import org.eclipse.jface.preference.BooleanFieldEditor;
08: import org.eclipse.jface.preference.FieldEditorPreferencePage;
09: import org.eclipse.ui.IWorkbench;
10: import org.eclipse.ui.IWorkbenchPreferencePage;
11:
12: /**
13: * This class represents a preference page that
14: * is contributed to the Preferences dialog. By
15: * subclassing <samp>FieldEditorPreferencePage</samp>, we
16: * can use the field support built into JFace that allows
17: * us to create a page that is small and knows how to
18: * save, restore and apply itself.
19: * <p>
20: * This page is used to modify preferences only. They
21: * are stored in the preference store that belongs to
22: * the main plug-in class. That way, preferences can
23: * be accessed directly via the preference store.
24: */
25:
26: public class CatalogPreferencePage extends FieldEditorPreferencePage
27: implements IWorkbenchPreferencePage {
28:
29: public CatalogPreferencePage() {
30: super (GRID);
31: setPreferenceStore(CatalogPlugin.getDefault()
32: .getPreferenceStore());
33: setDescription(Messages.CatalogPreferencePage_description);
34: }
35:
36: /**
37: * Creates the field editors. Field editors are abstractions of
38: * the common GUI blocks needed to manipulate various types
39: * of preferences. Each field editor knows how to save and
40: * restore itself.
41: */
42: public void createFieldEditors() {
43: addField(new BooleanFieldEditor(PreferenceConstants.P_TEMP_FT,
44: Messages.CatalogPreferencePage_fieldName,
45: getFieldEditorParent()));
46: }
47:
48: /* (non-Javadoc)
49: * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
50: */
51: public void init(IWorkbench workbench) {
52: }
53:
54: }
|