Enum Class ButtonStyle
- All Implemented Interfaces:
Serializable,Comparable<ButtonStyle>,Constable
The available styles used for
A button can have different styles to indicate its purpose.
Buttons.
A button can have different styles to indicate its purpose.
To see what each button looks like here is an example cheatsheet:

-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDanger/Deny button style, usually in red.Link button style, usually in gray and has a link attachedPremium button style, usually in blurple and has a SKU attachedPrimary button style, usually in blue.Secondary button style, usually in gray.Success/Approve button style, usually in green.Placeholder for future styles -
Method Summary
Modifier and TypeMethodDescriptionstatic ButtonStylefromKey(int key) Returns the style associated with the provided keyintgetKey()The raw style integer keystatic ButtonStyleReturns the enum constant of this class with the specified name.static ButtonStyle[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
UNKNOWN
Placeholder for future styles -
PRIMARY
Primary button style, usually in blue. Often used as the accept, submit, or acknowledge button. For confirm buttons (destructive action), useDANGER. -
SECONDARY
Secondary button style, usually in gray. Often used as the cancel or lesser used option. -
SUCCESS
Success/Approve button style, usually in green. This should be used to indicate a positive action. -
DANGER
Danger/Deny button style, usually in red. This button should be used to indicate destructive actions. -
LINK
Link button style, usually in gray and has a link attached -
PREMIUM
Premium button style, usually in blurple and has a SKU attached
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getKey
public int getKey()The raw style integer key- Returns:
- The raw style key
-
fromKey
Returns the style associated with the provided key- Parameters:
key- The key to convert- Returns:
- The button style or
UNKNOWN
-