From 13f1a17fd1be8433051d9a4499deb90db109a7a3 Mon Sep 17 00:00:00 2001 From: kpouer Date: Sat, 25 Jan 2003 15:49:09 +0000 Subject: [PATCH 1/1] a PHPSegment that describe a require or an include --- .../phpeditor/phpparser/PHPReqIncDeclaration.java | 47 ++++++++++++++++++++ 1 files changed, 47 insertions(+), 0 deletions(-) create mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPReqIncDeclaration.java diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPReqIncDeclaration.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPReqIncDeclaration.java new file mode 100644 index 0000000..d7e03fa --- /dev/null +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPReqIncDeclaration.java @@ -0,0 +1,47 @@ +package net.sourceforge.phpeclipse.phpeditor.phpparser; + +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 PHPReqIncDeclaration 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 PHPReqIncDeclaration(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 PHPReqIncDeclaration(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; + } +} -- 1.7.1