Interface HasThemeFilter

  • All Implemented Interfaces:

    
    public interface HasThemeFilter<C extends Component, HasTheme, SELF extends Locator<C, SELF>>
    
                        

    Mixin for Locators whose target component implements HasTheme. Exposes theme-based filter methods that would be meaningless on components without theme support, turning an inapplicable call into a compile error rather than a silent no-op.

    Since:

    1.1

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      SELF withTheme(ThemeVariant variant) Requires the matched component to have the given theme variant set.
      SELF withTheme(String theme) Requires the matched component to have the given theme set.
      SELF withoutTheme(ThemeVariant variant) Requires the matched component to not have the given theme variant set.
      SELF withoutTheme(String theme) Requires the matched component to not have the given theme set.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • withTheme

         SELF withTheme(ThemeVariant variant)

        Requires the matched component to have the given theme variant set. Prefer this over the raw-string withTheme so the IDE can autocomplete the variant and a typo becomes a compile error.

        
        ui.findButton().withTheme(ButtonVariant.LUMO_PRIMARY).click();
        
      • withoutTheme

         SELF withoutTheme(ThemeVariant variant)

        Requires the matched component to not have the given theme variant set. Prefer this over the raw-string withoutTheme for the same reasons as withTheme.