public static interface Fn.Presenter
META-INF/services
, for example with
@ServiceProvider(service = Fn.Presenter.class)
annotation.
Since 0.7 a presenter may implement Executor
interface, in case
it supports single threaded execution environment. The executor's
Executor.execute(java.lang.Runnable)
method is then supposed
to invoke the runnable immediately (in case we are on the right thread
already) or return and asynchronously invoke the runnable later on the
right thread (if we are on wrong thread).
Modifier and Type | Method and Description |
---|---|
Fn |
defineFn(String code,
String... names)
Creates new function with given parameter names and provided body.
|
void |
displayPage(URL page,
Runnable onPageLoad)
Opens the browser, loads provided page and when the
page is ready, it calls back to the provider runnable.
|
void |
loadScript(Reader code)
Loads a script into the browser JavaScript interpreter and
executes it.
|
Fn defineFn(String code, String... names)
code
- the body of the function. Can refer to variables named
as names
names
- names of parameters of the function - these will be
available when the code
body executesvoid displayPage(URL page, Runnable onPageLoad)
page
- the URL for the page to displayonPageLoad
- callback when the page is readyCopyright © 2018 NetBeans. All rights reserved.