From fa3efb7d4eca902bfb192194659d2ca20c5f56cc Mon Sep 17 00:00:00 2001 From: fvicente Date: Wed, 30 Jul 2003 00:49:03 +0000 Subject: [PATCH] First submit for debug plugin --- net.sourceforge.phpeclipse.debug.core/.classpath | 2 +- net.sourceforge.phpeclipse.debug.core/plugin.xml | 28 ++++++++++++++- .../internal/debug/core/PHPDebugCorePlugin.java | 36 +++++++++++++++++++- 3 files changed, 62 insertions(+), 4 deletions(-) diff --git a/net.sourceforge.phpeclipse.debug.core/.classpath b/net.sourceforge.phpeclipse.debug.core/.classpath index e71a810..6798997 100644 --- a/net.sourceforge.phpeclipse.debug.core/.classpath +++ b/net.sourceforge.phpeclipse.debug.core/.classpath @@ -34,6 +34,6 @@ - + diff --git a/net.sourceforge.phpeclipse.debug.core/plugin.xml b/net.sourceforge.phpeclipse.debug.core/plugin.xml index a955c33..f2a5952 100644 --- a/net.sourceforge.phpeclipse.debug.core/plugin.xml +++ b/net.sourceforge.phpeclipse.debug.core/plugin.xml @@ -9,7 +9,7 @@ - + @@ -19,5 +19,29 @@ - + + + + + + + + + + + + + + + + + + + + + + diff --git a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDebugCorePlugin.java b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDebugCorePlugin.java index e50fad3..038c3d4 100644 --- a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDebugCorePlugin.java +++ b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDebugCorePlugin.java @@ -6,21 +6,34 @@ import org.eclipse.core.runtime.IPluginDescriptor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.*; +/** + * The main plugin class to be used in the desktop. + */ public class PHPDebugCorePlugin extends Plugin { public static final String PLUGIN_ID = "net.sourceforge.phpeclipse.debug.core"; //$NON-NLS-1$ - + // The shared instance. protected static PHPDebugCorePlugin plugin; + /** + * The constructor. + */ public PHPDebugCorePlugin(IPluginDescriptor descriptor) { super(descriptor); plugin = this; } + /** + * Returns the shared instance. + */ public static PHPDebugCorePlugin getDefault() { return plugin; } + /** + * Returns the workspace instance. + */ public static IWorkspace getWorkspace() { return PHPeclipsePlugin.getWorkspace(); } @@ -37,4 +50,25 @@ public class PHPDebugCorePlugin extends Plugin { public static void log(Throwable e) { log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, "PHPLaunchingPlugin.internalErrorOccurred", e)); //$NON-NLS-1$ } + + /** + * Convenience method which returns the unique identifier of this plugin. + */ + public static String getUniqueIdentifier() { + if (getDefault() == null) { + // If the default instance is not yet initialized, + // return a static identifier. This identifier must + // match the plugin id defined in plugin.xml + return PLUGIN_ID; + } + return getDefault().getDescriptor().getUniqueIdentifier(); + } + + /** + * @see Plugin#shutdown() + */ + public void shutdown() throws CoreException { + plugin = null; + super.shutdown(); + } } -- 1.7.1