Enum Class ToggleButtonVariant

java.lang.Object
java.lang.Enum<ToggleButtonVariant>
com.flowingcode.vaadin.addons.togglebutton.ToggleButtonVariant
All Implemented Interfaces:
ThemeVariant, Serializable, Comparable<ToggleButtonVariant>, Constable

public enum ToggleButtonVariant extends Enum<ToggleButtonVariant> implements ThemeVariant
Theme variants for the ToggleButton component.

Size variants (SMALL, MEDIUM, LARGE) and LONGSWIPE can be combined (e.g. LONGSWIPE + LARGE).

Since:
1.0.0
  • Enum Constant Details

    • SMALL

      public static final ToggleButtonVariant SMALL
      Renders the toggle at a smaller size (32x18 px track).
    • MEDIUM

      public static final ToggleButtonVariant MEDIUM
      Renders the toggle at the default medium size (44x24 px track).
    • LARGE

      public static final ToggleButtonVariant LARGE
      Renders the toggle at a larger size (56x32 px track).
    • LONGSWIPE

      public static final ToggleButtonVariant LONGSWIPE
      Renders a wider switch track optimized for touch interaction. Can be combined with size variants: the track width is increased by 28 px while preserving the height of the chosen size.
    • PRIMARY

      public static final ToggleButtonVariant PRIMARY
      Applies the primary color to the checked state.
    • SUCCESS

      public static final ToggleButtonVariant SUCCESS
      Applies the success color to the checked state.
    • WARNING

      public static final ToggleButtonVariant WARNING
      Applies the warning color to the checked state.
    • ERROR

      public static final ToggleButtonVariant ERROR
      Applies the error color to the checked state.
    • CONTRAST

      public static final ToggleButtonVariant CONTRAST
      Applies the contrast color to the checked state.
  • Method Details

    • values

      public static ToggleButtonVariant[] 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 ToggleButtonVariant 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
    • getVariantName

      public String getVariantName()
      Specified by:
      getVariantName in interface ThemeVariant