1 package net.sourceforge.phpeclipse.phpunit.preferences;
3 import org.eclipse.jface.preference.*;
4 import org.eclipse.ui.IWorkbenchPreferencePage;
5 import org.eclipse.ui.IWorkbench;
6 import net.sourceforge.phpeclipse.phpunit.PHPUnitPlugin;
7 import org.eclipse.jface.preference.IPreferenceStore;
10 * This class represents a preference page that
11 * is contributed to the Preferences dialog. By
12 * subclassing <samp>FieldEditorPreferencePage</samp>, we
13 * can use the field support built into JFace that allows
14 * us to create a page that is small and knows how to
15 * save, restore and apply itself.
17 * This page is used to modify preferences only. They
18 * are stored in the preference store that belongs to
19 * the main plug-in class. That way, preferences can
20 * be accessed directly via the preference store.
23 public class PHPUnitPreferencePage
24 extends FieldEditorPreferencePage
25 implements IWorkbenchPreferencePage {
28 public static final String PHPUNIT_PATH = "PHPUnitPathPreference";
31 public PHPUnitPreferencePage() {
33 setPreferenceStore(PHPUnitPlugin.getDefault().getPreferenceStore());
34 setDescription("Please browse for the folder containing the PHPUnit files (among them: \"phpunit.php\" and \"socketTestResult.php\"). If you don't have it, please download the latest version from http://sourceforge.net/projects/phpunit/ first. ");
38 * Sets the default values of the preferences.
40 private void initializeDefaults() {
41 IPreferenceStore store = getPreferenceStore();
46 * Creates the field editors. Field editors are abstractions of
47 * the common GUI blocks needed to manipulate various types
48 * of preferences. Each field editor knows how to save and
52 public void createFieldEditors() {
54 addField(new DirectoryFieldEditor(PHPUNIT_PATH,
55 "&PHPUnit Path:", getFieldEditorParent()));
61 public void init(IWorkbench workbench) {