From: kpouer Date: Mon, 7 Apr 2003 09:01:38 +0000 (+0000) Subject: A Global declaration X-Git-Url: http://git.phpeclipse.com A Global declaration --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/PHPGlobalDeclaration.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/PHPGlobalDeclaration.java new file mode 100644 index 0000000..1ad7870 --- /dev/null +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/PHPGlobalDeclaration.java @@ -0,0 +1,48 @@ +package net.sourceforge.phpdt.internal.compiler.parser; + +import net.sourceforge.phpdt.internal.ui.PHPUiImages; + +import org.eclipse.jface.resource.ImageDescriptor; + +/** + * A require, require_once, include or include_once declaration strongly inspired by the PHPFunctionDeclaration of Khartlage (:. + * @author khartlage, Matthieu Casanova + */ +public class PHPGlobalDeclaration extends PHPSegment { + + /** What is required/included. */ + private String value; + /** + * Create an include declaration. + * @param parent the parent object (it should be a php class or function) + * @param name it should be require, require_once, include or include_once + * @param index where the keyword is in the file + * @param value what is included + */ + public PHPGlobalDeclaration(Object parent, String name, int index, String value) { + super(parent, name, index); + this.value = value; + } + + /** + * Create an include declaration. + * @param parent the parent object (it should be a php class or function) + * @param name it should be require, require_once, include or include_once + * @param index where the keyword is in the file + */ + public PHPGlobalDeclaration(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 + */ + public ImageDescriptor getImage() { + return PHPUiImages.DESC_INC; + } + + public String toString() { + return name + " : " + value; + } +}