/** * Reveals the given java element in the given editor. If the element is not an instance * of <code>ISourceReference</code> this method result in a NOP. If it is a source * reference no checking is done if the editor displays a compilation unit or class file that * contains the source reference element. The editor simply reveals the source range * denoted by the given element. * * @param part the editor displaying a compilation unit or class file * @param element the element to be revealed * * @since 2.0 */ public static void revealInEditor(IEditorPart part, IJavaElement element) { EditorUtility.revealInEditor(part, element); }
/** * Reveals the given java element in the given editor. If the element is not an instance * of <code>ISourceReference</code> this method result in a NOP. If it is a source * reference no checking is done if the editor displays a compilation unit or class file that * contains the source reference element. The editor simply reveals the source range * denoted by the given element. * * @param part the editor displaying a compilation unit or class file * @param element the element to be revealed * * @since 2.0 */ public static void revealInEditor(IEditorPart part, IJavaElement element) { EditorUtility.revealInEditor(part, element); }
/** * Reveals the given java element in the given editor. If the element is not an instance * of <code>ISourceReference</code> this method result in a NOP. If it is a source * reference no checking is done if the editor displays a compilation unit or class file that * contains the source reference element. The editor simply reveals the source range * denoted by the given element. * * @param part the editor displaying a compilation unit or class file * @param element the element to be revealed * * @since 2.0 */ public static void revealInEditor(IEditorPart part, IJavaElement element) { EditorUtility.revealInEditor(part, element); }
private boolean revealInEditor(IJavaElement element) { EditorUtility.revealInEditor(getJavaEditor(), element); return true; }
private boolean revealInEditor(IJavaElement element) { EditorUtility.revealInEditor(getJavaEditor(), element); return true; }
private boolean openInNewEditor(Object element) { try { IEditorPart newEditor= EditorUtility.openInEditor(element); if (newEditor != null && element instanceof IJavaElement) EditorUtility.revealInEditor(newEditor, (IJavaElement) element); return true; } catch (PartInitException e) { JavaPlugin.log(e); return false; } }
private boolean openInNewEditor(Object element) { try { IEditorPart newEditor= EditorUtility.openInEditor(element); if (newEditor != null && element instanceof IJavaElement) EditorUtility.revealInEditor(newEditor, (IJavaElement) element); return true; } catch (PartInitException e) { JavaPlugin.log(e); return false; } }
/** * Selects and reveals the given region in the given editor part. * * @param part the editor part * @param region the region */ public static void revealInEditor(IEditorPart part, IRegion region) { if (part != null && region != null) revealInEditor(part, region.getOffset(), region.getLength()); }
/** * Selects and reveals the given region in the given editor part. * * @param part the editor part * @param region the region */ public static void revealInEditor(IEditorPart part, IRegion region) { if (part != null && region != null) revealInEditor(part, region.getOffset(), region.getLength()); }
/** * Selects and reveals the given region in the given editor part. */ public static void revealInEditor(IEditorPart part, IRegion region) { if (part != null && region != null) revealInEditor(part, region.getOffset(), region.getLength()); }
@Override public void activateEditor(IWorkbenchPage page, IStructuredSelection selection) { if (selection == null || selection.isEmpty()) return; Object element= selection.getFirstElement(); IEditorPart part= EditorUtility.isOpenInEditor(element); if (part != null) { page.bringToTop(part); if (element instanceof IJavaElement) EditorUtility.revealInEditor(part, (IJavaElement) element); } }
public IEditorPart openElement(Object element) throws PartInitException { IWorkbenchPage wbPage= JavaPlugin.getActivePage(); IEditorPart editor; if (NewSearchUI.reuseEditor()) editor= showWithReuse(element, wbPage); else editor= showWithoutReuse(element); if (element instanceof IJavaElement) EditorUtility.revealInEditor(editor, (IJavaElement) element); return editor; }
@Override public void activateEditor(IWorkbenchPage page, IStructuredSelection selection) { if (selection == null || selection.isEmpty()) return; Object element= selection.getFirstElement(); IEditorPart part= EditorUtility.isOpenInEditor(element); if (part != null) { page.bringToTop(part); if (element instanceof IJavaElement) EditorUtility.revealInEditor(part, (IJavaElement) element); } }
public void activateEditor(IWorkbenchPage page, IStructuredSelection selection) { if (selection == null || selection.isEmpty()) return; Object element= selection.getFirstElement(); IEditorPart part= EditorUtility.isOpenInEditor(element); if (part != null) { page.bringToTop(part); if (element instanceof IJavaElement) EditorUtility.revealInEditor(part, (IJavaElement) element); } }
public IEditorPart openElement(Object element) throws PartInitException { IWorkbenchPage wbPage= JavaPlugin.getActivePage(); IEditorPart editor; if (NewSearchUI.reuseEditor()) editor= showWithReuse(element, wbPage); else editor= showWithoutReuse(element); if (element instanceof IJavaElement) EditorUtility.revealInEditor(editor, (IJavaElement) element); return editor; }
private void gotoSelectedElement() { Object selectedElement= getSelectedElement(); if (selectedElement != null) { try { dispose(); IEditorPart part= EditorUtility.openInEditor(selectedElement, true); if (part != null && selectedElement instanceof IJavaElement) EditorUtility.revealInEditor(part, (IJavaElement) selectedElement); } catch (CoreException ex) { JavaPlugin.log(ex); } } }
private void gotoSelectedElement() { Object selectedElement= getSelectedElement(); if (selectedElement != null) { try { dispose(); IEditorPart part= EditorUtility.openInEditor(selectedElement, true); if (part != null && selectedElement instanceof IJavaElement) EditorUtility.revealInEditor(part, (IJavaElement) selectedElement); } catch (CoreException ex) { JavaPlugin.log(ex); } } }
private void gotoSelectedElement() { Object selectedElement= getSelectedElement(); if (selectedElement != null) { try { dispose(); IEditorPart part= EditorUtility.openInEditor(selectedElement, true); if (part != null && selectedElement instanceof IJavaElement) EditorUtility.revealInEditor(part, (IJavaElement) selectedElement); } catch (CoreException ex) { JavaPlugin.log(ex); } } }
/** * Links to editor (if option enabled) * @param selection the selection */ private void linkToEditor(ISelection selection) { Object obj= SelectionUtil.getSingleElement(selection); if (obj != null) { IEditorPart part= EditorUtility.isOpenInEditor(obj); if (part != null) { IWorkbenchPage page= getSite().getPage(); page.bringToTop(part); if (obj instanceof IJavaElement) EditorUtility.revealInEditor(part, (IJavaElement) obj); } } }
/** * Links to editor (if option enabled) * @param selection the selection */ private void linkToEditor(ISelection selection) { Object obj= SelectionUtil.getSingleElement(selection); if (obj != null) { IEditorPart part= EditorUtility.isOpenInEditor(obj); if (part != null) { IWorkbenchPage page= getSite().getPage(); page.bringToTop(part); if (obj instanceof IJavaElement) EditorUtility.revealInEditor(part, (IJavaElement) obj); } } }