Bug 56909 [implementation] Method EditorUtitliy.revealInEditor checks for JavaEditor
In my plugin I have a MultiPageEditor that embeds a Java Editor on one of its pages. When a navigation to a Java method within the scope of my MPE is triggered the editor is correctly opened and switched to the source page, but no navigation to the method is triggered. Instead the cursor is positioned in the first row of the source code. This is due to the instanceOf check in the method EditorUtility.revealInEditor (IEditorPart part, IJavaElement element). It should be replaced by a check for the IGotoMarker interface. That would enable Java source navigation to quite a bunch of editors that have no chance to implement JavaEditor themselfes.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/EditorUtility.java
}
		
	/**
	 * Opens a Java editor for an element (IJavaElement, IFile, IStorage...)
	 * @return the IEditorPart or null if wrong element type or opening failed
	 */
	public static IEditorPart openInEditor(Object inputElement, boolean activate) throws JavaModelException, PartInitException {
		
		if (inputElement instanceof IFile)
			return openInEditor((IFile) inputElement, activate);
		
		IEditorInput input= getEditorInput(inputElement);
		if (input instanceof IFileEditorInput) {
			IFileEditorInput fileInput= (IFileEditorInput) input;
			return openInEditor(fileInput.getFile(), activate);
		}
		
		if (input != null)
			return openInEditor(input, getEditorID(input, inputElement), activate);
			
		return null;
	}
	
	/** 
	 * Selects a Java Element in an editor
	 */	
	public static void revealInEditor(IEditorPart part, IJavaElement element) {
		if (element != null && part instanceof JavaEditor) {
			((JavaEditor) part).setSelection(element);
		}