public interface AbstractJavaScriptEngine
JavaScriptEngine
.Modifier and Type | Method and Description |
---|---|
void |
addPostponedAction(PostponedAction action)
Adds an action that should be executed first when the script currently being executed has finished.
|
Object |
execute(HtmlPage page,
String sourceCode,
String sourceName,
int startLine)
Executes the specified JavaScript code in the context of a given page.
|
JavaScriptConfiguration |
getJavaScriptConfiguration()
Gets the associated configuration.
|
long |
getJavaScriptTimeout()
Returns the number of milliseconds that a script is allowed to execute before being terminated.
|
void |
initialize(WebWindow webWindow)
Performs initialization for the given webWindow.
|
boolean |
isScriptRunning()
Indicates if JavaScript is running in current thread.
|
void |
processPostponedActions()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Process postponed actions, if any. |
void |
registerWindowAndMaybeStartEventLoop(WebWindow webWindow)
Register WebWindow with the JavaScriptExecutor.
|
void |
setJavaScriptTimeout(long timeout)
Sets the number of milliseconds that a script is allowed to execute before being terminated.
|
void |
shutdown()
Shutdown the JavaScriptEngine.
|
JavaScriptConfiguration getJavaScriptConfiguration()
void addPostponedAction(PostponedAction action)
action
- the actionvoid processPostponedActions()
Object execute(HtmlPage page, String sourceCode, String sourceName, int startLine)
page
- the page that the code will execute withinsourceCode
- the JavaScript code to executesourceName
- the name that will be displayed on error conditionsstartLine
- the line at which the script source startsvoid registerWindowAndMaybeStartEventLoop(WebWindow webWindow)
webWindow
- the WebWindow to be registered.void initialize(WebWindow webWindow)
webWindow
- the web window to initialize forvoid setJavaScriptTimeout(long timeout)
timeout
- the timeout value, in millisecondslong getJavaScriptTimeout()
void shutdown()
boolean isScriptRunning()
true
if JavaScript is runningCopyright © 2002–2017 Gargoyle Software Inc.. All rights reserved.