1 package net.sourceforge.phpeclipse.xdebug.core;
3 import net.sourceforge.phpeclipse.xdebug.php.launching.IXDebugConstants;
5 import org.eclipse.core.resources.IWorkspace;
6 import org.eclipse.core.resources.ResourcesPlugin;
7 import org.eclipse.core.runtime.IStatus;
8 import org.eclipse.core.runtime.Status;
9 import org.eclipse.debug.core.DebugPlugin;
10 import org.eclipse.debug.core.IBreakpointManager;
11 import org.eclipse.debug.core.model.IBreakpoint;
12 import org.eclipse.jface.resource.ImageDescriptor;
13 import org.eclipse.ui.plugin.AbstractUIPlugin;
14 import org.osgi.framework.BundleContext;
17 * The main plugin class to be used in the desktop.
19 public class XDebugCorePlugin extends AbstractUIPlugin {
21 // The shared instance.
22 private static XDebugCorePlugin plugin;
24 public static final String PLUGIN_ID = "net.sourceforge.phpeclipse.xdebug.core"; //$NON-NLS-1$
29 public XDebugCorePlugin() {
34 * This method is called upon plug-in activation
36 public void start(BundleContext context) throws Exception {
41 * This method is called when the plug-in is stopped
43 public void stop(BundleContext context) throws Exception {
49 * Returns the shared instance.
51 public static XDebugCorePlugin getDefault() {
55 public static IBreakpoint[] getBreakpoints() {
56 return getBreakpointManager().getBreakpoints(
57 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 plug-in
70 * @return the image descriptor
72 public static ImageDescriptor getImageDescriptor(String path) {
73 return AbstractUIPlugin.imageDescriptorFromPlugin(
74 "net.sourceforge.phpeclipse.xdebug.core", path);
77 public static void log(int severity, String message) {
78 Status status = new Status(severity, PLUGIN_ID, IStatus.OK, message,
80 XDebugCorePlugin.log(status);
83 public static void log(IStatus status) {
84 getDefault().getLog().log(status);
87 public static void log(Throwable e) {
88 log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR,
89 "PHPLaunchingPlugin.internalErrorOccurred", e)); //$NON-NLS-1$
93 * Returns the workspace instance.
95 public static IWorkspace getWorkspace() {
96 return ResourcesPlugin.getWorkspace();