Class JavaFxWebEngine

java.lang.Object
com.dlsc.gmapsfx.javascript.JavaFxWebEngine
All Implemented Interfaces:
IWebEngine

public class JavaFxWebEngine
extends Object
implements IWebEngine
This class provides an implementation of the IWebEngine interface utilizing a javafx.scene.web.WebEngine as the underlying engine.
Author:
Rob Terpilowski
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected javafx.scene.web.WebEngine webEngine  
  • Constructor Summary

    Constructors 
    Constructor Description
    JavaFxWebEngine​(javafx.scene.web.WebEngine engine)
    Builds a new engine utilizing the specified JavaFX WebEngine
  • Method Summary

    Modifier and Type Method Description
    Object executeScript​(String command)
    Executes the specified JavaScript Command
    javafx.concurrent.Worker<Void> getLoadWorker()
    Gets a worked which will be notified when a web page has finished loading.
    void load​(String url)
    Loads the specified URL
    void loadContent​(String content)
    Loads the given HTML content directly.
    void setOnAlert​(javafx.event.EventHandler<javafx.scene.web.WebEvent<String>> eventHandler)  
    void setOnError​(javafx.event.EventHandler<javafx.scene.web.WebErrorEvent> eventHandler)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • webEngine

      protected javafx.scene.web.WebEngine webEngine
  • Constructor Details

    • JavaFxWebEngine

      public JavaFxWebEngine​(javafx.scene.web.WebEngine engine)
      Builds a new engine utilizing the specified JavaFX WebEngine
      Parameters:
      engine - The JavaFX WebEngine to use.
  • Method Details

    • executeScript

      public Object executeScript​(String command)
      Executes the specified JavaScript Command
      Specified by:
      executeScript in interface IWebEngine
      Parameters:
      command - The command to execute
      Returns:
      The object returned by the script (if any).
    • getLoadWorker

      public javafx.concurrent.Worker<Void> getLoadWorker()
      Gets a worked which will be notified when a web page has finished loading.
      Specified by:
      getLoadWorker in interface IWebEngine
      Returns:
      The worker
    • load

      public void load​(String url)
      Loads the specified URL
      Specified by:
      load in interface IWebEngine
      Parameters:
      url - The URL to load in the engine.
    • loadContent

      public void loadContent​(String content)
      Loads the given HTML content directly.
      Specified by:
      loadContent in interface IWebEngine
      Parameters:
      content - The HTML text to load in the engine.
    • setOnAlert

      public void setOnAlert​(javafx.event.EventHandler<javafx.scene.web.WebEvent<String>> eventHandler)
    • setOnError

      public void setOnError​(javafx.event.EventHandler<javafx.scene.web.WebErrorEvent> eventHandler)