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