public final class Scripts extends Object
Fn.Presenters that delegate
to Java scripting API. Initialize your presenter
like this:
and your runnable can make extensive use ofRunnablerun = ...; // your own init codeFn.Presenterp = Scripts.createPresenter(); BrowserBuilder.newBrowser(p).loadFinished(run).BrowserBuilder.showAndWait();
JavaScriptBody directly or
indirectly via APIs using such annotation themselves.| Modifier and Type | Method and Description |
|---|---|
static org.apidesign.html.boot.spi.Fn.Presenter |
createPresenter()
Simple implementation of
Fn.Presenter that delegates
to Java scripting API. |
static org.apidesign.html.boot.spi.Fn.Presenter |
createPresenter(Executor exc)
Implementation of
Fn.Presenter that delegates
to Java scripting API and can control execution
thread. |
public static org.apidesign.html.boot.spi.Fn.Presenter createPresenter()
Fn.Presenter that delegates
to Java scripting API. The presenter runs headless
without appropriate simulation of browser APIs. Its primary usefulness
is inside testing environments. The presenter implements Executor
interface, but invokes all runnables passed to Executor.execute(java.lang.Runnable)
immediately.ScriptEngine for text/javascript mimetypepublic static org.apidesign.html.boot.spi.Fn.Presenter createPresenter(Executor exc)
Fn.Presenter that delegates
to Java scripting API and can control execution
thread. The presenter runs headless
without appropriate simulation of browser APIs. Its primary usefulness
is inside testing environments. The presenter implements Executor
interface, and passes all runnables from Executor.execute(java.lang.Runnable)
to here in provided exc instance.exc - the executor to re-schedule all asynchronous requests toScriptEngine for text/javascript mimetypeCopyright © 2014 NetBeans. All Rights Reserved.