com.vaadin.flow.server.
Class InitialPageSettings
- java.lang.Object
-
- com.vaadin.flow.server.InitialPageSettings
-
All Implemented Interfaces:
public class InitialPageSettings extends Object implements Serializable
Initial page settings class for modifying the bootstrap page.
See Also:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
InitialPageSettings.Position
Append position enum.
static class
InitialPageSettings.WrapMode
Content wrapping mode enum.
-
Constructor Summary
Constructors Constructor and Description InitialPageSettings(VaadinRequest request, UI ui, AfterNavigationEvent afterNavigationEvent, WebBrowser browser)
Create new initial page settings object.
-
Method Summary
All Methods Modifier and Type Method and Description void
addFavIcon(InitialPageSettings.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(InitialPageSettings.Position position, String file, InitialPageSettings.WrapMode type)
Inline contents from classpath file to head of initial page.
void
addInlineFromFile(String file, InitialPageSettings.WrapMode type)
Inline contents from classpath file to append to head of initial page.
void
addInlineWithContents(InitialPageSettings.Position position, String contents, InitialPageSettings.WrapMode type)
Add content to head of initial page.
void
addInlineWithContents(String contents, InitialPageSettings.WrapMode type)
Add content to append to head of initial page.
void
addLink(InitialPageSettings.Position position, String href)
Add a link to initial page head.
void
addLink(InitialPageSettings.Position position, String href, Map<String,String> attributes)
Add a link to initial page head.
void
addLink(InitialPageSettings.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(InitialPageSettings.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.
AfterNavigationEvent
getAfterNavigationEvent()
Get the after navigation event.
WebBrowser
getBrowser()
Get the web browser used for the request used for these settings.
protected List<org.jsoup.nodes.Element>
getElement(InitialPageSettings.Position position)
Get the list of links to append to head.
protected List<elemental.json.JsonObject>
getInline(InitialPageSettings.Position position)
Get the list of inline objects to append to head.
LoadingIndicatorConfiguration
getLoadingIndicatorConfiguration()
Returns the configuration object for loading indicator.
PushConfiguration
getPushConfiguration()
Returns the object used for configuring the push channel.
ReconnectDialogConfiguration
getReconnectDialogConfiguration()
Returns the configuration object for reconnect dialog.
VaadinRequest
getRequest()
Get the initial request for the settings.
UI
getUi()
Get the target UI instance.
protected String
getViewport()
Get the currently set viewport setting for this settings object.
void
setViewport(String viewport)
Set the viewport value.
-
-
-
Constructor Detail
-
InitialPageSettings
public InitialPageSettings(VaadinRequest request, UI ui, AfterNavigationEvent afterNavigationEvent, WebBrowser browser)
Create new initial page settings object.
Parameters:
request
- initial requestui
- target uiafterNavigationEvent
- after navigation eventbrowser
- 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 headtype
- 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 appendfile
- dependency file to read and write to headtype
- dependency type
-
addInlineWithContents
public void addInlineWithContents(String contents, InitialPageSettings.WrapMode type)
Add content to append to head of initial page.
Parameters:
contents
- dependency contenttype
- dependency type
-
addInlineWithContents
public void addInlineWithContents(InitialPageSettings.Position position, String contents, InitialPageSettings.WrapMode type)
Add content to head of initial page.
Parameters:
position
- prepend or appendcontents
- dependency contenttype
- 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 appendReturns:
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 appendReturns:
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 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(InitialPageSettings.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(InitialPageSettings.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(InitialPageSettings.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(InitialPageSettings.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
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
-
-