1) Moved the fHasChanged flag from PHPVariable to PHPValue.
authorrobekras <robekras>
Thu, 20 Oct 2005 19:06:06 +0000 (19:06 +0000)
committerrobekras <robekras>
Thu, 20 Oct 2005 19:06:06 +0000 (19:06 +0000)
net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPValue.java
net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPVariable.java

index bf97de2..b736b8e 100644 (file)
@@ -56,7 +56,11 @@ public class PHPValue implements IValue {
        private String                  fValueString;                           // The value of this variable as text
        private Vector                  fVariables;                             // The children of this variable (other variables) if any
        private PHPStackFrame   fStackFrame;                            // The stackframe this value (variable) belongs to
-                                                                                                                                       //
+       private boolean         fHasChanged;                                                    // The value has changed between two suspends
+                                                                                                                                       // This variable was moved from PHPVariable due to the fact,
+                                                                                                                                       // that two PHPVariables can reference the same PHPValue,
+                                                                                                                                       // so only the first PHPVariable would win, when we check the variable tree
+                                                                                                                                       // for changed values.
 
        /**
         *
@@ -77,6 +81,7 @@ public class PHPValue implements IValue {
                this.fValueType   = fValueType;
                this.fValueString = value;
                this.fStackFrame  = frame;
+               this.fHasChanged  = false;
 
                if (subitems != null) {                                     // If there are children for this value (variable)
                        this.fVariables = new Vector (subitems);                // Then add the children to this value (variable)
@@ -217,4 +222,13 @@ public class PHPValue implements IValue {
                return null;
        }
 
+       public boolean hasValueChanged () throws DebugException {
+               return fHasChanged;
+       }
+
+       public void setValueChanged (boolean changed) {
+               fHasChanged = changed;
+       }
+
+
 }
index 0cdad2a..94fd528 100644 (file)
@@ -32,7 +32,6 @@ public class PHPVariable implements IVariable {
        private PHPStackFrame   fStackFrame;                            // The stackframe this variable belongs to
        private PHPVariable     fParent;                                // The parent variable (a back link)
        private String                  fLongName;                              // ???
-       private boolean         fHasChanged;                                                    //
 
        /**
         *
@@ -55,7 +54,6 @@ public class PHPVariable implements IVariable {
                this.fStackFrame = frame;
                this.fValue      = new PHPValue (frame, value, valueType, subitems);
                this.fParent     = parent;
-               this.fHasChanged = false;
 
                setName (name);
        }
@@ -154,9 +152,7 @@ public class PHPVariable implements IVariable {
         * @see org.eclipse.debug.core.model.IVariable#hasValueChanged()
         */
        public boolean hasValueChanged() throws DebugException {
-               // TODO Auto-generated method stub
-               // return false;
-               return fHasChanged;
+               return fValue.hasValueChanged ();
        }
 
        /**
@@ -167,7 +163,7 @@ public class PHPVariable implements IVariable {
         *                a different color.
         */
        public void setValueChanged (boolean changed) {
-               fHasChanged = changed;
+               fValue.setValueChanged (changed);
        }
 
     /**