From: shleh Date: Sun, 19 Sep 2004 01:07:54 +0000 (+0000) Subject: getting the path to phpunit from a preference page. added icons to progressComposite X-Git-Url: http://git.phpeclipse.com getting the path to phpunit from a preference page. added icons to progressComposite --- diff --git a/net.sourceforge.phpeclipse.phpunit/icons/error.gif b/net.sourceforge.phpeclipse.phpunit/icons/error.gif new file mode 100644 index 0000000..8612eaf Binary files /dev/null and b/net.sourceforge.phpeclipse.phpunit/icons/error.gif differ diff --git a/net.sourceforge.phpeclipse.phpunit/icons/failure.gif b/net.sourceforge.phpeclipse.phpunit/icons/failure.gif new file mode 100644 index 0000000..d45b970 Binary files /dev/null and b/net.sourceforge.phpeclipse.phpunit/icons/failure.gif differ diff --git a/net.sourceforge.phpeclipse.phpunit/plugin.xml b/net.sourceforge.phpeclipse.phpunit/plugin.xml index a86b87c..efe47a2 100644 --- a/net.sourceforge.phpeclipse.phpunit/plugin.xml +++ b/net.sourceforge.phpeclipse.phpunit/plugin.xml @@ -43,5 +43,14 @@ + + + + diff --git a/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/PHPUnitImages.java b/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/PHPUnitImages.java index 006336a..69e9756 100644 --- a/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/PHPUnitImages.java +++ b/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/PHPUnitImages.java @@ -34,8 +34,7 @@ public class PHPUnitImages { * Available cached Images in the Java plugin image registry. */ - public static final String IMG_SELECT_TEST_SUITE = - NAME_PREFIX + "tsuite.gif"; + public static final String IMG_SELECT_TEST_SUITE = NAME_PREFIX + "tsuite.gif"; public static final String IMG_RUN_TEST_SUITE = NAME_PREFIX + "start.gif"; public static final String IMG_TEST_ERROR = NAME_PREFIX + "testerr.gif"; public static final String IMG_TEST_FAILURE = NAME_PREFIX + "testfail.gif"; @@ -44,6 +43,8 @@ public class PHPUnitImages { public static final String IMG_TEST_SUITE_PASS = NAME_PREFIX + "tsuiteok.gif"; public static final String IMG_TEST_SUITE_FAILURE = NAME_PREFIX + "tsuitefail.gif"; + public static final String IMG_ERROR = NAME_PREFIX + "error.gif"; + public static final String IMG_FAILURE = NAME_PREFIX + "failure.gif"; @@ -56,6 +57,8 @@ public class PHPUnitImages { public static final ImageDescriptor DESC_TEST_SUITE_PASS = createManaged(IMG_TEST_SUITE_PASS); public static final ImageDescriptor DESC_TEST_SUITE_FAILURE = createManaged(IMG_TEST_SUITE_FAILURE); + public static final ImageDescriptor DESC_ERROR = createManaged(IMG_ERROR); + public static final ImageDescriptor DESC_FAILURE = createManaged(IMG_FAILURE); /** * Returns the image managed under the given key in this registry. * diff --git a/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/PHPUnitView.java b/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/PHPUnitView.java index e304352..765b4a9 100644 --- a/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/PHPUnitView.java +++ b/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/PHPUnitView.java @@ -7,6 +7,7 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; +import net.sourceforge.phpeclipse.phpunit.preferences.PHPUnitPreferencePage; import net.sourceforge.phpeclipse.phpunit.testpool.TestCase; import net.sourceforge.phpeclipse.phpunit.testpool.TestPool; import net.sourceforge.phpeclipse.phpunit.testpool.TestSuite; @@ -278,9 +279,11 @@ public class PHPUnitView extends ViewPart { out.write("FieldEditorPreferencePage, 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. + *

+ * 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