Class TabbedModeUtils

java.lang.Object
io.jmix.tabbedmode.TabbedModeUtils

public final class TabbedModeUtils extends Object
Utility class working with the Tabbed Window Mode specifics.
  • 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 and Views.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 and Views.ViewStack methods.
      Parameters:
      component - a view to set the closeable flag for
      closeable - 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 for
      defaultView - 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 for
      forceDialog - true if the view must be opened in a dialog window, false otherwise
    • findViewContainer

      public static Optional<ViewContainer> findViewContainer(View<?> view)
      Finds the parent ViewContainer for the specified View, if it exists.
      Parameters:
      view - the view whose container is to be found
      Returns:
      an Optional containing the parent ViewContainer if found, or an empty Optional if no container exists
    • getViewContainer

      public static ViewContainer getViewContainer(View<?> view)
      Returns the parent ViewContainer for the specified View.
      Parameters:
      view - the view whose container is to be found
      Returns:
      the parent ViewContainer
      Throws:
      IllegalStateException - if the specified View is not attached to a ViewContainer
    • getBreadcrumbs

      public static Collection<View<?>> getBreadcrumbs(ViewContainer viewContainer)
      Returns a collection of View stack of passed ViewContainer in descending order, the first element is an active view.
      Parameters:
      viewContainer - a ViewContainer 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

      public static void removePreservedViewCache(JmixUI ui, Runnable afterRemoveHandler)