1 package com.quantum.preferences;
4 import com.quantum.Messages;
5 import com.quantum.QuantumPlugin;
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;
15 * PreferencePage for the global options on QuantumDB
19 public class GlobalPreferences
20 extends FieldEditorPreferencePage
21 implements IWorkbenchPreferencePage {
23 public GlobalPreferences() {
24 super(FieldEditorPreferencePage.GRID);
26 // Set the preference store for the preference page.
27 IPreferenceStore store =
28 QuantumPlugin.getDefault().getPreferenceStore();
29 setPreferenceStore(store);
32 public void init(IWorkbench workbench) {
33 this.workbench = workbench;
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);