8e08bc4da5af2ec3c4a9abe501a4ef0bc180de04
[phpeclipse.git] /
1 /**
2  * 
3  */
4 package net.sourceforge.phpeclipse.xdebug.php.model;
5
6
7
8 import net.sourceforge.phpeclipse.xdebug.php.launching.IXDebugConstants;
9
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;
19
20 /**
21  * @author Christian
22  *
23  */
24 public class XDebugElement extends PlatformObject implements IDebugElement {
25                 
26         // containing target 
27         private XDebugTarget fTarget;
28         
29         /**
30          * Constructs a new debug element contained in the given
31          * debug target.
32          * 
33          * @param target debug target (PDA VM)
34          */
35         public XDebugElement(XDebugTarget target) {
36                 fTarget = target;
37         }
38         
39         public XDebugElement() {
40                 fTarget = null;
41         }
42         
43         /* (non-Javadoc)
44          * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
45          */
46         public String getModelIdentifier() {
47                 return IXDebugConstants.ID_PHP_DEBUG_MODEL;
48         }
49         /* (non-Javadoc)
50          * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
51          */
52         public IDebugTarget getDebugTarget() {
53                 return fTarget;
54         }
55         
56         /* (non-Javadoc)
57          * @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
58          */
59         public ILaunch getLaunch() {
60                 return getDebugTarget().getLaunch();
61         }
62         /* (non-Javadoc)
63          * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
64          */
65         public Object getAdapter(Class adapter) {
66                 if (adapter == IDebugElement.class) {
67                         return this;
68                 }
69                 return super.getAdapter(adapter);
70         }
71         
72         //protected void abort(String message, Throwable e) throws DebugException {
73 /*      Axel auskommentiert
74                 throw new DebugException(new Status(IStatus.ERROR, DebugExamplesPlugin.getDefault().getDescriptor().getUniqueIdentifier(), 
75                                 DebugPlugin.INTERNAL_ERROR, message, e));
76 */
77                 //}
78         
79         /**
80          * Fires a debug event
81          * 
82          * @param event the event to be fired
83          */
84 //      protected void fireEvent(DebugEvent event) {
85 //              DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event});
86 //      }
87         
88         /**
89          * Fires a <code>CREATE</code> event for this element.
90          */
91 //      public void fireCreationEvent() {
92 //              fireEvent(new DebugEvent(this, DebugEvent.CREATE));
93 //      }       
94         
95         /**
96          * Fires a <code>RESUME</code> event for this element with
97          * the given detail.
98          * 
99          * @param detail event detail code
100          */
101 //      public void fireResumeEvent(int detail) {
102 //              fireEvent(new DebugEvent(this, DebugEvent.RESUME, detail));
103 //      }
104
105         /**
106          * Fires a <code>SUSPEND</code> event for this element with
107          * the given detail.
108          * 
109          * @param detail event detail code
110          */
111 //      public void fireSuspendEvent(int detail) {
112 //              fireEvent(new DebugEvent(this, DebugEvent.SUSPEND, detail));
113 //      }
114         
115         /**
116          * Fires a <code>TERMINATE</code> event for this element.
117          */
118 //      protected void fireTerminateEvent() {
119 //              fireEvent(new DebugEvent(this, DebugEvent.TERMINATE));
120 //      }       
121 }