A software professional. Passionate about java and software development, and watercolor painting Vishal has posted 6 posts at DZone. You can read more from them at their website. View Full User Profile

When to Extend Which Extension Point in Eclipse Plugin

03.01.2013
| 3151 views |
  • submit to reddit
There’s no need to tell how much popular and widely used the Eclipse platform is. And the huge success of it lies in its extensibility.

It is extensible through the means of extension points (well defined exposed places/hooks for others to provide extended functionality) and plugins ( providing extended functionality using existing extension points and optionally exposing new extension points). Eclipse itself is made up of many and many of plugins built around the small core runtime engine capable of dynamic discovery, loading, and running of plug-ins.

In this post I’m not going to provide a hello-world plugin tutorial or introduction of Eclipse platform (as you can find many good ones on net). I’m going to share what difficulty I faced when I started plugin development. After reading some introduction tutorials I wanted to know quickly which extension points I need to use for some particular tasks. Once we know the name of extension point we can find the details in official eclipse documentation (Extension Points Reference) or even better within platform itself (Plugin Development Environment) when trying to add an extension point it gives the description and sample implementation (if available) to understand.

plugin1

So I’ll focus on quick introduction (to help you get started with further links) of some common extension points and when we can use them (not how) (considered release is Eclipse Juno). If you need introduction for Eclipse Plugin Development, you can read first http://www.vogella.com/articles/EclipsePlugIn/article.html for example or request google for other ones.

But before understanding the various extension points, we need to understand the Platform structure and few terms.

eclipse

The various subsystems (on top of Platform Runtime) as described above define many extension points to provide the additional related functionality.

Below are the various components of the workbench UI.

workbench

Now below describes the common functionality you want to extend/customize and which extensions points are your friends.

Add menus/buttons:

menus

declare an abstract semantic behavior of an action (command) with optional default handler: org.eclipse.ui.commands

add menus, menu items and toolbar buttons in UI: org.eclipse.ui.menus

add specific handlers to a command: org.eclipse.ui.handlers

declare key bindings (or set of them called as schemes) to commands: org.eclipse.ui.bindings

More help at: Configuring and adding menu items in Eclipse V3.3

Add Views:

view

define additional views  for the workbench: org.eclipse.ui.views

More help at: creating an Eclipse view (old)

Add Editors:

editor

add new editors to the  workbench: org.eclipse.ui.editors

More help at: Eclipse Editor Plugin Tutorial

Configure the launching of Applications:

launch1

launch2

define/configure a type for launching applications : org.eclipse.debug.core.launchConfigurationTypes

associate an image with a launch configuration type: org.eclipse.debug.ui.launchConfigurationTypeImages

define group of tabs for a launch configuration dialog: org.eclipse.debug.ui.launchConfigurationTabGroups

define shortcut for launching application based on current selection/ perspective: org.eclipse.debug.ui.launchShortcuts

More help at: Launching Framework in Eclipse

Add resource markers:

markers

add marker (additional information to tag to Resources like Projects, Files, Folders): org.eclipse.core.resources.markers

More help at: Using markers to tell users about problems and tasks

Add Preferences:

preference

add pages to the preference dialog box: org.eclipse.ui.preferencePages

More help at: Eclipse Preferences Tutorial

Add wizards:

wizard

add wizard to create a new resource: org.eclipse.ui.newWizards

add wizard to import a resource: org.eclipse.ui.importWizards

add wizard to export a resource: org.eclipse.ui.exportWizards

More help at: Creating Eclipse Wizards Tutorial

Contribute Help:

expanded_book

add help for an individual plugin: org.eclipse.help.toc

More help at: Contributing a little help

Define specialized searches:

register search pages: org.eclipse.search.searchPages

register search result pages: org.eclipse.search.searchResultViewPages

More help at: Custom Search Page

I hope it helps someone in the similar need. Let me know if it is useful or if you have any suggestions for improvement.

Happy Eclipse, Bye


Published at DZone with permission of its author, Vishal Jain.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)