Package io.jmix.ui

Class AppUI

java.lang.Object
com.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractSingleComponentContainer
com.vaadin.ui.UI
io.jmix.ui.AppUI
All Implemented Interfaces:
com.vaadin.event.Action.Container, com.vaadin.event.Action.Notifier, com.vaadin.event.ConnectorEventListener, com.vaadin.event.ContextClickEvent.ContextClickNotifier, com.vaadin.event.MethodEventSource, com.vaadin.event.SerializableEventListener, com.vaadin.event.UIEvents.PollNotifier, com.vaadin.server.ClientConnector, com.vaadin.server.ErrorHandler, com.vaadin.server.Sizeable, com.vaadin.server.VariableOwner, com.vaadin.shared.Connector, com.vaadin.ui.Component, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.HasContextHelp, com.vaadin.ui.HasComponents, com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.LegacyComponent, com.vaadin.ui.SingleComponentContainer, UiExceptionHandler.UiContext, EnhancedUI, Serializable, Iterable<com.vaadin.ui.Component>, EventListener
Direct Known Subclasses:
TestAppUI

@SpringUI public class AppUI extends com.vaadin.ui.UI implements com.vaadin.server.ErrorHandler, EnhancedUI, UiExceptionHandler.UiContext
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from class com.vaadin.ui.UI

    com.vaadin.ui.UI.WindowOrderUpdateEvent, com.vaadin.ui.UI.WindowOrderUpdateListener

    Nested classes/interfaces inherited from class com.vaadin.server.AbstractClientConnector

    com.vaadin.server.AbstractClientConnector.IncorrectConcurrentAccessHandler

    Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector

    com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener

    Nested classes/interfaces inherited from interface com.vaadin.ui.Component

    com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.HasContextHelp, com.vaadin.ui.Component.Listener

    Nested classes/interfaces inherited from interface com.vaadin.ui.Component.HasContextHelp

    com.vaadin.ui.Component.HasContextHelp.ContextHelpIconClickEvent, com.vaadin.ui.Component.HasContextHelp.ContextHelpIconClickListener

    Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents

    com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListener

    Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable

    com.vaadin.server.Sizeable.Unit
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected App
     
    protected org.springframework.beans.factory.BeanFactory
     
     
    protected Dialogs
     
    protected org.springframework.context.ApplicationEventPublisher
     
     
    protected Fragments
     
    protected History
     
    protected IconResolver
     
    static final String
     
    protected Messages
     
    protected Notifications
     
    protected Screens
     
    protected TestIdManager
     
     
    protected RootWindow
     
     
     
    protected UiProperties
     
     
    protected UrlRouting
     
     
    protected WebBrowserTools
     
     

    Fields inherited from class com.vaadin.ui.UI

    actionManager

    Fields inherited from class com.vaadin.ui.AbstractComponent

    componentErrorProvider, DESIGN_ATTR_PLAIN_TEXT, requiredError

    Fields inherited from interface com.vaadin.server.Sizeable

    SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
     
    protected App
     
    com.vaadin.server.Resource
     
    void
     
    void
    error(com.vaadin.server.ErrorEvent event)
     
     
    static AppUI
     
     
     
     
     
     
     
     
     
     
    protected com.vaadin.ui.AbstractComponent
     
     
     
     
     
     
    getWebJarPath(String webjar, String partialPath)
     
    void
    handleRequest(com.vaadin.server.VaadinRequest request)
     
    boolean
     
    protected void
    init(com.vaadin.server.VaadinRequest request)
     
    protected void
     
    protected void
    Dynamically init external JS libraries.
    boolean
    isAccessibleForUser(com.vaadin.ui.Component component)
    Check if users can interact with the component - there are no modal windows that prevent user action.
    boolean
     
    boolean
     
    protected boolean
     
    void
    paintContent(com.vaadin.server.PaintTarget target)
     
    protected void
    processExternalLink(com.vaadin.server.VaadinRequest request, NavigationState requestedState)
     
    protected void
     
    protected void
     
    protected void
    refresh(com.vaadin.server.VaadinRequest request)
     
    protected void
     
    void
     
    protected void
     
    void
     
    void
    INTERNAL.
    protected void
     
    void
     
    void
     
    protected void
     
    translateToWebPath(String fullWebJarPath)
     
    protected void
     
    void
     
    protected void
     

    Methods inherited from class com.vaadin.ui.UI

    access, accessSynchronously, addAction, addActionHandler, addClickListener, addPollListener, addWindow, addWindowOrderUpdateListener, attach, changeVariables, close, doInit, doRefresh, focus, getActionManager, getActiveDragSource, getComponentCount, getConnectorTracker, getEmbedId, getLastHeartbeatTimestamp, getLastProcessedClientToServerId, getLoadingIndicatorConfiguration, getLocaleService, getNavigator, getNotificationConfiguration, getOverlayContainerLabel, getPage, getPollInterval, getPushConfiguration, getPushConnection, getReconnectDialogConfiguration, getScrollLeft, getScrollTop, getSession, getState, getState, getStateType, getTabIndex, getTheme, getTooltipConfiguration, getUI, getUIId, getUiPathInfo, getUiRootPath, getWindows, isClosing, isConnectorEnabled, isMobileHtml5DndEnabled, isResizeLazy, isUsingThoroughSizeCheck, iterator, push, removeAction, removeActionHandler, removeClickListener, removePollListener, removeWindow, scrollIntoView, setActiveDragSource, setCaption, setContent, setCurrent, setFocusedComponent, setLastHeartbeatTimestamp, setLastProcessedClientToServerId, setMobileHtml5DndEnabled, setNavigator, setOverlayContainerLabel, setPollInterval, setPushConnection, setResizeLazy, setScrollLeft, setScrollTop, setSession, setTabIndex, setTheme, setUsingThoroughSizeCheck, showNotification, showNotification, showNotification, showNotification, showNotification, showNotification

    Methods inherited from class com.vaadin.ui.AbstractSingleComponentContainer

    addComponentAttachListener, addComponentDetachListener, fireComponentAttachEvent, fireComponentDetachEvent, getContent, readDesign, readDesignChildren, removeComponentAttachListener, removeComponentDetachListener, removeFromParent, setHeight, setWidth, writeDesign

    Methods inherited from class com.vaadin.ui.AbstractComponent

    addContextClickListener, addContextHelpIconClickListener, addListener, addShortcutListener, addStyleName, beforeClientResponse, ensureContextHelpInitialized, findAncestor, fireComponentErrorEvent, fireComponentEvent, fireContextHelpClick, getCaption, getComponentError, getComponentErrorProvider, getContextHelpText, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getJTestId, getLocale, getParent, getPrimaryStyleName, getRequiredError, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isContextHelpTextHtmlEnabled, isEnabled, isOrHasAncestor, isReadOnly, isRequiredIndicatorVisible, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaptionAsHtml, setComponentError, setComponentErrorProvider, setContextHelpText, setContextHelpTextHtmlEnabled, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeightFull, setHeightUndefined, setIcon, setId, setJTestId, setLocale, setParent, setPrimaryStyleName, setReadOnly, setRequiredError, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidthFull, setWidthUndefined

    Methods inherited from class com.vaadin.server.AbstractClientConnector

    addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getIncorrectConcurrentAccessHandler, getListeners, getResource, getRpcManager, getRpcProxy, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setConnectorResource, setErrorHandler, setIncorrectConcurrentAccessHandler, setResource, updateDiffstate

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.server.ClientConnector

    addAttachListener, addDetachListener, beforeClientResponse, encodeState, getErrorHandler, getExtensions, getRpcManager, handleConnectorRequest, isAttached, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler

    Methods inherited from interface com.vaadin.ui.Component

    addListener, addStyleName, addStyleNames, getCaption, getDescription, getIcon, getId, getJTestId, getLocale, getParent, getPrimaryStyleName, getStyleName, isEnabled, isVisible, readDesign, removeListener, removeStyleName, removeStyleNames, setEnabled, setIcon, setId, setJTestId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible, writeDesign

    Methods inherited from interface com.vaadin.shared.Connector

    getConnectorId

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods inherited from interface com.vaadin.ui.LegacyComponent

    markAsDirty

    Methods inherited from interface com.vaadin.server.Sizeable

    getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefined

    Methods inherited from interface com.vaadin.server.VariableOwner

    isEnabled
  • Field Details

    • app

      protected App app
    • LAST_REQUEST_PARAMS_ATTR

      public static final String LAST_REQUEST_PARAMS_ATTR
      See Also:
    • messages

      @Autowired protected Messages messages
    • eventPublisher

      @Autowired protected org.springframework.context.ApplicationEventPublisher eventPublisher
    • uiEventPublisher

      @Autowired protected UiEventPublisher uiEventPublisher
    • uiProperties

      @Autowired protected UiProperties uiProperties
    • themeConstantsRepository

      @Autowired protected ThemeConstantsRepository themeConstantsRepository
    • currentAuthentication

      @Autowired protected CurrentAuthentication currentAuthentication
    • uiEventsMulticaster

      @Autowired protected UiEventsMulticaster uiEventsMulticaster
    • iconResolver

      @Autowired protected IconResolver iconResolver
    • webJarResourceResolver

      @Autowired protected WebJarResourceResolver webJarResourceResolver
    • beanFactory

      @Autowired protected org.springframework.beans.factory.BeanFactory beanFactory
    • userSettingsTools

      @Autowired(required=false) protected UserSettingsTools userSettingsTools
    • testIdManager

      protected TestIdManager testIdManager
    • fileDownloader

      protected JmixFileDownloader fileDownloader
    • topLevelWindow

      protected RootWindow topLevelWindow
    • fragments

      protected Fragments fragments
    • screens

      protected Screens screens
    • dialogs

      protected Dialogs dialogs
    • notifications

      protected Notifications notifications
    • webBrowserTools

      protected WebBrowserTools webBrowserTools
    • urlChangeHandler

      protected UrlChangeHandler urlChangeHandler
    • urlRouting

      protected UrlRouting urlRouting
    • history

      protected History history
  • Constructor Details

    • AppUI

      public AppUI()
  • Method Details

    • initJsLibraries

      protected void initJsLibraries()
      Dynamically init external JS libraries. You should create JavaScriptExtension class and extend UI object here.

      Example:

      
       JavaScriptExtension:
      
       @JavaScript("resources/jquery/jquery-1.10.2.min.js")
       public class JQueryIntegration extends AbstractJavaScriptExtension {
      
           @Override
           public void extend(AbstractClientConnector target) {
               super.extend(target);
           }
      
           @Override
           protected Class<? extends ClientConnector> getSupportedParentType() {
               return UI.class;
           }
       }
      
       AppUI:
      
       protected void initJsLibraries() {
           new JQueryIntegration().extend(this);
       }

      If you want to include scripts to generated page statically implement BootstrapListener

    • initInternalComponents

      protected void initInternalComponents()
    • createApplication

      protected App createApplication()
    • getScreens

      public Screens getScreens()
      Specified by:
      getScreens in interface UiExceptionHandler.UiContext
      Returns:
      screens screens API
    • getDialogs

      public Dialogs getDialogs()
      Specified by:
      getDialogs in interface UiExceptionHandler.UiContext
      Returns:
      dialogs API
    • getNotifications

      public Notifications getNotifications()
      Specified by:
      getNotifications in interface UiExceptionHandler.UiContext
      Returns:
      notifications API
    • getWebBrowserTools

      public WebBrowserTools getWebBrowserTools()
      Specified by:
      getWebBrowserTools in interface UiExceptionHandler.UiContext
      Returns:
      web browser API
    • getFragments

      public Fragments getFragments()
      Specified by:
      getFragments in interface UiExceptionHandler.UiContext
      Returns:
      fragments API
    • getUrlRouting

      public UrlRouting getUrlRouting()
    • setUrlRouting

      @Autowired @Lazy public void setUrlRouting(UrlRouting urlRouting)
    • getUrlChangeHandler

      public UrlChangeHandler getUrlChangeHandler()
    • setUrlChangeHandler

      @Autowired @Lazy public void setUrlChangeHandler(UrlChangeHandler urlChangeHandler)
    • getHistory

      public History getHistory()
    • setHistory

      @Autowired @Lazy public void setHistory(History history)
    • init

      protected void init(com.vaadin.server.VaadinRequest request)
      Specified by:
      init in class com.vaadin.ui.UI
    • restoreRouteState

      protected void restoreRouteState(NavigationState requestedState)
    • hasAuthenticatedSession

      public boolean hasAuthenticatedSession()
      Returns:
      true if authentication is set and it isn't represented by AnonymousAuthenticationToken
    • publishAppInitializedEvent

      protected void publishAppInitializedEvent(App app)
    • showCriticalExceptionMessage

      protected void showCriticalExceptionMessage(Exception exception)
    • setupUI

      protected void setupUI()
    • refresh

      protected void refresh(com.vaadin.server.VaadinRequest request)
      Overrides:
      refresh in class com.vaadin.ui.UI
    • handleRequest

      public void handleRequest(com.vaadin.server.VaadinRequest request)
      Overrides:
      handleRequest in class com.vaadin.ui.UI
    • getCurrent

      @Nullable public static AppUI getCurrent()
      Returns:
      current AppUI
    • getApp

      public App getApp()
      Returns:
      this App instance
    • getTopLevelWindow

      @Nullable public RootWindow getTopLevelWindow()
      Returns:
      currently displayed top-level window
    • getTopLevelWindowNN

      public RootWindow getTopLevelWindowNN()
    • setTopLevelWindow

      public void setTopLevelWindow(@Nullable RootWindow window)
      INTERNAL. Set currently displayed top-level window.
    • getTestIdManager

      public TestIdManager getTestIdManager()
    • removePreviousTopLevelWindowConnector

      protected void removePreviousTopLevelWindowConnector()
    • isTestMode

      public boolean isTestMode()
      Returns:
      true if UI test mode is enabled and j-test-id attribute should be added to DOM tree
    • isPerformanceTestMode

      public boolean isPerformanceTestMode()
    • error

      public void error(com.vaadin.server.ErrorEvent event)
      Specified by:
      error in interface com.vaadin.server.ErrorHandler
    • processExternalLink

      protected void processExternalLink(com.vaadin.server.VaadinRequest request, NavigationState requestedState)
    • processRequest

      protected void processRequest(@Nullable NavigationState navigationState)
    • detach

      public void detach()
      Specified by:
      detach in interface com.vaadin.server.ClientConnector
      Overrides:
      detach in class com.vaadin.ui.UI
    • updateClientSystemMessages

      protected void updateClientSystemMessages(Locale locale)
    • getTopLevelWindowComposition

      protected com.vaadin.ui.AbstractComponent getTopLevelWindowComposition()
    • getTimers

      public List<JmixTimer> getTimers()
    • addTimer

      public void addTimer(JmixTimer timer)
    • removeTimer

      public void removeTimer(JmixTimer timer)
    • beforeTopLevelWindowInit

      public void beforeTopLevelWindowInit()
    • updateUiTheme

      protected void updateUiTheme()
    • getFileDownloader

      public JmixFileDownloader getFileDownloader()
    • getUiEventsMulticaster

      public UiEventsMulticaster getUiEventsMulticaster()
    • createVersionedResource

      @Nullable public com.vaadin.server.Resource createVersionedResource(String value)
      Specified by:
      createVersionedResource in interface EnhancedUI
    • getWebJarPath

      public String getWebJarPath(String webjar, String partialPath)
      Specified by:
      getWebJarPath in interface EnhancedUI
    • translateToWebPath

      public String translateToWebPath(String fullWebJarPath)
      Specified by:
      translateToWebPath in interface EnhancedUI
    • paintContent

      public void paintContent(com.vaadin.server.PaintTarget target) throws com.vaadin.server.PaintException
      Specified by:
      paintContent in interface com.vaadin.ui.LegacyComponent
      Overrides:
      paintContent in class com.vaadin.ui.UI
      Throws:
      com.vaadin.server.PaintException
    • isVaadinSessionOpen

      protected boolean isVaadinSessionOpen()
    • isAccessibleForUser

      public boolean isAccessibleForUser(com.vaadin.ui.Component component)
      Check if users can interact with the component - there are no modal windows that prevent user action.
      Parameters:
      component - component
      Returns:
      whether it accessible or not
    • updateSystemMessagesLocale

      public void updateSystemMessagesLocale(AppUI.SystemMessages msgs)