latest quantum sources 2.3.2
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / preferences / GlobalPreferences.java
1 package com.quantum.preferences;
2
3
4 import com.quantum.Messages;
5 import com.quantum.QuantumPlugin;
6
7 import org.eclipse.jface.preference.FieldEditorPreferencePage;
8 import org.eclipse.jface.preference.IPreferenceStore;
9 import org.eclipse.jface.preference.IntegerFieldEditor;
10 import org.eclipse.ui.IWorkbench;
11 import org.eclipse.ui.IWorkbenchPreferencePage;
12
13 /**
14  * PreferencePage for the global options on QuantumDB
15  * @author panic
16  *
17  */
18 public class GlobalPreferences 
19 extends FieldEditorPreferencePage 
20 implements IWorkbenchPreferencePage {
21
22         public GlobalPreferences() {
23                 super(FieldEditorPreferencePage.GRID);
24                 
25                 // Set the preference store for the preference page.
26                 IPreferenceStore store =
27                         QuantumPlugin.getDefault().getPreferenceStore();
28                 setPreferenceStore(store);
29         }
30
31         public void init(IWorkbench workbench) {
32                 this.workbench = workbench;
33         }
34
35         IWorkbench workbench;
36                 
37         protected void createFieldEditors() {
38         IntegerFieldEditor queryHistorySize = new IntegerFieldEditor(
39             "com.quantum.model.Bookmark.queryHistorySize", 
40             Messages.getString(getClass().getName() + "." 
41                 + "com.quantum.model.Bookmark.queryHistorySize"), 
42             getFieldEditorParent());
43         queryHistorySize.setValidRange(0, Integer.MAX_VALUE);
44         this.addField(queryHistorySize);
45         }
46 }