Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




EclipseJDT Plug-in Developer Guide
Previous Page Home Next Page

Opening a Java editor

The following snippet shows how JavaUI can be used to open a Java editor and display a specific member of a Java compilation unit.

    void showMethod(IMember member) throws PartInitException, JavaModelException {
        ICompilationUnit cu = member.getCompilationUnit();
        IEditorPart javaEditor = JavaUI.openInEditor(cu);
        JavaUI.revealInEditor(javaEditor, (IJavaElement)member);

The methods openInEditor and revealInEditor also work for class files and for members contained in class files.

  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire