package com.quantum.preferences;


import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IntegerFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

import com.quantum.Messages;
import com.quantum.QuantumPlugin;

/**
 * PreferencePage for the global options on QuantumDB
 * @author panic
 *
 */
public class GlobalPreferences 
extends FieldEditorPreferencePage 
implements IWorkbenchPreferencePage {

	public GlobalPreferences() {
		super(FieldEditorPreferencePage.GRID);
		setPreferenceStore(QuantumPlugin.getDefault().getPreferenceStore());
	}

	public void init(IWorkbench workbench) {
	}

	protected void createFieldEditors() {
        IntegerFieldEditor queryHistorySize = new IntegerFieldEditor(
            "com.quantum.model.Bookmark.queryHistorySize", 
            Messages.getString(getClass().getName() + "." 
                + "com.quantum.model.Bookmark.queryHistorySize"), 
            getFieldEditorParent());
        queryHistorySize.setValidRange(0, Integer.MAX_VALUE);
        this.addField(queryHistorySize);
	}
}