X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/EditorUtility.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/EditorUtility.java index 5952b81..0e1ed18 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/EditorUtility.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/EditorUtility.java @@ -20,7 +20,7 @@ import net.sourceforge.phpdt.core.JavaCore; import net.sourceforge.phpdt.core.JavaModelException; import net.sourceforge.phpdt.internal.corext.util.JavaModelUtil; import net.sourceforge.phpdt.ui.JavaUI; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; +//import net.sourceforge.phpeclipse.PHPeclipsePlugin; import net.sourceforge.phpeclipse.ui.WebUI; import org.eclipse.core.resources.IFile; @@ -49,16 +49,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 @@ -66,24 +66,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 = WebUI.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 = WebUI.getActivePage(); +// if (p != null) { +// return p.findEditor(input); +// } +// } +// +// return null; +// } /** * Opens a Java editor for an element such as IJavaElement, @@ -222,20 +222,20 @@ public class EditorUtility { * If the current active editor edits a java element return it, else return * null */ - public static IJavaElement getActiveEditorJavaInput() { - IWorkbenchPage page = WebUI.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 = WebUI.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 @@ -264,18 +264,18 @@ public class EditorUtility { * @return the corresponding member in the shared working copy or * null 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.