1 package net.sourceforge.phpdt.internal.compiler.ast;
3 import net.sourceforge.phpdt.internal.compiler.parser.Outlineable;
4 import net.sourceforge.phpdt.internal.ui.PHPUiImages;
5 import org.eclipse.jface.resource.ImageDescriptor;
9 * This is a variable declaration for a php class
10 * In fact it's an array of VariableDeclaration, since a field could contains
13 * @author Matthieu Casanova
15 public class FieldDeclaration extends Statement implements Outlineable {
18 public VariableDeclaration[] vars;
20 private Object parent;
23 * @param vars the array of variables.
24 * @param sourceStart the starting offset
25 * @param sourceEnd the ending offset
27 public FieldDeclaration(VariableDeclaration[] vars, int sourceStart, int sourceEnd, Object parent) {
28 super(sourceStart, sourceEnd);
34 * Return the object into String.
35 * @param tab how many tabs (not used here
38 public String toString(int tab) {
39 final StringBuffer buff = new StringBuffer(tabString(tab));
40 buff.append("var ");//$NON-NLS-1$
41 for (int i = 0; i < vars.length; i++) {
42 VariableDeclaration var = vars[i];
44 buff.append(',');//$NON-NLS-1$
46 buff.append(var.toStringExpression());
48 return buff.toString();
52 * Get the image of a variable.
53 * @return the image that represents a php variable
55 public ImageDescriptor getImage() {
56 return PHPUiImages.DESC_VAR;
59 public Object getParent() {