Interface ActionButton
@NonExtendable
public interface ActionButton
Represents an action button in a dialog, which can be used to trigger actions or navigate within the dialog.
Action buttons can have labels, tooltips, and associated actions.
- Since:
- 1.21.7
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA builder for creating ActionButton instances. -
Method Summary
Modifier and TypeMethodDescription@Nullable DialogActionaction()Returns the action associated with this button, or null if no action is associated.static ActionButton.Builderbuilder(net.kyori.adventure.text.Component label) Creates a new action button builder with the specified label.static ActionButtoncreate(net.kyori.adventure.text.Component label, @Nullable net.kyori.adventure.text.Component tooltip, @Range(from=1L,to=1024L) int width, @Nullable DialogAction action) Creates a new action button with the specified label, tooltip, width, and action.net.kyori.adventure.text.Componentlabel()Returns the label of the action button.@Nullable net.kyori.adventure.text.Componenttooltip()Returns the tooltip of the action button, or null if no tooltip is set.@Range(from=1L,to=1024L) intwidth()Returns the width of the action button.
-
Method Details
-
create
@Contract(value="_, _, _, _ -> new", pure=true) static ActionButton create(net.kyori.adventure.text.Component label, @Nullable net.kyori.adventure.text.Component tooltip, @Range(from=1L,to=1024L) int width, @Nullable DialogAction action) Creates a new action button with the specified label, tooltip, width, and action.- Parameters:
label- the label of the buttontooltip- the tooltip to display when hovering over the button, or null if no tooltip is neededwidth- the width of the buttonaction- the action to perform when the button is clicked, or null if no action is associated- Returns:
- a new ActionButton instance
- Since:
- 1.21.7
-
builder
@Contract(pure=true, value="_ -> new") static ActionButton.Builder builder(net.kyori.adventure.text.Component label) Creates a new action button builder with the specified label.- Parameters:
label- the label of the button- Returns:
- a new ActionButton.Builder instance
- Since:
- 1.21.7
-
label
@Contract(pure=true) net.kyori.adventure.text.Component label()Returns the label of the action button.- Returns:
- the label of the button
- Since:
- 1.21.7
-
tooltip
@Contract(pure=true) @Nullable net.kyori.adventure.text.Component tooltip()Returns the tooltip of the action button, or null if no tooltip is set.- Returns:
- the tooltip of the button, or null
- Since:
- 1.21.7
-
width
@Contract(pure=true) @Range(from=1L,to=1024L) int width()Returns the width of the action button.- Returns:
- the width of the button
- Since:
- 1.21.7
-
action
Returns the action associated with this button, or null if no action is associated.- Returns:
- the action to perform when the button is clicked, or null
- Since:
- 1.21.7
-