Class WebComponentUI
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- com.vaadin.flow.component.UI
-
- com.vaadin.flow.component.webcomponent.WebComponentUI
-
- All Implemented Interfaces:
AttachNotifier
,DetachNotifier
,HasComponents
,HasElement
,HasEnabled
,PollNotifier
,RouterLayout
,Serializable
public class WebComponentUI extends UI
Custom UI for use with WebComponents served from the server.For internal use only. May be renamed or removed in a future release.
- Since:
- 2.0
- Author:
- Vaadin Ltd.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WebComponentUI.WebComponentConnectEvent
Event used for sending the activation event for an exported web component from the client to the server.
-
Field Summary
Fields Modifier and Type Field Description static String
NO_NAVIGATION
-
Constructor Summary
Constructors Constructor Description WebComponentUI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doInit(VaadinRequest request, int uiId, String appId)
Internal initialization method, should not be overridden.boolean
isNavigationSupported()
Returns true if this UI instance supports navigation.<T,C extends Component & HasUrlParameter<T>>
Optional<C>navigate(Class<? extends C> navigationTarget, T parameter)
Updates this UI to show the view corresponding to the given navigation target with the specified parameter.<T extends Component>
Optional<T>navigate(Class<T> navigationTarget)
Updates this UI to show the view corresponding to the given navigation target.void
navigate(String location)
Updates this UI to show the view corresponding to the given location.void
navigate(String location, QueryParameters queryParameters)
Updates this UI to show the view corresponding to the given location and query parameters.-
Methods inherited from class com.vaadin.flow.component.UI
access, accessLater, accessLater, accessSynchronously, add, addAfterNavigationListener, addBeforeEnterListener, addBeforeLeaveListener, addHeartbeatListener, addModal, addShortcutListener, addShortcutListener, addToModalComponent, beforeClientResponse, close, doInit, getActiveDragSourceComponent, getCsrfToken, getCurrent, getElement, getInternals, getLoadingIndicatorConfiguration, getLocale, getNavigationListeners, getPage, getPollInterval, getPushConfiguration, getReconnectDialogConfiguration, getRouter, getSession, getUI, getUIId, hasModalComponent, init, isClosing, navigate, navigate, navigate, onAttach, onDetach, push, setChildComponentModal, setCurrent, setDirection, setLocale, setPollInterval
-
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getEventBus, getId, getListeners, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, scrollIntoView, set, setElement, setId, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
-
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
-
Methods inherited from interface com.vaadin.flow.component.HasComponents
add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAll
-
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
-
Methods inherited from interface com.vaadin.flow.component.PollNotifier
addPollListener
-
Methods inherited from interface com.vaadin.flow.router.RouterLayout
removeRouterLayoutContent, showRouterLayoutContent
-
-
-
-
Field Detail
-
NO_NAVIGATION
public static final String NO_NAVIGATION
- See Also:
- Constant Field Values
-
-
Method Detail
-
doInit
public void doInit(VaadinRequest request, int uiId, String appId)
Description copied from class:UI
Internal initialization method, should not be overridden. This method is not declared as final because that would break compatibility with e.g. CDI.- Overrides:
doInit
in classUI
- Parameters:
request
- the initialization requestuiId
- the id of the new uiappId
- the application id- See Also:
UI.getUIId()
-
isNavigationSupported
public boolean isNavigationSupported()
Description copied from class:UI
Returns true if this UI instance supports navigation.- Overrides:
isNavigationSupported
in classUI
- Returns:
- true if this UI instance supports navigation, otherwise false.
-
navigate
public void navigate(String location)
Description copied from class:UI
Updates this UI to show the view corresponding to the given location. The location must be a relative path without any ".." segments.Besides the navigation to the
location
this method also updates the browser location (and page history).- Overrides:
navigate
in classUI
- Parameters:
location
- the location to navigate to, notnull
- See Also:
UI.navigate(String, QueryParameters)
,Router.navigate(UI, Location, NavigationTrigger)
-
navigate
public <T extends Component> Optional<T> navigate(Class<T> navigationTarget)
Description copied from class:UI
Updates this UI to show the view corresponding to the given navigation target.Besides the navigation to the
location
this method also updates the browser location (and page history).If the view change actually happens (e.g. the view itself doesn't cancel the navigation), all navigation listeners are notified and a reference of the new view is returned for additional configuration.
- Overrides:
navigate
in classUI
- Parameters:
navigationTarget
- navigation target to navigate to- Returns:
- the view instance, if navigation actually happened
- See Also:
UI.navigate(Class, Object)
,UI.navigate(Class, RouteParameters)
-
navigate
public <T,C extends Component & HasUrlParameter<T>> Optional<C> navigate(Class<? extends C> navigationTarget, T parameter)
Description copied from class:UI
Updates this UI to show the view corresponding to the given navigation target with the specified parameter. The parameter needs to be the same as defined in the route target HasUrlParameter.Besides the navigation to the
location
this method also updates the browser location (and page history).Note! A
null
parameter will be handled the same as navigate(navigationTarget) and will throw an exception if HasUrlParameter is not @OptionalParameter or @WildcardParameter.If the view change actually happens (e.g. the view itself doesn't cancel the navigation), all navigation listeners are notified and a reference of the new view is returned for additional configuration.
-
navigate
public void navigate(String location, QueryParameters queryParameters)
Description copied from class:UI
Updates this UI to show the view corresponding to the given location and query parameters. The location must be a relative path without any ".." segments.Besides the navigation to the
location
this method also updates the browser location (and page history).- Overrides:
navigate
in classUI
- Parameters:
location
- the location to navigate to, notnull
queryParameters
- query parameters that are used for navigation, notnull
- See Also:
UI.navigate(String)
,Router.navigate(UI, Location, NavigationTrigger)
-
-