Class MockPage
- All Implemented Interfaces:
Serializable
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
Page.ExtendedClientDetailsReceiver, Page.NavigationJs, Page.PageJs -
Constructor Summary
ConstructorsConstructorDescriptionMockPage(UI ui, UIFactory uiFactory, VaadinSession session) Creates the page of the given UI. -
Method Summary
Modifier and TypeMethodDescriptiongetExternalNavigationURL(String windowName) 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.voidOpens the given URL in a window with the given name.voidreload()Reloads the page in the browser.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
-
Constructor Details
-
MockPage
Creates the page of the given UI.- Parameters:
ui- the UI the page belongs touiFactory- creates the UI that replaces this one on a reloadsession- the session of the UI
-
-
Method Details
-
getOpenedWindows
Returns the URLs opened in windows other than the page's own, by window name.- Returns:
- the opened URLs, by window name
-
open
Description copied from class:PageOpens the given URL in a window with the given name.The supplied
windowNameis used as the target name in a window.open call in the client. This means that special values such as "_blank", "_self", "_top", "_parent" have special meaning. An empty ornullwindow name is also a special case."", null and "_self" as
windowNameall causes the URL to be opened in the current window, replacing any old contents. For downloadable content you should avoid "_self" as "_self" causes the client to skip rendering of any other changes as it considers them irrelevant (the page will be replaced by the response from the URL). This can speed up the opening of a URL, but it might also put the client side into an inconsistent state if the window content is not completely replaced e.g., if the URL is downloaded instead of displayed in the browser."_blank" as
windowNamecauses the URL to always be opened in a new window or tab (depends on the browser and browser settings)."_top" and "_parent" as
windowNameworks as specified by the HTML standard.Any other
windowNamewill open the URL in a window with that name, either by opening a new window/tab in the browser or by replacing the contents of an existing window with that name. -
reload
public void reload()Description copied from class:PageReloads the page in the browser.