Package com.vaadin.flow.component.page
Interface AppShellConfigurator
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
FakeAppConf
An interface to configure application features and the host page where the
Vaadin application is running. It automatically configures the index.html
page. Configuration can be done using a class implementing this interface
with following annotations that affect the generated index.html page (also
known as 'application shell'):
Meta
: appends an HTML<meta>
tag to the bottom of the<head>
elementInline
: inlines a static content in any point of the documentViewport
: defines the viewport tag of the pageBodySize
: configures the size of the bodyPageTitle
: establishes the page titlePush
: configures automatic server pushPWA
: defines application PWA properties
There is a single application shell for the entire Vaadin application, and
there can only be one class implementing AppShellConfigurator
per
Application. Also, app shell class is not allowed to extend Vaadin Component,
since app shells are only intended for page configuration and are
instantiated before the UI is created.
NOTE: the application shell class is the only valid target for the page configuration annotations listed below. The application would fail to start if any of these annotations is wrongly placed on a class other than the application shell class.
Example:
@Meta(name = "Author", content = "Donald Duck")
@PWA(name = "My Fun Application", shortName = "fun-app")
@Inline("my-custom-javascript.js")
@Viewport("width=device-width, initial-scale=1")
@BodySize(height = "100vh", width = "100vw")
@PageTitle("my-title")
@Push(value = PushMode.AUTOMATIC, transport = Transport.WEBSOCKET_XHR)
public class AppShell implements AppShellConfigurator {
}
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
configurePage
(AppShellSettings settings) Configure the initial application shell settings when called.
-
Method Details
-
configurePage
Configure the initial application shell settings when called.- Parameters:
settings
- initial application shell settings
-