Class DynamicTitle.PaginatedDynamicTitle

java.lang.Object
io.rhythmknights.coreapi.component.module.DynamicTitle.PaginatedDynamicTitle
All Implemented Interfaces:
DynamicTitle
Enclosing interface:
DynamicTitle

public static class DynamicTitle.PaginatedDynamicTitle extends Object implements DynamicTitle
Implementation for paginated modals that shows current page / total pages
  • Constructor Details

    • PaginatedDynamicTitle

      public PaginatedDynamicTitle(@NotNull @NotNull String baseTitle, int currentPage, int totalPages)
      Creates a paginated dynamic title
      Parameters:
      baseTitle - Base title text
      currentPage - Initial current page
      totalPages - Initial total pages
    • PaginatedDynamicTitle

      public PaginatedDynamicTitle(@NotNull @NotNull Function<DynamicTitle.PaginationState,net.kyori.adventure.text.Component> titleFunction, @NotNull @NotNull String baseTitle, int currentPage, int totalPages)
      Creates a paginated dynamic title with custom formatting
      Parameters:
      titleFunction - Function to create title from pagination state
      baseTitle - Base title text
      currentPage - Initial current page
      totalPages - Initial total pages
  • Method Details

    • getDynamicTitle

      @NotNull public @NotNull net.kyori.adventure.text.Component getDynamicTitle()
      Description copied from interface: DynamicTitle
      Get the current dynamic title based on modal state
      Specified by:
      getDynamicTitle in interface DynamicTitle
      Returns:
      Current component title
    • update

      @NotNull public @NotNull net.kyori.adventure.text.Component update(@NotNull @NotNull Object state)
      Description copied from interface: DynamicTitle
      Update the dynamic title with a new state object
      Specified by:
      update in interface DynamicTitle
      Parameters:
      state - Object containing state information for the update
      Returns:
      Updated component title
    • update

      @NotNull public @NotNull net.kyori.adventure.text.Component update(int currentPage, int totalPages)
      Update pagination state and get new title
      Parameters:
      currentPage - New current page
      totalPages - New total pages
      Returns:
      Updated component title
    • getCurrentPage

      public int getCurrentPage()
      Get the current page
      Returns:
      Current page number
    • getTotalPages

      public int getTotalPages()
      Get the total number of pages
      Returns:
      Total pages
    • getBaseTitle

      public String getBaseTitle()
      Get the base title
      Returns:
      Base title text