@ParametersAreNonnullByDefault public class WebScreens extends java.lang.Object implements Screens, WindowManager
Modifier and Type | Class and Description |
---|---|
protected class |
WebScreens.OpenedScreensImpl |
protected static class |
WebScreens.ScreenOpenDetails |
class |
WebScreens.TabCloseTask |
protected static class |
WebScreens.TabWindowContainerImpl
Content of each tab of AppWorkArea TabSheet.
|
protected static class |
WebScreens.WindowStackImpl |
WindowManager.OpenType
Screens.LaunchMode, Screens.OpenedScreens, Screens.WindowStack
Modifier and Type | Field and Description |
---|---|
protected AttributeAccessSupport |
attributeAccessSupport |
protected BeanLocator |
beanLocator |
protected ClientConfig |
clientConfig |
protected DataSupplier |
defaultDataSupplier |
protected java.util.List<ControllerDependencyInjector> |
dependencyInjectors |
protected Events |
events |
protected IconResolver |
iconResolver |
protected Icons |
icons |
protected Messages |
messages |
protected ScreenHistorySupport |
screenHistorySupport |
protected ScreenProfilerImpl |
screenProfiler |
protected ScreenViewsLoader |
screenViewsLoader |
protected ScreenXmlLoader |
screenXmlLoader |
protected Security |
security |
protected AppUI |
ui |
protected UiComponents |
uiComponents |
protected UrlTools |
urlTools |
protected UuidSource |
uuidSource |
protected WebConfig |
webConfig |
protected WindowConfig |
windowConfig |
protected WindowCreationHelper |
windowCreationHelper |
MAIN_MENU_ACTION_ID
NAVIGATION_CLOSE_ACTION, NAVIGATION_CLOSE_ACTION_ID
Constructor and Description |
---|
WebScreens(AppUI ui) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterScreenRemove(Screen screen) |
protected void |
afterShowWindow(Screen screen) |
protected void |
applyDataLoadingSettings(Screen screen) |
protected void |
applyOpenTypeParameters(Window window,
WindowManager.OpenType openType)
Deprecated.
|
protected void |
changeUrl(Screen screen) |
OperationResult |
checkModificationsAndCloseAll()
Check modifications and close all screens in all main windows excluding root screens.
|
void |
checkModificationsAndCloseAll(java.lang.Runnable runIfOk)
Deprecated.
|
void |
checkModificationsAndCloseAll(java.lang.Runnable runIfOk,
java.lang.Runnable runIfCancel)
Deprecated.
|
protected void |
checkNotYetOpened(Screen screen) |
protected void |
checkOpened(Screen screen) |
protected void |
checkPermissions(Screens.LaunchMode launchMode,
WindowInfo windowInfo) |
void |
closeAll()
Deprecated.
Use
removeAll() instead. |
void |
closeAllWindows()
Deprecated.
Use
App.removeAllWindows() instead. |
protected void |
closeWindowsInternal() |
protected Dialogs.MessageType |
convertMessageType(Frame.MessageMode messageMode) |
protected Notifications.NotificationType |
convertNotificationType(Frame.NotificationType type) |
<T extends Screen> |
create(java.lang.Class<T> requiredScreenClass,
Screens.LaunchMode launchMode,
ScreenOptions options)
Creates a screen by its controller class.
|
Screen |
create(java.lang.String screenId,
Screens.LaunchMode launchMode,
ScreenOptions options)
Creates a screen by its screen id.
|
protected <T extends Screen> |
createController(WindowInfo windowInfo,
Window window,
java.lang.Class<T> screenClass) |
Screen |
createEditor(WindowInfo windowInfo,
Entity item,
WindowManager.OpenType openType,
java.util.Map<java.lang.String,java.lang.Object> params) |
protected void |
createNewTabLayout(Screen screen) |
protected NavigationState |
createOrUpdateState(NavigationState state,
int stateMark) |
protected java.util.Map<java.lang.String,java.lang.Object> |
createParametersMap(WindowInfo windowInfo,
java.util.Map<java.lang.String,java.lang.Object> params)
Deprecated.
|
protected <T extends Screen> |
createScreen(WindowInfo windowInfo,
Screens.LaunchMode launchMode,
ScreenOptions options) |
protected Window |
createWindow(WindowInfo windowInfo,
java.lang.Class<? extends Screen> screenClass,
WebScreens.ScreenOpenDetails openDetails) |
protected WindowBreadCrumbs |
createWindowBreadCrumbs(Screen screen) |
protected java.util.stream.Stream<Screen> |
getActiveWorkAreaScreensStream() |
protected Screen |
getAnyCurrentScreen() |
protected com.haulmont.cuba.web.gui.components.mainwindow.WebAppWorkArea |
getConfiguredWorkArea() |
protected com.haulmont.cuba.web.gui.components.mainwindow.WebAppWorkArea |
getConfiguredWorkAreaOrNull() |
protected java.util.Collection<Screen> |
getCurrentBreadcrumbs() |
protected java.util.stream.Stream<Screen> |
getDialogScreensStream() |
protected java.lang.String |
getMessagePack(java.lang.String descriptorPath) |
Screens.OpenedScreens |
getOpenedScreens() |
protected java.util.stream.Stream<Screen> |
getOpenedWorkAreaScreensStream() |
java.util.Collection<Window> |
getOpenWindows() |
protected Screen |
getRootScreenOrNull() |
protected WindowInfo |
getScreenInfo(java.lang.Class<? extends Screen> screenClass) |
protected Settings |
getSettingsImpl(java.lang.String id) |
protected java.util.stream.Stream<Screens.WindowStack> |
getTabbedScreensStacks(com.haulmont.cuba.web.gui.components.mainwindow.WebAppWorkArea workArea) |
protected java.util.Collection<Screens.WindowStack> |
getWorkAreaStacks(com.haulmont.cuba.web.gui.components.mainwindow.WebAppWorkArea workArea) |
protected void |
handleTabWindowClose(HasTabSheetBehaviour targetTabSheet,
com.vaadin.ui.Component tabContent) |
protected void |
handleWindowBreadCrumbsNavigate(WindowBreadCrumbs breadCrumbs,
Window window) |
protected boolean |
hasModalDialogWindow()
Checks if there are modal GUI dialog windows.
|
protected boolean |
hasModalWindow()
Checks if there are modal Vaadin dialog windows.
|
boolean |
hasUnsavedChanges()
Check if there are screens that have unsaved changes.
|
protected void |
initDatasources(Window window,
DsContext dsContext,
java.util.Map<java.lang.String,java.lang.Object> params) |
protected void |
initDsContext(Window window,
org.dom4j.Element element,
com.haulmont.cuba.gui.xml.layout.loaders.ComponentLoaderContext componentLoaderContext) |
protected boolean |
isMaxTabCountExceeded(Screen screen) |
protected boolean |
isWindowClosePrevented(Window window,
Window.CloseOrigin closeOrigin) |
protected void |
loadDataBeforeShow(Screen screen) |
protected DsContext |
loadDsContext(org.dom4j.Element element) |
protected org.dom4j.Element |
loadScreenXml(WindowInfo windowInfo,
ScreenOptions options) |
protected <T extends Screen> |
loadWindowFromXml(org.dom4j.Element element,
WindowInfo windowInfo,
Window window,
T controller,
com.haulmont.cuba.gui.xml.layout.loaders.ComponentLoaderContext componentLoaderContext) |
Window.Editor |
openEditor(WindowInfo windowInfo,
Entity item,
WindowManager.OpenType openType) |
Window.Editor |
openEditor(WindowInfo windowInfo,
Entity item,
WindowManager.OpenType openType,
Datasource parentDs) |
Window.Editor |
openEditor(WindowInfo windowInfo,
Entity item,
WindowManager.OpenType openType,
java.util.Map<java.lang.String,java.lang.Object> params) |
Window.Editor |
openEditor(WindowInfo windowInfo,
Entity item,
WindowManager.OpenType openType,
java.util.Map<java.lang.String,java.lang.Object> params,
Datasource parentDs) |
Frame |
openFrame(Frame parentFrame,
Component parent,
java.lang.String id,
WindowInfo windowInfo,
java.util.Map<java.lang.String,java.lang.Object> params) |
Frame |
openFrame(Frame parentFrame,
Component parent,
WindowInfo windowInfo) |
Frame |
openFrame(Frame parentFrame,
Component parent,
WindowInfo windowInfo,
java.util.Map<java.lang.String,java.lang.Object> params) |
Window.Lookup |
openLookup(WindowInfo windowInfo,
Window.Lookup.Handler handler,
WindowManager.OpenType openType) |
Window.Lookup |
openLookup(WindowInfo windowInfo,
Window.Lookup.Handler handler,
WindowManager.OpenType openType,
java.util.Map<java.lang.String,java.lang.Object> params) |
Window |
openWindow(WindowInfo windowInfo,
WindowManager.OpenType openType) |
Window |
openWindow(WindowInfo windowInfo,
WindowManager.OpenType openType,
java.util.Map<java.lang.String,java.lang.Object> params) |
protected WebScreens.ScreenOpenDetails |
prepareScreenOpenDetails(java.lang.Class<? extends Screen> resolvedScreenClass,
org.dom4j.Element element,
Screens.LaunchMode requiredLaunchMode) |
void |
remove(Screen screen)
Removes screen from UI and releases all the resources of screen.
|
void |
removeAll()
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 |
saveScreenHistory() |
void |
saveScreenSettings() |
void |
selectWindowTab(Window window)
Select tab with window in main tabsheet.
|
OperationResult |
show(Screen screen)
Displays the given screen according to its
Screens.LaunchMode . |
protected void |
showDialogWindow(Screen screen) |
void |
showExceptionDialog(java.lang.Throwable throwable)
Shows exception dialog with default caption, message and displays stacktrace of given throwable.
|
void |
showExceptionDialog(java.lang.Throwable throwable,
java.lang.String caption,
java.lang.String message)
Shows exception dialog with given caption, message and displays stacktrace of given throwable.
|
OperationResult |
showFromNavigation(Screen screen)
Displays the given screen taking into account already opened screens and multipleOpen option.
|
void |
showMessageDialog(java.lang.String title,
java.lang.String message,
Frame.MessageType messageType)
Show message dialog with title and message.
|
protected void |
showNewTabWindow(Screen screen) |
void |
showNotification(java.lang.String caption)
Show notification with
Frame.NotificationType#HUMANIZED . |
void |
showNotification(java.lang.String caption,
Frame.NotificationType type)
Show notification.
|
void |
showNotification(java.lang.String caption,
java.lang.String description,
Frame.NotificationType type)
Show notification with caption description.
|
void |
showOptionDialog(java.lang.String title,
java.lang.String message,
Frame.MessageType messageType,
Action[] actions)
Show options dialog with title and message.
|
protected void |
showRootWindow(Screen screen) |
protected void |
showThisTabWindow(Screen screen) |
protected void |
showTooManyOpenTabsMessage() |
void |
showWebPage(java.lang.String url,
java.util.Map<java.lang.String,java.lang.Object> params)
Open a web page in browser.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, openDefaultScreen, setWindowCaption
@Inject protected BeanLocator beanLocator
@Inject protected WindowConfig windowConfig
@Inject protected Security security
@Inject protected UuidSource uuidSource
@Inject protected UiComponents uiComponents
@Inject protected ScreenXmlLoader screenXmlLoader
@Inject protected IconResolver iconResolver
@Inject protected Messages messages
@Inject protected Icons icons
@Inject protected Events events
@Inject protected UrlTools urlTools
@Inject protected WindowCreationHelper windowCreationHelper
@Inject protected AttributeAccessSupport attributeAccessSupport
@Inject protected ScreenHistorySupport screenHistorySupport
@Inject protected ScreenViewsLoader screenViewsLoader
@Inject protected WebConfig webConfig
@Inject protected ClientConfig clientConfig
@Inject protected ScreenProfilerImpl screenProfiler
@Inject protected java.util.List<ControllerDependencyInjector> dependencyInjectors
protected AppUI ui
protected DataSupplier defaultDataSupplier
public WebScreens(AppUI ui)
public <T extends Screen> T create(java.lang.Class<T> requiredScreenClass, Screens.LaunchMode launchMode, ScreenOptions options)
Screens
public Screen create(java.lang.String screenId, Screens.LaunchMode launchMode, ScreenOptions options)
Screens
protected <T extends Screen> T createScreen(WindowInfo windowInfo, Screens.LaunchMode launchMode, ScreenOptions options)
protected WebScreens.ScreenOpenDetails prepareScreenOpenDetails(java.lang.Class<? extends Screen> resolvedScreenClass, @Nullable org.dom4j.Element element, Screens.LaunchMode requiredLaunchMode)
@Nullable protected org.dom4j.Element loadScreenXml(WindowInfo windowInfo, ScreenOptions options)
protected <T extends Screen> void loadWindowFromXml(org.dom4j.Element element, WindowInfo windowInfo, Window window, T controller, com.haulmont.cuba.gui.xml.layout.loaders.ComponentLoaderContext componentLoaderContext)
protected void initDsContext(Window window, org.dom4j.Element element, com.haulmont.cuba.gui.xml.layout.loaders.ComponentLoaderContext componentLoaderContext)
protected DsContext loadDsContext(org.dom4j.Element element)
protected void initDatasources(Window window, DsContext dsContext, java.util.Map<java.lang.String,java.lang.Object> params)
protected java.lang.String getMessagePack(java.lang.String descriptorPath)
public OperationResult show(Screen screen)
Screens
Screens.LaunchMode
.show
in interface Screens
screen
- screenOperationResult.success()
if screen is shown or otherwise OperationResult.fail()
public OperationResult showFromNavigation(Screen screen)
Screens
showFromNavigation
in interface Screens
screen
- screenprotected void loadDataBeforeShow(Screen screen)
protected void changeUrl(Screen screen)
protected void checkNotYetOpened(Screen screen)
protected void checkOpened(Screen screen)
protected boolean isMaxTabCountExceeded(Screen screen)
protected void showTooManyOpenTabsMessage()
protected void applyDataLoadingSettings(Screen screen)
protected void afterShowWindow(Screen screen)
protected Settings getSettingsImpl(java.lang.String id)
public void remove(Screen screen)
Screens
protected void afterScreenRemove(Screen screen)
protected Screen getAnyCurrentScreen()
protected void removeThisTabWindow(Screen screen)
protected void removeRootWindow(Screen screen)
protected void removeNewTabWindow(Screen screen)
protected void removeDialogWindow(Screen screen)
public void removeAll()
Screens
public boolean hasUnsavedChanges()
Screens
hasUnsavedChanges
in interface Screens
public Screens.OpenedScreens getOpenedScreens()
getOpenedScreens
in interface Screens
protected java.util.stream.Stream<Screen> getOpenedWorkAreaScreensStream()
protected java.util.stream.Stream<Screen> getActiveWorkAreaScreensStream()
protected java.util.stream.Stream<Screen> getDialogScreensStream()
protected java.util.Collection<Screen> getCurrentBreadcrumbs()
protected Screen getRootScreenOrNull()
protected java.util.stream.Stream<Screens.WindowStack> getTabbedScreensStacks(com.haulmont.cuba.web.gui.components.mainwindow.WebAppWorkArea workArea)
protected java.util.Collection<Screens.WindowStack> getWorkAreaStacks(com.haulmont.cuba.web.gui.components.mainwindow.WebAppWorkArea workArea)
@Nonnull protected com.haulmont.cuba.web.gui.components.mainwindow.WebAppWorkArea getConfiguredWorkArea()
java.lang.IllegalStateException
- if there is no root screen or root screen does not have AppWorkArea
@Nullable protected com.haulmont.cuba.web.gui.components.mainwindow.WebAppWorkArea getConfiguredWorkAreaOrNull()
protected <T extends Screen> T createController(WindowInfo windowInfo, Window window, java.lang.Class<T> screenClass)
protected Window createWindow(WindowInfo windowInfo, java.lang.Class<? extends Screen> screenClass, WebScreens.ScreenOpenDetails openDetails)
protected void checkPermissions(Screens.LaunchMode launchMode, WindowInfo windowInfo)
protected WindowInfo getScreenInfo(java.lang.Class<? extends Screen> screenClass)
protected void showRootWindow(Screen screen)
protected boolean isWindowClosePrevented(Window window, Window.CloseOrigin closeOrigin)
protected boolean hasModalDialogWindow()
protected boolean hasModalWindow()
public java.util.Collection<Window> getOpenWindows()
getOpenWindows
in interface WindowManager
public void selectWindowTab(Window window)
WindowManager
selectWindowTab
in interface WindowManager
public Window openWindow(WindowInfo windowInfo, WindowManager.OpenType openType, java.util.Map<java.lang.String,java.lang.Object> params)
openWindow
in interface WindowManager
public Window openWindow(WindowInfo windowInfo, WindowManager.OpenType openType)
openWindow
in interface WindowManager
public Window.Editor openEditor(WindowInfo windowInfo, Entity item, WindowManager.OpenType openType, Datasource parentDs)
openEditor
in interface WindowManager
public Window.Editor openEditor(WindowInfo windowInfo, Entity item, WindowManager.OpenType openType)
openEditor
in interface WindowManager
public Window.Editor openEditor(WindowInfo windowInfo, Entity item, WindowManager.OpenType openType, java.util.Map<java.lang.String,java.lang.Object> params)
openEditor
in interface WindowManager
public Screen createEditor(WindowInfo windowInfo, Entity item, WindowManager.OpenType openType, @Nullable java.util.Map<java.lang.String,java.lang.Object> params)
createEditor
in interface WindowManager
public Window.Editor openEditor(WindowInfo windowInfo, Entity item, WindowManager.OpenType openType, @Nullable java.util.Map<java.lang.String,java.lang.Object> params, Datasource parentDs)
openEditor
in interface WindowManager
public Window.Lookup openLookup(WindowInfo windowInfo, Window.Lookup.Handler handler, WindowManager.OpenType openType, java.util.Map<java.lang.String,java.lang.Object> params)
openLookup
in interface WindowManager
public Window.Lookup openLookup(WindowInfo windowInfo, Window.Lookup.Handler handler, WindowManager.OpenType openType)
openLookup
in interface WindowManager
public Frame openFrame(Frame parentFrame, Component parent, WindowInfo windowInfo)
openFrame
in interface WindowManager
public Frame openFrame(Frame parentFrame, Component parent, WindowInfo windowInfo, java.util.Map<java.lang.String,java.lang.Object> params)
openFrame
in interface WindowManager
public Frame openFrame(Frame parentFrame, Component parent, @Nullable java.lang.String id, WindowInfo windowInfo, java.util.Map<java.lang.String,java.lang.Object> params)
openFrame
in interface WindowManager
public void showNotification(java.lang.String caption)
WindowManager
Frame.NotificationType#HUMANIZED
. \n
).showNotification
in interface WindowManager
caption
- textpublic void showNotification(java.lang.String caption, Frame.NotificationType type)
WindowManager
\n
).showNotification
in interface WindowManager
caption
- texttype
- defines how to display the notification.
Don't forget to escape data from the database in case of *_HTML
types!public void showNotification(java.lang.String caption, java.lang.String description, Frame.NotificationType type)
WindowManager
\n
).showNotification
in interface WindowManager
caption
- captiondescription
- texttype
- defines how to display the notification.
Don't forget to escape data from the database in case of *_HTML
types!protected Notifications.NotificationType convertNotificationType(Frame.NotificationType type)
public void showMessageDialog(java.lang.String title, java.lang.String message, Frame.MessageType messageType)
WindowManager
\n
) for non HTML messageType.showMessageDialog
in interface WindowManager
title
- dialog titlemessage
- textmessageType
- defines how to display the dialog.
Don't forget to escape data from the database in case of *_HTML
types!protected Dialogs.MessageType convertMessageType(Frame.MessageMode messageMode)
public void showOptionDialog(java.lang.String title, java.lang.String message, Frame.MessageType messageType, Action[] actions)
WindowManager
\n
) for non HTML messageType.showOptionDialog
in interface WindowManager
title
- dialog titlemessage
- textmessageType
- defines how to display the dialog.
Don't forget to escape data from the database in case of *_HTML
types!actions
- available actionspublic void showExceptionDialog(java.lang.Throwable throwable)
WindowManager
showExceptionDialog
in interface WindowManager
throwable
- throwablepublic void showExceptionDialog(java.lang.Throwable throwable, @Nullable java.lang.String caption, @Nullable java.lang.String message)
WindowManager
showExceptionDialog
in interface WindowManager
throwable
- throwablecaption
- dialog captionmessage
- dialog messagepublic void showWebPage(java.lang.String url, @Nullable java.util.Map<java.lang.String,java.lang.Object> params)
WindowManager
WebBrowserTools
instead.showWebPage
in interface WindowManager
url
- URL of the pageparams
- optional parameters.
target
- String value used as the target name in a
window.open call in the client. This means that special values such as
"_blank", "_self", "_top", "_parent" have special meaning. If not specified, "_blank" is used.width
- Integer value specifying the width of the browser window in pixelsheight
- Integer value specifying the height of the browser window in pixelsborder
- String value specifying the border style of the window of the browser window.
Possible values are "DEFAULT", "MINIMAL", "NONE".WebBrowserTools.showWebPage(String, Map)
@Deprecated public void checkModificationsAndCloseAll(@Nullable java.lang.Runnable runIfOk)
runIfOk
- a closure to run after all screens are closed@Deprecated public void checkModificationsAndCloseAll(@Nullable java.lang.Runnable runIfOk, @Nullable java.lang.Runnable runIfCancel)
runIfOk
- a closure to run after all screens are closedrunIfCancel
- a closure to run if there were modifications and a user canceled the operationpublic OperationResult checkModificationsAndCloseAll()
protected void closeWindowsInternal()
public void saveScreenHistory()
public void saveScreenSettings()
@Deprecated public void closeAllWindows()
App.removeAllWindows()
instead.@Deprecated public void closeAll()
removeAll()
instead.@Deprecated protected java.util.Map<java.lang.String,java.lang.Object> createParametersMap(WindowInfo windowInfo, @Nullable java.util.Map<java.lang.String,java.lang.Object> params)
protected void showNewTabWindow(Screen screen)
protected WindowBreadCrumbs createWindowBreadCrumbs(Screen screen)
protected void createNewTabLayout(Screen screen)
protected void showThisTabWindow(Screen screen)
protected void showDialogWindow(Screen screen)
protected NavigationState createOrUpdateState(@Nullable NavigationState state, int stateMark)
protected void handleWindowBreadCrumbsNavigate(WindowBreadCrumbs breadCrumbs, Window window)
protected void handleTabWindowClose(HasTabSheetBehaviour targetTabSheet, com.vaadin.ui.Component tabContent)
@Deprecated protected void applyOpenTypeParameters(Window window, WindowManager.OpenType openType)