Class BaseConfirmationPage

java.lang.Object
mc.obliviate.inventory.Gui
com.ultikits.ultitools.abstracts.gui.BaseInventoryPage
com.ultikits.ultitools.abstracts.gui.BaseConfirmationPage
All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder

public abstract class BaseConfirmationPage extends BaseInventoryPage
Base class for confirmation dialogs with OK and Cancel buttons.

带有确定和取消按钮的确认对话框基类。

Since:
6.2.0
Version:
2.0.0
Author:
wisdomme
  • Field Details

    • CANCEL_BUTTON_COLUMN

      protected static final int CANCEL_BUTTON_COLUMN
      Default column for the cancel button
      See Also:
    • OK_BUTTON_COLUMN

      protected static final int OK_BUTTON_COLUMN
      Default column for the OK button
      See Also:
  • Constructor Details

    • BaseConfirmationPage

      public BaseConfirmationPage(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id, String title, int rows)
    • BaseConfirmationPage

      public BaseConfirmationPage(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id, String title, org.bukkit.event.inventory.InventoryType inventoryType)
    • BaseConfirmationPage

      public BaseConfirmationPage(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id, net.kyori.adventure.text.Component title, int rows)
    • BaseConfirmationPage

      public BaseConfirmationPage(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id, net.kyori.adventure.text.Component title, org.bukkit.event.inventory.InventoryType inventoryType)
  • Method Details

    • setupContent

      protected final void setupContent(org.bukkit.event.inventory.InventoryOpenEvent event)
      Description copied from class: BaseInventoryPage
      Sets up the GUI content. Override this method to add custom content.

      设置 GUI 内容。重写此方法以添加自定义内容。

      Specified by:
      setupContent in class BaseInventoryPage
      Parameters:
      event - the inventory open event
    • setupDialogContent

      protected void setupDialogContent(org.bukkit.event.inventory.InventoryOpenEvent event)
      Sets up the dialog content. Override to add custom content.

      设置对话框内容。重写以添加自定义内容。

      Parameters:
      event - the inventory open event
    • setupConfirmationButtons

      protected void setupConfirmationButtons()
      Sets up the OK and Cancel buttons.

      设置确定和取消按钮。

    • createOkButton

      protected mc.obliviate.inventory.Icon createOkButton()
      Creates the OK button. Override to customize.

      创建确定按钮。 重写以自定义。

      Returns:
      the OK button icon
    • createCancelButton

      protected mc.obliviate.inventory.Icon createCancelButton()
      Creates the Cancel button. Override to customize.

      创建取消按钮。 重写以自定义。

      Returns:
      the Cancel button icon
    • getOkButtonName

      protected String getOkButtonName()
      Gets the OK button display name. Override to customize.

      获取确定按钮的显示名称。 重写以自定义。

      Returns:
      the OK button name
    • getCancelButtonName

      protected String getCancelButtonName()
      Gets the Cancel button display name. Override to customize.

      获取取消按钮的显示名称。 重写以自定义。

      Returns:
      the Cancel button name
    • onConfirm

      protected abstract void onConfirm(org.bukkit.event.inventory.InventoryClickEvent event)
      Called when the OK button is clicked.

      当点击确定按钮时调用。

      Parameters:
      event - the click event
    • onCancel

      protected void onCancel(org.bukkit.event.inventory.InventoryClickEvent event)
      Called when the Cancel button is clicked. Default implementation does nothing.

      当点击取消按钮时调用。 默认实现不做任何事情。

      Parameters:
      event - the click event
    • builder

      public static BaseConfirmationPage.Builder builder(@NotNull @NotNull org.bukkit.entity.Player player)
      Creates a new builder for confirmation dialogs.

      创建确认对话框的新构建器。

      Parameters:
      player - the player to show the dialog to
      Returns:
      a new builder