Interface HasThemeVariant<TVariantEnum extends ThemeVariant>

Type Parameters:
TVariantEnum - The specific theme variant enum type
All Superinterfaces:
com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasTheme, Serializable

public interface HasThemeVariant<TVariantEnum extends ThemeVariant> extends com.vaadin.flow.component.HasTheme
Mixin interface that allows adding and removing typed theme variants to / from a component
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Adds theme variants to the component.
    default void
    bindThemeVariant(TVariantEnum variant, com.vaadin.flow.signals.Signal<Boolean> signal)
    Binds the presence of the given theme variant to a Signal.
    default void
    Removes theme variants from the component.
    default void
    setThemeVariant(TVariantEnum variant, boolean set)
    Adds or removes the given theme variant for this component.
    default void
    setThemeVariants(boolean set, TVariantEnum... variants)
    Adds or removes the given theme variants for this component.
    default void
    Sets the theme variants of this component.

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasTheme

    addThemeName, addThemeNames, bindThemeName, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
  • Method Details

    • addThemeVariants

      default void addThemeVariants(TVariantEnum... variants)
      Adds theme variants to the component.
      Parameters:
      variants - theme variants to add
    • removeThemeVariants

      default void removeThemeVariants(TVariantEnum... variants)
      Removes theme variants from the component.
      Parameters:
      variants - theme variants to remove
    • setThemeVariant

      default void setThemeVariant(TVariantEnum variant, boolean set)
      Adds or removes the given theme variant for this component.
      Parameters:
      variant - the theme variant to add or remove, not null
      set - true to add the theme variant, false to remove it
    • setThemeVariants

      default void setThemeVariants(TVariantEnum... variants)
      Sets the theme variants of this component. This method overwrites any previous set theme variants.
      Parameters:
      variants - the theme variants to set
    • setThemeVariants

      default void setThemeVariants(boolean set, TVariantEnum... variants)
      Adds or removes the given theme variants for this component.
      Parameters:
      set - true to add the theme variants, false to remove them
      variants - the theme variants to add or remove
    • bindThemeVariant

      default void bindThemeVariant(TVariantEnum variant, com.vaadin.flow.signals.Signal<Boolean> signal)
      Binds the presence of the given theme variant to a Signal. This is a shortcut for calling HasTheme.bindThemeName(String, Signal) with the variant name.
      Parameters:
      variant - the theme variant to bind, not null or blank
      signal - the boolean signal to bind to, not null
      See Also:
      • HasTheme.bindThemeName(String, Signal)