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.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A builder for creating ActionButton instances.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the action associated with this button, or null if no action is associated.
    builder(net.kyori.adventure.text.Component label)
    Creates a new action button builder with the specified label.
    create(net.kyori.adventure.text.Component label, @Nullable net.kyori.adventure.text.Component tooltip, @org.jetbrains.annotations.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.Component
    Returns the label of the action button.
    @Nullable net.kyori.adventure.text.Component
    Returns the tooltip of the action button, or null if no tooltip is set.
    @org.jetbrains.annotations.Range(from=1L, to=1024L) int
    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, @org.jetbrains.annotations.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 button
      tooltip - the tooltip to display when hovering over the button, or null if no tooltip is needed
      width - the width of the button
      action - the action to perform when the button is clicked, or null if no action is associated
      Returns:
      a new ActionButton instance
    • 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
    • label

      @Contract(pure=true) net.kyori.adventure.text.Component label()
      Returns the label of the action button.
      Returns:
      the label of the button
    • 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
    • width

      @Contract(pure=true) @org.jetbrains.annotations.Range(from=1L, to=1024L) int width()
      Returns the width of the action button.
      Returns:
      the width of the button
    • action

      @Contract(pure=true) @Nullable DialogAction 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