4 package net.sourceforge.phpeclipse.xdebug.php.model;
8 import net.sourceforge.phpeclipse.xdebug.php.launching.IXDebugConstants;
10 //import org.eclipse.core.runtime.CoreException;
11 import org.eclipse.core.runtime.PlatformObject;
12 import org.eclipse.debug.core.DebugEvent;
13 import org.eclipse.debug.core.DebugException;
14 import org.eclipse.debug.core.DebugPlugin;
15 import org.eclipse.debug.core.ILaunch;
16 import org.eclipse.debug.core.model.IDebugElement;
17 import org.eclipse.debug.core.model.IDebugTarget;
18 //import org.eclipse.debug.core.model.IVariable;
24 public class XDebugElement extends PlatformObject implements IDebugElement {
27 protected XDebugTarget fTarget;
30 * Constructs a new debug element contained in the given
33 * @param target debug target (PDA VM)
35 public XDebugElement(XDebugTarget target) {
39 public XDebugElement() {
44 * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
46 public String getModelIdentifier() {
47 return IXDebugConstants.ID_PHP_DEBUG_MODEL;
50 * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
52 public IDebugTarget getDebugTarget() {
56 public void setDebugTarget(XDebugTarget target) {
61 * @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
63 public ILaunch getLaunch() {
64 return getDebugTarget().getLaunch();
67 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
69 public Object getAdapter(Class adapter) {
70 if (adapter == IDebugElement.class) {
73 return super.getAdapter(adapter);
76 protected void abort(String message, Throwable e) throws DebugException {
77 /* Axel auskommentiert
78 throw new DebugException(new Status(IStatus.ERROR, DebugExamplesPlugin.getDefault().getDescriptor().getUniqueIdentifier(),
79 DebugPlugin.INTERNAL_ERROR, message, e));
86 * @param event the event to be fired
88 protected void fireEvent(DebugEvent event) {
89 DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event});
93 * Fires a <code>CREATE</code> event for this element.
95 public void fireCreationEvent() {
96 fireEvent(new DebugEvent(this, DebugEvent.CREATE));
100 * Fires a <code>RESUME</code> event for this element with
103 * @param detail event detail code
105 public void fireResumeEvent(int detail) {
106 fireEvent(new DebugEvent(this, DebugEvent.RESUME, detail));
110 * Fires a <code>SUSPEND</code> event for this element with
113 * @param detail event detail code
115 public void fireSuspendEvent(int detail) {
116 fireEvent(new DebugEvent(this, DebugEvent.SUSPEND, detail));
120 * Fires a <code>TERMINATE</code> event for this element.
122 protected void fireTerminateEvent() {
123 fireEvent(new DebugEvent(this, DebugEvent.TERMINATE));