1 package net.sourceforge.phpeclipse.xdebug.core;
4 import net.sourceforge.phpeclipse.xdebug.php.launching.IXDebugConstants;
6 import org.eclipse.ui.plugin.*;
7 import org.eclipse.core.resources.IWorkspace;
8 import org.eclipse.core.resources.ResourcesPlugin;
9 import org.eclipse.core.runtime.IStatus;
10 import org.eclipse.core.runtime.Status;
11 import org.eclipse.debug.core.DebugPlugin;
12 import org.eclipse.debug.core.IBreakpointManager;
13 import org.eclipse.debug.core.model.IBreakpoint;
14 import org.eclipse.jface.resource.ImageDescriptor;
15 import org.osgi.framework.BundleContext;
18 * The main plugin class to be used in the desktop.
20 public class XDebugCorePlugin extends AbstractUIPlugin {
22 //The shared instance.
23 private static XDebugCorePlugin plugin;
24 public static final String PLUGIN_ID = "net.sourceforge.phpeclipse.xdebug.core"; //$NON-NLS-1$
30 public XDebugCorePlugin() {
35 * This method is called upon plug-in activation
37 public void start(BundleContext context) throws Exception {
42 * This method is called when the plug-in is stopped
44 public void stop(BundleContext context) throws Exception {
50 * Returns the shared instance.
52 public static XDebugCorePlugin getDefault() {
56 public static IBreakpoint[] getBreakpoints() {
57 return getBreakpointManager().getBreakpoints(IXDebugConstants.ID_PHP_DEBUG_MODEL);
60 public static IBreakpointManager getBreakpointManager() {
61 return DebugPlugin.getDefault().getBreakpointManager();
65 * Returns an image descriptor for the image file at the given
66 * plug-in relative path.
68 * @param path the path
69 * @return the image descriptor
71 public static ImageDescriptor getImageDescriptor(String path) {
72 return AbstractUIPlugin.imageDescriptorFromPlugin("net.sourceforge.phpeclipse.xdebug.core", path);
75 public static void log(int severity, String message) {
76 Status status = new Status(severity, PLUGIN_ID, IStatus.OK, message, null) ;
77 XDebugCorePlugin.log(status) ;
80 public static void log(IStatus status) {
81 getDefault().getLog().log(status);
84 public static void log(Throwable e) {
85 log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, "PHPLaunchingPlugin.internalErrorOccurred", e)); //$NON-NLS-1$
89 * Returns the workspace instance.
91 public static IWorkspace getWorkspace() {
92 return ResourcesPlugin.getWorkspace();