Bug 111509 [api] Need public api for EditorUtility.getActiveEditorJavaInput(..)
We are using internal jdt calls to perform some of our operations. We are using EditorUtility.getActiveEditorJavaInput(..) and would like to replace it with public api. We couldn't find public API to replace this usage. This is blocking our effort to remove access to JDT internal source.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/EditorUtility.java
while (element != null) {
			if (element instanceof ICompilationUnit) {
				ICompilationUnit unit= JavaModelUtil.toOriginal((ICompilationUnit) element);
					IResource resource= unit.getResource();
					if (resource instanceof IFile)
						return new FileEditorInput((IFile) resource);
			}
			if (element instanceof IClassFile)
				return new InternalClassFileEditorInput((IClassFile) element);
			element= element.getParent();
		}
		return null;
	}
	public static IEditorInput getEditorInput(Object input) throws JavaModelException {
		if (input instanceof IJavaElement)
			return getEditorInput((IJavaElement) input);
		if (input instanceof IFile)
			return new FileEditorInput((IFile) input);
		if (input instanceof IStorage)
			return new JarEntryEditorInput((IStorage)input);
		return null;
	}
	/**
	 * If the current active editor edits a java element return it, else
	 * return null
	 */
	public static IJavaElement getActiveEditorJavaInput() {
		IWorkbenchPage page= JavaPlugin.getActivePage();
		if (page != null) {
			IEditorPart part= page.getActiveEditor();