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..9b0a57e 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 @@ -22,70 +22,56 @@ import org.w3c.dom.NodeList; * 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; - } - setType(typeName); + private boolean fhasChanged; + + public XDebugAbstractValue(XDebugStackFrame frame, Node varNode) { + super((XDebugTarget) frame.getDebugTarget()); + + fTypeName = PHPDebugUtils.getAttributeValue(varNode,"type"); + + int NumChildren = 0; + if (!PHPDebugUtils.getAttributeValue(varNode,"numchildren").equals("")) { + NumChildren = Integer.parseInt(PHPDebugUtils.getAttributeValue(varNode, "numchildren")); + } + NodeList property = varNode.getChildNodes(); - if (variable.hasChildren()) { + if (NumChildren > 0) { renderValueString(""+property.getLength()); fVariables = new IVariable[property.getLength()]; for (int i = 0; i0); + return (fVariables.length > 0); } - public boolean isArray() { - return ((fType & VALUETYPE_ARRAY) > 0); - } - - public abstract void setType(String typeName); public abstract void renderValueString(String data); public abstract boolean verifyValue(String expression); @@ -131,14 +116,18 @@ public abstract class XDebugAbstractValue extends XDebugElement implements IVal public boolean setValue(String expression) { if (!verifyValue(expression)) return false; - if(fTarget.setVarValue(fVariable.getFullName(),expression)) { - renderValueString(expression); - return true; - } + if( getDebugTarget() == null ) { + renderValueString(expression); + } else { + /* if(((XDebugTarget) getDebugTarget()).setVarValue(fVariable.getFullName(),expression)) { + renderValueString(expression); + return true; + }*/ + } return false; } - + public boolean supportsValueModification() { return false; } -} +} \ No newline at end of file