getting the path to phpunit from a preference page. added icons to progressComposite
[phpeclipse.git] / net.sourceforge.phpeclipse.phpunit / src / net / sourceforge / phpeclipse / phpunit / PHPUnitPlugin.java
index e3873a4..fb89999 100644 (file)
@@ -6,15 +6,13 @@
  */
 package net.sourceforge.phpeclipse.phpunit;
 
-import java.net.MalformedURLException;
-import java.net.URL;
 import java.util.ResourceBundle;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPluginDescriptor;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.dialogs.IDialogSettings;
 import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.resource.ImageRegistry;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
@@ -31,21 +29,42 @@ public class PHPUnitPlugin extends AbstractUIPlugin {
 
        private static PHPUnitPlugin plugin;
        private ResourceBundle resourceBundle;
-
+       public static final String PLUGIN_ID= "net.sourceforge.phpeclipse.phpunit"; //$NON-NLS-1$
 
        /**
         * @param descriptor
         */
        public PHPUnitPlugin(IPluginDescriptor descriptor) {
+               
                super(descriptor);
                
-               plugin = this;
-
+               System.out.println("desc: "  + descriptor.getInstallURL());
+                               
+               
+               plugin= this;
+               
+               
+               String pathSuffix= "icons/"; //$NON-NLS-1$
+               
+               System.out.println("" + Platform.getLocation());
+               
+               System.out.println("" + Platform.getPluginStateLocation(plugin));
+               
+               System.out.println("" + Platform.getLogFileLocation());
+               
+               
                
        
                
        }
 
+       public String getPath() {
+               return plugin.getDescriptor().getInstallURL().getFile();
+       }
+
+       
+
        public static PHPUnitPlugin getDefault() {
                return plugin;
        }
@@ -158,25 +177,6 @@ public class PHPUnitPlugin extends AbstractUIPlugin {
                super.startup();
        }
 
-       /**
-        * @param string
-        */
-       public static ImageDescriptor getImageDescriptor(String name) {
-               
-               String iconPath = "icons/";
-               try {
-                       URL installURL = getDefault().getDescriptor().getInstallURL();
-                       URL url = new URL(installURL, iconPath + name);
-                       
-                       System.out.println("url:" + url.toExternalForm());
-                       
-                       return ImageDescriptor.createFromURL(url);
-               } catch (MalformedURLException e) {
-                       // should not happen
-                       return ImageDescriptor.getMissingImageDescriptor();
-               }               
-               
-               
-       }
+
 
 }