Package io.jmix.ui.sys
Class ScreensImpl
java.lang.Object
io.jmix.ui.sys.ScreensImpl
- All Implemented Interfaces:
Screens
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
protected static class
class
protected static class
Content of each tab of AppWorkArea TabSheet.protected static class
Nested classes/interfaces inherited from interface io.jmix.ui.Screens
Screens.OpenedScreens, Screens.WindowStack
-
Field Summary
Modifier and TypeFieldDescriptionprotected AccessManager
protected org.springframework.context.ApplicationContext
protected UiControllerDependencyManager
protected IconResolver
protected Icons
protected Messages
protected io.micrometer.core.instrument.MeterRegistry
protected ScreenXmlLoader
protected AppUI
protected UiComponents
protected UiProperties
protected UrlTools
protected WindowConfig
Fields inherited from interface io.jmix.ui.Screens
NAVIGATION_CLOSE_ACTION, NAVIGATION_CLOSE_ACTION_ID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
afterScreenRemove
(Screen screen) protected void
Check modifications and close all screens in all main windows excluding root screens.void
checkModificationsAndCloseAll
(Runnable runIfOk) Deprecated.void
checkModificationsAndCloseAll
(Runnable runIfOk, Runnable runIfCancel) Deprecated.protected void
checkNotYetOpened
(Screen screen) protected void
checkOpened
(Screen screen) protected void
checkPermissions
(OpenMode openMode, WindowInfo windowInfo) <T extends Screen>
Tcreate
(Class<T> requiredScreenClass, OpenMode openMode, ScreenOptions options) Creates a screen by its controller class.create
(String screenId, OpenMode openMode, ScreenOptions options) Creates a screen by its screen id.protected ComponentLoaderContext
protected <T extends Screen>
TcreateController
(WindowInfo windowInfo, Window window, Class<T> screenClass) protected DialogWindow
createDialogWindow
(WindowInfo windowInfo) protected void
createNewTabLayout
(Screen screen) protected NavigationState
createOrUpdateState
(NavigationState state, int stateMark) createParametersMap
(WindowInfo windowInfo, Map<String, Object> params) Deprecated.protected RootWindow
createRootWindow
(WindowInfo windowInfo) protected <T extends Screen>
TcreateScreen
(WindowInfo windowInfo, OpenMode openMode, ScreenOptions options) protected TabWindow
createTabWindow
(WindowInfo windowInfo) protected Window
createWindow
(WindowInfo windowInfo, Class<? extends Screen> screenClass, ScreensImpl.ScreenOpenDetails openDetails) protected WindowBreadCrumbs
createWindowBreadCrumbs
(Screen screen) protected WindowContextImpl
createWindowContext
(Window window, ScreensImpl.ScreenOpenDetails openDetails) protected void
findMessageGroup
(org.dom4j.Element element, String descriptorPath, ComponentLoaderContext componentLoaderContext) protected void
fireScreenAfterDetachEvent
(FrameOwner screen, Class<Screen.AfterDetachEvent> eventType, Screen.AfterDetachEvent event) protected void
fireScreenAfterInitEvent
(FrameOwner screen, Class<Screen.AfterInitEvent> eventType, Screen.AfterInitEvent event) protected void
fireScreenAfterShowEvent
(FrameOwner screen, Class<Screen.AfterShowEvent> eventType, Screen.AfterShowEvent event) protected void
fireScreenBeforeShowEvent
(FrameOwner screen, Class<Screen.BeforeShowEvent> eventType, Screen.BeforeShowEvent event) protected void
fireScreenInitEvent
(FrameOwner screen, Class<Screen.InitEvent> eventType, Screen.InitEvent event) protected Screen
protected Collection<Screen>
protected String
getMessageGroup
(String descriptorPath) protected Screen
protected WindowInfo
getScreenInfo
(Class<? extends Screen> screenClass) protected Stream<Screens.WindowStack>
getTabbedScreensStacks
(AppWorkAreaImpl workArea) protected Collection<Screens.WindowStack>
getWorkAreaStacks
(AppWorkAreaImpl workArea) protected void
handleTabWindowClose
(HasTabSheetBehaviour targetTabSheet, com.vaadin.ui.Component tabContent) protected void
handleWindowBreadCrumbsNavigate
(WindowBreadCrumbs breadCrumbs, Window window) protected boolean
Checks if there are modal GUI dialog windows.protected boolean
Checks if there are modal Vaadin dialog windows.boolean
Check if there are screens that have unsaved changes.protected boolean
isMaxTabCountExceeded
(Screen screen) protected boolean
isWindowClosePrevented
(Window window, Window.CloseOrigin closeOrigin) protected org.dom4j.Element
loadScreenXml
(WindowInfo windowInfo, ScreenOptions options) protected <T extends Screen>
voidloadWindowFromXml
(org.dom4j.Element element, WindowInfo windowInfo, Window window, T controller, ComponentLoaderContext componentLoaderContext) protected ScreensImpl.ScreenOpenDetails
prepareScreenOpenDetails
(Class<? extends Screen> resolvedScreenClass, org.dom4j.Element element, OpenMode requiredOpenMode) void
Removes screen from UI and releases all the resources of screen.void
Removes all child screens (screens of work area and dialog screens) from the root screen and releases their resources.protected void
removeDialogWindow
(Screen screen) protected void
removeNewTabWindow
(Screen screen) protected void
removeRootWindow
(Screen screen) protected void
removeThisTabWindow
(Screen screen) void
Displays the given screen according to itsOpenMode
.protected void
showDialogWindow
(Screen screen) showFromNavigation
(Screen screen) Displays the given screen taking into account already opened screens and multipleOpen option.protected void
showNewTabWindow
(Screen screen) protected void
showRootWindow
(Screen screen) protected void
showThisTabWindow
(Screen screen) protected void
-
Field Details
-
applicationContext
@Autowired protected org.springframework.context.ApplicationContext applicationContext -
windowConfig
-
uiComponents
-
screenXmlLoader
-
iconResolver
-
messages
-
icons
-
urlTools
-
meterRegistry
@Autowired protected io.micrometer.core.instrument.MeterRegistry meterRegistry -
accessManager
-
dependencyManager
-
uiProperties
-
ui
-
-
Constructor Details
-
ScreensImpl
public ScreensImpl()
-
-
Method Details
-
setAppUi
-
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. -
create
Description copied from interface:Screens
Creates a screen by its screen id. -
createScreen
protected <T extends Screen> T createScreen(WindowInfo windowInfo, OpenMode openMode, ScreenOptions options) -
createComponentLoaderContext
-
prepareScreenOpenDetails
protected ScreensImpl.ScreenOpenDetails prepareScreenOpenDetails(Class<? extends Screen> resolvedScreenClass, @Nullable org.dom4j.Element element, OpenMode requiredOpenMode) -
loadScreenXml
-
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
-
show
Description copied from interface:Screens
Displays the given screen according to itsOpenMode
.- Specified by:
show
in interfaceScreens
- Parameters:
screen
- screen- Returns:
OperationResult.success()
if screen is shown or otherwiseOperationResult.fail()
-
changeUrl
-
checkNotYetOpened
-
checkOpened
-
isMaxTabCountExceeded
-
showTooManyOpenTabsMessage
protected void showTooManyOpenTabsMessage() -
remove
Description copied from interface:Screens
Removes screen from UI and releases all the resources of screen. -
afterScreenRemove
-
getAnyCurrentScreen
-
removeThisTabWindow
-
removeRootWindow
-
removeNewTabWindow
-
removeDialogWindow
-
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. -
hasUnsavedChanges
public boolean hasUnsavedChanges()Description copied from interface:Screens
Check if there are screens that have unsaved changes.- Specified by:
hasUnsavedChanges
in interfaceScreens
- Returns:
- true if there are screens with unsaved changes
-
getOpenedScreens
- Specified by:
getOpenedScreens
in interfaceScreens
- Returns:
- object that provides information about opened screens
-
getOpenedWorkAreaScreensStream
-
getActiveWorkAreaScreensStream
-
getDialogScreensStream
-
getCurrentBreadcrumbs
-
getRootScreenOrNull
-
getTabbedScreensStacks
-
getWorkAreaStacks
-
getConfiguredWorkArea
- Returns:
- workarea instance of the root screen
- Throws:
IllegalStateException
- if there is no root screen or root screen does not haveAppWorkArea
-
getConfiguredWorkAreaOrNull
- Specified by:
getConfiguredWorkAreaOrNull
in interfaceScreens
-
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
-
createRootWindow
-
createTabWindow
-
createWindowContext
protected WindowContextImpl createWindowContext(Window window, ScreensImpl.ScreenOpenDetails openDetails) -
checkPermissions
-
getScreenInfo
-
showRootWindow
-
isWindowClosePrevented
-
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.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 closedrunIfCancel
- a closure to run if there were modifications and a user canceled the operation
-
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
-
createWindowBreadCrumbs
-
createNewTabLayout
-
showThisTabWindow
-
showDialogWindow
-
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)
-