com.vaadin.flow.server.

Class InitialPageSettings

    • Constructor Detail

      • InitialPageSettings

        public InitialPageSettings(VaadinRequest request,
                                   UI ui,
                                   AfterNavigationEvent afterNavigationEvent,
                                   WebBrowser browser)

        Create new initial page settings object.

        Parameters:

        request - initial request

        ui - target ui

        afterNavigationEvent - after navigation event

        browser - browser information

    • Method Detail

      • getRequest

        public VaadinRequest getRequest()

        Get the initial request for the settings.

        Returns:

        used request

      • getUi

        public UI getUi()

        Get the target UI instance.

        Returns:

        ui instance

      • getAfterNavigationEvent

        public AfterNavigationEvent getAfterNavigationEvent()

        Get the after navigation event.

        Returns:

        the after navigation event

      • getBrowser

        public WebBrowser getBrowser()

        Get the web browser used for the request used for these settings.

        Returns:

        browser information

      • setViewport

        public void setViewport(String viewport)

        Set the viewport value.

        Parameters:

        viewport - viewport value to set

      • getViewport

        protected String getViewport()

        Get the currently set viewport setting for this settings object.

        Note! this will not reflect any setting made using Viewport

        Returns:

        current viewport setting or null if nothing set?

      • addInlineFromFile

        public void addInlineFromFile(String file,
                                      InitialPageSettings.WrapMode type)

        Inline contents from classpath file to append to head of initial page.

        Parameters:

        file - dependency file to read and write to head

        type - dependency type

      • addInlineFromFile

        public void addInlineFromFile(InitialPageSettings.Position position,
                                      String file,
                                      InitialPageSettings.WrapMode type)

        Inline contents from classpath file to head of initial page.

        Parameters:

        position - prepend or append

        file - dependency file to read and write to head

        type - dependency type

      • addInlineWithContents

        public void addInlineWithContents(String contents,
                                          InitialPageSettings.WrapMode type)

        Add content to append to head of initial page.

        Parameters:

        contents - dependency content

        type - dependency type

      • getInline

        protected List<elemental.json.JsonObject> getInline(InitialPageSettings.Position position)

        Get the list of inline objects to append to head.

        Parameters:

        position - prepend or append

        Returns:

        current list of inline objects

      • getElement

        protected List<org.jsoup.nodes.Element> getElement(InitialPageSettings.Position position)

        Get the list of links to append to head.

        Parameters:

        position - prepend or append

        Returns:

        current list of links

      • addLink

        public void addLink(String href)

        Add a link to be appended to initial page head.

        Parameters:

        href - link href

      • addLink

        public void addLink(InitialPageSettings.Position position,
                            String href)

        Add a link to initial page head.

        Parameters:

        position - prepend or append

        href - link href

      • addLink

        public void addLink(String href,
                            Map<String,String> attributes)

        Append a link to initial page head.

        Parameters:

        href - location of the linked document

        attributes - map of attributes for link element

      • addLink

        public void addLink(InitialPageSettings.Position position,
                            String href,
                            Map<String,String> attributes)

        Add a link to initial page head.

        Parameters:

        position - prepend or append

        href - location of the linked document

        attributes - map of attributes for link element

      • addLink

        public void addLink(String rel,
                            String href)

        Append a link to initial page head.

        Parameters:

        rel - link relationship

        href - location of the linked document

      • addLink

        public void addLink(InitialPageSettings.Position position,
                            String rel,
                            String href)

        Add a link to initial page head.

        Parameters:

        position - prepend or append

        rel - link relationship

        href - location of the linked document

      • addFavIcon

        public void addFavIcon(String rel,
                               String href,
                               String sizes)

        Append a fav icon link to initial page head.

        Parameters:

        rel - link relationship

        href - location of the fav icon

        sizes - size of the linked fav icon

      • addFavIcon

        public void addFavIcon(InitialPageSettings.Position position,
                               String rel,
                               String href,
                               String sizes)

        Append a fav icon link to initial page head.

        Parameters:

        position - prepend or append

        rel - link relationship

        href - location of the fav icon

        sizes - size of the linked fav icon

      • addMetaTag

        public void addMetaTag(String name,
                               String content)

        Add a meta tag to be appended to initial page head.

        Parameters:

        name - meta tag name

        content - meta tag content

      • addMetaTag

        public void addMetaTag(InitialPageSettings.Position position,
                               String name,
                               String content)

        Add a meta tag to initial page head.

        Parameters:

        position - prepend or append

        name - meta tag name

        content - meta tag content

      • getLoadingIndicatorConfiguration

        public LoadingIndicatorConfiguration getLoadingIndicatorConfiguration()

        Returns the configuration object for loading indicator.

        Returns:

        the instance used for configuring the loading indicator

      • getReconnectDialogConfiguration

        public ReconnectDialogConfiguration getReconnectDialogConfiguration()

        Returns the configuration object for reconnect dialog.

        Returns:

        The instance used for reconnect dialog configuration

      • getPushConfiguration

        public PushConfiguration getPushConfiguration()

        Returns the object used for configuring the push channel.

        Returns:

        the instance used for push channel configuration