1 package net.sourceforge.phpeclipse.xdebug.php.model;
 
   3 import net.sourceforge.phpeclipse.xdebug.core.PHPDebugUtils;
 
   5 import org.eclipse.debug.core.DebugException;
 
   6 import org.eclipse.debug.core.model.IVariable;
 
   7 import org.w3c.dom.Node;
 
   8 import org.w3c.dom.NodeList;
 
  10 public class XDebugArrayValue extends XDebugAbstractValue {
 
  11         private int NumChildren;
 
  13         public XDebugArrayValue(XDebugStackFrame variable, Node value) throws DebugException {
 
  14                 super(variable, value);
 
  17                 if (!PHPDebugUtils.getAttributeValue(value, "numchildren").equals("")) {
 
  18                         NumChildren = Integer.parseInt(PHPDebugUtils.getAttributeValue(value, "numchildren"));
 
  21                 if (NumChildren > 0) {
 
  22                         NodeList property = value.getChildNodes();
 
  23                         renderValueString(""+property.getLength());
 
  24                         IVariable[] Variables = new IVariable[property.getLength()];
 
  26                         for (int i = 0; i<property.getLength(); i++) {
 
  27                                 Node propertyNode = property.item(i);
 
  28                                 Variables[i] = new XDebugVariable(variable, propertyNode);
 
  31                         setChildren(Variables);
 
  35         private void renderValueString(String data) throws DebugException  {
 
  36                 if (data.equals("")) {
 
  37                         setValueString("empty");
 
  39                         if ("array".equals(getReferenceTypeName())) {
 
  40                                 setValueString("array(" + NumChildren + ")");