Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Embedding Applet within RAP
Embedding Applet within RAP [message #110646] Tue, 28 October 2008 16:02 Go to next message
Ali Alauoubiy is currently offline Ali AlauoubiyFriend
Messages: 1
Registered: July 2009
Junior Member
Hi Everyone,

We have an existing applet that we want to reuse in the RAP projecy we are
currently working on. The example provided in the custom widget section is
not suffeciant enough. Is there anyone who can help use and provide
complete/simple hello world RAP example with embeded applet inside it.

Regards
Ali
Re: Embedding Applet within RAP [message #110658 is a reply to message #110646] Tue, 28 October 2008 16:19 Go to previous messageGo to next message
Alex Ignácio da Silva is currently offline Alex Ignácio da SilvaFriend
Messages: 23
Registered: July 2009
Junior Member
Hi Ali,

Unfortunately I do not have a complete working example to send you right
now. But the general steps involved are:

Create a javascript qooxdoo widget that inherits from
qx.ui.embed.Iframe. As its name suggests, it embeds an Iframe from which
you can load an HTML page containing your applet. Check the qooxdoo
documentation for details on its object oriented syntax. When browsing
the API documentation on the qooxdoo website keep in mind that RAP still
uses the 0.7 version of qooxdoo.

The constructor of your qooxdoo widget must receive an id, which will be
uniquely assigned by the RAP framework, as demonstrated in the GMap example.

On the client side you can easily communicate from your javascript
widget to the embedded applet and vice-versa in order so synchronize
their state.

On the server side you need to create a Java widget that extends from
org.eclipse.swt.widgets.Composite and synchronize its state with the
javascript client widget through RAP's mechanism. Basically you assign a
life cycle adapter class to your widget that implements some callback
methods to plug into the relevant life cycle phases of processing of the
client's request.

Best regards,

Alex

Ali Alauoubiy wrote:
> Hi Everyone,
> We have an existing applet that we want to reuse in the RAP projecy we
> are currently working on. The example provided in the custom widget
> section is not suffeciant enough. Is there anyone who can help use and
> provide complete/simple hello world RAP example with embeded applet
> inside it.
>
> Regards
> Ali
>
Re: Embedding Applet within RAP [message #121206 is a reply to message #110658] Wed, 11 February 2009 11:11 Go to previous messageGo to next message
Kristian Rink is currently offline Kristian RinkFriend
Messages: 64
Registered: July 2009
Member
Folks;

Alex Ignácio da Silva schrieb:
[...]
> Unfortunately I do not have a complete working example to send you right
> now. But the general steps involved are:
[...]
> Create a javascript qooxdoo widget that inherits from
> qx.ui.embed.Iframe. As its name suggests, it embeds an Iframe from which
> you can load an HTML page containing your applet.

Getting back to this rather old thread, we generally do have applet
integration working using the SWT Browser widget which works more or less
well except for two different issues:

(a) Having a Browser widget located in a certain view, I see the applet got
disposed as soon as the view lost focus and, subsequently, got restarted as
soon as the view got focused again. This, in our case, is rather painful as
loading this applet takes some time.

(b) In case of our applet (a document viewer), JavaScript commands / applet
scripting can be issued to make the applet do things, like opening
documents, saving markup, ... . Using a "simple" Browser widget however,
this kind of interaction with the applet in a view is hardly possible.

So to ask: Does anyone have any experience in doing an applet integration
"tighter" than just Browser/iframe to compensate for (or eventually even
overcome) both limitations (a) and (b)?

Thanks in advance and all the best,
Kristian

--
Kristian Rink
cell : +49 176 2447 2771
personal: http://pictorial.zimmer428.net
"Past midnight. Never knew such silence.
The earth might be uninhabited..."
//beckett / krapp's last tape//
Re: Embedding Applet within RAP [message #121308 is a reply to message #121206] Thu, 12 February 2009 03:29 Go to previous messageGo to next message
Cole Markham is currently offline Cole MarkhamFriend
Messages: 150
Registered: July 2009
Location: College Station, TX
Senior Member

Kristian Rink wrote:

> Folks;

> Alex Ignácio da Silva schrieb:
> [...]
>> Unfortunately I do not have a complete working example to send you right
>> now. But the general steps involved are:
> [...]
>> Create a javascript qooxdoo widget that inherits from
>> qx.ui.embed.Iframe. As its name suggests, it embeds an Iframe from which
>> you can load an HTML page containing your applet.

> Getting back to this rather old thread, we generally do have applet
> integration working using the SWT Browser widget which works more or less
> well except for two different issues:

> (a) Having a Browser widget located in a certain view, I see the applet got
> disposed as soon as the view lost focus and, subsequently, got restarted as
> soon as the view got focused again. This, in our case, is rather painful as
> loading this applet takes some time.

> (b) In case of our applet (a document viewer), JavaScript commands / applet
> scripting can be issued to make the applet do things, like opening
> documents, saving markup, ... . Using a "simple" Browser widget however,
> this kind of interaction with the applet in a view is hardly possible.

> So to ask: Does anyone have any experience in doing an applet integration
> "tighter" than just Browser/iframe to compensate for (or eventually even
> overcome) both limitations (a) and (b)?

> Thanks in advance and all the best,
> Kristian


Kristian,

I haven't tested an applet with a UI, but I've been doing some experiments
with using an applet for background processing on the client. I created a
custom qooxdoo widget similar to the google maps example. Communication
between java and javascript is working. I would be happy to share some of
the code if you are interested.

I'm not sure about sizing of the applet, maybe that's why people are
suggesting an iframe. It should be pretty easy to test it out. When I get
to work tomorrow, I'll take a look and pass the code along.

Cole
Re: Embedding Applet within RAP [message #121323 is a reply to message #121308] Thu, 12 February 2009 07:41 Go to previous messageGo to next message
Kristian Rink is currently offline Kristian RinkFriend
Messages: 64
Registered: July 2009
Member
Hi Cole, *;

Cole Markham schrieb:
[...]
> I haven't tested an applet with a UI, but I've been doing some
> experiments with using an applet for background processing on the
> client.

Sounds rather interesting... so far I haven't seen a, well, "headless
applet" embedded in any application... what exactly are you doing there?

[...]
> example. Communication between java and javascript is working. I would
> be happy to share some of the code if you are interested.

Would be great, thanks a bunch for that in advance. :) We're so far into
investigating what can be done here and how, as well... maybe this is a way
to grow something to stay; such a widget seems interesting for qooxdoo or
RAP. :)

Cheers & all the best,
Kristian


--
Kristian Rink
cell : +49 176 2447 2771
personal: http://pictorial.zimmer428.net
"Past midnight. Never knew such silence.
The earth might be uninhabited..."
//beckett / krapp's last tape//
Re: Embedding Applet within RAP [message #121914 is a reply to message #121206] Wed, 18 February 2009 18:11 Go to previous messageGo to next message
Stefan Hansel is currently offline Stefan HanselFriend
Messages: 103
Registered: July 2009
Senior Member
Kristian,

why aren't you going the way Alex described (i.e. writing a custom widget
and using a qooxdoo IFrame to embed the applet)?
We do it the same way and I think it perfectly solves your problem.

We do have a 'document'-applet/custom-widget as well - it is invisible but
does stuff like
- downloading a doc from server
- showing it with the native doc-viewer (i.e. Microsoft Office or
OpenOffice opens 'by magic')
- sending all changes of the doc automatically back to the server
- sending all exceptions from the applet to the server
- javascript communicates with applet and vice-versa.

The user just sees a normal RAP-progress-bar while all this is done.
Re: Embedding Applet within RAP [message #126275 is a reply to message #121308] Thu, 26 March 2009 19:03 Go to previous message
andre jobin is currently offline andre jobinFriend
Messages: 3
Registered: July 2009
Junior Member
hi Markham,
I am working on whiteboard sharing, (like paint brush) Using RAP , and we
will use applet or flash widget inside RAP plugin, it's will great if you
could share your code with us.
thx
Previous Topic:java.lang.LinkageError in SR1 WAR
Next Topic:Connection refused -- steps to get RAP working on your browser?
Goto Forum:
  


Current Time: Sat Apr 27 00:03:06 GMT 2024

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

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

Back to the top