I'm currently working on a project for Google Summer of Code for the
Eclipse Foundation. I've been trying to leverage GWT in this project,
but I think j2s might actually be a better target. I'd like to present
my ideas here and see what people thing.
The project is to take GMF, and allow it to produce web-based diagram
editors instead of SWT-based ones. My project mentor has asked that,
rather than write a custom generator that goes generates
platform-specific code for the UI (in HTML, CSS and JavaScript)
directly from the EMF generator model by writing a custom generator,
that I continue to use the current GMF Java generator, and then
compile the resultant Java code (built on the Draw2d/SWT/JRE stack) to
platform-specific JavaScript. The e4 project has been using this
strategy to target ActionScript/Flash with some success.
I've been attempting to use GWT to do this, but unfortunately, this
effort has so far not been very productive. It seems that Eclipse GC
is more deeply tied to other parts of SWT than I first realized, and
this has made porting it a much larger project than I originally
intended. Also, GWT's Eclipse tooling has been highly problematic.
It seems to me that Java2Script might be more closely aligned to the
goals of my project, as it comes with good SWT emulation, and better
Eclipse tooling. In terms of SWT emulation, the most critical things
for my project are GC and Canvas. I took a look at the source code to
GC and it looks like most of of it is stub code, except for a few
methods which seem to do simple graphical operations using DOM and CSS
styling. This is to be expected, and perhaps I can contribute code
that would allow a more sophisticated implementating of GC that would
target HTML Canvas (or Google's excanvas, for compatibility with IE).
The way I imagine doing this is simply filling in the stub methods
with JSNI native code. I'd like to know what the j2s developers think:
does it seem like a more complete implementation of GC should be
fairly straightforward to "slot in"? More generally, does it sound
like Java2Script would align well with the needs of my project?
I'd appreciate it if you would let me know what you think. Thanks,
Jake