Package com.vaadin.browserless.mocks
Class MockedUI
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.UI
com.vaadin.browserless.mocks.MockedUI
- All Implemented Interfaces:
AttachNotifier,DetachNotifier,HasComponents,HasComponentsOfType<Component>,HasElement,HasEnabled,HasStyle,PollNotifier,RouterLayout,Serializable
The
UI the mocked environment creates by default.
It stands in for the browser in the two places the browser would normally act: it renders a navigation server-side, since there is no client router to hand the location to, and it flushes the state tree after a modality change, since there is no client response to trigger it.
The class is not final, so a test that needs a different UI can pass a factory producing a subclass, but the shape of what it overrides is not part of the published API.
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.UI
UI.BrowserLeaveNavigationEvent, UI.BrowserNavigateEvent, UI.BrowserRefreshEvent, UI.ClientViewPlaceholder, UI.UiJs -
Field Summary
Fields inherited from class com.vaadin.flow.component.UI
CLIENT_NAVIGATE_TO, wrapperElement -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToModalComponent(Component component) Add component as child to the most recently set component with modality, eitherModalityMode.STRICTorModalityMode.VISUAL, if there is one.voidnavigate(String locationString, QueryParameters queryParameters) Renders the route server side, as a test has no client router to hand the navigation to.voidsetChildComponentModal(Component childComponent, ModalityMode mode) Change the child component server side modality by modality mode:ModalityMode.STRICT,ModalityMode.VISUAL, orModalityMode.MODELESS.Methods inherited from class com.vaadin.flow.component.UI
access, accessLater, accessLater, accessSynchronously, add, addAfterNavigationListener, addBeforeEnterListener, addBeforeLeaveListener, addHeartbeatListener, addModal, addShortcutListener, addShortcutListener, beforeClientResponse, browserNavigate, close, doInit, getActiveDragSourceComponent, getActiveRouterTargetsChain, getActiveViewLocation, getChildren, getCsrfToken, getCurrent, getCurrentOrThrow, getCurrentView, getElement, getForwardToClientUrl, getInternals, getLastUpdateSentTimestamp, getLoadingIndicatorConfiguration, getLocale, getNavigationListeners, getPage, getPollInterval, getPushConfiguration, getReconnectDialogConfiguration, getSession, getSessionOrThrow, getUI, getUIId, hasModalComponent, init, isClosing, isNavigationSupported, leaveNavigation, localeSignal, navigate, navigate, navigate, navigate, navigate, navigate, navigate, navigate, navigateToClient, onAttach, onDetach, push, refreshCurrentRoute, routerStateSignal, setChildComponentModal, setCurrent, setDirection, setLocale, setPollInterval, triggerAfterMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUIOrThrow, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible, whenAttachedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasComponents
addMethods inherited from interface com.vaadin.flow.component.HasComponentsOfType
add, addComponentAsFirst, addComponentAtIndex, bindChildren, getComponentAt, getComponentCount, indexOf, remove, remove, removeAll, replaceMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.PollNotifier
addPollListenerMethods inherited from interface com.vaadin.flow.router.RouterLayout
removeRouterLayoutContent, showRouterLayoutContent
-
Constructor Details
-
MockedUI
public MockedUI()Creates the UI.
-
-
Method Details
-
setChildComponentModal
Description copied from class:UIChange the child component server side modality by modality mode:ModalityMode.STRICT,ModalityMode.VISUAL, orModalityMode.MODELESS. The component needs to be a child of this UI. By default, all child components are modeless. Note that calling this doesn't show a modality curtain or change the visible state of the components in the UI - that should be handled by the component separately. Thus, this is purely a server side feature.- Overrides:
setChildComponentModalin classUI- Parameters:
childComponent- the child component to change state formode- the modality mode, not null
-
addToModalComponent
Description copied from class:UIAdd component as child to the most recently set component with modality, eitherModalityMode.STRICTorModalityMode.VISUAL, if there is one. Else it will be added to the UI normally.This is meant to be used with components that are not added as part of a layout, like dialog, so that they are interactive when a component with modality opens up an overlay component.
- Overrides:
addToModalComponentin classUI- Parameters:
component- component to add to modal component
-