Class ButtonElement
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionButtonElement
(PlainTextObject text, String actionId, String url, String value, String style, ConfirmationDialogObject confirm, String accessibilityLabel) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
protected boolean
boolean
A label for longer descriptive text about a button element.An identifier for this action.A confirm object that defines an optional confirmation dialog after the button is clicked.getStyle()
Decorates buttons with alternative visual color schemes.getText()
A text object that defines the button's text.getType()
getUrl()
A URL to load in the user's browser when the button is clicked.getValue()
The value to send along with the interaction payload.int
hashCode()
void
setAccessibilityLabel
(String accessibilityLabel) A label for longer descriptive text about a button element.void
setActionId
(String actionId) An identifier for this action.void
setConfirm
(ConfirmationDialogObject confirm) A confirm object that defines an optional confirmation dialog after the button is clicked.void
Decorates buttons with alternative visual color schemes.void
setText
(PlainTextObject text) A text object that defines the button's text.void
A URL to load in the user's browser when the button is clicked.void
The value to send along with the interaction payload.toString()
-
Field Details
-
TYPE
- See Also:
-
-
Constructor Details
-
ButtonElement
public ButtonElement() -
ButtonElement
public ButtonElement(PlainTextObject text, String actionId, String url, String value, String style, ConfirmationDialogObject confirm, String accessibilityLabel)
-
-
Method Details
-
builder
-
getType
-
getText
A text object that defines the button's text. Can only be of type: plain_text. Maximum length for the text in this field is 75 characters. -
getActionId
An identifier for this action. You can use this when you receive an interaction payload to identify the source of the action. Should be unique among all other action_ids used elsewhere by your app. Maximum length for this field is 255 characters. -
getUrl
A URL to load in the user's browser when the button is clicked. Maximum length for this field is 3000 characters. If you're using url, you'll still receive an interaction payload and will need to send an acknowledgement response. -
getValue
The value to send along with the interaction payload. Maximum length for this field is 2000 characters. -
getStyle
Decorates buttons with alternative visual color schemes. Use this option with restraint.`primary` gives buttons a green outline and text, ideal for affirmation or confirmation actions. `primary` should only be used for one button within a set.
`danger` gives buttons a red outline and text, and should be used when the action is destructive. Use danger even more sparingly than `primary`.
If you don't include this field, the `default` button style will be used.
-
getConfirm
A confirm object that defines an optional confirmation dialog after the button is clicked. -
getAccessibilityLabel
A label for longer descriptive text about a button element. This label will be read out by screen readers instead of the button text object. Maximum length for this field is 75 characters. -
setText
A text object that defines the button's text. Can only be of type: plain_text. Maximum length for the text in this field is 75 characters. -
setActionId
An identifier for this action. You can use this when you receive an interaction payload to identify the source of the action. Should be unique among all other action_ids used elsewhere by your app. Maximum length for this field is 255 characters. -
setUrl
A URL to load in the user's browser when the button is clicked. Maximum length for this field is 3000 characters. If you're using url, you'll still receive an interaction payload and will need to send an acknowledgement response. -
setValue
The value to send along with the interaction payload. Maximum length for this field is 2000 characters. -
setStyle
Decorates buttons with alternative visual color schemes. Use this option with restraint.`primary` gives buttons a green outline and text, ideal for affirmation or confirmation actions. `primary` should only be used for one button within a set.
`danger` gives buttons a red outline and text, and should be used when the action is destructive. Use danger even more sparingly than `primary`.
If you don't include this field, the `default` button style will be used.
-
setConfirm
A confirm object that defines an optional confirmation dialog after the button is clicked. -
setAccessibilityLabel
A label for longer descriptive text about a button element. This label will be read out by screen readers instead of the button text object. Maximum length for this field is 75 characters. -
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-