Interface AbstractTheme

All Superinterfaces:
Serializable

public interface AbstractTheme extends Serializable
Abstract theme definition class for defining theme variables when in use.
Since:
1.0
Author:
Vaadin Ltd
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    base url will not be translated to the theme url anymore
    default List<String>
    Return a list of contents to inline to the bootstrap header.
    default Map<String,String>
    Gets the attributes that should be set on the <html> element when the Theme variant is applied.
    Deprecated, for removal: This API element is subject to removal in a future version.
    base url will not be translated to the theme url anymore
    default String
    Deprecated, for removal: This API element is subject to removal in a future version.
    No translation of the url will be done in 25
  • Method Details

    • getBaseUrl

      @Deprecated(since="25.0", forRemoval=true) String getBaseUrl()
      Deprecated, for removal: This API element is subject to removal in a future version.
      base url will not be translated to the theme url anymore
      The url for the base component implementation.

      e.g. src/

      Returns:
      the base component path
    • getThemeUrl

      @Deprecated(since="25.0", forRemoval=true) String getThemeUrl()
      Deprecated, for removal: This API element is subject to removal in a future version.
      base url will not be translated to the theme url anymore
      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 CustomStyle

      For importing theme files, use JsModule on the corresponding theme subclass.

      Returns:
      list of string content to inline or empty list if nothing to inline
    • 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 the Theme annotation, not null
      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

      @Deprecated(since="25.0", forRemoval=true) default String translateUrl(String url)
      Deprecated, for removal: This API element is subject to removal in a future version.
      No translation of the url will be done in 25
      Translates the given url using the result of the getThemeUrl() theme method.

      If translation is possible then translated URL is returned. Otherwise the url is returned.

      Parameters:
      url - the URL to translate using the theme
      Returns:
      translated URL if possible or the same given url if not.