Class ScreensImpl

java.lang.Object
io.jmix.ui.sys.ScreensImpl
All Implemented Interfaces:
Screens

@ParametersAreNonnullByDefault @UIScope @Component("ui_Screens") public class ScreensImpl extends Object implements Screens
  • Field Details

    • applicationContext

      @Autowired protected org.springframework.context.ApplicationContext applicationContext
    • windowConfig

      @Autowired protected WindowConfig windowConfig
    • uiComponents

      @Autowired protected UiComponents uiComponents
    • screenXmlLoader

      @Autowired protected ScreenXmlLoader screenXmlLoader
    • iconResolver

      @Autowired protected IconResolver iconResolver
    • messages

      @Autowired protected Messages messages
    • icons

      @Autowired protected Icons icons
    • urlTools

      @Autowired protected UrlTools urlTools
    • meterRegistry

      @Autowired protected io.micrometer.core.instrument.MeterRegistry meterRegistry
    • accessManager

      @Autowired protected AccessManager accessManager
    • dependencyManager

      @Autowired protected UiControllerDependencyManager dependencyManager
    • uiProperties

      @Autowired protected UiProperties uiProperties
    • ui

      protected AppUI ui
  • Constructor Details

    • ScreensImpl

      public ScreensImpl()
  • Method Details

    • setAppUi

      @Autowired public void setAppUi(AppUI ui)
    • create

      public <T extends Screen> T create(Class<T> requiredScreenClass, OpenMode openMode, ScreenOptions options)
      Description copied from interface: Screens
      Creates a screen by its controller class.
      Specified by:
      create in interface Screens
      Parameters:
      requiredScreenClass - screen controller class
      openMode - how the screen should be opened
      options - screen parameters
    • create

      public Screen create(String screenId, OpenMode openMode, ScreenOptions options)
      Description copied from interface: Screens
      Creates a screen by its screen id.
      Specified by:
      create in interface Screens
      Parameters:
      screenId - screen id
      openMode - how the screen should be opened
      options - screen parameters
    • createScreen

      protected <T extends Screen> T createScreen(WindowInfo windowInfo, OpenMode openMode, ScreenOptions options)
    • createComponentLoaderContext

      protected ComponentLoaderContext createComponentLoaderContext(ScreenOptions options)
    • prepareScreenOpenDetails

      protected ScreensImpl.ScreenOpenDetails prepareScreenOpenDetails(Class<? extends Screen> resolvedScreenClass, @Nullable org.dom4j.Element element, OpenMode requiredOpenMode)
    • loadScreenXml

      @Nullable protected org.dom4j.Element loadScreenXml(WindowInfo windowInfo, ScreenOptions options)
    • loadWindowFromXml

      protected <T extends Screen> void loadWindowFromXml(org.dom4j.Element element, WindowInfo windowInfo, Window window, T controller, ComponentLoaderContext componentLoaderContext)
    • findMessageGroup

      protected void findMessageGroup(org.dom4j.Element element, String descriptorPath, ComponentLoaderContext componentLoaderContext)
    • getMessageGroup

      protected String getMessageGroup(String descriptorPath)
    • show

      public OperationResult show(Screen screen)
      Description copied from interface: Screens
      Displays the given screen according to its OpenMode.
      Specified by:
      show in interface Screens
      Parameters:
      screen - screen
      Returns:
      OperationResult.success() if screen is shown or otherwise OperationResult.fail()
    • showFromNavigation

      public OperationResult showFromNavigation(Screen screen)
      Description copied from interface: Screens
      Displays the given screen taking into account already opened screens and multipleOpen option.
      Specified by:
      showFromNavigation in interface Screens
      Parameters:
      screen - screen
      Returns:
      operation result
    • changeUrl

      protected void changeUrl(Screen screen)
    • checkNotYetOpened

      protected void checkNotYetOpened(Screen screen)
    • checkOpened

      protected void checkOpened(Screen screen)
    • isMaxTabCountExceeded

      protected boolean isMaxTabCountExceeded(Screen screen)
    • showTooManyOpenTabsMessage

      protected void showTooManyOpenTabsMessage()
    • remove

      public void remove(Screen screen)
      Description copied from interface: Screens
      Removes screen from UI and releases all the resources of screen.
      Specified by:
      remove in interface Screens
      Parameters:
      screen - screen
    • afterScreenRemove

      protected void afterScreenRemove(Screen screen)
    • getAnyCurrentScreen

      @Nullable protected Screen getAnyCurrentScreen()
    • removeThisTabWindow

      protected void removeThisTabWindow(Screen screen)
    • removeRootWindow

      protected void removeRootWindow(Screen screen)
    • removeNewTabWindow

      protected void removeNewTabWindow(Screen screen)
    • removeDialogWindow

      protected void removeDialogWindow(Screen screen)
    • removeAll

      public void removeAll()
      Description copied from interface: Screens
      Removes all child screens (screens of work area and dialog screens) from the root screen and releases their resources.
      Specified by:
      removeAll in interface Screens
    • hasUnsavedChanges

      public boolean hasUnsavedChanges()
      Description copied from interface: Screens
      Check if there are screens that have unsaved changes.
      Specified by:
      hasUnsavedChanges in interface Screens
      Returns:
      true if there are screens with unsaved changes
    • getOpenedScreens

      public Screens.OpenedScreens getOpenedScreens()
      Specified by:
      getOpenedScreens in interface Screens
      Returns:
      object that provides information about opened screens
    • getOpenedWorkAreaScreensStream

      protected Stream<Screen> getOpenedWorkAreaScreensStream()
    • getActiveWorkAreaScreensStream

      protected Stream<Screen> getActiveWorkAreaScreensStream()
    • getDialogScreensStream

      protected Stream<Screen> getDialogScreensStream()
    • getCurrentBreadcrumbs

      protected Collection<Screen> getCurrentBreadcrumbs()
    • getRootScreenOrNull

      @Nullable protected Screen getRootScreenOrNull()
    • getTabbedScreensStacks

      protected Stream<Screens.WindowStack> getTabbedScreensStacks(AppWorkAreaImpl workArea)
    • getWorkAreaStacks

      protected Collection<Screens.WindowStack> getWorkAreaStacks(AppWorkAreaImpl workArea)
    • getConfiguredWorkArea

      public AppWorkAreaImpl getConfiguredWorkArea()
      Returns:
      workarea instance of the root screen
      Throws:
      IllegalStateException - if there is no root screen or root screen does not have AppWorkArea
    • getConfiguredWorkAreaOrNull

      @Nullable public AppWorkArea getConfiguredWorkAreaOrNull()
      Specified by:
      getConfiguredWorkAreaOrNull in interface Screens
    • createController

      protected <T extends Screen> T createController(WindowInfo windowInfo, Window window, Class<T> screenClass)
    • createWindow

      protected Window createWindow(WindowInfo windowInfo, Class<? extends Screen> screenClass, ScreensImpl.ScreenOpenDetails openDetails)
    • createDialogWindow

      protected DialogWindow createDialogWindow(WindowInfo windowInfo)
    • createRootWindow

      protected RootWindow createRootWindow(WindowInfo windowInfo)
    • createTabWindow

      protected TabWindow createTabWindow(WindowInfo windowInfo)
    • createWindowContext

      protected WindowContextImpl createWindowContext(Window window, ScreensImpl.ScreenOpenDetails openDetails)
    • checkPermissions

      protected void checkPermissions(OpenMode openMode, WindowInfo windowInfo)
    • getScreenInfo

      protected WindowInfo getScreenInfo(Class<? extends Screen> screenClass)
    • showRootWindow

      protected void showRootWindow(Screen screen)
    • isWindowClosePrevented

      protected boolean isWindowClosePrevented(Window window, Window.CloseOrigin closeOrigin)
    • hasModalDialogWindow

      protected boolean hasModalDialogWindow()
      Checks if there are modal GUI dialog windows.
      Returns:
      true if there is at least one modal dialog window
    • hasModalWindow

      protected boolean hasModalWindow()
      Checks if there are modal Vaadin dialog windows.
      Returns:
      true if there is at least one modal Vaadin dialog window
    • checkModificationsAndCloseAll

      @Deprecated public void checkModificationsAndCloseAll(@Nullable Runnable runIfOk)
      Deprecated.
      Check modifications and close all screens in all main windows.
      Parameters:
      runIfOk - a closure to run after all screens are closed
    • checkModificationsAndCloseAll

      @Deprecated public void checkModificationsAndCloseAll(@Nullable Runnable runIfOk, @Nullable Runnable runIfCancel)
      Deprecated.
      Check modifications and close all screens in all main windows.
      Parameters:
      runIfOk - a closure to run after all screens are closed
      runIfCancel - a closure to run if there were modifications and a user canceled the operation
    • checkModificationsAndCloseAll

      public OperationResult checkModificationsAndCloseAll()
      Check modifications and close all screens in all main windows excluding root screens.
      Returns:
      operation result
    • createParametersMap

      @Deprecated protected Map<String,Object> createParametersMap(WindowInfo windowInfo, @Nullable Map<String,Object> params)
      Deprecated.
    • showNewTabWindow

      protected void showNewTabWindow(Screen screen)
    • createWindowBreadCrumbs

      protected WindowBreadCrumbs createWindowBreadCrumbs(Screen screen)
    • createNewTabLayout

      protected void createNewTabLayout(Screen screen)
    • showThisTabWindow

      protected void showThisTabWindow(Screen screen)
    • showDialogWindow

      protected void showDialogWindow(Screen screen)
    • createOrUpdateState

      protected NavigationState createOrUpdateState(@Nullable NavigationState state, int stateMark)
    • handleWindowBreadCrumbsNavigate

      protected void handleWindowBreadCrumbsNavigate(WindowBreadCrumbs breadCrumbs, Window window)
    • handleTabWindowClose

      protected void handleTabWindowClose(HasTabSheetBehaviour targetTabSheet, com.vaadin.ui.Component tabContent)
    • fireScreenInitEvent

      protected void fireScreenInitEvent(FrameOwner screen, Class<Screen.InitEvent> eventType, Screen.InitEvent event)
    • fireScreenAfterInitEvent

      protected void fireScreenAfterInitEvent(FrameOwner screen, Class<Screen.AfterInitEvent> eventType, Screen.AfterInitEvent event)
    • fireScreenBeforeShowEvent

      protected void fireScreenBeforeShowEvent(FrameOwner screen, Class<Screen.BeforeShowEvent> eventType, Screen.BeforeShowEvent event)
    • fireScreenAfterShowEvent

      protected void fireScreenAfterShowEvent(FrameOwner screen, Class<Screen.AfterShowEvent> eventType, Screen.AfterShowEvent event)
    • fireScreenAfterDetachEvent

      protected void fireScreenAfterDetachEvent(FrameOwner screen, Class<Screen.AfterDetachEvent> eventType, Screen.AfterDetachEvent event)