Class JVaadinPanel

All Implemented Interfaces:
VaadinEventNotifier, ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
JCefJVaadinPanel

public abstract class JVaadinPanel extends JPanel implements VaadinEventNotifier
A Swing panel that can embed a Vaadin app.
See Also:
  • Field Details

    • ready

      protected boolean ready
  • Constructor Details

    • JVaadinPanel

      protected JVaadinPanel()
      Creates a new Panel that can be added to a Swing view. It adds a default exception handler and both an attach and a detach event listener for updating the status of the panel.
  • Method Details

    • executeJs

      protected abstract void executeJs(String cli)
      Execute a JS script in the Vaadin app the panel is embedding.
    • as

      public <T extends SwingVaadinCallable> T as(Class<T> swingVaadinInterface)

      It lets you use the JVaadinPanel as any SwingVaadinCallable implemented by the Vaadin view so that any methods defined by the interface can be called directly.

      See docs for more info.

      Type Parameters:
      T - the type of the interface
      Parameters:
      swingVaadinInterface - the interface to treat the Vaadin panel as.
      Returns:
      a proxy object that implements the given interface and forwards method calls to the Vaadin app
    • isReady

      public boolean isReady()
      Query the Vaadin view to check if it is ready to receive action calls.
      Returns:
      true if the Vaadin view is ready, false otherwise.
    • reload

      public abstract void reload()
      Reload the Vaadin view.
    • setName

      public void setName(String name)
      Overrides:
      setName in class Component
    • setBrowserName

      protected abstract void setBrowserName(String name)
      Sets the name of the component holding the browser instance.
      Parameters:
      name - the name to use.
    • addDefaultExceptionHandler

      public final void addDefaultExceptionHandler()

      Enable a default VaadinEventListener to handle exceptions from the Vaadin view in the panel. The default exception handler shows a message dialog with information about the exception thrown. If the exception is of type NETWORK_EXCEPTION then the Vaadin view will be automatically redirected to the network error page.

    • removeDefaultExceptionHandler

      public final void removeDefaultExceptionHandler()
      Disables the default VaadinEventListener to hande exceptions from the Vaadin view in the panel.
    • getListeners

      public Map<String,List<VaadinEventListener>> getListeners()
      Description copied from interface: VaadinEventNotifier
      Get a map with one list for each type of all listeners registered in this notifier.
      Specified by:
      getListeners in interface VaadinEventNotifier
      Returns:
      a map with one list of all registered listeners for each event type.
    • clearListeners

      public final void clearListeners(String eventType)
      Description copied from interface: VaadinEventNotifier
      Unregister all listeners of a certain event type.
      Specified by:
      clearListeners in interface VaadinEventNotifier
      Parameters:
      eventType - the type of event to clear of listeners.
    • clearListeners

      public final void clearListeners()
      Description copied from interface: VaadinEventNotifier
      Unregister all listeners.
      Specified by:
      clearListeners in interface VaadinEventNotifier