2008-09-04

The Eclipse RCP - 1 - Rich Client Platform

For the full tutorial, see http://www.vogella.de/articles/RichClientPlatform/article.html

The Platform
The Eclipse RCP is a platform, where no functionality is implemented in it; its sole purpose is to manage the plug-ins, where everything in the program is done using the plug-ins.
The plug-ins implement everything, from the menu bar, to the status bar, to the main toolbar, to the views (or panels), to the Editors (which may not be editing anything, but they are the main focus of the program), to auxiliary functionality like software automatic update and help and the management of long-running background operations; these plug-ins are the heart-and-soul of any Eclipse RCP-based program.
The basis for this architecture is the runtime environment of Eclipse which is based on the OSGi Alliance. Eclipse used the OSGi reference implementation Equinox to run upon. The Plug-in concept of Eclipse is the same as the bundle concept of OSGi.

Minimum Requirements
As a minimum, a RCP application requires:
  • Main program or Application (org.eclipse.core.runtime.applications extension point)
  • Workbench Advisor (invoked from the Application handler, it sets the default Perspective, invokes WorkbenchWindowAdvisor which configures the default Main window state and subsequently invokes ActionBarAdvisor, which in turn provides one of the ways to configure the Action Bar or the main menu and Cool Bar or the main toolbar)
  • A Perspective (org.eclipse.ui.perspectives extension point)
  • A View (org.eclipse.ui.views extension point, views are technically not required for a RCP application, but they are the base interface element)
The RCP application depends on 2 main plug-ins:
  • org.eclipse.core.runtime
  • org.eclipse.ui

Plug-ins Architecture
The RCP architecture is based on the concept of extension-points, which a plug-in provides so that any other plug-ins can contribute functionality to it in the form of extensions, e.g. you can easily provide your menu items in the Action Bar (an extension point provided by the org.eclipse.ui plug-in) by implementing extensions that connect to the org.eclipse.ui.menus extension point and provide their own implementation. In general an extension point can be used several times (either by the same plug-in or by other plug-ins).
The plug-in architecture is based on 2 configuration files (or manifests) that describe the behavior of the plug-in, "MANIFEST.MF" and "plugin.xml", by double clicking on any of them, Eclipse provides a graphical editor of the files contents.
The plug-in manifest ties all the code and the resources together, the OSGi bundle manifest is stored in "MANIFEST.MF", while the Eclipse specific parts are stored in "plugin.xml".

No comments: