X-Git-Url: http://git.phpeclipse.com 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 4efdb76..8e080dd 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 @@ -18,16 +18,19 @@ import org.osgi.framework.BundleContext; * The main plugin class to be used in the desktop. */ public class PHPDebugCorePlugin extends AbstractUIPlugin { - // The shared instance. + // The shared instance. protected static PHPDebugCorePlugin plugin; + public static final String PLUGIN_ID = "net.sourceforge.phpeclipse.debug.core"; //$NON-NLS-1$ - + public static IWorkbenchPage getActivePage() { return getDefault().internalGetActivePage(); } + public static Shell getActiveWorkbenchShell() { return getActiveWorkbenchWindow().getShell(); } + public static IWorkbenchWindow getActiveWorkbenchWindow() { return getDefault().getWorkbench().getActiveWorkbenchWindow(); } @@ -36,19 +39,20 @@ public class PHPDebugCorePlugin extends AbstractUIPlugin { * Returns the shared instance. */ public static PHPDebugCorePlugin getDefault() { - return plugin; + return plugin; } - + public static String getFormattedMessage(String key, String arg) { String text = getResourceString(key); return java.text.MessageFormat.format(text, new Object[] { arg }); } + public static String getResourceString(String key) { ResourceBundle bundle = plugin.getResourceBundle(); if (bundle != null) { try { String bundleString = bundle.getString(key); - //return "$"+bundleString; + // return "$"+bundleString; return bundleString; } catch (MissingResourceException e) { // default actions is to return key, which is OK @@ -70,10 +74,11 @@ public class PHPDebugCorePlugin extends AbstractUIPlugin { public static IWorkspace getWorkspace() { return PHPeclipsePlugin.getWorkspace(); } - + public static void log(int severity, String message) { - Status status = new Status(severity, PLUGIN_ID, IStatus.OK, message, null) ; - PHPDebugCorePlugin.log(status) ; + Status status = new Status(severity, PLUGIN_ID, IStatus.OK, message, + null); + PHPDebugCorePlugin.log(status); } public static void log(IStatus status) { @@ -81,9 +86,12 @@ public class PHPDebugCorePlugin extends AbstractUIPlugin { } public static void log(Throwable e) { - log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, "PHPLaunchingPlugin.internalErrorOccurred", e)); //$NON-NLS-1$ + log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, + "PHPLaunchingPlugin.internalErrorOccurred", e)); //$NON-NLS-1$ } + private ResourceBundle resourceBundle; + /** * The constructor. */ @@ -91,30 +99,28 @@ public class PHPDebugCorePlugin extends AbstractUIPlugin { super(); plugin = this; try { - resourceBundle = - ResourceBundle.getBundle( - "net.sourceforge.phpdt.internal.debug.core.debugresources"); //$NON-NLS-1$ + resourceBundle = ResourceBundle + .getBundle("net.sourceforge.phpdt.internal.debug.core.debugresources"); //$NON-NLS-1$ } catch (MissingResourceException x) { resourceBundle = null; } - } - + } + public java.util.ResourceBundle getResourceBundle() { return resourceBundle; } - + private IWorkbenchPage internalGetActivePage() { return getWorkbench().getActiveWorkbenchWindow().getActivePage(); } - + /** * @see Plugin#shutdown() */ -/* public void shutdown() throws CoreException { - plugin = null; - super.shutdown(); - } -*/ + /* + * public void shutdown() throws CoreException { plugin = null; + * super.shutdown(); } + */ /** * This method is called upon plug-in activation */ @@ -126,7 +132,7 @@ public class PHPDebugCorePlugin extends AbstractUIPlugin { * This method is called when the plug-in is stopped */ public void stop(BundleContext context) throws Exception { - plugin=null; + plugin = null; super.stop(context); } }