com.vaadin.flow.server.
Class AppShellSettings
- java.lang.Object
-
- com.vaadin.flow.server.AppShellSettings
-
public class AppShellSettings extends Object
Initial page settings class for modifying the application shell.
Since:
3.0
-
-
Constructor Summary
Constructors Constructor and Description AppShellSettings()
-
Method Summary
All Methods Modifier and Type Method and Description void
addFavIcon(Inline.Position position, String rel, String href, String sizes)
Append a fav icon link to initial page head.
void
addFavIcon(String rel, String href, String sizes)
Append a fav icon link to initial page head.
void
addInlineFromFile(Inline.Position position, String file, Inline.Wrapping type)
Inline contents from classpath file to head of initial page.
void
addInlineFromFile(String file, Inline.Wrapping type)
Inline contents from classpath file to append to head of initial page.
void
addInlineFromFile(TargetElement target, Inline.Position position, String file, Inline.Wrapping type)
Inline contents from classpath file to head of initial page.
void
addInlineWithContents(Inline.Position position, String contents, Inline.Wrapping type)
Add content to head of initial page.
void
addInlineWithContents(String contents, Inline.Wrapping type)
Add content to append to head of initial page.
void
addInlineWithContents(TargetElement target, Inline.Position position, String contents, Inline.Wrapping type)
Add content to the specified target of initial page.
void
addLink(Inline.Position position, String href)
Add a link to initial page head.
void
addLink(Inline.Position position, String href, Map<String,String> attributes)
Add a link to initial page head.
void
addLink(Inline.Position position, String rel, String href)
Add a link to initial page head.
void
addLink(String href)
Add a link to be appended to initial page head.
void
addLink(String href, Map<String,String> attributes)
Append a link to initial page head.
void
addLink(String rel, String href)
Append a link to initial page head.
void
addMetaTag(Inline.Position position, String name, String content)
Add a meta tag to initial page head.
void
addMetaTag(String name, String content)
Add a meta tag to be appended to initial page head.
Optional<WebBrowser>
getBrowser()
Get the web browser used for the request used for these settings.
Optional<LoadingIndicatorConfiguration>
getLoadingIndicatorConfiguration()
Deprecated.
It only works when useDeprecatedV14Bootstrapping is enabled. Use aUIInitListener
instead if there are server-side views.Optional<PushConfiguration>
getPushConfiguration()
Deprecated.
It only works when useDeprecatedV14Bootstrapping is enabled. Use aUIInitListener
instead if there are server-side views.Optional<ReconnectDialogConfiguration>
getReconnectDialogConfiguration()
Deprecated.
It only works when useDeprecatedV14Bootstrapping is enabled. Use aUIInitListener
instead if there are server-side views.VaadinRequest
getRequest()
Get the current request.
Optional<UI>
getUi()
Get the target UI instance.
void
setBodySize(String width, String height)
Set the body size.
void
setPageTitle(String title)
Set the page title.
void
setViewport(String viewport)
Set the viewport value.
-
-
-
Method Detail
-
getRequest
public VaadinRequest getRequest()
Get the current request.
Returns:
used request
-
getBrowser
public Optional<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. Since viewport can be set only once per page, call to this method will have preference over the
Viewport
annotation. If the method is called multiple times, the last one will be used.Parameters:
viewport
- viewport value to set
-
setBodySize
public void setBodySize(String width, String height)
Set the body size. If the method is called multiple times, the last one will be used.
Parameters:
width
- body withheight
- body height
-
setPageTitle
public void setPageTitle(String title)
Set the page title. If the method is called multiple times, the last one will be used.
Parameters:
title
- title
-
addInlineFromFile
public void addInlineFromFile(String file, Inline.Wrapping type)
Inline contents from classpath file to append to head of initial page.
Parameters:
file
- dependency file to read and write to headtype
- dependency type
-
addInlineFromFile
public void addInlineFromFile(Inline.Position position, String file, Inline.Wrapping type)
Inline contents from classpath file to head of initial page.
Parameters:
position
- prepend or appendfile
- dependency file to read and write to headtype
- dependency type
-
addInlineFromFile
public void addInlineFromFile(TargetElement target, Inline.Position position, String file, Inline.Wrapping type)
Inline contents from classpath file to head of initial page.
Parameters:
target
- head of bodyposition
- prepend or appendfile
- dependency file to read and write to headtype
- dependency type
-
addInlineWithContents
public void addInlineWithContents(String contents, Inline.Wrapping type)
Add content to append to head of initial page.
Parameters:
contents
- inline content to be added to the pagetype
- type of content which can be JavaScript or Stylesheet (CSS)
-
addInlineWithContents
public void addInlineWithContents(Inline.Position position, String contents, Inline.Wrapping type)
Add content to head of initial page.
Parameters:
position
- prepend or appendcontents
- inline content to be added to the pagetype
- type of content which can be JavaScript or Stylesheet (CSS)
-
addInlineWithContents
public void addInlineWithContents(TargetElement target, Inline.Position position, String contents, Inline.Wrapping type)
Add content to the specified target of initial page.
Parameters:
target
- head of bodyposition
- prepend or appendcontents
- inline content to be added to the pagetype
- type of content which can be JavaScript or Stylesheet (CSS)
-
addLink
public void addLink(String href)
Add a link to be appended to initial page head.
Parameters:
href
- link href
-
addLink
public void addLink(Inline.Position position, String href)
Add a link to initial page head.
Parameters:
position
- prepend or appendhref
- 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 documentattributes
- map of attributes for link element
-
addLink
public void addLink(Inline.Position position, String href, Map<String,String> attributes)
Add a link to initial page head.
Parameters:
position
- prepend or appendhref
- location of the linked documentattributes
- map of attributes for link element
-
addLink
public void addLink(String rel, String href)
Append a link to initial page head.
Parameters:
rel
- link relationshiphref
- location of the linked document
-
addLink
public void addLink(Inline.Position position, String rel, String href)
Add a link to initial page head.
Parameters:
position
- prepend or appendrel
- link relationshiphref
- 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 relationshiphref
- location of the fav iconsizes
- size of the linked fav icon
-
addFavIcon
public void addFavIcon(Inline.Position position, String rel, String href, String sizes)
Append a fav icon link to initial page head.
Parameters:
position
- prepend or appendrel
- link relationshiphref
- location of the fav iconsizes
- 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 namecontent
- meta tag content
-
addMetaTag
public void addMetaTag(Inline.Position position, String name, String content)
Add a meta tag to initial page head.
Parameters:
position
- prepend or appendname
- meta tag namecontent
- meta tag content
-
getLoadingIndicatorConfiguration
@Deprecated public Optional<LoadingIndicatorConfiguration> getLoadingIndicatorConfiguration()
Deprecated. It only works when useDeprecatedV14Bootstrapping is enabled. Use a
UIInitListener
instead if there are server-side views.Returns the configuration object for loading indicator.
Returns:
An optional instance used for configuring the loading indicator or an empty optional if UI is not available.
Throws:
UnsupportedOperationException
- If UI is not avaialble, for example, when using client-side bootstrapping
-
getReconnectDialogConfiguration
@Deprecated public Optional<ReconnectDialogConfiguration> getReconnectDialogConfiguration()
Deprecated. It only works when useDeprecatedV14Bootstrapping is enabled. Use a
UIInitListener
instead if there are server-side views.Returns the configuration object for reconnect dialog.
Returns:
An optional instance used for reconnect dialog configuration or an empty optional if UI is not available.
Throws:
UnsupportedOperationException
- If UI is not avaialble, for example, when using the client-side bootstrapping
-
getPushConfiguration
@Deprecated public Optional<PushConfiguration> getPushConfiguration()
Deprecated. It only works when useDeprecatedV14Bootstrapping is enabled. Use a
UIInitListener
instead if there are server-side views.Returns the object used for configuring the push channel.
Returns:
An optional instance used for push channel configuration or an empty optional if UI is not available.
Throws:
UnsupportedOperationException
- If UI is not avaialble, for example, when using the client-side bootstrapping
-
-