X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugAbstractValue.java b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugAbstractValue.java index 9498ed9..3912916 100644 --- a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugAbstractValue.java +++ b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugAbstractValue.java @@ -1,19 +1,19 @@ -/* - * Created on 23.11.2004 + /* Created on 23.11.2004 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package net.sourceforge.phpeclipse.xdebug.php.model; -import net.sourceforge.phpeclipse.xdebug.core.Base64; +import java.util.Arrays; +import java.util.Iterator; +import java.util.Vector; import net.sourceforge.phpeclipse.xdebug.core.PHPDebugUtils; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.model.IValue; import org.eclipse.debug.core.model.IVariable; import org.w3c.dom.Node; -import org.w3c.dom.NodeList; /** * @author Axel @@ -21,124 +21,131 @@ import org.w3c.dom.NodeList; * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ -public abstract class XDebugAbstractValue extends XDebugElement implements IValue { - - public static final int VALUETYPE_UNKNOWN = -1; - public static final int VALUETYPE_UNINITIALIZED = 0; - public static final int VALUETYPE_STRING = 1; - public static final int VALUETYPE_INT = 4; - public static final int VALUETYPE_FLOAT = 5; - public static final int VALUETYPE_BOOLEAN = 6; - public static final int VALUETYPE_ARRAY = 8; - public static final int VALUETYPE_HASH = 9; - public static final int VALUETYPE_OBJECT = 10; - - - protected XDebugVariable fVariable; - private IVariable[] fVariables; - protected String fValueString; - protected int fType; - protected String fTypeName; - - public XDebugAbstractValue(XDebugVariable variable,Node varNode,String typeName) { - super((XDebugTarget) variable.getDebugTarget()); - fVariable = variable; - if (varNode==null){ - try { - System.out.println(variable.getName()+"=null"); - } catch (DebugException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return; + +public /*abstract*/ class XDebugAbstractValue extends XDebugElement implements IValue { + private String fValueString; + private String fTypeName; + private boolean fhasChanged; + protected String rowValue; + private boolean fSorted; + private Vector fVariables; // The children of this variable (other variables) if any + + public XDebugAbstractValue(XDebugStackFrame frame, Node value) throws DebugException { + super(frame == null ? null : (XDebugTarget)frame.getDebugTarget()); + + fTypeName = PHPDebugUtils.getAttributeValue(value, "type"); + + fVariables = new Vector(); // Create an empty vector + fValueString = ""; + rowValue = ""; + fSorted = false; + + try { + rowValue = value.getFirstChild().getNodeValue(); + } catch (NullPointerException e) { + rowValue = ""; } - setType(typeName); - NodeList property = varNode.getChildNodes(); - if (variable.hasChildren()) { - renderValueString(""+property.getLength()); - fVariables = new IVariable[property.getLength()]; - for (int i = 0; i0); + return (fVariables.size() != 0); } - - public boolean isArray() { - return ((fType & VALUETYPE_ARRAY) > 0); + + public boolean setValue(String expression) throws DebugException { + return true; + }; + + protected boolean verifyValue(String expression) { + return true; } - - public abstract void setType(String typeName); - public abstract void renderValueString(String data); - - public abstract boolean verifyValue(String expression); - - public boolean setValue(String expression) { - if (!verifyValue(expression)) - return false; - if(fTarget.setVarValue(fVariable.getFullName(),expression)) { - renderValueString(expression); - return true; - } + + protected boolean supportsValueModification() { return false; } - public boolean supportsValueModification() { - return false; + protected void setValueString(String valueString) { + fValueString = valueString; } + + protected void setChildren(IVariable[] newChildren) { + fVariables = new Vector (Arrays.asList(newChildren)); + } + + public void setReferenceTypeName (String referenceTypeName) { + fTypeName = referenceTypeName; + } }