Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Is that possible to make custom SWT widget work as native RWT widgets?
Is that possible to make custom SWT widget work as native RWT widgets? [message #879087] Wed, 30 May 2012 09:46 Go to next message
Xihui Chen is currently offline Xihui Chen
Messages: 35
Registered: June 2011
Member
Custom SWT/draw2d widgets are drawn from GC, so each update on custom widget would require the transferring of all painting info from client side. For example: updating a custom label widget will transfer information like "draw a rectangle, fill the background, draw the text", while a native RWT lable widget only need to transfer the text string and browser knows how to rendering the label widget with this text string.
For complicated custom SWT widgets such as Nebula widget, this results in a big overhead on traffic. I have looked at RAP clientScripting, but it can only modify the behavior of existing RWT widgets.

My idea is that converting/compiling GC/draw2d drawing code to Javascript code, so the server only needs to transfer the value to browser and browser knows how to draw it.

Is that possible?

Thanks!

[Updated on: Wed, 30 May 2012 09:49]

Report message to a moderator

Re: Make custom SWT widget work as native RWT widgets? [message #879115 is a reply to message #879087] Wed, 30 May 2012 10:38 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim Buschtoens
Messages: 355
Registered: July 2009
Senior Member
Hi!

> in a big overhead on traffic. I have looked at RAP clientScripting, but
> it can only modify the behavior of existing RWT widgets.

Drawing using ClientScripting is something i was toying with in my head.
I think its feasible (using PaintListener pattern, etc). But before that
you would need a way to sync your data somehow. You can open bugzilla
enhancement requests if these features would help you.

> My idea is that converting/compiling GC/draw2d drawing code to
> Javascript code, so the server only needs to transfer the value to
> browser and browser knows how to draw it.

Thats a very ambitious idea, though not entirely implausible. You would
need a mature, very flexible/configurable Java-to-JavaScript
cross-compiler (Source-to-source compiler) as a basis, and that is where
its gets tricky. I researched that a (longer) while ago and didn't find
a good one.

I think it would be less work to do the conversion by hand if your
widget isn't terribly complicated.

Greetings,
Tim

--
Tim Buschtöns

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Make custom SWT widget work as native RWT widgets? [message #879147 is a reply to message #879115] Wed, 30 May 2012 11:50 Go to previous message
Xihui Chen is currently offline Xihui Chen
Messages: 35
Registered: June 2011
Member
Since client scripting still need Javascript for painting, I would like to draw widget directly on HTML5 Canvas using browser widget, then reuse the behavior code in java and pass data to the browser widget whenever it needs redraw. So it looks like a hybrid widget: javascript for rendering and java for behavior.

Thanks!
Xihui
Previous Topic:Is that possible to make custom SWT widget work as native RWT widgets?
Next Topic:ESC keybinding firing twice
Goto Forum:
  


Current Time: Thu Apr 17 11:39:43 EDT 2014

Powered by FUDForum. Page generated in 0.01429 seconds