Fix variable view value modification and refactored XDebugAbstractValue and derived...
[phpeclipse.git] / net.sourceforge.phpeclipse.xdebug.core / src / net / sourceforge / phpeclipse / xdebug / php / model / XDebugObjectValue.java
index 01fabba..1af871a 100644 (file)
@@ -1,18 +1,38 @@
 package net.sourceforge.phpeclipse.xdebug.php.model;
 
+import net.sourceforge.phpeclipse.xdebug.core.PHPDebugUtils;
+
 import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IVariable;
 import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 public class XDebugObjectValue extends XDebugAbstractValue {
+       private int NumChildren;
+
        public XDebugObjectValue(XDebugStackFrame variable, Node value) throws DebugException {
                super(variable, value);
-       }
 
-       public void renderValueString(String data) {
-               setValueString(data)/*fValueString = data*/;
-       }
+               NumChildren = 0;
+               if (!PHPDebugUtils.getAttributeValue(value, "numchildren").equals("")) {
+                       NumChildren = Integer.parseInt(PHPDebugUtils.getAttributeValue(value, "numchildren"));
+               }               
 
-       public boolean verifyValue(String expression) {
-               return false;
+               if (NumChildren > 0) {
+                       NodeList property = value.getChildNodes();
+                       IVariable[] Variables = new IVariable[property.getLength()];
+                       
+                       for (int i = 0; i<property.getLength(); i++) {
+                               Node propertyNode = property.item(i);
+                               Variables[i] = new XDebugVariable(variable, propertyNode);
+                       }
+                       
+                       setChildren(Variables);
+               }
+               
+               String className = PHPDebugUtils.getAttributeValue(value,"classname");
+               if(!"".equals(className)) {
+                       setValueString(className);
+               }
        }
 }
\ No newline at end of file