public class InitialPageSettings extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
InitialPageSettings.Position
Append position enum.
|
static class |
InitialPageSettings.WrapMode
Content wrapping mode enum.
|
Constructor and Description |
---|
InitialPageSettings(VaadinRequest request,
UI ui,
AfterNavigationEvent afterNavigationEvent,
WebBrowser browser)
Create new initial page settings object.
|
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.
|
public InitialPageSettings(VaadinRequest request, UI ui, AfterNavigationEvent afterNavigationEvent, WebBrowser browser)
request
- initial requestui
- target uiafterNavigationEvent
- after navigation eventbrowser
- browser informationpublic VaadinRequest getRequest()
public UI getUi()
public AfterNavigationEvent getAfterNavigationEvent()
public WebBrowser getBrowser()
public void setViewport(String viewport)
viewport
- viewport value to setprotected String getViewport()
Note! this will not reflect any setting made using
Viewport
public void addInlineFromFile(String file, InitialPageSettings.WrapMode type)
file
- dependency file to read and write to headtype
- dependency typepublic void addInlineFromFile(InitialPageSettings.Position position, String file, InitialPageSettings.WrapMode type)
position
- prepend or appendfile
- dependency file to read and write to headtype
- dependency typepublic void addInlineWithContents(String contents, InitialPageSettings.WrapMode type)
contents
- dependency contenttype
- dependency typepublic void addInlineWithContents(InitialPageSettings.Position position, String contents, InitialPageSettings.WrapMode type)
position
- prepend or appendcontents
- dependency contenttype
- dependency typeprotected List<elemental.json.JsonObject> getInline(InitialPageSettings.Position position)
position
- prepend or appendprotected List<org.jsoup.nodes.Element> getElement(InitialPageSettings.Position position)
position
- prepend or appendpublic void addLink(String href)
href
- link hrefpublic void addLink(InitialPageSettings.Position position, String href)
position
- prepend or appendhref
- link hrefpublic void addLink(String href, Map<String,String> attributes)
href
- location of the linked documentattributes
- map of attributes for link elementpublic void addLink(InitialPageSettings.Position position, String href, Map<String,String> attributes)
position
- prepend or appendhref
- location of the linked documentattributes
- map of attributes for link elementpublic void addLink(String rel, String href)
rel
- link relationshiphref
- location of the linked documentpublic void addLink(InitialPageSettings.Position position, String rel, String href)
position
- prepend or appendrel
- link relationshiphref
- location of the linked documentpublic void addFavIcon(String rel, String href, String sizes)
rel
- link relationshiphref
- location of the fav iconsizes
- size of the linked fav iconpublic void addFavIcon(InitialPageSettings.Position position, String rel, String href, String sizes)
position
- prepend or appendrel
- link relationshiphref
- location of the fav iconsizes
- size of the linked fav iconpublic void addMetaTag(String name, String content)
name
- meta tag namecontent
- meta tag contentpublic void addMetaTag(InitialPageSettings.Position position, String name, String content)
position
- prepend or appendname
- meta tag namecontent
- meta tag contentpublic LoadingIndicatorConfiguration getLoadingIndicatorConfiguration()
public ReconnectDialogConfiguration getReconnectDialogConfiguration()
public PushConfiguration getPushConfiguration()
Copyright © 2019. All rights reserved.