com.vaadin.flow.component.webcomponent.
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.
Since:
2.0
Author:
Vaadin Ltd.
See Also:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and 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 and Description static String
NO_NAVIGATION
-
Constructor Summary
Constructors Constructor and Description WebComponentUI()
-
Method Summary
All Methods Modifier and Type Method and Description void
doInit(VaadinRequest request, int uiId)
Internal initialization method, should not be overridden.
Router
getRouter()
Gets the router used for navigating in this UI.
<T,C extends Component & HasUrlParameter<T>>
voidnavigate(Class<? extends C> navigationTarget, T parameter)
Updates this UI to show the view corresponding to the given navigation target with the specified parameter.
void
navigate(Class<? extends Component> 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, addShortcutListener, addShortcutListener, beforeClientResponse, close, getActiveDragSourceComponent, getCsrfToken, getCurrent, getElement, getInternals, getLoadingIndicatorConfiguration, getLocale, getNavigationListeners, getPage, getPollInterval, getPushConfiguration, getReconnectDialogConfiguration, getSession, getUI, getUIId, init, isClosing, onAttach, onDetach, push, setCurrent, setLocale, setPollInterval
-
Methods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getChildren, getEventBus, getId, getParent, getTranslation, getTranslation, hasListener, isTemplateMapped, isVisible, onEnabledStateChanged, 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.PollNotifier
addPollListener
-
Methods inherited from interface com.vaadin.flow.component.HasComponents
add, addComponentAsFirst, addComponentAtIndex, remove, removeAll
-
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
-
Methods inherited from interface com.vaadin.flow.router.RouterLayout
removeRouterLayoutContent, showRouterLayoutContent
-
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
-
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
-
-
-
-
Field Detail
-
NO_NAVIGATION
public static final String NO_NAVIGATION
See Also:
-
-
Method Detail
-
doInit
public void doInit(VaadinRequest request, int uiId)
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:
Parameters:
request
- the initialization requestuiId
- the id of the new uiSee Also:
-
getRouter
public Router getRouter()
Description copied from class:
UI
Gets the router used for navigating in this UI.
-
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:
Parameters:
location
- the location to navigate to, notnull
See Also:
UI.navigate(String, QueryParameters)
,Router.navigate(UI, Location, NavigationTrigger)
-
navigate
public void navigate(Class<? extends Component> 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).
-
navigate
public <T,C extends Component & HasUrlParameter<T>> void 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.
-
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:
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)
-
-