Package com.vaadin.swingkit.server
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 TypeMethodDescriptionvoidIt handles an encoded invocation coming from the JVaadinPanel in the Swing app.protected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) protected voidonDetach(com.vaadin.flow.component.DetachEvent detachEvent) ping()A ping method for testing purpose.Methods inherited from class com.vaadin.flow.component.littemplate.LitTemplate
getChildrenMethods 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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods 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:
onAttachin classcom.vaadin.flow.component.Component
-
onDetach
protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent) - Overrides:
onDetachin classcom.vaadin.flow.component.Component
-
invoke
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 validSwingJavascriptResponseexecuted by the Vaadin view usingPage.executeJsmethod.- Parameters:
invocation- The encoded invocation coming from Swing app.
-
ping
A ping method for testing purpose.- Returns:
- Pong if the call is successful
-