Package io.jmix.ui

Class App

java.lang.Object
io.jmix.ui.App
Direct Known Subclasses:
JmixApp

public abstract class App extends Object
Central class of the web application. An instance of this class is created for each client's session and is bound to VaadinSession.
Use getInstance() static method to obtain the reference to the current App instance.
  • Field Details

  • Constructor Details

    • App

      public App()
  • Method Details

    • loadTheme

      protected ThemeConstants loadTheme()
    • applyTheme

      protected void applyTheme(String appWindowTheme)
    • initExceptionHandlers

      protected void initExceptionHandlers(boolean isConnected)
      Initializes exception handlers immediately after login and logout. Can be overridden in descendants to manipulate exception handlers programmatically.
      Parameters:
      isConnected - true after login, false after logout
    • getThemeConstants

      public ThemeConstants getThemeConstants()
    • getAppUIs

      public List<AppUI> getAppUIs()
    • loginOnStart

      public abstract void loginOnStart()
    • init

      protected void init(Locale requestLocale)
      Called when the first UI of the session is initialized.
    • resolveLocale

      protected Locale resolveLocale(@Nullable Locale requestLocale)
    • createTopLevelWindow

      public void createTopLevelWindow(AppUI ui)
      Called on each browser tab initialization.
    • routeTopLevelWindowId

      protected abstract String routeTopLevelWindowId()
    • createTopLevelWindow

      public void createTopLevelWindow()
    • onHeartbeat

      public void onHeartbeat()
      Called from heartbeat request.
      Used for ping middleware session and show session messages
    • getInstance

      public static App getInstance()
      Returns:
      Current App instance. Can be invoked anywhere in application code.
      Throws:
      IllegalStateException - if no application instance is bound to the current VaadinSession
    • isBound

      public static boolean isBound()
      Returns:
      true if an App instance is currently bound and can be safely obtained by getInstance()
    • getWindowManager

      @Deprecated @Nullable public ScreensImpl getWindowManager()
      Deprecated.
      Get screens API from AppUI instead.
      Returns:
      WindowManagerImpl instance or null if the current UI has no MainWindow
    • getExceptionHandlers

      public ExceptionHandlers getExceptionHandlers()
    • getCookieValue

      @Nullable public String getCookieValue(String name)
    • getCookieMaxAge

      public int getCookieMaxAge(String name)
    • addCookie

      public void addCookie(String name, String value, int maxAge)
    • addCookie

      public void addCookie(String name, String value)
    • removeCookie

      public void removeCookie(String name)
    • getLocale

      public Locale getLocale()
    • setLocale

      public void setLocale(Locale locale)
    • setUserAppTheme

      public void setUserAppTheme(String themeName)
    • addBackgroundTask

      public void addBackgroundTask(Future task)
    • removeBackgroundTask

      public void removeBackgroundTask(Future task)
    • cleanupBackgroundTasks

      public void cleanupBackgroundTasks()
    • removeAllWindows

      public void removeAllWindows()
      Removes all windows from all UIs.
    • removeAllWindows

      protected void removeAllWindows(List<AppUI> uis)
      Removes all windows in the given uis.
      Parameters:
      uis - AppUI instances
    • logout

      public OperationResult logout()
      Try to perform logout. If there are unsaved changes in opened windows then logout will not be performed and unsaved changes dialog will appear.
      Returns:
      operation result object
    • performStandardLogout

      protected void performStandardLogout(AppUI ui)
    • performForceLogout

      protected void performForceLogout()
    • forceLogout

      protected void forceLogout()
    • closeWindowsInternal

      public void closeWindowsInternal(boolean fireEvent)
      Removes all windows from all UIs and fires CloseWindowsInternalEvent application event.
      Parameters:
      fireEvent - fire event or not
    • getContextPathName

      @Nullable protected String getContextPathName()
    • clearSettingsCache

      protected void clearSettingsCache()
    • forceRefreshUIsExceptCurrent

      public void forceRefreshUIsExceptCurrent()