1) Moved net.sourceforge.phpeclipse.ui\src\net\sourceforge\phpdt back to net.sourcefo...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / EditorUtility.java
index 7c1747a..33d847c 100644 (file)
@@ -48,16 +48,16 @@ import org.eclipse.ui.texteditor.ITextEditor;
  */
 public class EditorUtility {
 
-       public static boolean isEditorInput(Object element, IEditorPart editor) {
-               if (editor != null) {
-                       try {
-                               return editor.getEditorInput().equals(getEditorInput(element));
-                       } catch (JavaModelException x) {
-                               PHPeclipsePlugin.log(x.getStatus());
-                       }
-               }
-               return false;
-       }
+//     public static boolean isEditorInput(Object element, IEditorPart editor) {
+//             if (editor != null) {
+//                     try {
+//                             return editor.getEditorInput().equals(getEditorInput(element));
+//                     } catch (JavaModelException x) {
+//                             PHPeclipsePlugin.log(x.getStatus());
+//                     }
+//             }
+//             return false;
+//     }
 
        /**
         * Tests if a cu is currently shown in an editor
@@ -65,24 +65,24 @@ public class EditorUtility {
         * @return the IEditorPart if shown, null if element is not open in an
         *         editor
         */
-       public static IEditorPart isOpenInEditor(Object inputElement) {
-               IEditorInput input = null;
-
-               try {
-                       input = getEditorInput(inputElement);
-               } catch (JavaModelException x) {
-                       PHPeclipsePlugin.log(x.getStatus());
-               }
-
-               if (input != null) {
-                       IWorkbenchPage p = PHPeclipsePlugin.getActivePage();
-                       if (p != null) {
-                               return p.findEditor(input);
-                       }
-               }
-
-               return null;
-       }
+//     public static IEditorPart isOpenInEditor(Object inputElement) {
+//             IEditorInput input = null;
+//
+//             try {
+//                     input = getEditorInput(inputElement);
+//             } catch (JavaModelException x) {
+//                     PHPeclipsePlugin.log(x.getStatus());
+//             }
+//
+//             if (input != null) {
+//                     IWorkbenchPage p = PHPeclipsePlugin.getActivePage();
+//                     if (p != null) {
+//                             return p.findEditor(input);
+//                     }
+//             }
+//
+//             return null;
+//     }
 
        /**
         * Opens a Java editor for an element such as <code>IJavaElement</code>,
@@ -221,20 +221,20 @@ public class EditorUtility {
         * If the current active editor edits a java element return it, else return
         * null
         */
-       public static IJavaElement getActiveEditorJavaInput() {
-               IWorkbenchPage page = PHPeclipsePlugin.getActivePage();
-               if (page != null) {
-                       IEditorPart part = page.getActiveEditor();
-                       if (part != null) {
-                               IEditorInput editorInput = part.getEditorInput();
-                               if (editorInput != null) {
-                                       return (IJavaElement) editorInput
-                                                       .getAdapter(IJavaElement.class);
-                               }
-                       }
-               }
-               return null;
-       }
+//     public static IJavaElement getActiveEditorJavaInput() {
+//             IWorkbenchPage page = PHPeclipsePlugin.getActivePage();
+//             if (page != null) {
+//                     IEditorPart part = page.getActiveEditor();
+//                     if (part != null) {
+//                             IEditorInput editorInput = part.getEditorInput();
+//                             if (editorInput != null) {
+//                                     return (IJavaElement) editorInput
+//                                                     .getAdapter(IJavaElement.class);
+//                             }
+//                     }
+//             }
+//             return null;
+//     }
 
        /**
         * Gets the working copy of an compilation unit opened in an editor
@@ -263,18 +263,18 @@ public class EditorUtility {
         * @return the corresponding member in the shared working copy or
         *         <code>null</code> if not found
         */
-       public static IMember getWorkingCopy(IMember member)
-                       throws JavaModelException {
-               ICompilationUnit cu = member.getCompilationUnit();
-               if (cu != null) {
-                       ICompilationUnit workingCopy = getWorkingCopy(cu);
-                       if (workingCopy != null) {
-                               return JavaModelUtil.findMemberInCompilationUnit(workingCopy,
-                                               member);
-                       }
-               }
-               return null;
-       }
+//     public static IMember getWorkingCopy(IMember member)
+//                     throws JavaModelException {
+//             ICompilationUnit cu = member.getCompilationUnit();
+//             if (cu != null) {
+//                     ICompilationUnit workingCopy = getWorkingCopy(cu);
+//                     if (workingCopy != null) {
+//                             return JavaModelUtil.findMemberInCompilationUnit(workingCopy,
+//                                             member);
+//                     }
+//             }
+//             return null;
+//     }
 
        /**
         * Returns the compilation unit for the given java element.