1 / 9

Extending Eclipse

Extending Eclipse. General concepts and Project related APIs. Yearly project, Winter 05/06 The Technion. Eclipse – an overview. Eclipse is a collection of plugins Each plugin may provide Extension points APIs To be used by other plugin ’ s extensions. UI contribution.

tudor
Download Presentation

Extending Eclipse

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Extending Eclipse General concepts and Project related APIs Yearly project, Winter 05/06 The Technion

  2. Eclipse – an overview • Eclipse is a collection of plugins • Each plugin may provide • Extension points • APIs • To be used by other plugin’s extensions

  3. UI contribution • The starting point: • org.eclipse.ui.* extension points • Usually, for implementing UI features, extensions use org.eclipse.jface.* helper classes (Dialogs, Wizard, etc.) • JFace is implemented on top of SWT (Standard Widget Toolkit, org.eclipse.swt.*) • (Extensions may use SWT directly)

  4. Resources • The workspace contains the user’s resources: projects, folders and files • Resources plug-in provides APIs for manipulating the workspace (org.eclipse.core.resources) • Manipulation is done via handles • IResource, IProject, IFile… • IResource.exist() IWorkspaceRoot myWorkspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); IProject myProject = myWorkspaceRoot.getProject("MyProj");

  5. The Java Model • Java-based view on resources • Java handles are retrieved via JavaCore • IJavaElement, ICompilationUnit, IMethod… • Use DOM/AST API for a detailed analysis of a compilation unit • org.eclipse.jdt.core.dom

  6. Eclipse Runtime • The Plugin class represents a plug-in that is running in the platform • Managed as an OSGI bundle • start(BundleContextcontext) • initialization behavior for a plug-in • Use BundleContextto obtain information of all bundles (excluding extensions’ info) • And to register listeners to changes in other bundles’ life-cycle • stop(BundleContextcontext)

  7. Eclipse Runtime (Cont.) • IExtensionRegistry provides information related to extension-points and extensions import org.eclipse.core.runtime.Platform; IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint point = registry.getExtensionPoint("org.eclipse.ui.views"); IExtension[] extensions = point.getExtensions(); [Then, IConfigurationElement can be used to examine the attributes of an extension and to create a new instance of the related class by calling: createExecutableExtension(…)]

  8. Eclipse debug model • Defines generic interfaces • To be implemented and extended by…(?) • ILaunch, IDebugTarget, IThread, IStackFrame, IBreakpoint, DebugEvent… • org.eclipse.debug.* • org.eclipse.debug.core.DebugPlugin (a starting point)

  9. JDT debug • supports running and debugging of Java code • org.eclipse.jdt.debug.* • org.eclipse.jdt.debug.core.JDIDebugModel • May be used to create BPs for resources • To register BPs listeners

More Related