Class SwingJavascriptResponse

java.lang.Object
com.vaadin.swingkit.server.SwingJavascriptResponse
All Implemented Interfaces:
EmbeddedBrowserJSCaller
Direct Known Subclasses:
JCefSwingJavascriptResponse, JxBrowserSwingJavascriptResponse

public abstract class SwingJavascriptResponse extends Object implements EmbeddedBrowserJSCaller
Class to respond to a previous Swing app call to Vaadin app. It generates a JS call after EmbeddedBrowserJSCaller implementation. It checks that the function and the context is available to be executed.
Author:
Vaadin Ltd
  • Constructor Details

    • SwingJavascriptResponse

      public SwingJavascriptResponse()
  • Method Details

    • generateResponseJS

      public String generateResponseJS(String encodedResponse) throws EmbeddedBrowserException
      Generates a valid Javascript response as a String that will be sent through the embedded browser to the Swing app.
      Parameters:
      encodedResponse - The encoded response that has to be sent to the Swing app
      Returns:
      A string with the javascript executable call containing the encoded response.
      Throws:
      EmbeddedBrowserException - Thrown if no SwingKit embedded browser is detected.
    • checkContext

      protected com.vaadin.flow.component.page.PendingJavaScriptResult checkContext()