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 parentViewContainerfor the specifiedView, if it exists.static Collection<View<?>>getBreadcrumbs(ViewContainer viewContainer) Returns a collection ofViewstack of passedViewContainerin descending order, the first element is an active view.static ViewContainergetViewContainer(View<?> view) Returns the parentViewContainerfor the specifiedView.static TabbedModeViewPropertiesDatagetViewProperties(com.vaadin.flow.component.Component component) static booleanisCloseable(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.OpenedViewsandViews.ViewStackmethods.static booleanisDefaultView(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 booleanisForceDialog(com.vaadin.flow.component.Component component) Returns whether the passed view must be opened in a dialog window.static voidremovePreservedViewCache(JmixUI ui, Runnable afterRemoveHandler) static voidsetCloseable(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.OpenedViewsandViews.ViewStackmethods.static voidsetDefaultView(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 voidsetForceDialog(com.vaadin.flow.component.Component component, boolean forceDialog) Sets whether the passed view must be opened in a dialog window.static voidsetViewProperties(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.OpenedViewsandViews.ViewStackmethods.- Parameters:
component- a view to check- Returns:
trueif the view is closeable,falseotherwise- 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.OpenedViewsandViews.ViewStackmethods.- Parameters:
component- a view to set the closeable flag forcloseable-trueif the view is closeable,falseotherwise- 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:
trueif the view is a default,falseotherwise
-
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-trueif the view is a default,falseotherwise
-
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:
trueif the view must be opened in a dialog window,falseotherwise
-
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-trueif the view must be opened in a dialog window,falseotherwise
-
findViewContainer
Finds the parentViewContainerfor the specifiedView, if it exists.- Parameters:
view- the view whose container is to be found- Returns:
- an
Optionalcontaining the parentViewContainerif found, or an emptyOptionalif no container exists
-
getViewContainer
Returns the parentViewContainerfor the specifiedView.- Parameters:
view- the view whose container is to be found- Returns:
- the parent
ViewContainer - Throws:
IllegalStateException- if the specifiedViewis not attached to aViewContainer
-
getBreadcrumbs
Returns a collection ofViewstack of passedViewContainerin descending order, the first element is an active view.- Parameters:
viewContainer- aViewContainerto get the breadcrumbs for- Returns:
- a collection of
Viewstack representing the current breadcrumbs, or an empty collection if no breadcrumbs are available.
-
removePreservedViewCache
-