4 package net.sourceforge.phpeclipse.xdebug.php.model;
7 import net.sourceforge.phpeclipse.xdebug.core.ResponseData;
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) {
38 * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
40 public String getModelIdentifier() {
41 return IXDebugConstants.ID_PHP_DEBUG_MODEL;
44 * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
46 public IDebugTarget getDebugTarget() {
50 * @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
52 public ILaunch getLaunch() {
53 return getDebugTarget().getLaunch();
56 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
58 public Object getAdapter(Class adapter) {
59 if (adapter == IDebugElement.class) {
62 return super.getAdapter(adapter);
65 protected void abort(String message, Throwable e) throws DebugException {
66 /* Axel auskommentiert
67 throw new DebugException(new Status(IStatus.ERROR, DebugExamplesPlugin.getDefault().getDescriptor().getUniqueIdentifier(),
68 DebugPlugin.INTERNAL_ERROR, message, e));
75 * @param event the event to be fired
77 protected void fireEvent(DebugEvent event) {
78 DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event});
82 * Fires a <code>CREATE</code> event for this element.
84 public void fireCreationEvent() {
85 fireEvent(new DebugEvent(this, DebugEvent.CREATE));
89 * Fires a <code>RESUME</code> event for this element with
92 * @param detail event detail code
94 public void fireResumeEvent(int detail) {
95 fireEvent(new DebugEvent(this, DebugEvent.RESUME, detail));
99 * Fires a <code>SUSPEND</code> event for this element with
102 * @param detail event detail code
104 public void fireSuspendEvent(int detail) {
105 fireEvent(new DebugEvent(this, DebugEvent.SUSPEND, detail));
109 * Fires a <code>TERMINATE</code> event for this element.
111 protected void fireTerminateEvent() {
112 fireEvent(new DebugEvent(this, DebugEvent.TERMINATE));
115 public void fireDebugResponseEvent(ResponseData data) {
116 DebugEvent de=new DebugEvent(this, DebugEvent.MODEL_SPECIFIC);