added button to start tests.
[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.jface.preference.StringFieldEditor;
11 import org.eclipse.ui.IWorkbench;
12 import org.eclipse.ui.IWorkbenchPreferencePage;
13
14 /**
15  * PreferencePage for the global options on QuantumDB
16  * @author panic
17  *
18  */
19 public class GlobalPreferences 
20 extends FieldEditorPreferencePage 
21 implements IWorkbenchPreferencePage {
22
23         public GlobalPreferences() {
24                 super(FieldEditorPreferencePage.GRID);
25                 
26                 // Set the preference store for the preference page.
27                 IPreferenceStore store =
28                         QuantumPlugin.getDefault().getPreferenceStore();
29                 setPreferenceStore(store);
30         }
31
32         public void init(IWorkbench workbench) {
33                 this.workbench = workbench;
34         }
35
36         IWorkbench workbench;
37                 
38         protected void createFieldEditors() {
39         IntegerFieldEditor queryHistorySize = new IntegerFieldEditor(
40             "com.quantum.model.Bookmark.queryHistorySize", 
41             Messages.getString(getClass().getName() + "." 
42                 + "com.quantum.model.Bookmark.queryHistorySize"), 
43             getFieldEditorParent());
44         queryHistorySize.setValidRange(0, Integer.MAX_VALUE);
45         this.addField(queryHistorySize);
46                 StringFieldEditor askPasswordString = new StringFieldEditor("askPasswordString", "&Ask for password string:", getFieldEditorParent());
47                 this.addField(askPasswordString);
48         }
49 }