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