Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/port80/eclipse/jdt/preferences/JdtPreferencePage.java


1   package com.port80.eclipse.jdt.preferences;
2   
3   import org.eclipse.jface.preference.BooleanFieldEditor;
4   import org.eclipse.jface.preference.FieldEditorPreferencePage;
5   import org.eclipse.jface.preference.IntegerFieldEditor;
6   import org.eclipse.ui.IWorkbench;
7   import org.eclipse.ui.IWorkbenchPreferencePage;
8   
9   import com.port80.eclipse.jdt.IConstants;
10  import com.port80.eclipse.jdt.JdtPlugin;
11  import com.port80.eclipse.util.SeparatorFieldEditor;
12  
13  /**
14   * This class represents a preference page that
15   * is contributed to the Preferences dialog. By 
16   * subclassing <samp>FieldEditorPreferencePage</samp>, we
17   * can use the field support built into JFace that allows
18   * us to create a page that is small and knows how to 
19   * save, restore and apply itself.
20   * <p>
21   * This page is used to modify preferences only. They
22   * are stored in the preference store that belongs to
23   * the main plug-in class. That way, preferences can
24   * be accessed directly via the preference store.
25   */
26  
27  public class JdtPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
28  
29    public JdtPreferencePage() {
30      super(GRID);
31      setPreferenceStore(JdtPlugin.getDefault().getPreferenceStore());
32      // setDescription(JdtPlugin.getString("Preferences.desc"));
33      initializeDefaults();
34    }
35  
36    /**
37     * Sets the default values of the preferences.
38     */
39  
40    private void initializeDefaults() {
41    }
42  
43    /**
44     * Creates the field editors. Field editors are abstractions of
45     * the common GUI blocks needed to manipulate various types
46     * of preferences. Each field editor knows how to save and
47     * restore itself.
48     */
49  
50    public void createFieldEditors() {
51      addField(
52        new IntegerFieldEditor(
53          IConstants.PREF_EDITOR_HISTORY_VISITED_SIZE,
54          JdtPlugin.getString("EditorHistory.visited.size"),
55          getFieldEditorParent()));
56      addField(
57        new IntegerFieldEditor(
58          IConstants.PREF_EDITOR_HISTORY_SIZE,
59          JdtPlugin.getString("EditorHistory.size"),
60          getFieldEditorParent()));
61      addField(
62        new SeparatorFieldEditor(
63          "",
64          JdtPlugin.getString("EditorHistory.size.change.warning"),
65          getFieldEditorParent()));
66      addField(new SeparatorFieldEditor("", "", getFieldEditorParent()));
67      addField(
68        new IntegerFieldEditor(
69          IConstants.PREF_ANNOTATIONVIEW_INBOX_LIMIT,
70          JdtPlugin.getString("AnnotationView.inbox.limit"),
71          getFieldEditorParent()));
72      addField(new SeparatorFieldEditor("", "", getFieldEditorParent()));
73      addField(
74        new BooleanFieldEditor(
75          IConstants.PREF_METHODVIEW_SYNC_FROM_EDITOR,
76          JdtPlugin.getString("MethodView.sync.from.editor"),
77          getFieldEditorParent()));
78      addField(new SeparatorFieldEditor("", "", getFieldEditorParent()));
79    }
80  
81    public void init(IWorkbench workbench) {
82    }
83  }