Version 5.8
Copyright © 2009, 2010 , 2011, 2012 Lars Vogel
10.04.2012
| Revision History | ||
|---|---|---|
| Revision 0.1 | 14.02.2009 | Lars Vogel |
| created | ||
| Revision 0.2 - 5.8 | 16.02.2009 - 10.04.2012 | Lars Vogel |
| bug fixes and enhancements | ||
Table of Contents
Eclipse 4 allows to run Eclipse 3.x RCP applications and Eclipse 3.x plug-ins. You Eclipse RCP application should have an existing product configuration file for the migration.
Using the compatibility layer allows to migrate existing Eclipse 3.x plug-ins and applications to Eclipse 4 and to start evaluating advantages of Eclipse 4, e.g. the application model and CSS based styling.
The compatibility layer converts the relevant extension point information into the application model. In the "org.eclipse.platform" plug-in you find the file "LegacyIDE.e4xmi" which defines the initial window and some add-ons.
If Eclipse is started in compatibility mode, this file is read via
the
E4Workbench
class
from the
org.eclipse.e4.workbench.ui.internal
package.
E4Workbench
will then convert the relevant extension points in the application
model.
Unfortunately concepts like dependency injection for
Views
do not work (out of the box) with the compatibility layer.
The easiest way to migrate your Eclipse RCP application to Eclipse
4.2 is to have a feature
based
product configuration file which
includes
the standard
org.eclipse.rcp
feature.
In Eclipse 4 this feature has been upgraded to includes most of the necessary additional plug-ins for the compatibility mode. If your product is based on this feature you can just start your Eclipse 3.x product unmodified and it will work.
You only need to add two additional plugins, "org.eclipse.emf.ecore" and "org.eclipse.emf.common".
If you product configuration file is based on plug-ins you have to add the following plug-ins to it:
org.eclipse.e4.ui.workbench.addons.swt
org.eclipse.equinox.ds
org.eclipse.equinox.event
org.eclipse.equinox.util
org.eclipse.platform
org.eclipse.ui.forms
org.eclipse.ui.intro
After this change you should be able to start your existing application based on Eclipse 4.
Currently the compatibility layer has a few limitations. Here is a list of some relevant bugs. Please note that Eclipse 4 is moving fast, hence these bugs might already be closed by the time you are reading this.
Related bugs:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=319991 - Quick access should not be hard-coded
https://bugs.eclipse.org/bugs/show_bug.cgi?id=372373 - [Compatibility] Update of org.eclipse.rcp feature
https://bugs.eclipse.org/bugs/show_bug.cgi?id=365799 - Incorrect features are added via "Add Required"
https://bugs.eclipse.org/bugs/show_bug.cgi?id=378975 - RCP templates fail to launch
Unfortunately it is not possible to run an application in compatibility model and extend its application model via fragments or processors. This is due to the fact that first the fragments and then the processors are processed and afterwards the compatibility layer.
You can however define your own "LegacyIDE.xmi" file and add your
model components to this file. Via the "applicationXMI" parameter in
your
org.eclipse.core.runtime.products
extension point you point to that file.
For this approach you would copy the standard "LegacyIDE.e4xmi"
file
and add your model components to it. This file can be found
in the
org.eclipse.ui.workbench
plug-in.
An example for this approach can be found under Mixed Eclipse RCP application on Github .
While this approach seems to work, it is currently not official supported so be careful if you use this.
Before posting questions, please see the vogella FAQ. If you have questions or find an error in this article please use the www.vogella.com Google Group. I have created a short list how to create good questions which might also help you.
http://wiki.eclipse.org/E4 Eclipse E4 - Wiki