Change visibility to private for net.sourceforge.phpeclipse.xdebug.php.model.XDebugEl...
[phpeclipse.git] / net.sourceforge.phpeclipse.xdebug.core / src / net / sourceforge / phpeclipse / xdebug / php / model / XDebugThread.java
index 91d1868..ed32941 100644 (file)
@@ -204,7 +204,8 @@ public class XDebugThread extends XDebugElement implements IThread, IDebugEventS
         * @see org.eclipse.debug.core.model.ISuspendResume#isSuspended()
         */
        public boolean isSuspended() {
-               return fTarget.isSuspended();
+//             return fTarget.isSuspended();
+               return getDebugTarget().isSuspended();
        }
        
        /* (non-Javadoc)
@@ -212,14 +213,14 @@ public class XDebugThread extends XDebugElement implements IThread, IDebugEventS
         */
        public void resume() throws DebugException {
                fBreakpoints=null;
-               fTarget.resume();
+               getDebugTarget().resume();
        }
        
        /* (non-Javadoc)
         * @see org.eclipse.debug.core.model.ISuspendResume#suspend()
         */
        public void suspend() throws DebugException {
-               fTarget.suspend();
+               getDebugTarget().suspend();
        }
        
        /* (non-Javadoc)
@@ -259,7 +260,7 @@ public class XDebugThread extends XDebugElement implements IThread, IDebugEventS
         */
        public void stepInto() throws DebugException {
                fBreakpoints=null;
-               fTarget.step_into();
+               ((XDebugTarget) getDebugTarget()).step_into();
        }
 
        /* (non-Javadoc)
@@ -267,7 +268,7 @@ public class XDebugThread extends XDebugElement implements IThread, IDebugEventS
         */
        public void stepOver() throws DebugException {
                fBreakpoints=null;
-               fTarget.step_over();
+               ((XDebugTarget) getDebugTarget()).step_over();
        }
 
        /* (non-Javadoc)
@@ -275,7 +276,7 @@ public class XDebugThread extends XDebugElement implements IThread, IDebugEventS
         */
        public void stepReturn() throws DebugException {
                fBreakpoints=null;
-               fTarget.step_out();
+               ((XDebugTarget) getDebugTarget()).step_out();
        }
 
        /* (non-Javadoc)
@@ -296,7 +297,7 @@ public class XDebugThread extends XDebugElement implements IThread, IDebugEventS
         * @see org.eclipse.debug.core.model.ITerminate#terminate()
         */
        public void terminate() throws DebugException {
-               fTarget.getDebugConnection().stop();
+               ((XDebugTarget) getDebugTarget()).getDebugConnection().stop();
                fTerminated = true;
        }
        
@@ -321,4 +322,47 @@ public class XDebugThread extends XDebugElement implements IThread, IDebugEventS
        public void removeEventListeners() {
                DebugPlugin.getDefault().removeDebugEventListener(this);
        }
+       
+       /**
+        * Fires a debug event
+        * 
+        * @param event the event to be fired
+        */
+       protected void fireEvent(DebugEvent event) {
+               DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event});
+       }
+       
+       /**
+        * Fires a <code>CREATE</code> event for this element.
+        */
+       public void fireCreationEvent() {
+               fireEvent(new DebugEvent(this, DebugEvent.CREATE));
+       }       
+       
+       /**
+        * Fires a <code>RESUME</code> event for this element with
+        * the given detail.
+        * 
+        * @param detail event detail code
+        */
+       public void fireResumeEvent(int detail) {
+               fireEvent(new DebugEvent(this, DebugEvent.RESUME, detail));
+       }
+
+       /**
+        * Fires a <code>SUSPEND</code> event for this element with
+        * the given detail.
+        * 
+        * @param detail event detail code
+        */
+       public void fireSuspendEvent(int detail) {
+               fireEvent(new DebugEvent(this, DebugEvent.SUSPEND, detail));
+       }
+       
+       /**
+        * Fires a <code>TERMINATE</code> event for this element.
+        */
+       protected void fireTerminateEvent() {
+               fireEvent(new DebugEvent(this, DebugEvent.TERMINATE));
+       }       
 }
\ No newline at end of file