Change visibility to private for net.sourceforge.phpeclipse.xdebug.php.model.XDebugEl...
authorincastrix <incastrix>
Tue, 16 Sep 2008 17:50:17 +0000 (17:50 +0000)
committerincastrix <incastrix>
Tue, 16 Sep 2008 17:50:17 +0000 (17:50 +0000)
net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugAbstractValue.java
net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugElement.java
net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugStackFrame.java
net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugTarget.java
net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugThread.java
net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugVariable.java

index 96f14f2..5056d77 100644 (file)
@@ -154,10 +154,10 @@ public abstract class XDebugAbstractValue  extends XDebugElement implements IVal
        public boolean setValue(String expression) {
                if (!verifyValue(expression))
                        return false;
-        if( fTarget == null ) {
+        if( getDebugTarget() == null ) {
             renderValueString(expression);
            } else {
-                   if(fTarget.setVarValue(fVariable.getFullName(),expression)) {
+                   if(((XDebugTarget) getDebugTarget()).setVarValue(fVariable.getFullName(),expression)) {
                            renderValueString(expression);
                            return true;
                    }
index c84a976..8e08bc4 100644 (file)
@@ -9,9 +9,9 @@ import net.sourceforge.phpeclipse.xdebug.php.launching.IXDebugConstants;
 
 //import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.debug.core.DebugEvent;
+//import org.eclipse.debug.core.DebugEvent;
 //import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
+//import org.eclipse.debug.core.DebugPlugin;
 import org.eclipse.debug.core.ILaunch;
 import org.eclipse.debug.core.model.IDebugElement;
 import org.eclipse.debug.core.model.IDebugTarget;
@@ -24,7 +24,7 @@ import org.eclipse.debug.core.model.IDebugTarget;
 public class XDebugElement extends PlatformObject implements IDebugElement {
                
        // containing target 
-       protected/*private*/ XDebugTarget fTarget;
+       private XDebugTarget fTarget;
        
        /**
         * Constructs a new debug element contained in the given
@@ -81,16 +81,16 @@ public class XDebugElement extends PlatformObject implements IDebugElement {
         * 
         * @param event the event to be fired
         */
-       protected void fireEvent(DebugEvent event) {
-               DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event});
-       }
+//     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));
-       }       
+//     public void fireCreationEvent() {
+//             fireEvent(new DebugEvent(this, DebugEvent.CREATE));
+//     }       
        
        /**
         * Fires a <code>RESUME</code> event for this element with
@@ -98,9 +98,9 @@ public class XDebugElement extends PlatformObject implements IDebugElement {
         * 
         * @param detail event detail code
         */
-       public void fireResumeEvent(int detail) {
-               fireEvent(new DebugEvent(this, DebugEvent.RESUME, detail));
-       }
+//     public void fireResumeEvent(int detail) {
+//             fireEvent(new DebugEvent(this, DebugEvent.RESUME, detail));
+//     }
 
        /**
         * Fires a <code>SUSPEND</code> event for this element with
@@ -108,14 +108,14 @@ public class XDebugElement extends PlatformObject implements IDebugElement {
         * 
         * @param detail event detail code
         */
-       public void fireSuspendEvent(int detail) {
-               fireEvent(new DebugEvent(this, DebugEvent.SUSPEND, detail));
-       }
+//     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));
-       }       
+//     protected void fireTerminateEvent() {
+//             fireEvent(new DebugEvent(this, DebugEvent.TERMINATE));
+//     }       
 }
\ No newline at end of file
index 5fbece5..b292684 100644 (file)
@@ -71,8 +71,8 @@ public class XDebugStackFrame  extends XDebugElement implements IStackFrame {
        
        public IVariable[] getVariables() throws DebugException {
                if (fVariables == null) {
-                       Node dfl = fTarget.getLocalVariables(fLevel);
-                       Node dfg = fTarget.getGlobalVariables(fLevel);
+                       Node dfl = ((XDebugTarget) getDebugTarget()).getLocalVariables(fLevel);
+                       Node dfg = ((XDebugTarget) getDebugTarget()).getGlobalVariables(fLevel);
                        parseVariable(dfl, dfg);
                }
 
index 9b7b206..ee034ec 100644 (file)
@@ -177,7 +177,7 @@ public class XDebugTarget extends XDebugElement implements IDebugTarget, IDebugE
                        fSuspended = false;
                        
                        XDebugCorePlugin.getBreakpointManager().removeBreakpointListener(this);
-                       fireTerminateEvent();
+                       fThread.fireTerminateEvent();
                        DebugPlugin.getDefault().removeDebugEventListener(this);
                        /*if (fThread!=null)
                                fThread.removeEventListeners();*/
@@ -557,9 +557,9 @@ public class XDebugTarget extends XDebugElement implements IDebugTarget, IDebugE
                stopListener();
                fDebugConnection.close();
 
-               fThread.removeEventListeners();
+/*             fThread.removeEventListeners();
                fThread = null;
-               fThreads = new IThread[0];
+               fThreads = new IThread[0];*/
                
 /*             stopListener();
                fDebugConnection.close();*/
@@ -575,18 +575,23 @@ public class XDebugTarget extends XDebugElement implements IDebugTarget, IDebugE
                        }
                } else {
                        fDebugConnection = null;
-                       fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CONTENT));
-               }               
+                       fThread.fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CONTENT));
+               }
+               
+               fThread.removeEventListeners();
+               fThread = null;
+               fThreads = new IThread[0];
        }
        
        public void handleProxyEvent(/*String ideKey,*/ XDebugConnection connection) {
                setDebugConnection(connection);
                System.out.println("* New Connection - XDebug.Target: " + fDebugConnection.getSessionID());
                
-               fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CHANGE));
+//             fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CHANGE));
                
                fThread = new XDebugThread(this);
                fThreads = new IThread[] {fThread};
+               fThread.fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CHANGE));
                try {
                        started();
                } catch( DebugException e ){
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
index 9bd587e..f8c54bd 100644 (file)
@@ -10,7 +10,7 @@ import net.sourceforge.phpeclipse.xdebug.core.PHPDebugUtils;
 
 //import org.eclipse.core.runtime.CoreException;
 import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugEvent;
+//import org.eclipse.debug.core.DebugEvent;
 import org.eclipse.debug.core.model.IValue;
 import org.eclipse.debug.core.model.IVariable;
 import org.w3c.dom.Node;
@@ -130,8 +130,10 @@ public class XDebugVariable  extends XDebugElement implements IVariable/*, IWatc
         * @see org.eclipse.debug.core.model.IValueModification#setValue(java.lang.String)
         */
        public void setValue(String expression) throws DebugException {
-               if(fValue.setValue(expression))
-                       fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CONTENT));
+               if(fValue.setValue(expression)) {
+                       
+               }
+                       //fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CONTENT));
                //fValue.setValueA(expression);
        }