The e4-Team just announced the availability of the Eclipse 4.0 SDK “Early Adopter Release” (Reviewslides) which marks a major platform update since the inception of 3.0 6 years ago.
Just to reiterate what the 4.0 SDK is and to set expectations right. The 4.0 SDK is marked as an “Early adopter release” targeted at Plug-in Developers who want to test their code on the upcoming 4.x platform and report problems because of broken APIs or “APIs” not available anymore because they used internals of the platform.
The 4.0 SDK “Early Adopter Release” is not targeted for use as your Primary IDE so keep this rough edges in mind when giving the 4.0 SDK a try.
When takeing a closer look to the release you’ll notice that in reality multiple different things have been released:
- Eclipse 4.0:
- Eclipse 4.0 Application Platform: The new application platform to write OSGi-base (UI-)Applications centered around a new programming model using DI and a modeled application kernel
- Eclipse 4.0 Compatible Rich Client Platform: Compability layer for API clean 3.x bundles to run unmodified on the new Application Platform
- Eclipse 4.0 SDK: Eclipse 4.0 Application Platform + Eclipse 4.0 Compatible Rich Client Platform + PDE 3.6 + JDT 3.6
- Eclipse 4.0 Technologies (also called “e4 SDK 0.10” / “e4 release July 2010” because the releasing project is e4):
- XWT + Tooling: XAML for SWT/JFace and Visual Designer Tools
- Semantic Filesystem implementation
- Application Modeltooling
A small hint for Plug-in developers who are trying to debug their Plug-In by launching an inner Eclipse and all Eclipse 4.0 Application-Developers. The Eclipse 4.0 SDK misses at the moment the source bundles for the new Eclipse 4.0 components and you need to install it through the p2-repositories pre configured for you.
We recommend to install:
- EMF SDK
- Modeled Workbench Source
- CSS Support Source
to successfully step through the code using the debugger.
My personal main focus in the Eclipse 4.0 development for the last 2 years has been the “Eclipse 4.0 Application Platform” whose goal is to modernize and simplify the development of OSGi-based UI-Application using DI and a modeled application approach. In the last few months I also worked on a tool to make writing applications for the Eclipse 4.0 Application Platform easier.
The model tooling
Since March I’ve been dedicated half of my 4.0 development time implementing support for the application model underpinning the Eclipse 4.0 Application Platform.
The model tooling has not yet graduated out of the e4-incubator and so is not part of the Eclipse 4.0 SDK download and you’ll have to install it using the preconfigured e4-repository – you find it in the “E4 Tools”-category.
The tooling is working in 2 modes:
- Design/Development-Time mode: This is the standard mode you are using when developing an application. In this mode you operate on a Application-Model persisted as a XMI-File in your workspace.
- Live mode: In this mode you are operating on the live model of a running application and are able to inspect and modify live
The Eclipse 4.0 Modeltooling is written to run native on the Eclipse 4.0 Application Platform (no useage of the Backward-Compat-Layer) but also integrates smoothly in the Eclipse 4.0 SDK.
Probably one of the most remarkable things though is that it runs also in a 3.6 SDK enabled by the so called Forward Compat Layer I started developing who does the opposite of the backward-compat-layer. It allows you to run components using the Eclipse 4.0 Progamming model which is built upon POJOs and DI in a 3.6 environment.
This makes it possible to write Eclipse 4.0 Applications using the 3.6 SDK as the screenshot demonstrates:
All you need is to install the tools using the e4 Update Site which is available on http://download.eclipse.org/e4/updates/2010.
When introducing new technologies we know that it is important to give people a medium sized example application which explains the concepts of the framework and provides them “monkey see, monkey do” example code. That’s why I’ve worked in the last few days/weeks on a tutorial which helps people getting started writing applications using the “Eclipse 4.0 Application Platform”
You can download the tutorial which is released under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 using this link. The sources codes are released under EDL-1.0/EPL-1.0 and are available from github and/or as individual zips (urls found in the PDF).
If you only want to take a look at an application built using the Eclipse 4.0 Application Platform you can downloaded using the links below:
- Mac Version (cocoa32bit,cocoa64bit)
- Linux Version(32bit,64bit)
- Win32 Version(32bit,64bit)
You need Java 6 to run the demo although Eclipse 4.0 itself only needs Java5. To get accounts displayed on the left you should enter the following values in the Preference Dialog:
- Username: john
- Password: doe
- Host: blabla.com
It looks like the update-code triggering of the AccountView is a bit weak so if you are not informed about the opening of the session after clicking around stop and starting the application should help you (I’ll try to work on a solution in the days to come).
Just in case you like the service I’m providing to you for free with this tutorial and you want to donate some cents here’s the button to push:
- Fixed unclear section on page 6
- Added warning to not install Visual WorkbenchTooling
Thank you, Tom! This is an excellent post, great job and a perfect tutorial!!
Thanks for good tutorial.It would be great if there is sample e4 with Hibernate with persistence context .
I try to follow this excellent tutorial, but i don’t manage to add Tools with update manager. EMF dependancy is missing. Do you know this issue? Wich version of SDK is better to download to follow the tutorial?
Did you download the 4.0 SDK? The update-manager should resolve EMF just fine but you could also install EMF-SDK first using the Helios-Update-Site part of the preconfigured Repository in 4.0 SDK.
Yes i downloaded the 4.0 SDK. I don’t understand, i’ll try later with not “early adpter” release.
Not sure what’s going wrong for you. You need to make sure the update-manager “Contact all other update sites during install to find required software” is checked. Does installing the EMF-SDK throught the helios update site (Helios – http://download.eclipse.org/releases/helios) work?
Great job! In fact, I face the same issue: I think you should recommend to add Helios update site to make sure all dependencies will be solved.
Once again, thanks for the great work.
hm – isn’t the Helios update-site preconfigured in the Eclipse 4.0 SDK?
Nope, my Eclipse 4.0 came without any update site.
Do you by chance still have the URL you downloaded the zip from or give me a detailed Version number? What’s the exact name of the ZIP?
just get it from http://download.eclipse.org/e4/sdk/drops/R-4.0-201007271520/
Note, I took the x86 64 bits version (eclipse-SDK-4.0-win32-x86_64.zip)
Hope that helps
Thanks for the information – I’ve forwarded the message to the e4-IRC so that we can probably find out what’s wrong to fix it at least for the next milestones. I’ve update the tutorial to troubleshoot the situation.
OK with : C:~\eclipse-SDK-4.0-win32>eclipsec.exe -application org.eclipse.equinox.p2.director -consoleLog -noSplash -repository http://download.eclipse.org/eclipse/updates/4.0,http://download.eclipse.org/e4/updates/2010,http://download.eclipse.org/releases/helios -installIU org.eclipse.releng.tools.feature.group,org.eclipse.emf.sdk.feature.group,org.eclipse.e4.ui.css.source.feature.feature.group,org.eclipse.e4.ui.source.feature.feature.group,org.eclipse.e4.ui.css.feature.feature.group,org.eclipse.e4.ui.feature.feature.group,org.eclipse.e4.core.tools.feature.feature.group
Wow, really impressive! Finally a thread for RCP programming. I feel I’m starting to get a fan of e4 – even at this early stage. Thanks a lot for the tutorial and additional information!
On Page 6, I could not find the Plugin.xml. Should I create one?
If you have the MANIFEST.MF open you can click on the Extension-Tab on the bottom and the add and the “org.eclipse.core.runtime.products”-extension point
Thanks for the response, the ‘new->other->e4’ does not provide the options for the ‘plugin.xml’ or ‘application.e4xmi’ or ‘.product’ file.
Also, when I had the MANIFEST.MF file open in the default editor, I could not see the extensions tab.
So, I created a brand new project, this time used the wizard and then I copied the plugin.xml from the new project to the old project, searched and replaced the project names.
Then when I open the MANIFEST.XML, I could see the ‘extensions’ tab.
Since the ‘new->other’ is not helping me in generating the .e4xmi and .product file, I had to copy them from the new project, and I am at page 10, but when I click runas -> java app, nothing happens.
Is my download from the eclipse.org not the right one? I did update the e4tools from the help-> install new software, but it looks like limited functionality. is the a seperate bundle somewhere to download as a whole?
-thanks a lot
You can’t run this as a Java-App because you need to have a Equinox-Application.
I do appreciate your effort to write this tutorial (I really do), but its current version is simply useless. It just doesn’t work with the Eclipse 4.0 SDK that was released a week ago.
First, as others pointed out, when you get to the bottom of page 6 there is no plugin.xml created in the project. I was able to find the Extension Points link in the Overview tab of MANIFEST.MF, but when I press it and go to Extension Points -> Add, it is not apparent to me what to put in those fields (Extension Point ID, Name, Schema). If I put “product”, “org.eclipse.core.runtime.products” and leave the schema intact, I get a SWTException. If I edit the plugin.xml with the text editor and paste the sample from the PDF it is still the same.
If I put this problem aside and continue the tutorial, the next road block is on the next page, 7. When I create the Application Model and press finish, I get “‘Setup’ encountered an error” message with a NPE in the details.
Either I am really stupid, or the SDK and the tutorials are far from ready for any kind of adopters. Sad but true.
Thanks for your feedback and I’m sorry that you find it and the 4.0 SDK useless. I’ll try rework this section to clarify this point.
Beside that you are using the wrong “Tab”. You’ll have to use “Extensions”-Tab and not “Extension Points” – that’s exactly the answer I gave to another comment! I don’t know what you installed and if you got an NPE I’d have hoped you filed a bugzilla with the details attached without seeing at least a stacktrace I can only say that it works on my installation, maybe you have installed the visual designer which doesn’t work but that’s something I can’t influence because its not written by me. Without getting stacktraces and bug reports we can’t fix your problems.
You can also get help at the e4-newsgroup if you are not comfortable filing bugs. You need to understand that you are working with a bleeding edge kind of framework which we are going to mature in the year to come.
I’ve now clarified the section on the plugin.xml and added a warning to NOT install an XWT-Workbench-Tooling stuff which at least doesn’t work for me.
I tried again, with the latest version of the tutorial and taking your advice into consideration and it works! Thanks!
It must have been the XWT that was causing the main problem – this time I took the SDK and only installed the E4 Tools, as you suggest and it works fine.
A couple of suggestions, that I believe will make the tutorial even better:
1. On page 6, in the initial version of the plugin.xml, the root element is missing from the sample code.
2. On page 11, when starting the mail application for the first time, it would be nice to point out that you should select the product file and then Run As -> Eclipse application. My first attempt was by selecting the project and it didn’t work as I expected – new Eclipse instance was started.
Thanks again! And sorry if my first comment was a bit harsh. I am playing with e4 in my spare time and it was really annoying not to be able to get it to work (after a hard day at work ;)).
Thanks Stefan – I/we (the whole e4-team) appreciate any feedback and incooperate it into the tutorial. To your suggestions:
About the first one, the Create a plugin.xml section on page 6 – I probably didn’t explain it clearly.
The problem is that the sample XML after Add a product definition like this misses the root element for a plugin.xml file, the plugin element. It starts with an extension element instead.
The latest PDF-version holds a complete plugin.xml:
When I use the sample XML, I get a “Invalid root element” error in the editor. But when I put plugin element around the extension element, like this:
everything seems to be fine. That is why I suggested a change in the tutorial.
Ooops, the sample code didn’t show up. Retry:
You are right – fixed the plugin.xml to hold the plugin-element in the root
Sorry for my English school.
Besides the keyboard shortcut section untreated( ExitHandler + DirectMenuItem), no problem with eclipse-SDK-4.0-win32 and all Java code.
Page 29 of the tutorial should specify one Add -> Dependencies -> org.eclipse.e4.core.di.extensions.
Thanks for your info the info. On the KeyBinding stuff did the explanation not work for you? Should I improve it in some way (e.g. more screenshots?)
I’ve fixed the missing dependency information and pushed a new version to the git-repo. Thanks for the feedback!
Sorry for the confusion, I have not dealt with the keyboard shortcut section for personal reasons (FOR ME not interesting).
At the step where I try to first create the Application.e4xmi the Visual Design Editor does not open properly, but instead presents a NullPointer exception. That implies something is missing, yet I HAVE updated everything available at the update site.
Please don’t install the Visual Editor stuff because it’s not working (at least for me it never worked on OS-X). Now that you have already installed it you could work around it by right clicking an selecting “Open With”
Pingback: 2010 in review « Tomsondev Blog
I have a comment/ question regarding an aspect of the e4 architecture.
Going through the contribution part of the tutorial I am wondering about why you have to wire things in the “NewMailHandler” which can be modeled in “Application.e4xmi” of the main plugin. Seeing the concepts of the “Application.e4xmi” model I would have expected that things like the “controls” part may be available also in the “fragment.e4xmi” and the most of the things in “NewMailHandler” would be provided by the framework.
Is this intentional or did the team not see/ consider the potential extensions of the architectural concept? I think that the current design of fragments is (for some areas) behind the capabilities of the old extension point concept.
I’m not sure I can follow you can you try to rephrase so that I better understand what we could/should improve. The fragement concept is as powerful and as the old plugin.xml. If you are not satisfied with the current model you can extend is quite easily (e.g. see our SimpleIDE project) if you know a little about EMF.
Thanks, for the response. Before I rephrase I have to study more your tutorial. Maybe I have overseen something.
I do not get the newmail part to run in e4.1 m5. The window pops up but while rendering the trimbar I get a nullPointer Exception.
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
Any idea where to start searching? Deleting the trimBar part all works fine.
Can please file a bug. There is the possibility of a regression in the rendering stuff and or I’m simply creating invalid things. Please cc me on the bug
Done with Bug 337890.
First of all, thanks for the tutorial – it’s a nice way to learn about E4. However, I have run across a number of issues as I try to go through the tutorial. For example:
* Some of the examples do not seem to run on Eclipse 4.1. For example, opening the preference dialog bombs in 4.1 with java.lang.NullPointerException at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener.getShellContext(ShellActivationListener.java:193). Note: I ran the code directly from chapter8.zip to make sure this wasn’t due to my own mistake. This code works in Eclipse 4.0 however.
* Running the code from contributions.zip in Eclipse 4.1 results in org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature ‘bindingContextId’ not found. Trying Eclipse 4.0 yields java.lang.ClassNotFoundException: org.eclipse.e4.core.commands.CommandServiceAddon and others.
* The document suggests all the source code is available from the git repository, but it looks to me like the git repository only contains the document – not the source. I was hoping to gain a little more insight about the differences between 4.0 and 4.1 via the history in git.
I started updating the stuff to 4.1 but didn’t had time to finish it. The source is also in the git repo and found in various branches. I’m going to take a look (maybe tonight) and publish a blog post when done. So if you simply subscribe to my blog you should get informed when I’m done.
Thanx very much for the tutorial. I just have one question about the NPE. I still get this Exception on the 4.1 Platform. What exaclty is the problem?
i also get another problem when running the code downloaded from git:
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature ‘bindingContextId’ not found. (platform:/plugin/org.eclipse.e4.demo.mailapp/Application.e4xmi, 30, 166)
What am I doing wrong?
The problem is that we’ve changed the model slightly in this area while working on 4.1 but I haven’t had the chance to fix my tutorial sources
Thanks Tom! I’m sorry – I’m a bit of a git noob. I see the branches now. I guess what confused me was that there appears to be no source in master. I’ll be watching the blog for updates. Thanks again.
Thanx for the quick answer. Is there a fast way to solve the NPE in the ShellActivationListener?
Caused by: java.lang.NullPointerException
Very nice e4 tutorial ! But wenn i try to start the example the same Problem here: Feature ‘bindingContextId’ not found.
will check your blog and hope you will find the time to update the sources 😉
I also ran into this nullpointer with eclipse 4.1. It works with 4.0. (older release of org.eclipse.e4.ui.workbench.swt)
Another thing to mention: Chapter “Event-System”. You didn’t mention, that you’ve created the interface EventConstants.
Nice tutorial. I am using the 4.1 version of your tutorial and doing testing with it on Juno 4.2. I guess something has changed again to cause NPE errors ( I have reached the end of page 26.) Don’t know if this was true on earlier Eclipse builds but the use of @Optional and ESelectionService are discouraged giving warnings. So I suppress the warnings and then when selection changes the NullPointerException error occurs. Trying to learn the right way to do things here…any suggestions would be helpful. Regards
They are marked as warning because they are not yet released.
Ok. So how hard should it be to eliminate the NPE error on 4.2. Are you interested in assisting?
So who is NULL at this point? Can you show me the NPE you get?
Ok Tom..thanks for looking at it
Here is first part of console output when the product is launched, there is a problem but it still opens:
!SESSION 2012-08-10 10:36:32.375 ———————————————–
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.e4.demo.mailapp.product
Command-line arguments: -product org.eclipse.e4.demo.mailapp.product -data C:\Users\Jim\workspace2/../runtime-MailDemo-4.0.product -dev file:C:/Users/Jim/workspace2/.metadata/.plugins/org.eclipse.pde.core/MailDemo-4.0.product/dev.properties -os win32 -ws win32 -arch x86 -consoleLog
!ENTRY org.eclipse.e4.ui.workbench 4 0 2012-08-10 10:36:35.937
!MESSAGE Unable to create class ‘org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon’ from bundle ’27’
…selecting an Account throws an NPE exception modal dialog, the app does sort of work as folders and mail
are mostly updated/displayed, here is console output when account is selected:
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Caused by: java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
… 42 more
so it looks like:
produces the NPE. what does this line look like? Did you tried adding syserr’s there to see who is null?
the problem is getMails() in org.eclipse.e4.demo.mailapp.mailservice.mock.MailSessionImpl
You could guard
return folderMails.get(folder).subList(startIndex, startIndex + amount);
if (folderMails.get(folder) == null) return new ArrayList();
Sorry this maybe an immature question but I am quite new to Eclipse 4.x.
From what I understand by reading your tutorial and various others, that without your E4 Tool, it is not possible to create an E4 Application?
The reason I am asking is because I recently downloaded Eclipse Juno and when I go to create a plugin project, it asks me for which Eclipse 3.x should the plugin be for; there is no option for 4.x. Also, I went to the E4 RCP Eclipse wiki and it gives me a permission denied on the chapters relating to `Creating an e4xmi file’. (http://wiki.eclipse.org/Eclipse4/RCP).
I have been working on an RCP for the last year in Eclipse 3.x and I was debating whether it is worth porting the project into 4.x or if I should wait longer (for example, until the E4 Tools comes out of incubation).
It is of course possible but a lot harder. The tooling though not released directly is useable and bugs get fixed so. Not having the tooling released should not stop you from using e4.
Hi, I am new to this and I’ve been trying to use your tutorial with Juno. Other than a few minor issues, it has been going fine. I have just gotten to the part where I add the annotations, create the parts, and wire them to the classes and I get the following NPE:
!ENTRY org.eclipse.e4.ui.workbench 4 0 2012-09-13 15:19:13.208
!MESSAGE Unable to create class ‘org.eclipse.e4.demo.mailapp.AccountView’ from bundle ’71’
org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor in org.eclipse.e4.demo.mailapp.AccountView
plus other similar errors for FolderView.
I am using a Juno release with Build id: 20120614-1722.
Dependency Injection is really not working for me very well.
Any help here would be very much appreciated.
Excellent tutorial on a pretty complicated topic. It appears that e4 is undergoing a lot of work and changing rapidly. One thing that hung me up for a full day is that changes to the .e4xmi file are not reflected when running the application after the INITIAL create. I finally found an entry in the FAQ stating that you must use persistState=false and/or clearPersistedState=true to get changes reflected in the runtime. This is painful as the run configuration gets re-generated whenever you synch so the added entries go away. What do you think about this? Seems like the default should be to NOT save the state… For that matter when would you ever want to save the state when running in an IDE???
Yeah when i wrote the tutorial 2 years ago there was no need to clear the state. Once i have a launch config i always adjust it and don’t regenerate.
Hi, it appears to be a good tutorial, but I just can’t find the source codes.
On the github page there is the tutorial and a bunch images and the links in the pdf don’t work. Am I just to stupid or are the files gone?
they are in branches
Hi Tom, did you remove the sources? I can’t find them in the repository even the zip links doesn’t work
no they are in branches of the repo
now I’ve found them, thx for quick help
Hi, the URLs include the in the tutorial PDF are not availables anymore.
Ps: When are you updating this great toturial for the new Eclipse 4.2/4.3
Keep the good work.
The pdf is part of the repo and I doubt I’ll update it to 4.2 – but all stuff is released under Creative Commons so you are free to update the the odt and sources and provide a patch.
very nice tutorial and thanks for that ! Is it possible to fix that broken source code links ?
many thanks in advance 🙂
In this way of creating E4 RCP project, does it allow us to use “3.X Compatibility Layer” in order to create views such as Project Explorer which is based on 3.X API. As I searched and experienced if we create a pure e4 application, compatibility layer is not enabled for use.
Thanks in advance!