f2d2a1d52ade9609c20a1ef2f11f5b1154e2c1a1
[phpeclipse.git] / net.sourceforge.phpeclipse.phpunit / src / net / sourceforge / phpeclipse / phpunit / preferences / PHPUnitPreferencePage.java
1 package net.sourceforge.phpeclipse.phpunit.preferences;
2
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;
8
9 /**
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.
16  * <p>
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.
21  */
22
23 public class PHPUnitPreferencePage
24         extends FieldEditorPreferencePage
25         implements IWorkbenchPreferencePage {
26                 
27                 
28         public static final String PHPUNIT_PATH = "PHPUnitPathPreference";
29
30
31         public PHPUnitPreferencePage() {
32                 super(GRID);
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. ");
35                 initializeDefaults();
36         }
37 /**
38  * Sets the default values of the preferences.
39  */
40         private void initializeDefaults() {
41                 IPreferenceStore store = getPreferenceStore();
42
43         }
44         
45 /**
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
49  * restore itself.
50  */
51
52         public void createFieldEditors() {
53
54                 addField(new DirectoryFieldEditor(PHPUNIT_PATH, 
55                                 "&PHPUnit Path:", getFieldEditorParent()));
56                         
57
58
59         }
60         
61         public void init(IWorkbench workbench) {
62                 
63         }
64 }