Package dev.majek.pc.chat
Class Paginate
- java.lang.Object
-
- dev.majek.pc.chat.Paginate
-
public class Paginate extends Object
Used to paginate long lists of text, such as help, in chat.
-
-
Field Summary
Fields Modifier and Type Field Description StringNEXTStringNEXT_PAGEStringNO_NEXT_PAGEStringNO_PREVIOUS_PAGEStringPAGEStringPREVStringPREVIOUS_PAGE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcreatePage(List<String> lines, int pageNumber, String command)Create a new page of values.StringgetConfigString(String path)intgetMaxPage()StringgetNextPage()StringgetPage()StringgetPage(int page)StringgetPreviousPage()
-
-
-
Constructor Detail
-
Paginate
public Paginate(List<String> lines, String header, int linesPerPage, String command)
Generate pagination for when there is a long list of values to display in chat.- Parameters:
lines- The list of values to display across pages.header- The header to display at the top of every page.linesPerPage- How many lines to display on each page.command- The command, not including page number, to use for moving between pages.
-
-
Method Detail
-
getPage
public String getPage()
-
getPage
public String getPage(int page)
-
getNextPage
public String getNextPage()
-
getPreviousPage
public String getPreviousPage()
-
getMaxPage
public int getMaxPage()
-
createPage
public String createPage(List<String> lines, int pageNumber, String command)
Create a new page of values. The page formatting is the same as the /help pages.- Parameters:
lines- The list of values for this page.pageNumber- The page number assigned to this page.command- The command, not including page number, to use for moving between pages.- Returns:
- The created page ready to send formatted.
-
-