removing nasty hack to keep the error page from displaying. Scorphus has applied...
[phpeclipse.git] / net.sourceforge.phpeclipse.phpunit / src / net / sourceforge / phpeclipse / phpunit / preferences / PHPUnitPreferencePage.java
1 /*************************************************************************
2  * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
3  *
4  * Plugin for PHP unit Testing.
5  * www.phpeclipse.de
6  * 
7  *************************************************************************/
8
9 package net.sourceforge.phpeclipse.phpunit.preferences;
10
11 import net.sourceforge.phpeclipse.phpunit.PHPUnitPlugin;
12
13 import org.eclipse.jface.preference.DirectoryFieldEditor;
14 import org.eclipse.jface.preference.FieldEditorPreferencePage;
15 import org.eclipse.jface.preference.IPreferenceStore;
16 import org.eclipse.ui.IWorkbench;
17 import org.eclipse.ui.IWorkbenchPreferencePage;
18
19 /**
20  * This class represents a preference page that is contributed to the
21  * Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>,
22  * we can use the field support built into JFace that allows us to create a page
23  * that is small and knows how to save, restore and apply itself.
24  * <p>
25  * This page is used to modify preferences only. They are stored in the
26  * preference store that belongs to the main plug-in class. That way,
27  * preferences can be accessed directly via the preference store.
28  */
29
30 public class PHPUnitPreferencePage extends FieldEditorPreferencePage implements
31                 IWorkbenchPreferencePage {
32
33         public static final String PHPUNIT_PATH = "PHPUnitPathPreference";
34
35         public PHPUnitPreferencePage() {
36                 super(GRID);
37                 setPreferenceStore(PHPUnitPlugin.getDefault().getPreferenceStore());
38                 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. ");
39                 initializeDefaults();
40         }
41
42         /**
43          * Sets the default values of the preferences.
44          */
45         private void initializeDefaults() {
46                 IPreferenceStore store = getPreferenceStore();
47
48         }
49
50         /**
51          * Creates the field editors. Field editors are abstractions of the common
52          * GUI blocks needed to manipulate various types of preferences. Each field
53          * editor knows how to save and restore itself.
54          */
55
56         public void createFieldEditors() {
57
58                 addField(new DirectoryFieldEditor(PHPUNIT_PATH, "&PHPUnit Path:",
59                                 getFieldEditorParent()));
60
61         }
62
63         public void init(IWorkbench workbench) {
64
65         }
66 }