4.5.8. Web Client Specifics
Implementation of the generic user interface of the Web Client block is based on the Vaadin framework. The main classes available in the web client infrastructure are described below.
-
App
- the central class of the application infrastructure. Contains links toConnection
,AppWindow
and other infrastructure objects. Only one instance ofApp
exists for a given HTTP-session.Each application typically has its own
App
class class inherited from theDefaultApp
and thus from the basic abstractApp
class of the platform. It allows you to overridecreateAppWindow()
andcreateLoginWindow()
methods to create custom implementations of the main window and the login window.The
App
class of an application should be registered in theapplication
parameter of theapp_servlet
in the web.xml file of the web module. -
Connection
is the interface providing functionality of connecting to middleware and storing user sessions.DefaultConnection
is a standard implementation of this interface. -
AppUI
is a platform class inherited fromcom.vaadin.ui.UI
class. There is one instance of this class for each open tab of a web browser. Contains a link to theUIView
object – either aLoginWindow
orAppWindow
.AppUI
application class should be registered in theUI
parameter of theapp_servlet
in the web/WEB-INF/web.xml file of the web module. In most cases, standard platform class is used. -
LoginWindow
– the window displayed before a user logs in. In your application you can create an inheritor ofLoginWindow
and redefine thecreateLoginWindow()
method of theApp
class to use it. -
AppWindow
– main application window displayed after a user logs in. In your application, you can create an inheritor ofAppWindow
and override thecreateAppWindow()
method of theApp
class to use it.onHistoryBackPerformed()
method allows you to handle browser Back button. This method is invoked instead of standard browser behavior if cuba.web.allowHandleBrowserHistoryBack application property is true.You can control certain main window parameters without creating
AppWindow
inheritor, using the following application properties:-
cuba.web.useLightHeader - switches on compact window header - logo, menu bar, user name and log out button in one line. When switched off,
AppWindow.createTitleLayout()
method creates additional area at the top. -
cuba.web.foldersPaneEnabled - enables creation of folders pane by
AppWindow.createFoldersPane()
method. -
cuba.web.appWindowMode – sets default mode for the main window: tabbed or single screen (
TABBED
orSINGLE
). Users can change the mode later using Help > Settings screen. -
cuba.web.maxTabCount – when the main window is in the tabbed mode, this property sets the maximum number of tabs that a user can open. The default value is 7.
-
-
WindowManager
- the central class implementing application screens management logic.openWindow()
,openEditor()
,showMessageDialog()
and other methods of theFrame
interface implemented by screen controllers delegate to the window manager.WindowManager
class is located in the platform’s common gui module and is abstract. The web module has a dedicatedWebWindowManager
class that implements web client specifics.Normally, the
WindowManager
is not used in the application code directly. -
ExceptionHandlers
- contains a collection of client-level exception handlers.