import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import net.sourceforge.phpdt.core.compiler.ITerminalSymbols;
import net.sourceforge.phpdt.core.compiler.InvalidInputException;
public class IncludesScanner implements ITerminalSymbols {
- private final PHPOpenAllIncludesEditorAction fLineCreator;
+// private final PHPOpenAllIncludesEditorAction fOpenAllIncludesAction;
private IProject fProject;
private IFileEditorInput fEditorInput;
- HashSet fSet;
- public IncludesScanner(PHPOpenAllIncludesEditorAction action, IProject project, IFileEditorInput editorInput) {
+ private HashSet fSet;
+ public IncludesScanner(IProject project, IFileEditorInput editorInput) {
fProject = project;
- this.fLineCreator = action;
+// fOpenAllIncludesAction = action;
fEditorInput = editorInput;
fSet = new HashSet();
}
try {
if (fileToParse.exists()) {
- addInputStream(new BufferedInputStream(fileToParse.getContents()), fileToParse.getFullPath().toString());
+ addInputStream(new BufferedInputStream(fileToParse.getContents()), fileToParse.getProjectRelativePath().toString());
}
} catch (CoreException e1) {
e1.printStackTrace();
// e.printStackTrace();
}
}
+
+ private IContainer getWorkingLocation(IFileEditorInput editorInput) {
+ if (editorInput == null || editorInput.getFile() == null) {
+ return null;
+ }
+ return editorInput.getFile().getParent();
+ }
public IFile getIncludeFile(String relativeFilename) {
- IContainer container = this.fLineCreator.getWorkingLocation(fEditorInput);
+ IContainer container = getWorkingLocation(fEditorInput);
String fullPath = fProject.getLocation().toString();
IFile file = null;
if (relativeFilename.startsWith("../")) {
return list;
}
+ /**
+ * @return Returns the set.
+ */
+ public Set getSet() {
+ return fSet;
+ }
}
\ No newline at end of file