Package io.jmix.ui.sys
Class ScreensImpl
java.lang.Object
io.jmix.ui.sys.ScreensImpl
- All Implemented Interfaces:
Screens
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classprotected static classclassprotected static classContent of each tab of AppWorkArea TabSheet.protected static classNested classes/interfaces inherited from interface io.jmix.ui.Screens
Screens.OpenedScreens, Screens.WindowStack -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AccessManagerprotected org.springframework.context.ApplicationContextprotected UiControllerDependencyManagerprotected IconResolverprotected Iconsprotected Messagesprotected io.micrometer.core.instrument.MeterRegistryprotected ScreenXmlLoaderprotected AppUIprotected UiComponentsprotected UiPropertiesprotected UrlToolsprotected WindowConfigFields inherited from interface io.jmix.ui.Screens
NAVIGATION_CLOSE_ACTION, NAVIGATION_CLOSE_ACTION_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterScreenRemove(Screen screen) protected voidCheck modifications and close all screens in all main windows excluding root screens.voidcheckModificationsAndCloseAll(Runnable runIfOk) Deprecated.voidcheckModificationsAndCloseAll(Runnable runIfOk, Runnable runIfCancel) Deprecated.protected voidcheckNotYetOpened(Screen screen) protected voidcheckOpened(Screen screen) protected voidcheckPermissions(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 ComponentLoaderContextprotected <T extends Screen>
TcreateController(WindowInfo windowInfo, Window window, Class<T> screenClass) protected DialogWindowcreateDialogWindow(WindowInfo windowInfo) protected voidcreateNewTabLayout(Screen screen) protected NavigationStatecreateOrUpdateState(NavigationState state, int stateMark) createParametersMap(WindowInfo windowInfo, Map<String, Object> params) Deprecated.protected RootWindowcreateRootWindow(WindowInfo windowInfo) protected <T extends Screen>
TcreateScreen(WindowInfo windowInfo, OpenMode openMode, ScreenOptions options) protected TabWindowcreateTabWindow(WindowInfo windowInfo) protected WindowcreateWindow(WindowInfo windowInfo, Class<? extends Screen> screenClass, ScreensImpl.ScreenOpenDetails openDetails) protected WindowBreadCrumbscreateWindowBreadCrumbs(Screen screen) protected WindowContextImplcreateWindowContext(Window window, ScreensImpl.ScreenOpenDetails openDetails) protected voidfindMessageGroup(org.dom4j.Element element, String descriptorPath, ComponentLoaderContext componentLoaderContext) protected voidfireScreenAfterDetachEvent(FrameOwner screen, Class<Screen.AfterDetachEvent> eventType, Screen.AfterDetachEvent event) protected voidfireScreenAfterInitEvent(FrameOwner screen, Class<Screen.AfterInitEvent> eventType, Screen.AfterInitEvent event) protected voidfireScreenAfterShowEvent(FrameOwner screen, Class<Screen.AfterShowEvent> eventType, Screen.AfterShowEvent event) protected voidfireScreenBeforeShowEvent(FrameOwner screen, Class<Screen.BeforeShowEvent> eventType, Screen.BeforeShowEvent event) protected voidfireScreenInitEvent(FrameOwner screen, Class<Screen.InitEvent> eventType, Screen.InitEvent event) protected Screenprotected Collection<Screen>protected StringgetMessageGroup(String descriptorPath) protected Screenprotected WindowInfogetScreenInfo(Class<? extends Screen> screenClass) protected Stream<Screens.WindowStack>getTabbedScreensStacks(AppWorkAreaImpl workArea) protected Collection<Screens.WindowStack>getWorkAreaStacks(AppWorkAreaImpl workArea) protected voidhandleTabWindowClose(HasTabSheetBehaviour targetTabSheet, com.vaadin.ui.Component tabContent) protected voidhandleWindowBreadCrumbsNavigate(WindowBreadCrumbs breadCrumbs, Window window) protected booleanChecks if there are modal GUI dialog windows.protected booleanChecks if there are modal Vaadin dialog windows.booleanCheck if there are screens that have unsaved changes.protected booleanisMaxTabCountExceeded(Screen screen) protected booleanisWindowClosePrevented(Window window, Window.CloseOrigin closeOrigin) protected org.dom4j.ElementloadScreenXml(WindowInfo windowInfo, ScreenOptions options) protected <T extends Screen>
voidloadWindowFromXml(org.dom4j.Element element, WindowInfo windowInfo, Window window, T controller, ComponentLoaderContext componentLoaderContext) protected ScreensImpl.ScreenOpenDetailsprepareScreenOpenDetails(Class<? extends Screen> resolvedScreenClass, org.dom4j.Element element, OpenMode requiredOpenMode) voidRemoves screen from UI and releases all the resources of screen.voidRemoves all child screens (screens of work area and dialog screens) from the root screen and releases their resources.protected voidremoveDialogWindow(Screen screen) protected voidremoveNewTabWindow(Screen screen) protected voidremoveRootWindow(Screen screen) protected voidremoveThisTabWindow(Screen screen) voidDisplays the given screen according to itsOpenMode.protected voidshowDialogWindow(Screen screen) showFromNavigation(Screen screen) Displays the given screen taking into account already opened screens and multipleOpen option.protected voidshowNewTabWindow(Screen screen) protected voidshowRootWindow(Screen screen) protected voidshowThisTabWindow(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:ScreensCreates a screen by its controller class. -
create
Description copied from interface:ScreensCreates 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:ScreensDisplays the given screen according to itsOpenMode.- Specified by:
showin 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:ScreensRemoves screen from UI and releases all the resources of screen. -
afterScreenRemove
-
getAnyCurrentScreen
-
removeThisTabWindow
-
removeRootWindow
-
removeNewTabWindow
-
removeDialogWindow
-
removeAll
public void removeAll()Description copied from interface:ScreensRemoves 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:ScreensCheck if there are screens that have unsaved changes.- Specified by:
hasUnsavedChangesin interfaceScreens- Returns:
- true if there are screens with unsaved changes
-
getOpenedScreens
- Specified by:
getOpenedScreensin 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:
getConfiguredWorkAreaOrNullin 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)
-