01: /*******************************************************************************
02: * Copyright (c) 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.examples.undo.preferences;
11:
12: import org.eclipse.jface.preference.*;
13: import org.eclipse.ui.IWorkbenchPreferencePage;
14: import org.eclipse.ui.IWorkbench;
15: import org.eclipse.ui.examples.undo.UndoExampleMessages;
16: import org.eclipse.ui.examples.undo.UndoPlugin;
17:
18: /**
19: * This class is used to define preferences that control how
20: * undo occurs. It demonstrates the use of preferences to configure
21: * the operation history in different ways.
22: */
23:
24: public class UndoPreferencePage extends FieldEditorPreferencePage
25: implements IWorkbenchPreferencePage {
26:
27: public UndoPreferencePage() {
28: super (GRID);
29: setPreferenceStore(UndoPlugin.getDefault().getPreferenceStore());
30: setDescription(UndoExampleMessages.UndoPreferences_Description);
31: }
32:
33: /**
34: * Creates the field editors.
35: */
36: public void createFieldEditors() {
37:
38: addField(new IntegerFieldEditor(
39: PreferenceConstants.PREF_UNDOLIMIT,
40: UndoExampleMessages.UndoPreferences_HistoryLimit,
41: getFieldEditorParent()));
42:
43: addField(new BooleanFieldEditor(
44: PreferenceConstants.PREF_SHOWDEBUG,
45: UndoExampleMessages.UndoPreferences_ShowDebug,
46: getFieldEditorParent()));
47:
48: addField(new BooleanFieldEditor(
49: PreferenceConstants.PREF_CONFIRMUNDO,
50: UndoExampleMessages.UndoPreferences_ConfirmUndo,
51: getFieldEditorParent()));
52: }
53:
54: /* (non-Javadoc)
55: * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
56: */
57: public void init(IWorkbench workbench) {
58: }
59:
60: }
|