public final class ProtoPresenterBuilder
extends java.lang.Object
Fn.Presenter
based on
top of textual protocol transferred between JVM and JavaScript engines.
Supports one additional configuration property; by setting
org.netbeans.html.Generic.wait4js
to true
one enables, more reliable, yet possibly slower, mode.Modifier and Type | Class and Description |
---|---|
static interface |
ProtoPresenterBuilder.Displayer
Interface to handle displaying of a URL.
|
static interface |
ProtoPresenterBuilder.Evaluator
Interfaces for evaluation of JavaScript code.
|
static interface |
ProtoPresenterBuilder.Logger
Implementation of a logging interface from the
ProtoPresenter . |
static class |
ProtoPresenterBuilder.OnPrepared
Callback to make when
ProtoPresenterBuilder.Preparator.prepare(org.netbeans.html.presenters.spi.ProtoPresenterBuilder.OnPrepared) is
finished. |
static interface |
ProtoPresenterBuilder.Preparator
Prepares the JavaScript environment.
|
Modifier and Type | Method and Description |
---|---|
ProtoPresenterBuilder |
app(java.lang.String app)
The identification of the application.
|
ProtoPresenter |
build()
Builds instance of presenter based on registered values.
|
ProtoPresenterBuilder |
dispatcher(java.util.concurrent.Executor executor,
boolean implementExecutor)
Registers the executor to run all tasks in.
|
ProtoPresenterBuilder |
displayer(ProtoPresenterBuilder.Displayer displayer)
Registers new displayer.
|
ProtoPresenterBuilder |
loadJavaScript(ProtoPresenterBuilder.Evaluator loadScript,
boolean synchronous)
Registers an implementation of
ProtoPresenterBuilder.Evaluator . |
ProtoPresenterBuilder |
logger(ProtoPresenterBuilder.Logger logger)
Registers instance of logger.
|
static ProtoPresenterBuilder |
newBuilder()
Starts building new, customized instance of
ProtoPresenter . |
ProtoPresenterBuilder |
preparator(ProtoPresenterBuilder.Preparator onReady,
boolean evalJavaScript)
Registers instance of
ProtoPresenterBuilder.Preparator . |
ProtoPresenterBuilder |
register(java.lang.Object data)
Registers additional data with the
ProtoPresenter .The data can be obtained by ProtoPresenter.lookup(java.lang.Class<T>) . |
ProtoPresenterBuilder |
type(java.lang.String type)
The type of the presenter (iOS, Android, etc.).
|
public static ProtoPresenterBuilder newBuilder()
ProtoPresenter
.public ProtoPresenterBuilder loadJavaScript(ProtoPresenterBuilder.Evaluator loadScript, boolean synchronous)
ProtoPresenterBuilder.Evaluator
.loadScript
- the evaluator to usesynchronous
- is the evaluator synchronous or asynchronouspublic ProtoPresenterBuilder dispatcher(java.util.concurrent.Executor executor, boolean implementExecutor)
executor
- the executorimplementExecutor
- true
if the presenter created
by ProtoPresenterBuilder.build()
method should also implement the Executor
interfacepublic ProtoPresenterBuilder preparator(ProtoPresenterBuilder.Preparator onReady, boolean evalJavaScript)
ProtoPresenterBuilder.Preparator
.onReady
- the instance to useevalJavaScript
- is the result of function registered by ProtoPresenterBuilder.OnPrepared.callbackIsPrepared(java.lang.String)
just a string (return true
) or real JavaScript object (return false
)?public ProtoPresenterBuilder type(java.lang.String type)
type
- string to identify the presenterpublic ProtoPresenterBuilder app(java.lang.String app)
app
- string to identify the applicationpublic ProtoPresenterBuilder displayer(ProtoPresenterBuilder.Displayer displayer)
displayer
- the instance of displayer.public ProtoPresenterBuilder register(java.lang.Object data)
ProtoPresenter
.The data can be obtained by ProtoPresenter.lookup(java.lang.Class<T>)
.data
- instance of some datapublic ProtoPresenterBuilder logger(ProtoPresenterBuilder.Logger logger)
logger
- instance of logger - may be null
public ProtoPresenter build()
Copyright © 2021 The Apache Software Foundation. All rights reserved.