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.
For internal use only. May be renamed or removed in a future release.
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()
Deprecated.
For internal use only. Will be removed in the future.Optional<ThemeDefinition>
getThemeFor(Class<?> navigationTarget, String path)
Gets the
ThemeDefinition
associated with the given navigation target, if any.boolean
isNavigationSupported()
Returns false, since WebComponentUI does not support navigation.
<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, navigate, onAttach, onDetach, push, setCurrent, setDirection, setLocale, setPollInterval
-
Methods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getChildren, getEventBus, getId, getParent, getTranslation, getTranslation, getTranslation, getTranslation, hasListener, isAttached, 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
@Deprecated public Router getRouter()
Deprecated. For internal use only. Will be removed in the future.
Always returns
null
, since WebComponentUI doesn't support navigation.
-
isNavigationSupported
public boolean isNavigationSupported()
Returns false, since WebComponentUI does not support navigation.
Overrides:
isNavigationSupported
in classUI
Returns:
false
-
getThemeFor
public Optional<ThemeDefinition> getThemeFor(Class<?> navigationTarget, String path)
Description copied from class:
UI
Gets the
ThemeDefinition
associated with the given navigation target, if any. The theme is defined by using theTheme
annotation on the navigation target class.If no
Theme
andNoTheme
annotation are used, by default thecom.vaadin.flow.theme.lumo.Lumo
class is used (if present on the classpath).Overrides:
getThemeFor
in classUI
Parameters:
navigationTarget
- the navigation target classpath
- the resolved route path so we can determine what the rendered target is forReturns:
the associated ThemeDefinition, or empty if none is defined and the Lumo class is not in the classpath, or if the NoTheme annotation is being used.
See Also:
-
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).Overrides:
Parameters:
navigationTarget
- navigation target to navigate toSee Also:
UI.navigate(Class, Object)
,UI.navigate(Class, RouteParameters)
-
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)
-
-