1) Fixed issue #844: Short form of ternary operator (since PHP 5.3).
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / actions / PHPOpenAllIncludesEditorAction.java
index 3dd63ff..62e913b 100644 (file)
@@ -19,7 +19,7 @@ import org.eclipse.core.resources.IContainer;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+//import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
@@ -32,7 +32,7 @@ import org.eclipse.swt.graphics.Point;
 import org.eclipse.ui.IEditorActionDelegate;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
+//import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.actions.ActionDelegate;
 import org.eclipse.ui.dialogs.ListSelectionDialog;
@@ -66,12 +66,12 @@ public class PHPOpenAllIncludesEditorAction extends ActionDelegate implements
                }
        }
 
-       private IWorkbenchPage getActivePage() {
-               IWorkbenchWindow workbenchWindow = fEditor.getEditorSite()
-                               .getWorkbenchWindow();
-               IWorkbenchPage page = workbenchWindow.getActivePage();
-               return page;
-       }
+//     private IWorkbenchPage getActivePage() {
+//             IWorkbenchWindow workbenchWindow = fEditor.getEditorSite()
+//                             .getWorkbenchWindow();
+//             IWorkbenchPage page = workbenchWindow.getActivePage();
+//             return page;
+//     }
 
        public IContainer getWorkingLocation(IFileEditorInput editorInput) {
                if (editorInput == null || editorInput.getFile() == null) {
@@ -80,31 +80,31 @@ public class PHPOpenAllIncludesEditorAction extends ActionDelegate implements
                return editorInput.getFile().getParent();
        }
 
-       private IFile getIncludeFile(IProject project,
-                       IFileEditorInput editorInput, String relativeFilename) {
-               IContainer container = getWorkingLocation(editorInput);
-               String fullPath = project.getLocation().toString();
-               IFile file = null;
-               if (relativeFilename.startsWith("../")) {
-                       Path path = new Path(relativeFilename);
-                       file = container.getFile(path);
-                       return file;
-               }
-               int index = relativeFilename.lastIndexOf('/');
-
-               if (index >= 0) {
-                       Path path = new Path(relativeFilename);
-                       file = project.getFile(path);
-                       if (file.exists()) {
-                               return file;
-                       }
-               }
-
-               Path path = new Path(relativeFilename);
-               file = container.getFile(path);
-
-               return file;
-       }
+//     private IFile getIncludeFile(IProject project,
+//                     IFileEditorInput editorInput, String relativeFilename) {
+//             IContainer container = getWorkingLocation(editorInput);
+//             String fullPath = project.getFullPath().toString();
+//             IFile file = null;
+//             if (relativeFilename.startsWith("../")) {
+//                     Path path = new Path(relativeFilename);
+//                     file = container.getFile(path);
+//                     return file;
+//             }
+//             int index = relativeFilename.lastIndexOf('/');
+//
+//             if (index >= 0) {
+//                     Path path = new Path(relativeFilename);
+//                     file = project.getFile(path);
+//                     if (file.exists()) {
+//                             return file;
+//                     }
+//             }
+//
+//             Path path = new Path(relativeFilename);
+//             file = container.getFile(path);
+//
+//             return file;
+//     }
 
        public void run(IAction action) {
                if (fEditor == null) {
@@ -144,7 +144,7 @@ public class PHPOpenAllIncludesEditorAction extends ActionDelegate implements
                                        if (list != null && list.size() > 0) {
                                                // String workspaceLocation =
                                                // PHPeclipsePlugin.getWorkspace().getRoot().getLocation().toString();
-                                               String workspaceLocation = fProject.getLocation()
+                                               String workspaceLocation = fProject.getFullPath()
                                                                .toString()
                                                                + File.separatorChar;