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 classprotected static classclassA class that provides information about all opened views.protected static classstatic classA class representing views of a tab. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.springframework.context.ApplicationContextstatic final CloseActionprotected final EntityStatesprotected final Messagesprotected final io.micrometer.core.instrument.MeterRegistryprotected final Notificationsprotected final RouteSupportprotected final TabbedModePropertiesprotected final UiAccessCheckerprotected final UiComponentsprotected final UiPropertiesprotected 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 voidcheckNotYetOpened(View<?> view) protected voidcheckPermissions(ViewInfo viewInfo) protected OperationResultcloseSameView(JmixUI ui, ViewOpeningContext context) <T extends View<?>>
TCreates a newViewinstance by the passed view class.View<?>Creates a newViewinstance by the passed view id.protected <V extends View<?>>
DialogWindow<V>createDialog(V view) protected View<?>createInternal(ViewInfo viewInfo) protected voidcreateNewTabLayout(WorkArea workArea, ViewOpeningContext context) protected Views.TabCloseTaskcreateTabCloseTask(TabbedViewsContainer<?> tabbedContainer, com.vaadin.flow.component.tabs.Tab tab) protected ViewBreadcrumbsFinds the current active view within a specific UI context.protected voidfireQueryParametersChangeEvent(View<?> view, com.vaadin.flow.router.QueryParameters queryParameters) protected voidfireViewBeforeShowEvent(View<?> view) protected voidfireViewOpenedEvent(View<?> view) protected voidfireViewReadyEvent(View<?> view) protected ViewOpenModegetActualOpenMode(JmixUI ui, ViewOpeningContext context) protected JmixUIView<?>View<?>getCurrentView(JmixUI ui) Returns the current activeViewwithin a specific UI context.protected StringgetEmptyLocationString(View<?> view, ViewOpeningContext context) Returns id of theViewthat will be used as Login viewReturns id of theViewthat will be used as Main viewReturns an instance ofViews.OpenedViewsfor the currentJmixUIinstance.getOpenedViews(JmixUI ui) Returns an instance ofViews.OpenedViewsfor the givenJmixUIinstance.protected ObjectgetParamValue(DetailView<?> detailView) protected com.vaadin.flow.router.RouteConfigurationprotected StringgetRouteParamName(StandardDetailView<?> detailView) protected Stream<Views.ViewStack>getTabbedViewsStacks(WorkArea workArea) protected JmixUIgetUI(com.vaadin.flow.component.Component component) protected static ViewBreadcrumbsgetViewBreadcrumbs(TabbedViewsContainer<?> tabbedContainer, com.vaadin.flow.component.tabs.Tab tab) protected voidhandleViewTabClose(ViewTab.CloseContext<ViewTab> context) protected booleanprotected voidinitProperties(View<?> view) protected booleanisMaxTabCountExceeded(JmixUI ui, ViewOpenMode openMode) protected booleanisMultipleOpen(View<?> view) protected booleanisRootView(com.vaadin.flow.component.Component component) protected voidopen(View<?> view, ViewOpenMode openMode) Opens the passedViewin the current UI with the passedViewOpenMode.open(ViewOpeningContext context) open(JmixUI ui, View<?> view, ViewOpenMode openMode) Opens the passedViewin the given UI with the passedViewOpenMode.open(JmixUI ui, ViewOpeningContext context) Opens aViewin the given UI using parameters obtained from passedViewOpeningContext.protected voidopenDialogWindow(JmixUI ui, ViewOpeningContext context) protected voidopenNewTab(JmixUI ui, ViewOpeningContext context) protected voidopenRootView(JmixUI ui, ViewOpeningContext context) protected voidopenThisTab(JmixUI ui, ViewOpeningContext context) protected voidremoveNewTabView(WorkArea workArea, View<?> view) protected voidremoveThisTabView(WorkArea workArea, View<?> viewToRemove) protected com.vaadin.flow.router.LocationresolveLocation(View<?> view) protected com.vaadin.flow.router.LocationresolveLocation(View<?> view, ViewOpeningContext context) protected StringresolveLocationBaseString(View<?> view) protected StringresolveLocationString(View<?> view, ViewOpeningContext context) protected voidsendNavigationEvent(JmixUI ui, ViewOpeningContext context) protected voidprotected voidupdateBreadcrumbTitle(ViewBreadcrumbs breadcrumbs, View<?> view, String title) protected voidupdatePageTitle(View<?> view) protected voidupdatePageTitle(View<?> view, String title) protected voidupdateTabTitle(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 newViewinstance by the passed view id. -
create
Creates a newViewinstance by the passed view class. -
createInternal
-
initProperties
-
checkPermissions
-
open
Opens the passedViewin the current UI with the passedViewOpenMode.- Parameters:
view- a view to openopenMode- in which open mode to open a view- Returns:
OperationResultwith the result of the opening operation
-
open
Opens the passedViewin 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:
OperationResultwith the result of the opening operation
-
open
-
open
Opens aViewin 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:
OperationResultwith 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
-
updateBreadcrumbTitle
-
handleViewTabClose
-
createTabCloseTask
protected Views.TabCloseTask createTabCloseTask(TabbedViewsContainer<?> tabbedContainer, com.vaadin.flow.component.tabs.Tab tab) -
getLoginViewId
Returns id of theViewthat will be used as Login view- Returns:
- id of the
Viewthat will be used as Login view - See Also:
-
getMainViewId
Returns id of theViewthat will be used as Main view- Returns:
- id of the
Viewthat will be used as Main view - See Also:
-
createViewBreadCrumbs
-
findConfiguredWorkArea
-
getConfiguredWorkArea
- Parameters:
ui- theJmixUIinstance for which the work area is being searched- Returns:
- the
WorkAreainstance for the givenJmixUIinstance - Throws:
IllegalStateException- if a root view does not have any configured work area
-
getTabbedViewsStacks
-
getOpenedViews
Returns an instance ofViews.OpenedViewsfor the currentJmixUIinstance.- Returns:
- an instance of
Views.OpenedViewsfor the currentJmixUIinstance
-
getOpenedViews
Returns an instance ofViews.OpenedViewsfor the givenJmixUIinstance.- Parameters:
ui- theJmixUIinstance for which to get theViews.OpenedViews- Returns:
- an instance of
Views.OpenedViewsfor the givenJmixUIinstance
-
getCurrentView
Returns the current activeViewfor the currentJmixUIinstance. 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 currentViewis not found
-
getCurrentView
Returns the current activeViewwithin 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- theJmixUIinstance representing the UI context in which to find the current view.- Returns:
- the current active
View - Throws:
IllegalStateException- if the currentViewis 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)
-