On Sep 19, 2008, at 8:09 PM, Boris Bokowski wrote:
Patrick Mueller wrote on 09/19/2008 05:48:16 PM:
> I think my main problem boils down to: I want more API on SWT
> Browser so I can talk from inside the browser to outside (Java), and
> probably finer control over talking to the inside (browser) from the
> outside (Java) than the current "run this hunk of _javascript_ code"
> method. For example, it would be nice to have direct access to the
> DOM from Java.
I believe this is already possible, by using Mozilla's XPCOM interface to the SWT.MOZILLA variant of the SWT Browser widget. It's just not very well documented. For a taste of what's possible, here is a snippet that talks to some of the XPCOM interfaces:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet277.java?view=co
Thanks for the tip, I was able to get this running after installing the plugins and XULRunner externally.
The problem with this approach, I believe, is the footprint you get from creating many instances of SWT Browser, but I might be wrong on that. Maybe someone from the SWT team can correct me if I am wrong.
I've heard similar fears on the resource usage issue. Need to investigate.
May I ask where you are going with this?
The products I work on have user interfaces that show up in Eclipse, Visual Studio, and the web. We're looking at the possibility of reusing the web user interface in the other two environments. Timely, as we are also moving our web user interface to a finer-grained component model, which is chunked roughly at the same level of Eclipse views/editors - specifically, we have some ui components for the web which could serve, w/r/t visual function, as Eclipse views and editors. Also interesting to note there are other component-ish stories around web UI that are getting some play now - Google Gadgets, Open Social, iWidget (from IBM), etc. It's easy for me to tilt my head when I look at these and imagine them somehow showing up a composite widgets in SWT, or views/editors in Eclipse. Would be cool to have access to another 44,420 widgets (
http://www.google.com/ig/directory?synd=open ) in SWT/Eclipse.