getting the path to phpunit from a preference page. added icons to progressComposite
[phpeclipse.git] / net.sourceforge.phpeclipse.phpunit / src / net / sourceforge / phpeclipse / phpunit / preferences / PHPUnitPreferencePage.java
diff --git a/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/preferences/PHPUnitPreferencePage.java b/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/preferences/PHPUnitPreferencePage.java
new file mode 100644 (file)
index 0000000..f2d2a1d
--- /dev/null
@@ -0,0 +1,64 @@
+package net.sourceforge.phpeclipse.phpunit.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+import net.sourceforge.phpeclipse.phpunit.PHPUnitPlugin;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+/**
+ * This class represents a preference page that
+ * is contributed to the Preferences dialog. By 
+ * subclassing <samp>FieldEditorPreferencePage</samp>, we
+ * can use the field support built into JFace that allows
+ * us to create a page that is small and knows how to 
+ * save, restore and apply itself.
+ * <p>
+ * This page is used to modify preferences only. They
+ * are stored in the preference store that belongs to
+ * the main plug-in class. That way, preferences can
+ * be accessed directly via the preference store.
+ */
+
+public class PHPUnitPreferencePage
+       extends FieldEditorPreferencePage
+       implements IWorkbenchPreferencePage {
+               
+               
+       public static final String PHPUNIT_PATH = "PHPUnitPathPreference";
+
+
+       public PHPUnitPreferencePage() {
+               super(GRID);
+               setPreferenceStore(PHPUnitPlugin.getDefault().getPreferenceStore());
+               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. ");
+               initializeDefaults();
+       }
+/**
+ * Sets the default values of the preferences.
+ */
+       private void initializeDefaults() {
+               IPreferenceStore store = getPreferenceStore();
+
+       }
+       
+/**
+ * Creates the field editors. Field editors are abstractions of
+ * the common GUI blocks needed to manipulate various types
+ * of preferences. Each field editor knows how to save and
+ * restore itself.
+ */
+
+       public void createFieldEditors() {
+
+               addField(new DirectoryFieldEditor(PHPUNIT_PATH, 
+                               "&PHPUnit Path:", getFieldEditorParent()));
+                       
+
+
+       }
+       
+       public void init(IWorkbench workbench) {
+               
+       }
+}
\ No newline at end of file