Class Paginator

java.lang.Object
com.jagrosh.jdautilities.menu.Menu
com.jagrosh.jdautilities.menu.Paginator

public class Paginator extends Menu
A Menu implementation that paginates a set of one or more text items across one or more pages.

When displayed, a Paginator will add three reactions in the following order:

  • Left Arrow - Causes the Paginator to traverse one page backwards.
  • Stop - Stops the Paginator.
  • Right Arrow - Causes the Paginator to traverse one page forwards.
Additionally, if specified in the Paginator.Builder, two "bulk skip" reactions will be added to allow a certain number of pages to be skipped left or right.
Paginator.Builders can also set a Paginator to accept various forms of text-input, such as left and right text commands, and even user specified page number via text.
Author:
John Grosh
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     

    Fields inherited from class com.jagrosh.jdautilities.menu.Menu

    roles, timeout, unit, users, waiter
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    display(net.dv8tion.jda.api.entities.channel.middleman.MessageChannel channel)
    Begins pagination on page 1 as a new Message in the provided MessageChannel.
    void
    display(net.dv8tion.jda.api.entities.Message message)
    Begins pagination on page 1 displaying this Pagination by editing the provided Message.
    void
    paginate(net.dv8tion.jda.api.entities.channel.middleman.MessageChannel channel, int pageNum)
    Begins pagination as a new Message in the provided MessageChannel, starting on whatever page number is provided.
    void
    paginate(net.dv8tion.jda.api.entities.Message message, int pageNum)
    Begins pagination displaying this Pagination by editing the provided Message, starting on whatever page number is provided.

    Methods inherited from class com.jagrosh.jdautilities.menu.Menu

    isValidUser, isValidUser

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • display

      public void display(net.dv8tion.jda.api.entities.channel.middleman.MessageChannel channel)
      Begins pagination on page 1 as a new Message in the provided MessageChannel.

      Starting on another page is available via Paginator#paginate(MessageChannel, int).

      Specified by:
      display in class Menu
      Parameters:
      channel - The MessageChannel to send the new Message to
    • display

      public void display(net.dv8tion.jda.api.entities.Message message)
      Begins pagination on page 1 displaying this Pagination by editing the provided Message.

      Starting on another page is available via Paginator#paginate(Message, int).

      Specified by:
      display in class Menu
      Parameters:
      message - The Message to display the Menu in
    • paginate

      public void paginate(net.dv8tion.jda.api.entities.channel.middleman.MessageChannel channel, int pageNum)
      Begins pagination as a new Message in the provided MessageChannel, starting on whatever page number is provided.
      Parameters:
      channel - The MessageChannel to send the new Message to
      pageNum - The page number to begin on
    • paginate

      public void paginate(net.dv8tion.jda.api.entities.Message message, int pageNum)
      Begins pagination displaying this Pagination by editing the provided Message, starting on whatever page number is provided.
      Parameters:
      message - The MessageChannel to send the new Message to
      pageNum - The page number to begin on