Community
Participate
Working Groups
Internet Explorer provides the facility to register an 'window.external' object (a COM Object which implements the IDispatch interface). With this facility one can communicate from a HTML page (using scripts) with its host client site (Java, SWT whatever). With this feature one could for instance create a HTML Report which contains links to files that reside in the Eclipse Workspace, and, by clicking on that link, the file would be opened in Eclipse directly. I have implemented this feature for Internet Explorer and it works fine for me. The source code which contains the necessary modifications to Browser.java, WebSite.java, an simple IDispatch implementation (SimpleIDispatch.java) is attached to this feature request. You may find this useful Sincerely Christian
Created attachment 15296 [details] Demonstrates usage of a Browser's 'window.external' interface
Hi Christian, Thanks for taking the time to post these. window.external is only defined by Internet Explorer isnt'it? We are looking at solutions that could also be implemented on Safari and Mozilla since the SWT Browser uses these engines on Mac and Linux. At the moment, HTML can pass information to the java app through the window.status (that triggers a org.eclipse.swt.browser.StatusTextListener.changed(..) notification). Not as fancy as window.external but more portable. Very recently, we've added a Browser.execute(String script) that can be used to communicate the other way around - from java to the html document, via a String containing javascript commands.
closing per comment 2