Interface PaginationSession<C,T,X extends AbstractPageContext<C,T,?>>
- All Known Implementing Classes:
DefaultPaginationSession
public interface PaginationSession<C,T,X extends AbstractPageContext<C,T,?>>
Live pagination state for one player.
A session tracks the current page and opens page menus as the player navigates.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the session and the viewer's inventory.intReturns the current page index.@NotNull AbstractPagination<C, T, ? super X> Returns the shared pagination definition.voidgoTo(int pageIndex) Opens the given page index.default booleanisFirst()Returns whether the current page is the first page.default booleanisLast()Returns whether the current page is the last page.voidnext()Opens the next page when possible.voidprevious()Opens the previous page when possible.voidreload()Rebuilds the session snapshot and reopens the current page from scratch.intReturns the total number of pages.@NotNull org.bukkit.entity.Playerviewer()Returns the player viewing this session.
-
Method Details
-
definition
Returns the shared pagination definition. -
viewer
@NotNull @NotNull org.bukkit.entity.Player viewer()Returns the player viewing this session. -
currentIndex
int currentIndex()Returns the current page index. -
totalPages
int totalPages()Returns the total number of pages. -
next
void next()Opens the next page when possible. -
previous
void previous()Opens the previous page when possible. -
goTo
void goTo(int pageIndex) Opens the given page index. -
reload
void reload()Rebuilds the session snapshot and reopens the current page from scratch. This recalculates page count and re-renders title, capacity, and content. -
close
void close()Closes the session and the viewer's inventory. -
isFirst
default boolean isFirst()Returns whether the current page is the first page. -
isLast
default boolean isLast()Returns whether the current page is the last page.
-