1 /*************************************************************************
2 * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
4 * Plugin for PHP unit Testing.
7 *************************************************************************/
10 package net.sourceforge.phpeclipse.phpunit.preferences;
12 import org.eclipse.jface.preference.*;
13 import org.eclipse.ui.IWorkbenchPreferencePage;
14 import org.eclipse.ui.IWorkbench;
15 import net.sourceforge.phpeclipse.phpunit.PHPUnitPlugin;
16 import org.eclipse.jface.preference.IPreferenceStore;
19 * This class represents a preference page that
20 * is contributed to the Preferences dialog. By
21 * subclassing <samp>FieldEditorPreferencePage</samp>, we
22 * can use the field support built into JFace that allows
23 * us to create a page that is small and knows how to
24 * save, restore and apply itself.
26 * This page is used to modify preferences only. They
27 * are stored in the preference store that belongs to
28 * the main plug-in class. That way, preferences can
29 * be accessed directly via the preference store.
32 public class PHPUnitPreferencePage
33 extends FieldEditorPreferencePage
34 implements IWorkbenchPreferencePage {
37 public static final String PHPUNIT_PATH = "PHPUnitPathPreference";
40 public PHPUnitPreferencePage() {
42 setPreferenceStore(PHPUnitPlugin.getDefault().getPreferenceStore());
43 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. ");
47 * Sets the default values of the preferences.
49 private void initializeDefaults() {
50 IPreferenceStore store = getPreferenceStore();
55 * Creates the field editors. Field editors are abstractions of
56 * the common GUI blocks needed to manipulate various types
57 * of preferences. Each field editor knows how to save and
61 public void createFieldEditors() {
63 addField(new DirectoryFieldEditor(PHPUNIT_PATH,
64 "&PHPUnit Path:", getFieldEditorParent()));
70 public void init(IWorkbench workbench) {