Class Views.OpenedViews

java.lang.Object
io.jmix.tabbedmode.Views.OpenedViews
Enclosing class:
Views

public class Views.OpenedViews extends Object
A class that provides information about all opened views.
  • Field Details

  • Constructor Details

  • Method Details

    • getRootView

      public View<?> getRootView()
      Returns:
      the root view of the UI
      Throws:
      IllegalStateException - in case there is no root view in UI
    • findRootView

      public Optional<View<?>> findRootView()
      Returns:
      the root view of the UI if present
    • getAll

      public Collection<View<?>> getAll()
      Returns:
      all opened views excluding the root view or empty collection if the root view does not have WorkArea
      Throws:
      IllegalStateException - in case there is no root view in UI
    • getOpenedWorkAreaViews

      public Collection<View<?>> getOpenedWorkAreaViews()
      Returns:
      all opened views excluding the root view and dialogs or empty collection if the root view does not have WorkArea
      Throws:
      IllegalStateException - in case there is no root view in UI
    • getActiveViews

      public Collection<View<?>> getActiveViews()
      Returns:
      top views from work area tabs and all dialog windows or empty collection if the root view does not have WorkArea
      Throws:
      IllegalStateException - in case there is no root view in UI
    • getActiveWorkAreaViews

      public Collection<View<?>> getActiveWorkAreaViews()
      Returns:
      top views from work area tabs or empty collection if the root view does not have WorkArea
      Throws:
      IllegalStateException - in case there is no root view in UI
    • getDialogWindows

      public Collection<View<?>> getDialogWindows()
      Returns:
      all views opened in a dialog window
    • getCurrentBreadcrumbs

      public Collection<View<?>> getCurrentBreadcrumbs()
      Returns:
      views of the currently opened tab of a WorkArea in descending order (first element is active view) or empty collection if the root view does not have WorkArea
      Throws:
      IllegalStateException - in case there is no root view in UI
    • getWorkAreaViewStacks

      public Collection<Views.ViewStack> getWorkAreaViewStacks()
      Returns:
      collection of view stacks representing each tab with access to breadcrumbs or empty collection if the root view does not have WorkArea
      Throws:
      IllegalStateException - in case there is no root view in UI
    • closeAll

      public void closeAll()
      Closes all child views (views if WorkArea and dialog windows) from the root view.
    • hasUnsavedChanges

      public boolean hasUnsavedChanges()
      Check if there are views that have unsaved changes.
      Returns:
      true if there are views with unsaved changes, false otherwise