com.vaadin.flow.component.webcomponent.

Class WebComponentUI

    • Constructor Detail

      • WebComponentUI

        public WebComponentUI()
    • 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:

        doInit in class UI

        Parameters:

        request - the initialization request

        uiId - the id of the new ui

        See Also:

        UI.getUIId()

      • 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.

        Overrides:

        getRouter in class UI

        Returns:

        null

      • isNavigationSupported

        public boolean isNavigationSupported()

        Returns false, since WebComponentUI does not support navigation.

        Overrides:

        isNavigationSupported in class UI

        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 the Theme annotation on the navigation target class.

        If no Theme and NoTheme annotation are used, by default the com.vaadin.flow.theme.lumo.Lumo class is used (if present on the classpath).

        Overrides:

        getThemeFor in class UI

        Parameters:

        navigationTarget - the navigation target class

        path - the resolved route path so we can determine what the rendered target is for

        Returns:

        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:

        ThemeUtil.findThemeForNavigationTarget(UI, Class, String)

      • 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 class UI

        Parameters:

        location - the location to navigate to, not null

        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:

        navigate in class UI

        Parameters:

        navigationTarget - navigation target to navigate to

        See 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.

        Overrides:

        navigate in class UI

        Type Parameters:

        T - url parameter type

        C - navigation target type

        Parameters:

        navigationTarget - navigation target to navigate to

        parameter - parameter to pass to view

      • 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 class UI

        Parameters:

        location - the location to navigate to, not null

        queryParameters - query parameters that are used for navigation, not null

        See Also:

        UI.navigate(String), Router.navigate(UI, Location, NavigationTrigger)