4 package net.sourceforge.phpeclipse.xdebug.php.model;
6 import net.sourceforge.phpeclipse.xdebug.core.ResponseData;
7 import net.sourceforge.phpeclipse.xdebug.php.launching.IXDebugConstants;
9 import org.eclipse.core.runtime.PlatformObject;
10 import org.eclipse.debug.core.DebugEvent;
11 import org.eclipse.debug.core.DebugException;
12 import org.eclipse.debug.core.DebugPlugin;
13 import org.eclipse.debug.core.ILaunch;
14 import org.eclipse.debug.core.model.IDebugElement;
15 import org.eclipse.debug.core.model.IDebugTarget;
21 public class XDebugElement extends PlatformObject implements IDebugElement {
24 protected XDebugTarget fTarget;
27 * Constructs a new debug element contained in the given debug target.
30 * debug target (PDA VM)
32 public XDebugElement(XDebugTarget target) {
39 * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
41 public String getModelIdentifier() {
42 return IXDebugConstants.ID_PHP_DEBUG_MODEL;
48 * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
50 public IDebugTarget getDebugTarget() {
57 * @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
59 public ILaunch getLaunch() {
60 return getDebugTarget().getLaunch();
66 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
68 public Object getAdapter(Class adapter) {
69 if (adapter == IDebugElement.class) {
72 return super.getAdapter(adapter);
75 protected void abort(String message, Throwable e) throws DebugException {
77 * Axel auskommentiert throw new DebugException(new
78 * Status(IStatus.ERROR,
79 * DebugExamplesPlugin.getDefault().getDescriptor().getUniqueIdentifier(),
80 * DebugPlugin.INTERNAL_ERROR, message, e));
88 * the event to be fired
90 protected void fireEvent(DebugEvent event) {
91 DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] { event });
95 * Fires a <code>CREATE</code> event for this element.
97 public void fireCreationEvent() {
98 fireEvent(new DebugEvent(this, DebugEvent.CREATE));
102 * Fires a <code>RESUME</code> event for this element with the given
108 public void fireResumeEvent(int detail) {
109 fireEvent(new DebugEvent(this, DebugEvent.RESUME, detail));
113 * Fires a <code>SUSPEND</code> event for this element with the given
119 public void fireSuspendEvent(int detail) {
120 fireEvent(new DebugEvent(this, DebugEvent.SUSPEND, detail));
124 * Fires a <code>TERMINATE</code> event for this element.
126 protected void fireTerminateEvent() {
127 fireEvent(new DebugEvent(this, DebugEvent.TERMINATE));
130 public void fireDebugResponseEvent(ResponseData data) {
131 DebugEvent de = new DebugEvent(this, DebugEvent.MODEL_SPECIFIC);