com.vaadin.flow.theme.
Interface AbstractTheme
-
All Superinterfaces:
public interface AbstractTheme extends Serializable
Abstract theme definition class for defining theme variables when in use.
Since:
1.0
Author:
Vaadin Ltd
-
-
Method Summary
All Methods Modifier and Type Method and Description String
getBaseUrl()
The url for the base component implementation.
default Map<String,String>
getBodyAttributes(String variant)
Deprecated.
usegetHtmlAttributes(String)
insteaddefault List<String>
getHeaderInlineContents()
Return a list of contents to inline to the bootstrap header.
default Map<String,String>
getHtmlAttributes(String variant)
Gets the attributes that should be set on the
<html>
element when the Theme variant is applied.String
getThemeUrl()
The url for the components themed version implementation.
default String
translateUrl(String url)
Translates the given
url
using the result of thegetThemeUrl()
theme method.
-
-
-
Method Detail
-
getBaseUrl
String getBaseUrl()
The url for the base component implementation.
e.g. src/
Returns:
the base component path
-
getThemeUrl
String getThemeUrl()
The url for the components themed version implementation.
e.g. theme/lumo/
Returns:
the themed component path
-
getHeaderInlineContents
default List<String> getHeaderInlineContents()
Return a list of contents to inline to the bootstrap header. The contents will be handled as no-wrap as is and will be inserted to the initial page head tag.
This will usually be the any
<custom-style>
declarations, see CustomStyleFor importing theme files, use
HtmlImport
on the corresponding theme subclass.Returns:
list of string content to inline or empty list if nothing to inline
-
getBodyAttributes
@Deprecated default Map<String,String> getBodyAttributes(String variant)
Deprecated. use
getHtmlAttributes(String)
insteadGets the attributes that should be set on the
<body>
element when the Theme variant is applied.Parameters:
variant
- the variant defined in theTheme
annotation, notnull
Returns:
a Map with the attributes (keys and values) that should be set in the body, or an empty Map if nothing should be set for the given variant.
-
getHtmlAttributes
default Map<String,String> getHtmlAttributes(String variant)
Gets the attributes that should be set on the
<html>
element when the Theme variant is applied.Parameters:
variant
- the variant defined in theTheme
annotation, notnull
Returns:
a Map with the attributes (keys and values) that should be set in the body, or an empty Map if nothing should be set for the given variant.
-
translateUrl
default String translateUrl(String url)
Translates the given
url
using the result of thegetThemeUrl()
theme method.If translation is possible then translated URL is returned. Otherwise the
url
is returned.Parameters:
url
- the URL to translate using the themeReturns:
translated URL if possible or the same given
url
if not.
-
-