From eca3ee2863bc12e449172232d5b90a6633906abb Mon Sep 17 00:00:00 2001 From: kpouer Date: Fri, 24 Jan 2003 11:31:51 +0000 Subject: [PATCH 1/1] It's now possible to assign a value to a variable the toString() method changed to allow it --- .../phpeditor/phpparser/PHPVarDeclaration.java | 24 +++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPVarDeclaration.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPVarDeclaration.java index 2f81a61..1a40ab9 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPVarDeclaration.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPVarDeclaration.java @@ -9,16 +9,30 @@ import org.eclipse.jface.resource.ImageDescriptor; */ public class PHPVarDeclaration extends PHPSegment { + private String value; /** * Create a php variable declaration. * @param parent the parent object (it should be a php class) * @param name the name of the variable * @param index where the variable is in the file + * @param value la valeur */ - public PHPVarDeclaration(Object parent, String name, int index) { + public PHPVarDeclaration(Object parent, String name, int index, String value) { super(parent, name, index); + this.value = value; } + /** + * Create a php variable declaration. + * @param parent the parent object (it should be a php class) + * @param name the name of the variable + * @param index where the variable is in the file + * @param value la valeur + */ + public PHPVarDeclaration(Object parent, String name, int index) { + this(parent, name, index,null); + } + /** * Get the image of a variable. * @return the image that represents a php variable @@ -26,4 +40,12 @@ public class PHPVarDeclaration extends PHPSegment { public ImageDescriptor getImage() { return PHPUiImages.DESC_VAR; } + + public String toString() { + if (value == null) { + return super.toString(); + } else { + return name + " = " + value; + } + } } -- 1.7.1