Open jbsarrodie opened 5 years ago
Comment to self
A first step could be to expose the (SWT) Browser object or proxify its .evaluate()
method. This would allow a jArchi script to execute code inside the browser and get the result.
For later reference
Found this other example of a nice implementation: http://ramkulkarni.com/blog/webapprunner-run-your-web-applications-standalone/
This is a note to self for my future experimentations
ATM it is possible to open a browser window (in fact a "Tab" in the UI) which either load an HTTP(S) resource or a local content (potentially a simple string created "on the fly" by a jArchi script).
This is very powerful but is "read only": even if the loaded HTML page can be interactive, it is impossible to return some information to the calling script, and also impossible to call some script functions from withing the browser. Changing this would allow to create even more powerful script that could leverage the best of both world: great UI created with HTML/JS/CSS, and ability to work (query/edit) the model.
It seems that this could be made possible by binding some Java objects to JS object inside the browser. This post explains how to do it with code samples.
This involves extending BrowserFunction.
Of course this is not as simple: this is limited in the number of types supported and this binds a Java function, not a jArchi one. Experimentation is needed...