1
/*******************************************************************************
2
* Copyright (C) 2003-2004, 2013, Guillaume Brocker
4
* All rights reserved. This program and the accompanying materials
5
* are made available under the terms of the Eclipse Public License v1.0
6
* which accompanies this distribution, and is available at
7
* http://www.eclipse.org/legal/epl-v10.html
10
* Guillaume Brocker - Initial API and implementation
12
******************************************************************************/
16
import org.eclipse.jface.preference.BooleanFieldEditor;
17
import org.eclipse.jface.preference.IntegerFieldEditor;
18
import org.eclipse.jface.preference.RadioGroupFieldEditor;
19
import org.eclipse.swt.widgets.Composite;
20
import org.eclipse.ui.IWorkbench;
21
import org.eclipse.ui.IWorkbenchPreferencePage;
25
* Implements the plugin preference page.
29
public class PreferencePage extends org.eclipse.jface.preference.FieldEditorPreferencePage implements IWorkbenchPreferencePage
34
public PreferencePage() {
38
public void init( IWorkbench workbench ) {
39
setPreferenceStore( Plugin.getDefault().getPreferenceStore() );
43
* Creates the preference page fields.
45
protected void createFieldEditors() {
46
Composite rootControl = getFieldEditorParent();
48
// Create the controls.
50
BooleanFieldEditor escapeValueStrings = new BooleanFieldEditor(IPreferences.HANDLE_ESCAPED_VALUES, "Handle escapes for \" and \\ in value strings", rootControl);
51
escapeValueStrings.setPreferenceStore( getPreferenceStore() );
52
addField( escapeValueStrings );
54
IntegerFieldEditor historySize = new IntegerFieldEditor(IPreferences.BUILD_HISTORY_SIZE, "Build history size:", rootControl);
55
historySize.setPreferenceStore( getPreferenceStore() );
56
historySize.setValidRange( 1, 100 );
57
addField( historySize );
59
RadioGroupFieldEditor autoSave = new RadioGroupFieldEditor(
60
IPreferences.AUTO_SAVE,
61
"Save all modified files before building",
64
{IPreferences.AUTO_SAVE_NEVER, IPreferences.AUTO_SAVE_NEVER},
65
{IPreferences.AUTO_SAVE_ALWAYS, IPreferences.AUTO_SAVE_ALWAYS},
66
{IPreferences.AUTO_SAVE_ASK, IPreferences.AUTO_SAVE_ASK},
70
autoSave.setPreferenceStore( getPreferenceStore() );