Goto line/Goto Matching Bracket Shortcuts should work
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / actions / IncludesScanner.java
index 439f302..839d1e7 100644 (file)
@@ -6,6 +6,7 @@ import java.io.InputStream;
 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;
@@ -22,13 +23,13 @@ import org.eclipse.ui.IFileEditorInput;
 
 
 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) {
+  public IncludesScanner(IProject project, IFileEditorInput editorInput) {
     fProject = project;
-    this.fLineCreator = action;
+//    fOpenAllIncludesAction = action;
     fEditorInput = editorInput;
     fSet = new HashSet();
   }
@@ -118,8 +119,15 @@ public class IncludesScanner implements ITerminalSymbols {
      // 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("../")) {
@@ -151,4 +159,10 @@ public class IncludesScanner implements ITerminalSymbols {
     return list;
   }
 
+  /**
+   * @return Returns the set.
+   */
+  public Set getSet() {
+    return fSet;
+  }
 }
\ No newline at end of file