Enum ButtonStyle
- All Implemented Interfaces:
Serializable
,Comparable<ButtonStyle>
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:
-
Enum Constant Summary
Enum ConstantDescriptionDanger/Deny button style, usually in red.Link button style, usually in gray and has a link 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 ButtonStyle
fromKey
(int key) Returns the style associated with the provided keyint
getKey()
The raw style integer keystatic ButtonStyle
Returns the enum constant of this type with the specified name.static ButtonStyle[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
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
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type 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
-