public class JBCefJSQuery extends java.lang.Object implements JBCefDisposable
Modifier and Type | Class and Description |
---|---|
static class |
JBCefJSQuery.Response
A JS handler response to a query.
|
Disposable.Parent
Modifier and Type | Method and Description |
---|---|
void |
addHandler(java.util.function.Function<java.lang.String,JBCefJSQuery.Response> handler) |
static JBCefJSQuery |
create(JBCefBrowser browser)
Creates a unique JS query
|
void |
dispose()
Usually not invoked directly, see class javadoc.
|
java.lang.String |
inject(java.lang.String queryResult)
Returns the query callback call to inject into JS code
|
java.lang.String |
inject(java.lang.String queryResult,
java.lang.String onSuccessCallback,
java.lang.String onFailureCallback)
Returns the query callback call to inject into JS code
|
boolean |
isDisposed() |
void |
removeHandler(java.util.function.Function<java.lang.String,JBCefJSQuery.Response> handler) |
public static JBCefJSQuery create(JBCefBrowser browser)
browser
- the associated cef browserpublic java.lang.String inject(java.lang.String queryResult)
queryResult
- the result that will be passed to the java handler addHandler(Function)
public java.lang.String inject(java.lang.String queryResult, java.lang.String onSuccessCallback, java.lang.String onFailureCallback)
queryResult
- the result that weill be passed to the java handler addHandler(Function)
onSuccessCallback
- JS callback in format: function(response) {}onFailureCallback
- JS callback in format: function(error_code, error_message) {}public void addHandler(java.util.function.Function<java.lang.String,JBCefJSQuery.Response> handler)
public void removeHandler(java.util.function.Function<java.lang.String,JBCefJSQuery.Response> handler)
public void dispose()
Disposable
dispose
in interface Disposable
public boolean isDisposed()
isDisposed
in interface JBCefDisposable