3.5.18. Generic UI Infrastructure

This section describes Generic UI infrastructure classes that can be extended in an application.

WebClientInfrastructure
Figure 27. Generic UI Infrastructure Classes
  • AppUI is a class inherited from com.vaadin.ui.UI. There is one instance of this class for each open web browser tab. It refers a RootWindow which contains either a login screen or main screen, depending on the connection state. You can get a reference to the AppUI for the current browser tab by using the AppUI.getCurrent() static method.

    If you want to customize functionality of AppUI in your project, create a class extending AppUI in the web module and register it in web-spring.xml with cuba_AppUI id and prototype scope, for example:

    <bean id="cuba_AppUI" class="com.company.sample.web.MyAppUI" scope="prototype"/>
  • Connection is an interface providing functionality of connecting to middleware and holding a user session. ConnectionImpl is a standard implementation of this interface.

    If you want to customize functionality of Connection in your project, create a class extending ConnectionImpl in the web module and register it in web-spring.xml with cuba_Connection id and vaadin scope, for example:

    <bean id="cuba_Connection" class="com.company.sample.web.MyConnection" scope="vaadin"/>
  • ExceptionHandlers class contains a collection of client-level exception handlers.

  • App contains links to Connection, ExceptionHandlers and other infrastructure objects. A single instance of this class is created for an HTTP session and stored in its attribute. You can get a reference to the App instance by using the App.getInstance() static method.

    If you want to customize functionality of App in your project, create a class extending DefaultApp in the web module and register it in web-spring.xml with cuba_App id and vaadin scope, for example:

    <bean name="cuba_App" class="com.company.sample.web.MyApp" scope="vaadin"/>