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 String
NEXT
String
NEXT_PAGE
String
NO_NEXT_PAGE
String
NO_PREVIOUS_PAGE
String
PAGE
String
PREV
String
PREVIOUS_PAGE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
createPage(List<String> lines, int pageNumber, String command)
Create a new page of values.String
getConfigString(String path)
int
getMaxPage()
String
getNextPage()
String
getPage()
String
getPage(int page)
String
getPreviousPage()
-
-
-
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.
-
-