Class MockPage

java.lang.Object
com.vaadin.flow.component.page.Page
com.vaadin.browserless.internal.MockPage
All Implemented Interfaces:
Serializable

public final class MockPage extends com.vaadin.flow.component.page.Page
A Page which records the external navigations and recreates the UI on reload(), to simulate the browser's F5.

For internal use only. May be renamed or removed in a future release.

See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.vaadin.flow.component.page.Page

    com.vaadin.flow.component.page.Page.ExtendedClientDetailsReceiver, com.vaadin.flow.component.page.Page.NavigationJs, com.vaadin.flow.component.page.Page.PageJs
  • Constructor Summary

    Constructors
    Constructor
    Description
    MockPage(com.vaadin.flow.component.UI ui, UIFactory uiFactory, com.vaadin.flow.server.VaadinSession session)
    Creates the page of the given UI.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the URL last opened in the given window.
    Returns the URL the page last navigated to in its own window.
    Returns the URLs opened in windows other than the page's own, by window name.
    void
    open(String url, String windowName)
     
    void
     

    Methods inherited from class com.vaadin.flow.component.page.Page

    addBrowserWindowResizeListener, addDynamicImport, addDynamicImport, addJavaScript, addJavaScript, addJavaScript, addJsModule, addStyleSheet, addStyleSheet, addStyleSheet, executeJs, executeJs, executeJs, fetchCurrentURL, fetchPageDirection, getColorScheme, getExtendedClientDetails, getHistory, open, openUnsafe, openUnsafe, pageVisibilitySignal, retrieveExtendedClientDetails, setColorScheme, setLocation, setLocation, setTitle, windowSizeSignal

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MockPage

      public MockPage(com.vaadin.flow.component.UI ui, UIFactory uiFactory, com.vaadin.flow.server.VaadinSession session)
      Creates the page of the given UI.
      Parameters:
      ui - the UI the page belongs to
      uiFactory - creates the UI that replaces this one on a reload
      session - the session of the UI
  • Method Details

    • getLastExternalNavigationURL

      public String getLastExternalNavigationURL()
      Returns the URL the page last navigated to in its own window.
      Returns:
      the URL, or null if the page has not navigated away
    • getExternalNavigationURL

      public String getExternalNavigationURL(String windowName)
      Returns the URL last opened in the given window.
      Parameters:
      windowName - the name of the window
      Returns:
      the URL, or null if nothing was opened in that window
    • getOpenedWindows

      public Map<String,List<String>> getOpenedWindows()
      Returns the URLs opened in windows other than the page's own, by window name.
      Returns:
      the opened URLs, by window name
    • open

      public void open(String url, String windowName)
      Overrides:
      open in class com.vaadin.flow.component.page.Page
    • reload

      public void reload()
      Overrides:
      reload in class com.vaadin.flow.component.page.Page