Getting started with Eclipse 4 applications on RAP

In this blog post I’ll introduce you to using Eclipse 4 on RAP. Eclipse 4 on RAP means the use of Eclipse 4 API’s without the 3.x compat layer. Eclipse 3.x API users can simply stick to the plain vanilla 2.3 release of RAP. If you want to take advantage of the new Eclipse 4 programming model with services, injection and Pojo workbench elements read on to learn how to deploy Eclipse 4 based apps on the web using RAP 2.3 and the new RAP e4 incubator project.

RAP e4 incubator project

Since Eclipse 4.0 was released there was a steady and growing interest in combining Eclipse 4 based applications with RAP. The core e4 platform improved (and is improving) from release to release and now with Luna the Eclipse 4 application platform is in a shape that a RAP implementation can be provided with a reasonable implementation and maintenance effort.

EclipseSource sponsored us to help creating a RAP Eclipse 4 port. Our goal for Luna is to provide an RAP-p2-Target platform which e4 application developers can use to get their applications deployed. And here we are.

This target platform is provided by a RAP Incubator project named “RAP e4″, which we plan to graduate with the next major RAP release. It encompasses:

  • A complete p2 target platform including Equinox, RAP 2.3, Platform and RAP e4 bundles
  • An optional tooling plugin for your Eclipse IDE to bootstrap a RAP e4 application

Most of the bundles contained in the p2 target are the same as the ones provided by the upstream projects but because there are still some API gaps between RAP and SWT (e.g. StyledText, Graphics API and Mouse API) we had to fork 4 platform bundles:

  • org.eclipse.e4.ui.bindings
  • org.eclipse.e4.ui.workbench.addons.swt
  • org.eclipse.e4.ui.workbench.renderers.swt
  • org.eclipse.e4.ui.workbench.swt

We’ll work with the platform team in the Eclipse Mars release timeframe to modify them in a way that we can consume them unmodified.

Which parts of Eclipse 4 are supported

Eclipse 4 applications are built using 3 core technologies

  • The application model
  • The DI-Container
  • CSS

The application model and the DI-Container are fully supported by RAP e4, including things like the event bus (IEventBroker), ExtendedObjectSuppliers (@UIEventTopic, @Preference) and the new and shiny runtime language change support.

We decided to not support the Eclipse 4 CSS-Engine for now, because RAP already has a much more feature rich CSS/Theme system. It can take advantage of the CSS rendering of browsers and is not constrained by native controls.

I’ll explain in a follow up blog post how we managed to support them without modifying the upstream projects but replacing the default ones through RAP-specific implementations.

Where can you get RAP e4?

First and most important you can grab the sources from the following incubator repository at http://git.eclipse.org/c/rap/incubator/org.eclipse.rap.incubator.e4.git/ but most of you probably want a target platform and a nice wizard to bootstrap an application.

So the following is a short guide how to bootstrap your first “RAP on e4″ application.

Setup your IDE

Create an application

  • Download the target-platform as a zip file from http://download.eclipse.org/rt/rap/incubator/nightly/e4/target/site_assembly.zip
  • Create a new target platform setting (Preferences > Plug-in Development >Target Platform) using the zip you downloaded – in case you use the p2 option make sure to uncheck “include required software”. The downloaded platform is self-contained and all dependencies are resolved
  • Use the New “Plug-in Project” wizard with the following options:
    • This plug-in will make contributions to the UI (checked)
    • Would you like to create a 3.x rich client application (“No” checked)
    • “RAP e4 application” Template selected

We’ve put up those information also on a wiki-page describing the setup at https://wiki.eclipse.org/RAP/E4 so if you come to this post later on and the steps don’t work please consult the wiki page.

Example Applications

Finally some small example applications demonstrating e4 on RAP. The first application is part of the git repo and we use it to test various Eclipse 4 features.

This video shows an e4 demo app enabled for iPad/Android devices I wrote for a customer show case

You may also like...

Share this Post

Twitter2
Google+7
LinkedIn
Facebook

Tags

3 Responses to “Getting started with Eclipse 4 applications on RAP”

  1. Thorsten Hilker says:

    Hi!

    Wonderful work!

    But one question:

    When I try to start the “Application-Model” editor,
    I get the following error:

    org.eclipse.e4.core.di.InjectionException: java.lang.NoSuchFieldError: RENDERED_TOOL_BAR
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:63)

    Is the editor ready to use for RAP?

    Thanx in advance!

    Greetings!

    Thorsten

    PS This is what I installed in 4.4M6:

    E4 CSS Spy (Incubation) 0.14.0.v20130814-1230 org.eclipse.e4.tools.css.spy.feature.feature.group Eclipse.org
    E4 CSS Spy (Incubation) Developer Resources 0.14.0.v20130814-1230 org.eclipse.e4.tools.css.spy.feature.source.feature.group Eclipse.org
    Eclipse e4 Tools (Incubation) 0.14.0.v20140112-2002 org.eclipse.e4.core.tools.feature.feature.group Eclipse.org
    Eclipse e4 Tools Source (Incubation) 0.14.0.v20140112-2002 org.eclipse.e4.core.tools.feature.source.feature.group Eclipse.org
    Eclipse SDK 4.4.0.I20140306-1200 org.eclipse.sdk.ide null
    Eclipse p2 Provisioning Developer Resources 2.2.0.v20140228-1829 org.eclipse.equinox.p2.user.ui.source.feature.group Eclipse.org
    Eclipse Product Configuration 1.0.0.v20140303-1722 org.eclipse.rcp.configuration.feature.group Eclipse.org
    Eclipse Project SDK 4.4.0.v20140306-1642 org.eclipse.sdk.feature.group Eclipse.org
    Equinox p2 Provisioning for IDEs. 2.2.0.v20140228-1829 org.eclipse.equinox.p2.user.ui.feature.group Eclipse.org – Equinox
    Feature 0.9.0.201404160604 org.eclipse.rap.e4.tooling.feature.feature.group null
    RAP Tools 2.3.0.20140311-1049 org.eclipse.rap.tools.feature.feature.group Eclipse.org – RAP

  2. Thorsten Hilker says:

    Hi!

    Got it to work, with the “0326″, not sure if this is correct.
    Maybe you can post the correct version numbers.

    Regards,

    Thorsten

    PS
    E4 CSS Spy (Incubation) 0.14.0.v20130814-1230 org.eclipse.e4.tools.css.spy.feature.feature.group Eclipse.org
    E4 CSS Spy (Incubation) Developer Resources 0.14.0.v20130814-1230 org.eclipse.e4.tools.css.spy.feature.source.feature.group Eclipse.org
    Eclipse e4 Tools (Incubation) 0.14.0.v20140406-0326 org.eclipse.e4.core.tools.feature.feature.group Eclipse.org
    Eclipse e4 Tools Source (Incubation) 0.14.0.v20140406-0326 org.eclipse.e4.core.tools.feature.source.feature.group Eclipse.org
    Eclipse SDK 4.4.0.I20140306-1200 org.eclipse.sdk.ide null
    Eclipse p2 Provisioning Developer Resources 2.2.0.v20140228-1829 org.eclipse.equinox.p2.user.ui.source.feature.group Eclipse.org
    Eclipse Product Configuration 1.0.0.v20140303-1722 org.eclipse.rcp.configuration.feature.group Eclipse.org
    Eclipse Project SDK 4.4.0.v20140306-1642 org.eclipse.sdk.feature.group Eclipse.org
    Equinox p2 Provisioning for IDEs. 2.2.0.v20140228-1829 org.eclipse.equinox.p2.user.ui.feature.group Eclipse.org – Equinox
    Feature 0.9.0.201404160604 org.eclipse.rap.e4.tooling.feature.feature.group null
    RAP Tools 2.3.0.20140311-1049 org.eclipse.rap.tools.feature.feature.group Eclipse.org – RAP

  3. Thorsten Hilker says:

    Hi!

    Little Tip:

    Think the bundle “org.eclipse.core.databinding.beans_1.2.200.v20140214-0004″ is missing in the target.

    If you attach it to the target data binding works like a charm.

    Greetings!

    Thorsten

3 responses so far

Written by . Published in Categories: EclipseSource News, Editors choice, Planet Eclipse