Package io.jmix.tabbedmode
Class Views
java.lang.Object
io.jmix.tabbedmode.Views
API to create and open views.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
protected static class
class
A class that provides information about all opened views.protected static class
static class
A class representing views of a tab. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.springframework.context.ApplicationContext
static final CloseAction
protected final EntityStates
protected final Messages
protected final io.micrometer.core.instrument.MeterRegistry
protected final Notifications
protected final RouteSupport
protected final TabbedModeProperties
protected final UiAccessChecker
protected final UiComponents
protected final UiProperties
protected final ViewRegistry
-
Constructor Summary
ConstructorsConstructorDescriptionViews
(org.springframework.context.ApplicationContext applicationContext, ViewRegistry viewRegistry, UiComponents uiComponents, Notifications notifications, Messages messages, RouteSupport routeSupport, EntityStates entityStates, UiProperties uiProperties, io.micrometer.core.instrument.MeterRegistry meterRegistry, UiAccessChecker uiAccessChecker, TabbedModeProperties tabbedModeProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkNotYetOpened
(View<?> view) protected void
checkPermissions
(ViewInfo viewInfo) protected OperationResult
closeSameView
(JmixUI ui, ViewOpeningContext context) <T extends View<?>>
TCreates a newView
instance by the passed view class.View<?>
Creates a newView
instance by the passed view id.protected <V extends View<?>>
DialogWindow<V>createDialog
(V view) protected View<?>
createInternal
(ViewInfo viewInfo) protected void
createNewTabLayout
(WorkArea workArea, ViewOpeningContext context) protected Views.TabCloseTask
createTabCloseTask
(TabbedViewsContainer<?> tabbedContainer, com.vaadin.flow.component.tabs.Tab tab) protected ViewBreadcrumbs
Finds the current active view within a specific UI context.protected void
fireQueryParametersChangeEvent
(View<?> view, com.vaadin.flow.router.QueryParameters queryParameters) protected void
fireViewBeforeShowEvent
(View<?> view) protected void
fireViewOpenedEvent
(View<?> view) protected void
fireViewReadyEvent
(View<?> view) protected ViewOpenMode
getActualOpenMode
(JmixUI ui, ViewOpeningContext context) protected JmixUI
View<?>
View<?>
getCurrentView
(JmixUI ui) Returns the current activeView
within a specific UI context.protected String
getEmptyLocationString
(View<?> view, ViewOpeningContext context) Returns id of theView
that will be used as Login viewReturns id of theView
that will be used as Main viewReturns an instance ofViews.OpenedViews
for the currentJmixUI
instance.getOpenedViews
(JmixUI ui) Returns an instance ofViews.OpenedViews
for the givenJmixUI
instance.protected Object
getParamValue
(DetailView<?> detailView) protected com.vaadin.flow.router.RouteConfiguration
protected String
getRouteParamName
(StandardDetailView<?> detailView) protected Stream<Views.ViewStack>
getTabbedViewsStacks
(WorkArea workArea) protected JmixUI
getUI
(com.vaadin.flow.component.Component component) protected static ViewBreadcrumbs
getViewBreadcrumbs
(TabbedViewsContainer<?> tabbedContainer, com.vaadin.flow.component.tabs.Tab tab) protected void
handleViewTabClose
(ViewTab.CloseContext<ViewTab> context) protected boolean
protected void
initProperties
(View<?> view) protected boolean
isMaxTabCountExceeded
(JmixUI ui, ViewOpenMode openMode) protected boolean
isMultipleOpen
(View<?> view) protected boolean
isRootView
(com.vaadin.flow.component.Component component) protected void
open
(View<?> view, ViewOpenMode openMode) Opens the passedView
in the current UI with the passedViewOpenMode
.open
(ViewOpeningContext context) open
(JmixUI ui, View<?> view, ViewOpenMode openMode) Opens the passedView
in the given UI with the passedViewOpenMode
.open
(JmixUI ui, ViewOpeningContext context) Opens aView
in the given UI using parameters obtained from passedViewOpeningContext
.protected void
openDialogWindow
(JmixUI ui, ViewOpeningContext context) protected void
openNewTab
(JmixUI ui, ViewOpeningContext context) protected void
openRootView
(JmixUI ui, ViewOpeningContext context) protected void
openThisTab
(JmixUI ui, ViewOpeningContext context) protected void
removeNewTabView
(WorkArea workArea, View<?> view) protected void
removeThisTabView
(WorkArea workArea, View<?> viewToRemove) protected com.vaadin.flow.router.Location
resolveLocation
(View<?> view) protected com.vaadin.flow.router.Location
resolveLocation
(View<?> view, ViewOpeningContext context) protected String
resolveLocationBaseString
(View<?> view) protected String
resolveLocationString
(View<?> view, ViewOpeningContext context) protected void
sendNavigationEvent
(JmixUI ui, ViewOpeningContext context) protected void
protected void
updatePageTitle
(View<?> view) protected void
updatePageTitle
(View<?> view, String title) protected void
updateTabTitle
(com.vaadin.flow.component.tabs.Tab tab, String title) protected void
-
Field Details
-
CLOSE_SAME_VIEW_ACTION
-
applicationContext
protected final org.springframework.context.ApplicationContext applicationContext -
viewRegistry
-
uiComponents
-
notifications
-
messages
-
routeSupport
-
entityStates
-
uiProperties
-
meterRegistry
protected final io.micrometer.core.instrument.MeterRegistry meterRegistry -
uiAccessChecker
-
tabbedModeProperties
-
-
Constructor Details
-
Method Details
-
create
Creates a newView
instance by the passed view id. -
create
Creates a newView
instance by the passed view class. -
createInternal
-
initProperties
-
checkPermissions
-
open
Opens the passedView
in the current UI with the passedViewOpenMode
.- Parameters:
view
- a view to openopenMode
- in which open mode to open a view- Returns:
OperationResult
with the result of the opening operation
-
open
Opens the passedView
in the given UI with the passedViewOpenMode
.- Parameters:
ui
- UI in which to open a viewview
- a view to openopenMode
- in which open mode to open a view- Returns:
OperationResult
with the result of the opening operation
-
open
-
open
Opens aView
in the given UI using parameters obtained from passedViewOpeningContext
.- Parameters:
ui
- UI in which to open a viewcontext
- context with the view to open and other parameters- Returns:
OperationResult
with the result of the opening operation
-
closeSameView
-
isMultipleOpen
-
getActualOpenMode
-
hasModalDialogWindow
-
checkNotYetOpened
-
updatePageTitle
-
updatePageTitle
-
updateUrl
-
resolveLocation
-
resolveLocation
protected com.vaadin.flow.router.Location resolveLocation(View<?> view, @Nullable ViewOpeningContext context) -
resolveLocationString
-
isRootView
protected boolean isRootView(com.vaadin.flow.component.Component component) -
resolveLocationBaseString
-
getEmptyLocationString
-
getRouteParamName
-
getRouteConfiguration
protected com.vaadin.flow.router.RouteConfiguration getRouteConfiguration() -
getParamValue
-
openRootView
-
openDialogWindow
-
createDialog
-
openThisTab
-
removeThisTabView
-
openNewTab
-
removeNewTabView
-
createNewTabLayout
-
updateTabTitle
-
handleViewTabClose
-
createTabCloseTask
protected Views.TabCloseTask createTabCloseTask(TabbedViewsContainer<?> tabbedContainer, com.vaadin.flow.component.tabs.Tab tab) -
getLoginViewId
Returns id of theView
that will be used as Login view- Returns:
- id of the
View
that will be used as Login view - See Also:
-
getMainViewId
Returns id of theView
that will be used as Main view- Returns:
- id of the
View
that will be used as Main view - See Also:
-
createViewBreadCrumbs
-
findConfiguredWorkArea
-
getConfiguredWorkArea
- Parameters:
ui
- theJmixUI
instance for which the work area is being searched- Returns:
- the
WorkArea
instance for the givenJmixUI
instance - Throws:
IllegalStateException
- if a root view does not have any configured work area
-
getTabbedViewsStacks
-
getOpenedViews
Returns an instance ofViews.OpenedViews
for the currentJmixUI
instance.- Returns:
- an instance of
Views.OpenedViews
for the currentJmixUI
instance
-
getOpenedViews
Returns an instance ofViews.OpenedViews
for the givenJmixUI
instance.- Parameters:
ui
- theJmixUI
instance for which to get theViews.OpenedViews
- Returns:
- an instance of
Views.OpenedViews
for the givenJmixUI
instance
-
getCurrentView
Returns the current activeView
for the currentJmixUI
instance. This method searches for the current view using a prioritized approach:- Dialog windows
- Views of the currently opened tab of a
WorkArea
- The root view
- Returns:
- the current active
View
- Throws:
IllegalStateException
- if the currentView
is not found
-
getCurrentView
Returns the current activeView
within a specific UI context. This method searches for the current view using a prioritized approach:- Dialog windows
- Views of the currently opened tab of a
WorkArea
- The root view
- Parameters:
ui
- theJmixUI
instance representing the UI context in which to find the current view.- Returns:
- the current active
View
- Throws:
IllegalStateException
- if the currentView
is not found
-
findCurrentView
Finds the current active view within a specific UI context. This method searches for the current view using a prioritized approach:- Dialog windows
- Views of the currently opened tab of a
WorkArea
- The root view
-
fireQueryParametersChangeEvent
protected void fireQueryParametersChangeEvent(View<?> view, com.vaadin.flow.router.QueryParameters queryParameters) -
fireViewBeforeShowEvent
-
fireViewReadyEvent
-
fireViewOpenedEvent
-
isMaxTabCountExceeded
-
showTooManyOpenTabsMessage
protected void showTooManyOpenTabsMessage() -
getCurrentUI
-
getUI
-
getViewBreadcrumbs
protected static ViewBreadcrumbs getViewBreadcrumbs(TabbedViewsContainer<?> tabbedContainer, com.vaadin.flow.component.tabs.Tab tab)
-