migrated plugin from 3.0 to 3.1
[phpeclipse.git] / net.sourceforge.phpeclipse.externaltools / src / net / sourceforge / phpeclipse / externaltools / ExternalToolsPlugin.java
index 71aa940..b805a73 100644 (file)
@@ -25,7 +25,6 @@ import net.sourceforge.phpdt.externaltools.internal.registry.RefreshScopeVariabl
 import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants;
 
 import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPluginDescriptor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
@@ -40,6 +39,7 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
 
 /**
  * External tools plug-in class
@@ -70,7 +70,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin {
   public static final String APACHE_RESTART_PREF = "__apache_restart";
 
   public static final String HTTPD_CONF_PATH_PREF = "__httpd_conf_path";
-  
+
   public static final String ETC_HOSTS_PATH_PREF = "__etc_hosts_path";
   //  public static final String SHOW_OUTPUT_IN_CONSOLE = "_show_output_in_console";
 
@@ -161,7 +161,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin {
 
   /**
    * Writes the message to the plug-in's log
-   * 
+   *
    * @param message
    *          the text to write to the log
    */
@@ -177,7 +177,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin {
 
   /**
    * Returns the ImageDescriptor for the icon with the given path
-   * 
+   *
    * @return the ImageDescriptor object
    */
   public ImageDescriptor getImageDescriptor(String path) {
@@ -201,10 +201,10 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin {
     try {
       InputStream is = getDefault().openStream(new Path("prefs/default_" + operatingSystem + ".properties"));
       PropertyResourceBundle resourceBundle = new PropertyResourceBundle(is);
-      Enumeration enum = resourceBundle.getKeys();
+      Enumeration e = resourceBundle.getKeys();
       String key;
-      while (enum.hasMoreElements()) {
-        key = (String) enum.nextElement();
+      while (e.hasMoreElements()) {
+        key = (String) e.nextElement();
         store.setDefault(key, resourceBundle.getString(key));
       }
     } catch (Exception e) {
@@ -271,10 +271,11 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin {
   }
 
   /**
-   * @see org.eclipse.core.runtime.Plugin#startup()
+   * @throws Exception
+ * @see org.eclipse.core.runtime.Plugin#start(BundleContext context)
    */
-  public void startup() throws CoreException {
-    //    super.startup();
+  public void start(BundleContext context) throws Exception {
+    super.start(context);
     getStandardDisplay().asyncExec(new Runnable() {
       public void run() {
         //initialize the variable context manager
@@ -284,11 +285,12 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin {
   }
 
   /**
-   * @see org.eclipse.core.runtime.Plugin#shutdown()
+   * @throws Exception
+ * @see org.eclipse.core.runtime.Plugin#stop(BundleContext context)
    */
-  public void shutdown() throws CoreException {
-    //         super.shutdown();
+  public void stop(BundleContext context) throws Exception {
     ColorManager.getDefault().dispose();
+    super.stop(context);
   }
 
   /**