X-Git-Url: http://secure.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 index 0801ca4..28c1f9b 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/LastPHPFileExpander.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/variable/LastPHPFileExpander.java @@ -1,8 +1,6 @@ package net.sourceforge.phpdt.externaltools.variable; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; - -import org.eclipse.core.resources.IFile; +import org.eclipse.core.runtime.IPath; /** * Expands a variable into the last opened PHP file @@ -10,15 +8,27 @@ import org.eclipse.core.resources.IFile; * This class is not intended to be extended by clients. *
*/ -public class LastPHPFileExpander implements IVariableTextExpander { +public class LastPHPFileExpander extends ResourceExpander { //implements IVariableTextExpander { + + /** + * Create an instance + */ + public LastPHPFileExpander() { + super(); + } + /** + * Returns a string representation of the path to a file or directory + * for the given variable tag and value ornull
.
+ *
+ * @see IVariableTextExpander#getText(String, String, ExpandVariableContext)
+ */
public String getText(String varTag, String varValue, ExpandVariableContext context) {
- IFile file = PHPeclipsePlugin.getDefault().getLastEditorFile();
- String fileLocation ="";
- if (file != null) {
- fileLocation = file.getLocation().toString();
+ IPath path = getPath(varTag, varValue, context);
+ if (path != null) {
+ return path.toString();
}
- return fileLocation;
+ return null;
}
}