Example usage for javafx.scene.web WebEvent toString

List of usage examples for javafx.scene.web WebEvent toString

Introduction

In this page you can find the example usage for javafx.scene.web WebEvent toString.

Prototype

@Override
public String toString() 

Source Link

Document

Returns a string representation of this WebEvent object.

Usage

From source file:org.openbase.display.WebTab.java

private static WebView newWebView() {
    logger.info("init new WebView...");
    WebView webView = new WebView();
    WebEngine webEngine = webView.getEngine();
    webEngine.setJavaScriptEnabled(true);
    webEngine.setOnAlert((WebEvent<String> event) -> {
        ExceptionPrinter.printHistory(new InvalidStateException("Webengine alert detected!",
                new CouldNotPerformException(event.toString())), logger);
    });/*from  w  ww .j av  a 2  s  .c om*/
    webEngine.setOnError((WebErrorEvent event) -> {
        ExceptionPrinter.printHistory(new InvalidStateException("Webengine error detected!",
                new CouldNotPerformException(event.toString())), logger);
    });
    webEngine.getLoadWorker().stateProperty().addListener((ObservableValue<? extends Worker.State> observable,
            Worker.State oldValue, Worker.State newState) -> {
        Throwable exception = webEngine.getLoadWorker().getException();
        if (exception != null && newState == Worker.State.FAILED) {
            ExceptionPrinter.printHistory(new InvalidStateException("Webengine exception detected!", exception),
                    logger);
        }
    });

    CookieManager.getDefault();
    return webView;
}