Class DynamicTitle.PaginatedDynamicTitle
java.lang.Object
io.rhythmknights.coreapi.component.module.DynamicTitle.PaginatedDynamicTitle
- All Implemented Interfaces:
DynamicTitle
- Enclosing interface:
DynamicTitle
Implementation for paginated modals that shows current page / total pages
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.rhythmknights.coreapi.component.module.DynamicTitle
DynamicTitle.DynamicTitleImpl, DynamicTitle.InteractionDynamicTitle, DynamicTitle.InteractionState, DynamicTitle.PaginatedDynamicTitle, DynamicTitle.PaginationState -
Constructor Summary
ConstructorsConstructorDescriptionPaginatedDynamicTitle(@NotNull String baseTitle, int currentPage, int totalPages) Creates a paginated dynamic titlePaginatedDynamicTitle(@NotNull Function<DynamicTitle.PaginationState, net.kyori.adventure.text.Component> titleFunction, @NotNull String baseTitle, int currentPage, int totalPages) Creates a paginated dynamic title with custom formatting -
Method Summary
Modifier and TypeMethodDescriptionGet the base titleintGet the current page@NotNull net.kyori.adventure.text.ComponentGet the current dynamic title based on modal stateintGet the total number of pages@NotNull net.kyori.adventure.text.Componentupdate(int currentPage, int totalPages) Update pagination state and get new title@NotNull net.kyori.adventure.text.ComponentUpdate the dynamic title with a new state object
-
Constructor Details
-
PaginatedDynamicTitle
Creates a paginated dynamic title- Parameters:
baseTitle- Base title textcurrentPage- Initial current pagetotalPages- 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 statebaseTitle- Base title textcurrentPage- Initial current pagetotalPages- Initial total pages
-
-
Method Details
-
getDynamicTitle
@NotNull public @NotNull net.kyori.adventure.text.Component getDynamicTitle()Description copied from interface:DynamicTitleGet the current dynamic title based on modal state- Specified by:
getDynamicTitlein interfaceDynamicTitle- Returns:
- Current component title
-
update
Description copied from interface:DynamicTitleUpdate the dynamic title with a new state object- Specified by:
updatein interfaceDynamicTitle- 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 pagetotalPages- 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
Get the base title- Returns:
- Base title text
-