4 package net.sourceforge.phpeclipse.xdebug.php.model;
8 import net.sourceforge.phpeclipse.xdebug.php.launching.IXDebugConstants;
10 import org.eclipse.core.runtime.PlatformObject;
11 import org.eclipse.debug.core.DebugEvent;
12 import org.eclipse.debug.core.DebugException;
13 import org.eclipse.debug.core.DebugPlugin;
14 import org.eclipse.debug.core.ILaunch;
15 import org.eclipse.debug.core.model.IDebugElement;
16 import org.eclipse.debug.core.model.IDebugTarget;
22 public class XDebugElement extends PlatformObject implements IDebugElement {
25 protected XDebugTarget fTarget;
28 * Constructs a new debug element contained in the given
31 * @param target debug target (PDA VM)
33 public XDebugElement(XDebugTarget target) {
37 public XDebugElement() {
42 * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
44 public String getModelIdentifier() {
45 return IXDebugConstants.ID_PHP_DEBUG_MODEL;
48 * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
50 public IDebugTarget getDebugTarget() {
54 public void setDebugTarget(XDebugTarget target) {
59 * @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
61 public ILaunch getLaunch() {
62 return getDebugTarget().getLaunch();
65 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
67 public Object getAdapter(Class adapter) {
68 if (adapter == IDebugElement.class) {
71 return super.getAdapter(adapter);
74 protected void abort(String message, Throwable e) throws DebugException {
75 /* Axel auskommentiert
76 throw new DebugException(new Status(IStatus.ERROR, DebugExamplesPlugin.getDefault().getDescriptor().getUniqueIdentifier(),
77 DebugPlugin.INTERNAL_ERROR, message, e));
84 * @param event the event to be fired
86 protected void fireEvent(DebugEvent event) {
87 DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event});
91 * Fires a <code>CREATE</code> event for this element.
93 public void fireCreationEvent() {
94 fireEvent(new DebugEvent(this, DebugEvent.CREATE));
98 * Fires a <code>RESUME</code> event for this element with
101 * @param detail event detail code
103 public void fireResumeEvent(int detail) {
104 fireEvent(new DebugEvent(this, DebugEvent.RESUME, detail));
108 * Fires a <code>SUSPEND</code> event for this element with
111 * @param detail event detail code
113 public void fireSuspendEvent(int detail) {
114 fireEvent(new DebugEvent(this, DebugEvent.SUSPEND, detail));
118 * Fires a <code>TERMINATE</code> event for this element.
120 protected void fireTerminateEvent() {
121 fireEvent(new DebugEvent(this, DebugEvent.TERMINATE));