From b8a0cf2d672f8d35a004ad25e8d8d45d73a98b2f Mon Sep 17 00:00:00 2001 From: shleh Date: Sun, 19 Sep 2004 01:07:54 +0000 Subject: [PATCH] getting the path to phpunit from a preference page. added icons to progressComposite --- net.sourceforge.phpeclipse.phpunit/icons/error.gif | Bin 0 -> 84 bytes .../icons/failure.gif | Bin 0 -> 79 bytes net.sourceforge.phpeclipse.phpunit/plugin.xml | 9 +++ .../phpeclipse/phpunit/PHPUnitImages.java | 7 ++- .../phpeclipse/phpunit/PHPUnitView.java | 7 ++- .../phpeclipse/phpunit/ProgressInfoComposite.java | 12 +++- .../phpeclipse/phpunit/actions/RunTestsAction.java | 2 +- .../phpunit/preferences/PHPUnitPreferencePage.java | 64 ++++++++++++++++++++ 8 files changed, 94 insertions(+), 7 deletions(-) create mode 100644 net.sourceforge.phpeclipse.phpunit/icons/error.gif create mode 100644 net.sourceforge.phpeclipse.phpunit/icons/failure.gif create mode 100644 net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/preferences/PHPUnitPreferencePage.java diff --git a/net.sourceforge.phpeclipse.phpunit/icons/error.gif b/net.sourceforge.phpeclipse.phpunit/icons/error.gif new file mode 100644 index 0000000000000000000000000000000000000000..8612eaff5994f2b70514365e717d6ce1597020c2 GIT binary patch literal 84 zcmZ?wbhEHbWM|-DSj52apMhb&y?wpC{r~#<{qgbl_wWA?28usf7#SGY8FUzc0Hl_I iSu$edYO{nHswagRBbYXr$%Mro6!z^}z~;)tU=0A^iW{c@ literal 0 HcmV?d00001 diff --git a/net.sourceforge.phpeclipse.phpunit/icons/failure.gif b/net.sourceforge.phpeclipse.phpunit/icons/failure.gif new file mode 100644 index 0000000000000000000000000000000000000000..d45b9709894a77214a777a6d9a260f3fd6caf89e GIT binary patch literal 79 zcmZ?wbhEHbWM|-DSj52a|NsAnhKBg~cm^;VNJ4<(PZmZ71{MY#5ErDDfmuXi^J)R5 WhHv+}{9`yZ<7b*^oSDJEU=09I>=e8J literal 0 HcmV?d00001 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 -- 1.7.1