I'm rewriting my interface to the javascript engine available in the BrowserComponent but I'm a bit confused. I used to make java methods and objects available to the javascript scripts as below but I admit I can't find a way to do the same now.
Hope you can help.
E.
Object sample:
JSObject obj = (JSObject) ctx.get("{}");
if (data != null) {
for (String key : data.keySet()) {
obj.set(key, data.get(key));
}
}
ctx.set("window.data", obj);
Method sample:
JSObject devnull = (JSObject) ctx.get("{}");
devnull.set("devnull", new JSFunction() {
@Override
public void apply(JSObject self, Object[] args) {
//How about the args?
}
});
ctx.set("window.devnull", devnull);