Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] Coding an Eclipse plugin with HTML, JS (and Eclipse Browser)

On Thu, Mar 30, 2017 at 1:58 PM, Christian Pontesegger <christian.pontesegger@xxxxxx> wrote:
Ok, after playing a little with the browser widget I can say that it is possible to inject EASE into the browser. It takes some effort to allow to load EASE modules, but it is doable. Return types from the script engine into the Java world seem so be somewhat limited. I guess same counts for method call parameters. It seems that only basic types can be exchanged between JS and Java.

Yea, officially, as per evaluate(), only the following types are supported:
 * <li>_javascript_ null or undefined -> <code>null</code></li>
 * <li>_javascript_ number -> <code>java.lang.Double</code></li>
 * <li>_javascript_ string -> <code>java.lang.String</code></li>
 * <li>_javascript_ boolean -> <code>java.lang.Boolean</code></li>
 * <li>_javascript_ array whose elements are all of supported types -> <code>java.lang.Object[]</code></li>
 
Further the code is running in the UI thread, which may not be nice for long running scripts. For UI callbacks it would be sufficient I guess

On webkit2, technically the _javascript_/webkit2 runs in a separate process, but SWT ui thread loops in the gtk_event_loop until webkit2 finishes the call to be compliant to the SWT api (which is sync). I.e, technically it would be possible to implement an async call / return mechanism, but that would require OS X and Win32 to implement something similar on their end also.


Christian


On 30.03.2017 16:46, Christian Pontesegger wrote:
No, did not try that. Depends on which JS engines are used in the browser widgets on the different platforms. However if these engines support to access the running JRE we could imjplement EASE support quite easily. Would be really nice to mix EASE code in an HTML rendered browser widget. Any more information on the browser JS engines available?

Christian


On 30.03.2017 08:48, Mickael Istria wrote:
@Christian: is this something you already tried? Basically, the idea is to imagine you're provided a Browser widget, is it possible to add EASE JS libs in its JS context?


_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev



--
Leo Ufimtsev
Software Engineer, Eclipse team.
Toronto, Canada

Red Hat, Inc.
Leonidas@xxxxxxxxxx | http://DeveloperBlog.RedHat.com/

Back to the top