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 31.03.2017 19:10, Leo Ufimtsev wrote:

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>
Yes, I did read about that in the slideset mentioned by Mickael. Does this also hold true within a script block?
I did see that I could call
  new java.lang.String("")
in the Interpreter. I guess if that works I could instantiate anything the classloader has access to, right? Then could I bind a java Object to a variable and access the java object in the next line?

eg
var file = new java.io.File("...")
file.exists()

If that would be possible the limits of passing basic Datatypes would only apply for results returned by a script, not for script internal processes.
 
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.
Would be something to think about in case this scenario gets interesting for a larger community. Lets see how many interested people step up here in this thread.

Christian

Back to the top