Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Combining RWT with the Eclipse Workbench
Combining RWT with the Eclipse Workbench [message #760489] Fri, 02 December 2011 14:31 Go to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
Hi,

I'm working on an application that is a combined Eclipse and RWT
application. I essentially want to use Eclipse as the control panel for
an RWT application, e.g. control the content that is show in the
RWT--based UI. I've read the recent blog about RWT and osgi
(http://www.codeaffine.com/2011/10/13/raprwt-osgi-integration-iii/) and
thought that using the UIContributor technique should work well.

My setup is as follows:
- I've created a target based on Indigo, with RWT
(http://download.eclipse.org/rt/rap/1.5/runtime) and Jetty plugins added
on top.
- I have two plugins, one for the control panel and one for the
RWT-based UI. I try to insulate these from each other, so that they
resolve swt-classes against the respective toolkit implementations swt
and rwt.
-- I use an osgi service that implements (and register) and
UIContributor service, that depends on rap.ui.
-- The Eclipse view for the control panel connects to this service and
(is supposed to) contribute a new UI.

Everything compiles correctly, however, when launching a second Eclipse
workbench, I get a message saying the Application service cannot be
acquired, so no workbench appears.

I can imaging there are many things that go wrong in such a setup, but I
cannot understand that it is fundamentally impossible, since with osgi
and separate class-loading you should be able to host both the Eclipse
workbench and RWT at the same time.

The question is: Is it possible to make this work?

Best regards,

Hallvard Trætteberg
Re: Combining RWT with the Eclipse Workbench [message #760952 is a reply to message #760489] Mon, 05 December 2011 17:16 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 335
Registered: July 2009
Senior Member
Hallvard,

what you are trying is certainly possible. The reason this isn't working
might just be caused by the UIContributor code that has exemplary state
(just a wild guess). To make sure that running the Eclipse workbench +
RWT in the same VM works, I recommend to start without the UIContributor
code.
Please also see my comments below.

HTH
Rüdiger

On 02.12.2011 15:31, Hallvard Trætteberg wrote:
> Hi,
>
> I'm working on an application that is a combined Eclipse and RWT
> application. I essentially want to use Eclipse as the control panel for
> an RWT application, e.g. control the content that is show in the
> RWT--based UI. I've read the recent blog about RWT and osgi
> (http://www.codeaffine.com/2011/10/13/raprwt-osgi-integration-iii/) and
> thought that using the UIContributor technique should work well.
>
> My setup is as follows:
> - I've created a target based on Indigo, with RWT
> (http://download.eclipse.org/rt/rap/1.5/runtime) and Jetty plugins added
> on top.
You should only add o.e.rap.rwt and o.e.rap.rwt.osgi to your target. RWT
is the counterpart to SWT. Other artifacts from the download, like the
RAP adoption of the workbench (bundles o.e.rap.ui and
o.e.rap.ui.workbench) won't work.

> - I have two plugins, one for the control panel and one for the
> RWT-based UI. I try to insulate these from each other, so that they
> resolve swt-classes against the respective toolkit implementations swt
> and rwt.
> -- I use an osgi service that implements (and register) and
> UIContributor service, that depends on rap.ui.
With "rap.ui", are you referring to the o.e.rap.ui bundle? If so, this
won't work. The rap.ui bundle contributes extension points and
extensions that have the same name as those from the Eclipse workbench
(bundle o.e.ui).
Your UIContributor service implementation must only depend on
o.e.rap.rwt and o.e.rap.rwt.osgi.

> -- The Eclipse view for the control panel connects to this service and
> (is supposed to) contribute a new UI.
>
> Everything compiles correctly, however, when launching a second Eclipse
> workbench, I get a message saying the Application service cannot be
> acquired, so no workbench appears.
Not sure what you mean with "second Eclipse workbench".

>
> I can imaging there are many things that go wrong in such a setup, but I
> cannot understand that it is fundamentally impossible, since with osgi
> and separate class-loading you should be able to host both the Eclipse
> workbench and RWT at the same time.
>
> The question is: Is it possible to make this work?
>
> Best regards,
>
> Hallvard Trætteberg

--
Rüdiger Herrmann
http://codeaffine.com
Re: Combining RWT with the Eclipse Workbench [message #761273 is a reply to message #760952] Tue, 06 December 2011 08:03 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
On 05.12.11 18.16, Rüdiger Herrmann wrote:
>
> what you are trying is certainly possible.

Good!

> Please also see my comments below.

Thanks, I'm pretty sure the problem is due to invalid target definition.
I've done some cleaning up already and will do some more based on your
comments.

Best regards,

Hallvard Trætteberg
Re: Combining RWT with the Eclipse Workbench [message #766304 is a reply to message #761273] Thu, 15 December 2011 14:21 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
On 06.12.11 09.03, Hallvard Trætteberg wrote:
>>
>> what you are trying is certainly possible.
>
> Good!
>
>> Please also see my comments below.
>
> Thanks, I'm pretty sure the problem is due to invalid target definition.
> I've done some cleaning up already and will do some more based on your
> comments.

I've now managed to get it working. I read through the three blog
articles and decided to use the core API (HttpService,
ApplicationConfigurator and ApplicationLauncher) as described in the
first article, rather than the UIContribution stuff. The latter seems
easier to use with a static set of applications and UI contributions. In
my case, everything is dynamic and the core API was easy to use, once I
made my decision.

I'm so far very happy with the functionality and ease of use of RWT.

Hallvard

P.S.

My use of RWT may be an interesting case showing the power of both RWT
and its OSGi integration. I have create an Ecore model corresponding to
SWT, e.g. I have Ecore classes like Label, Text, Button, TabFolder etc.
This means I can create an in-memory structure of objects corresponding
to a concrete SWT UI, that can be edited and persisted using generic
tools. In addition, I have a renderer that builds an SWT UI inside a
composite from a model instance and keeps the SWT widgets in sync with
it. I previously could render into an Eclipse view (or a Shell), and now
I can render into an RWT application. Using OSGi and appropriate bundle
dependencies (essentially) the same code renders with SWT or RWT.

The setup actually allows rendering to SWT and RWT at the same time, so
you can interact with the same application instance using either the
desktop or web UI. Another and perhaps more interesting setup is to
render part of a complex desktop or web UI to a smartphone UI, e.g. you
bring a task with you when you are on the move, by telling which part of
an existing and running UI you want to replicate to the web with RWT and
then access it using either the web browser-based RWT or a native
implementation like the one you have for the iPhone. When you get back
to your desktop, it is as if all the interaction happened there. Of
course, in many cases you want a different design for the mobile case,
so you would rather render an alternative UI for the same application core.
Re: Combining RWT with the Eclipse Workbench [message #769032 is a reply to message #766304] Wed, 21 December 2011 09:29 Go to previous message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Hallvard,

this sounds very interesting. Is this Ecore model a live-model of the
UI or is it just a template that is used to create UIs? In case it's a
live model, you will have one model per user session, so it would be
interesting what the footprint of such a model is? Is there a blog post
or some other kind of reference to your work?

Have you also used RAP together with the Eclipse 4 workbench?

Best regards, Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:RAP error (Win/IE only)
Next Topic:Problem AutoCompletion with ContentProposalAdapter to select ems of popup with key up arrow
Goto Forum:
  


Current Time: Fri Mar 29 05:39:23 GMT 2024

Powered by FUDForum. Page generated in 0.04162 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top