/** * Reveals the source range of the given source reference element in the * given editor. No checking is done if the editor displays a compilation unit or * class file that contains the given source reference. The editor simply reveals * the source range denoted by the given source reference. * * @param part the editor displaying the compilation unit or class file * @param element the source reference element defining the source range to be revealed * * @deprecated use <code>revealInEditor(IEditorPart, IJavaElement)</code> instead */ public static void revealInEditor(IEditorPart part, ISourceReference element) { if (element instanceof IJavaElement) revealInEditor(part, (IJavaElement) element); }
/** * Reveals the source range of the given source reference element in the * given editor. No checking is done if the editor displays a compilation unit or * class file that contains the given source reference. The editor simply reveals * the source range denoted by the given source reference. * * @param part the editor displaying the compilation unit or class file * @param element the source reference element defining the source range to be revealed * * @deprecated use <code>revealInEditor(IEditorPart, IJavaElement)</code> instead */ @Deprecated public static void revealInEditor(IEditorPart part, ISourceReference element) { if (element instanceof IJavaElement) revealInEditor(part, (IJavaElement) element); }
/** * Reveals the source range of the given source reference element in the * given editor. No checking is done if the editor displays a compilation unit or * class file that contains the given source reference. The editor simply reveals * the source range denoted by the given source reference. * * @param part the editor displaying the compilation unit or class file * @param element the source reference element defining the source range to be revealed * * @deprecated use <code>revealInEditor(IEditorPart, IJavaElement)</code> instead */ @Deprecated public static void revealInEditor(IEditorPart part, ISourceReference element) { if (element instanceof IJavaElement) revealInEditor(part, (IJavaElement) element); }
public Object execute(ExecutionEvent event) throws ExecutionException { IJavaElement javaElement= (IJavaElement) event.getObjectParameterForExecution(PARAM_ID_ELEMENT_REF); try { IEditorPart editorPart= JavaUI.openInEditor(javaElement); JavaUI.revealInEditor(editorPart, javaElement); } catch (JavaModelException ex) { throw new ExecutionException("Error opening java element in editor", ex); //$NON-NLS-1$ } catch (PartInitException ex) { throw new ExecutionException("Error opening java element in editor", ex); //$NON-NLS-1$ } return null; }
@Override public Object execute(ExecutionEvent event) throws ExecutionException { IJavaElement javaElement= (IJavaElement) event.getObjectParameterForExecution(PARAM_ID_ELEMENT_REF); try { IEditorPart editorPart= JavaUI.openInEditor(javaElement); JavaUI.revealInEditor(editorPart, javaElement); } catch (JavaModelException ex) { throw new ExecutionException("Error opening java element in editor", ex); //$NON-NLS-1$ } catch (PartInitException ex) { throw new ExecutionException("Error opening java element in editor", ex); //$NON-NLS-1$ } return null; }
@Override public Object execute(ExecutionEvent event) throws ExecutionException { IJavaElement javaElement= (IJavaElement) event.getObjectParameterForExecution(PARAM_ID_ELEMENT_REF); try { IEditorPart editorPart= JavaUI.openInEditor(javaElement); JavaUI.revealInEditor(editorPart, javaElement); } catch (JavaModelException ex) { throw new ExecutionException("Error opening java element in editor", ex); //$NON-NLS-1$ } catch (PartInitException ex) { throw new ExecutionException("Error opening java element in editor", ex); //$NON-NLS-1$ } return null; }
IEditorPart part= EditorUtility.openInEditor(element, activateOnOpen); if (part != null && element instanceof IJavaElement) JavaUI.revealInEditor(part, (IJavaElement)element); } catch (PartInitException e) { String message= Messages.format(ActionMessages.OpenAction_error_problem_opening_editor, new String[] { new JavaUILabelProvider().getText(element), e.getStatus().getMessage() });
IEditorPart part= EditorUtility.openInEditor(element, activateOnOpen); if (part != null && element instanceof IJavaElement) JavaUI.revealInEditor(part, (IJavaElement)element); } catch (PartInitException e) { String message= Messages.format(ActionMessages.OpenAction_error_problem_opening_editor, new String[] { new JavaUILabelProvider().getText(element), e.getStatus().getMessage() });
IEditorPart part= EditorUtility.openInEditor(javaElement, activateOnOpen); if (part != null && javaElement instanceof IJavaElement) JavaUI.revealInEditor(part, (IJavaElement) javaElement);
IEditorPart part= EditorUtility.openInEditor(javaElement, activateOnOpen); if (part != null && javaElement instanceof IJavaElement) JavaUI.revealInEditor(part, (IJavaElement) javaElement);