Class BasePaginationPage

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

public abstract class BasePaginationPage extends BaseInventoryPage
Base class for paginated inventory pages. Provides automatic pagination with next/previous buttons.
Since:
6.2.0
Version:
2.0.0
Author:
wisdomme
  • Field Details

    • paginationManager

      private final mc.obliviate.inventory.pagination.PaginationManager paginationManager
    • PREV_BUTTON_COLUMN

      protected static final int PREV_BUTTON_COLUMN
      Default column for the "previous" button (0-based)
      See Also:
    • NEXT_BUTTON_COLUMN

      protected static final int NEXT_BUTTON_COLUMN
      Default column for the "next" button (0-based)
      See Also:
  • Constructor Details

    • BasePaginationPage

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

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

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

      public BasePaginationPage(@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

    • initPagination

      private void initPagination()
      Initializes the pagination manager.
    • 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.
      Specified by:
      setupContent in class BaseInventoryPage
      Parameters:
      event - the inventory open event
    • updatePaginatedContent

      protected void updatePaginatedContent()
      Updates the paginated content.
    • setupNavigationButtons

      protected void setupNavigationButtons()
      Sets up the navigation buttons.
    • createPreviousButton

      protected mc.obliviate.inventory.Icon createPreviousButton()
      Creates the "previous page" button. Override to customize.
      Returns:
      the previous button icon
    • createNextButton

      protected mc.obliviate.inventory.Icon createNextButton()
      Creates the "next page" button. Override to customize.
      Returns:
      the next button icon
    • provideItems

      protected abstract List<mc.obliviate.inventory.Icon> provideItems()
      Provides the items for pagination. Override this method to provide the items to display.
      Returns:
      list of icons to paginate
    • getPaginationManager

      protected mc.obliviate.inventory.pagination.PaginationManager getPaginationManager()
      Gets the pagination manager.
      Returns:
      the pagination manager
    • getCurrentPage

      public int getCurrentPage()
      Gets the current page number (1-based).
      Returns:
      the current page number
    • getTotalPages

      public int getTotalPages()
      Gets the total number of pages.
      Returns:
      the total page count
    • hasNextPage

      public boolean hasNextPage()
      Checks if there are more pages after the current one.
      Returns:
      true if not on the last page
    • hasPreviousPage

      public boolean hasPreviousPage()
      Checks if there are pages before the current one.
      Returns:
      true if not on the first page
    • goToPage

      public void goToPage(int page)
      Goes to a specific page.
      Parameters:
      page - the page number (1-based)