Package io.jmix.tabbedmode
Class TabbedModeUtils
java.lang.Object
io.jmix.tabbedmode.TabbedModeUtils
Utility class working with the Tabbed Window Mode specifics.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<ViewContainer>
findViewContainer
(View<?> view) Finds the parentViewContainer
for the specifiedView
, if it exists.static Collection<View<?>>
getBreadcrumbs
(ViewContainer viewContainer) Returns a collection ofView
stack of passedViewContainer
in descending order, the first element is an active view.static ViewContainer
getViewContainer
(View<?> view) Returns the parentViewContainer
for the specifiedView
.static TabbedModeViewPropertiesData
getViewProperties
(com.vaadin.flow.component.Component component) static boolean
isCloseable
(com.vaadin.flow.component.Component component) Returns whether the passed view can be closed by standard operations like a tab close button, close tab actions,Views.OpenedViews
andViews.ViewStack
methods.static boolean
isDefaultView
(com.vaadin.flow.component.Component component) Returns whether the passed view is a default, which means that it's opened after successful log in.static boolean
isForceDialog
(com.vaadin.flow.component.Component component) Returns whether the passed view must be opened in a dialog window.static void
removePreservedViewCache
(JmixUI ui, Runnable afterRemoveHandler) static void
setCloseable
(com.vaadin.flow.component.Component component, boolean closeable) Sets whether the passed view can be closed by standard operations like a tab close button, close tab actions,Views.OpenedViews
andViews.ViewStack
methods.static void
setDefaultView
(com.vaadin.flow.component.Component component, boolean defaultView) Sets whether the passed view is a default, which means that it's opened after successful log in.static void
setForceDialog
(com.vaadin.flow.component.Component component, boolean forceDialog) Sets whether the passed view must be opened in a dialog window.static void
setViewProperties
(com.vaadin.flow.component.Component component, TabbedModeViewPropertiesData viewProperties)
-
Method Details
-
getViewProperties
@Nullable public static TabbedModeViewPropertiesData getViewProperties(com.vaadin.flow.component.Component component) -
setViewProperties
public static void setViewProperties(com.vaadin.flow.component.Component component, @Nullable TabbedModeViewPropertiesData viewProperties) -
isCloseable
public static boolean isCloseable(com.vaadin.flow.component.Component component) Returns whether the passed view can be closed by standard operations like a tab close button, close tab actions,Views.OpenedViews
andViews.ViewStack
methods.- Parameters:
component
- a view to check- Returns:
true
if the view is closeable,false
otherwise- See Also:
-
setCloseable
public static void setCloseable(com.vaadin.flow.component.Component component, boolean closeable) Sets whether the passed view can be closed by standard operations like a tab close button, close tab actions,Views.OpenedViews
andViews.ViewStack
methods.- Parameters:
component
- a view to set the closeable flag forcloseable
-true
if the view is closeable,false
otherwise- See Also:
-
isDefaultView
public static boolean isDefaultView(com.vaadin.flow.component.Component component) Returns whether the passed view is a default, which means that it's opened after successful log in.- Parameters:
component
- a view to check- Returns:
true
if the view is a default,false
otherwise
-
setDefaultView
public static void setDefaultView(com.vaadin.flow.component.Component component, boolean defaultView) Sets whether the passed view is a default, which means that it's opened after successful log in.- Parameters:
component
- a view to set the default flag fordefaultView
-true
if the view is a default,false
otherwise
-
isForceDialog
public static boolean isForceDialog(com.vaadin.flow.component.Component component) Returns whether the passed view must be opened in a dialog window.- Parameters:
component
- a view to check- Returns:
true
if the view must be opened in a dialog window,false
otherwise
-
setForceDialog
public static void setForceDialog(com.vaadin.flow.component.Component component, boolean forceDialog) Sets whether the passed view must be opened in a dialog window.- Parameters:
component
- a view to set the force dialog flag forforceDialog
-true
if the view must be opened in a dialog window,false
otherwise
-
findViewContainer
Finds the parentViewContainer
for the specifiedView
, if it exists.- Parameters:
view
- the view whose container is to be found- Returns:
- an
Optional
containing the parentViewContainer
if found, or an emptyOptional
if no container exists
-
getViewContainer
Returns the parentViewContainer
for the specifiedView
.- Parameters:
view
- the view whose container is to be found- Returns:
- the parent
ViewContainer
- Throws:
IllegalStateException
- if the specifiedView
is not attached to aViewContainer
-
getBreadcrumbs
Returns a collection ofView
stack of passedViewContainer
in descending order, the first element is an active view.- Parameters:
viewContainer
- aViewContainer
to get the breadcrumbs for- Returns:
- a collection of
View
stack representing the current breadcrumbs, or an empty collection if no breadcrumbs are available.
-
removePreservedViewCache
-