| Free tutorials for Java, Eclipse and Web programming |
Version 4.1
Copyright © 2007-2010 Lars Vogel
12.04.2010
| Revision History | ||
|---|---|---|
| Revision 0.1-0.7 | 03.09.2007 | Lars Vogel |
| Eclipse RCP with Eclipse 3.3 | ||
| Revision 0.8 | 10.07.2008 | Lars Vogel |
| Updated to Eclipse 3.4 | ||
| Revision 0.9 | 03.11.2008 | Lars Vogel |
| Re-worked the command contribution to toolbars. | ||
| Revision 1.0 | 06.01.2009 | Lars Vogel |
| Re-worked the product configuration part | ||
| Revision 1.1 | 04.03.2009 | Lars Vogel |
| Added example for field assist | ||
| Revision 1.2 | 29.03.2009 | Lars Vogel |
| General rework | ||
| Revision 1.3 | 30.03.2009 | Lars Vogel |
| Moved several commmands related content to own Article, placed Actions into the appendix | ||
| Revision 1.3.1 | 04.04.2009 | Lars Vogel |
| Fixed screenshot problem | ||
| Revision 1.4 | 20.04.2009 | Lars Vogel |
| Reworked Dialog Examples | ||
| Revision 1.5 | 22.04.2009 | Lars Vogel |
| Reworked Wizard Examples, removed unnecessary method | ||
| Revision 1.6 | 30.04.2009 | Lars Vogel |
| Updated the progress example with commands | ||
| Revision 1.7 | 02.05.2009 | Lars Vogel |
| How to add view to perspective via extension point, moved Eclipse Forms to own article | ||
| Revision 1.8 | 24.05.2009 | Lars Vogel |
| Perspective now based on standard command | ||
| Revision 1.9 | 30.05.2009 | Lars Vogel |
| Combined part of commands in RCP and Eclipse Commands Article | ||
| Revision 2.0 | 10.06.2009 | Lars Vogel |
| Update to Eclipse 3.5 (Galileo), removed actions | ||
| Revision 2.1 | 24.06.2009 | Lars Vogel |
| Added ElementListSelectionDialog to dialog section | ||
| Revision 2.2 | 25.06.2009 | Lars Vogel |
| Moved preferences to own article http://www.vogella.de/articles/EclipsePreferences/article.html | ||
| Revision 2.3 | 28.06.2009 | Lars Vogel |
| Added command for showing the about dialog | ||
| Revision 2.4 | 01.07.2009 | Lars Vogel |
| How to install Eclipse RCP via the update manager | ||
| Revision 2.5 | 18.07.2009 | Lars Vogel |
| Fixed Tray example | ||
| Revision 2.6 | 25.07.2009 | Lars Vogel |
| Added plugin.xml for command example | ||
| Revision 2.7 | 28.07.2009 | Lars Vogel |
| moved how to create plugins from jars to own article http://www.vogella.de/articles/EclipseJarToPlugin/article.html | ||
| Revision 2.8 | 12.08.2009 | Lars Vogel |
| Launch configuration screenshots adjusted | ||
| Revision 2.9 | 13.08.2009 | Lars Vogel |
| Perspective screenshots adjusted | ||
| Revision 2.9 | 15.08.2009 | Lars Vogel |
| Moved how to add error log view to my blog | ||
| Revision 3.1 | 16.08.2009 | Lars Vogel |
| Product configuration updated | ||
| Revision 3.2 | 17.08.2009 | Lars Vogel |
| Moved internationalization to http://www.vogella.de/articles/EclipseInternationalization/article.html | ||
| Revision 3.3 | 08.09.2009 | Lars Vogel |
| Added plug-in required to update Java IDE to RCP IDE | ||
| Revision 3.4 | 10.10.2009 | Lars Vogel |
| Fixed bug in getStatusLine from editor | ||
| Revision 3.5 | 30.11.2009 | Lars Vogel |
| Improve TitleAreaDialog example | ||
| Revision 3.6 | 08.01.2010 | Lars Vogel |
| Fixed screenshot | ||
| Revision 3.7 | 27.01.2010 | Lars Vogel |
| Added screenshot to system tray and commented code | ||
| Revision 3.8 | 03.02.2010 | Lars Vogel |
| Added group by info | ||
| Revision 3.9 | 04.02.2010 | Lars Vogel |
| Removed reference to solved -consoleLog bug | ||
| Revision 4.0 | 17.02.2010 | Lars Vogel |
| Updated perspective chapter | ||
| Revision 4.1 | 12.04.2010 | Lars Vogel |
| Improved status line example | ||
Eclipse RCP
This article describes how to develop applications using the Eclipse Rich Client Platform (RCP) architecture.
The article covers among others the creating of RCP applications, using commands, views, editors, dialogs and creating and deploying a Eclipse product.
This article is based on Eclipse 3.5 (Eclipse Galileo).
Table of Contents
Eclipse RCP allows developers to use the Eclipse architecture to design flexible and extensible stand-alone applications re-using a lot of already existing functionality and coding patterns inherent in Eclipse.
For an brief introduction into Eclipse, the concepts and terminology (perspective, views, editors) please see Eclipse IDE Tutorial .
Eclipse is build upon a plugin architecture. This allows Eclipse to get easily extended. See Eclipse Plugin Tutorial for a guide on how-to extend the Eclipse IDE. Eclipse RCP provides the same modular concept for stand-alone applications.
To create an Eclipse RCP application you would create a plugin which contains the application. This application can use the existing hooks of Eclipse (called Extension Points) to define functionality and / or the user interface and / or provide its own extension points to get extended by other plugins.
The most important architectural characteristics of Eclipse is the Plugin architecture. The Eclipse IDE is build as a number of plugins which are dependent on each other.
Plugins are the smallest deployable and installable software components of Eclipse.
Each plugin can define extension-points which define possibilities for functionality contributions ( code and non-code ) by other plugins. Non-code functionality contributions are for example the provision of help content.
A plugin can use extensions, e.g. provide functionality to these extension points. In general an extension point can be used several times (either by the same plugin or by other plugins). See Eclipse Extension Points and Extensions - Tutorial for details.
The basis for this architecture is the runtime environment Equinox of Eclipse which is the reference implementation of OSGI. See OSGi development - Tutorial for details. The Plugin concept of Eclipse is the same as the bundle concept of OSGI. Generally speaking a OSGI bundle equals a Plugin and vice-versa.
The used extensions and the provided extension-points are described in the file plugin.xml. This file is a XML file which can be edited via the PDE (Plugin Development Environment) which provides a nice user interface for editing this file.
Eclipse RCP provides and uses the same framework as the Eclipse Workbench hence allowing the programmer to divide the application functionality into several plugins, to use existing extension points and to provide additional extension points. This concept of Eclipse allows every programmer to structure his RCP application into several independent components and to easily declare extensions to existing extensions points.
An Eclipse RCP application requires:
Main program - A RCP main application class implements the interface IApplication. Eclipse expects that the application class is defined via the extension point org.eclipse.core.runtime.application.
A Perspective - The perspective is extended from org.eclipse.ui.perspective
Workbench Advisor- invisible technical component which controls the appearance of the application (menus, toolbars, perspectives, etc)
All plugins must provide a so-called manifest named "plugin.xml".
The minimal required plugins to create and run an Eclipse RCP application are the two plugins "org.eclipse.core.runtime" and "org.eclipse.ui"
To run an Eclipse RCP program you have to define an application . The application can be seen as the main() method of a standard Java program. If this application shuts down the complete program is terminated.
In Eclipse terms a product is everything that goes with your application, e.g. icons, splash screen, external jars, other plugins, etc.
The plugin configuration is contained in the two files:
MANIFEST.MF - the OSGi bundle manifest is stored in MANIFEST.MF
plugin.xml - additional Eclipse specific (non standard OSGi) configuration, e.g. the extension points
The PDE provides an editor for editing the "MANIFEST.MF" and "plugin.xml".
In addition to these files you have the .project file. The .project contains the description of your project. It contains a XML tag "natures" where the nature of the project is described. A plugin project has the nature "org.eclipse.pde.PluginNature" and a java project has the nature "org.eclipse.jdt.core.javanature". These tags will also steer some behavior of the development environment, e.g. a project with PluginNature will update the java class path if you change the dependency information in a plugin project.