/** * Brings the corresponding editor to top if the selected resource is open. * * @since 3.5 */ protected void linkToEditor(ISelection selection) { if (this != this.getSite().getPage().getActivePart()) return; Object obj = getSingleElement(selection); if (obj instanceof IFile) { IFile file = (IFile) obj; IWorkbenchPage page = getSite().getPage(); IEditorPart editor = ResourceUtil.findEditor(page, file); if (editor != null) { page.bringToTop(editor); return; } } }