0801ca426e1fb7cc3730ef112682326d09adbb64
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / externaltools / variable / LastPHPFileExpander.java
1 package net.sourceforge.phpdt.externaltools.variable;
2
3 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
4
5 import org.eclipse.core.resources.IFile;
6
7 /**
8  * Expands a variable into the last opened PHP file 
9  * <p>
10  * This class is not intended to be extended by clients.
11  * </p>
12  */
13 public class LastPHPFileExpander implements IVariableTextExpander {
14
15   public String getText(String varTag, String varValue, ExpandVariableContext context) {
16     IFile file = PHPeclipsePlugin.getDefault().getLastEditorFile();
17     String fileLocation ="";
18     if (file != null) {
19       fileLocation = file.getLocation().toString();
20     }
21     return fileLocation;
22   }
23
24 }