Class SwingBridge

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.littemplate.LitTemplate
com.vaadin.swingkit.server.SwingBridge
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, com.vaadin.flow.internal.Template, Serializable

@Tag("swing-bridge") @JsModule("./vaadin-bridge.ts") public class SwingBridge extends com.vaadin.flow.component.littemplate.LitTemplate
Swing Vaadin bridge component that is inserted in the Vaadin views that want to be integrated into a Swing app JVaadinPanel. It is responsible for setting up the available functions that can be called from JVaadinPanel and to handle their invocations.
Author:
Vaadin Ltd
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    invoke(String invocation)
    It handles an encoded invocation coming from the JVaadinPanel in the Swing app.
    protected void
    onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
     
    protected void
    onDetach(com.vaadin.flow.component.DetachEvent detachEvent)
     
    A ping method for testing purpose.

    Methods inherited from class com.vaadin.flow.component.littemplate.LitTemplate

    getChildren

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, findAncestor, fireEvent, from, get, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
  • Method Details

    • onAttach

      protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
      Overrides:
      onAttach in class com.vaadin.flow.component.Component
    • onDetach

      protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent)
      Overrides:
      onDetach in class com.vaadin.flow.component.Component
    • invoke

      @ClientCallable public void invoke(String invocation)
      It handles an encoded invocation coming from the JVaadinPanel in the Swing app. So far only JVaadinPanel setEnabled method is available. After executing the invocation it generates an encoded response and sends it providing a valid SwingJavascriptResponse executed by the Vaadin view using Page.executeJs method.
      Parameters:
      invocation - The encoded invocation coming from Swing app.
    • ping

      @ClientCallable public String ping()
      A ping method for testing purpose.
      Returns:
      Pong if the call is successful