Enum Class FabVariant

java.lang.Object
java.lang.Enum<FabVariant>
com.flowingcode.vaadin.addons.chatassistant.model.FabVariant
All Implemented Interfaces:
Serializable, Comparable<FabVariant>, Constable

public enum FabVariant extends Enum<FabVariant>
Theme variants supported by the chat assistant floating action button (FAB).

Variants fall into two groups: the size variants SMALL and LARGE resize the FAB to a predefined diameter and are mutually exclusive (only one is active at a time), while the color variants are applied to the FAB and accumulate. All variants work under both the Lumo and Aura themes, except LUMO_CONTRAST, which is only effective under Lumo.

Since:
5.1.0
  • Enum Constant Details

    • SMALL

      public static final FabVariant SMALL
      Renders the FAB at the small predefined diameter.
    • LARGE

      public static final FabVariant LARGE
      Renders the FAB at the large predefined diameter.
    • PRIMARY

      public static final FabVariant PRIMARY
      Applies the primary color to the FAB.
    • SUCCESS

      public static final FabVariant SUCCESS
      Applies the success (green) color to the FAB.
    • ERROR

      public static final FabVariant ERROR
      Applies the error (red) color to the FAB.
    • LUMO_CONTRAST

      public static final FabVariant LUMO_CONTRAST
      Applies the contrast color to the FAB. Effective only under the Lumo theme.
  • Method Details

    • values

      public static FabVariant[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FabVariant valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isSizeVariant

      public boolean isSizeVariant()
      Returns whether this is a size variant (SMALL or LARGE), which resizes the FAB.
      Returns:
      true if this is a size variant
    • getButtonVariant

      public ButtonVariant getButtonVariant()
      Returns the Vaadin button variant that carries this variant's color.
      Returns:
      the underlying ButtonVariant
    • getAuraClass

      public String getAuraClass()
      Returns the Aura accent CSS class for this variant, or null if it renders from its Lumo token alone. Aura styles its accent colors via a CSS class rather than the theme attribute.
      Returns:
      the Aura accent class, or null