1 package net.sourceforge.phpdt.tidy.preferences;
3 import net.sourceforge.phpdt.tidy.JtidyPlugin;
4 import org.eclipse.jface.preference.BooleanFieldEditor;
5 import org.eclipse.jface.preference.FieldEditorPreferencePage;
6 import org.eclipse.jface.preference.FileFieldEditor;
7 import org.eclipse.jface.preference.IPreferenceStore;
8 import org.eclipse.ui.IWorkbench;
9 import org.eclipse.ui.IWorkbenchPreferencePage;
12 * A preference page for a simple HTML editor.
14 public class JTidyGeneralPreferences extends FieldEditorPreferencePage implements IWorkbenchPreferencePage, IPreferenceConstants {
16 public JTidyGeneralPreferences() {
17 super(FieldEditorPreferencePage.GRID);
19 // Set the preference store for the preference page.
20 IPreferenceStore store = JtidyPlugin.getDefault().getPreferenceStore();
21 setPreferenceStore(store);
25 * @see org.eclipse.jface.preference.
26 * FieldEditorPreferencePage#createFieldEditors()
28 protected void createFieldEditors() {
29 FileFieldEditor tidyConf = new FileFieldEditor(GENERAL_CONFIG_FILE, "Config file", true, getFieldEditorParent());
31 BooleanFieldEditor useConfigFile =
32 new BooleanFieldEditor(GENERAL_USE_CONFIG_FILE, "Use configurtion file", getFieldEditorParent());
33 addField(useConfigFile);
36 BooleanFieldEditor tidyMark =
37 new BooleanFieldEditor(GENERAL_TIDY_MARK, "Set Tidy signature in header", getFieldEditorParent());
40 BooleanFieldEditor showWarning =
41 new BooleanFieldEditor(GENERAL_SHOW_WARNINGS, "Show warnings", getFieldEditorParent());
42 addField(showWarning);
44 BooleanFieldEditor quiet =
45 new BooleanFieldEditor(GENERAL_QUIET, "Quiet output", getFieldEditorParent());
48 BooleanFieldEditor emacs =
49 new BooleanFieldEditor(GENERAL_EMACS, "Emacs error reporting style", getFieldEditorParent());
52 BooleanFieldEditor keepFileTimes =
53 new BooleanFieldEditor(GENERAL_KEEP_FILE_TIMES, "Keep last modified time", getFieldEditorParent());
54 addField(keepFileTimes);
58 * @see IWorkbenchPreferencePage#init
60 public void init(IWorkbench workbench) {