X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/LastPHPFileExpander.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/LastPHPFileExpander.java new file mode 100644 index 0000000..0801ca4 --- /dev/null +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/LastPHPFileExpander.java @@ -0,0 +1,24 @@ +package net.sourceforge.phpdt.externaltools.variable; + +import net.sourceforge.phpeclipse.PHPeclipsePlugin; + +import org.eclipse.core.resources.IFile; + +/** + * Expands a variable into the last opened PHP file + *

+ * This class is not intended to be extended by clients. + *

+ */ +public class LastPHPFileExpander implements IVariableTextExpander { + + public String getText(String varTag, String varValue, ExpandVariableContext context) { + IFile file = PHPeclipsePlugin.getDefault().getLastEditorFile(); + String fileLocation =""; + if (file != null) { + fileLocation = file.getLocation().toString(); + } + return fileLocation; + } + +}