if (selectedElement instanceof IJavaElement) { ICompilationUnit cu= (ICompilationUnit)((IJavaElement)selectedElement).getAncestor(IJavaElement.COMPILATION_UNIT); if (JavaModelUtil.isPrimary(cu)) {  IWorkbenchPage page= JavaPlugin.getActivePage(); if (page != null) { IEditorPart editor= page.getActiveEditor(); if (editor != null) { ICompilationUnit editorCU= JavaPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(editor.getEditorInput()); if (editorCU == cu) { EditorUtility.revealInEditor(editor, (IJavaElement)selectedElement); return; } } } if (!ActionUtil.isProcessable(shell, selectedElement)) return; } }
	private void gotoSelectedElement() {		Object selectedElement= getSelectedElement();		if (selectedElement != null) {			try {				dispose();				OpenActionUtil.open(selectedElement, true);			} catch (CoreException ex) {				JavaPlugin.log(ex);			}		}	}