public static class Slideshow.Builder extends Menu.Builder<Slideshow.Builder,Slideshow>
Menu.Builder
for
a Slideshow
.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
Slideshow.Builder |
addItems(java.lang.String... items)
Adds String items to the list of items to paginate.
|
Slideshow.Builder |
allowTextInput(boolean allowTextInput)
Sets the
Slideshow to allow
a slide number to be specified by a user via text. |
Slideshow |
build()
Builds the
Slideshow
with this Builder. |
Slideshow.Builder |
setBulkSkipNumber(int bulkSkipNumber)
Sets the
Slideshow 's bulk-skip
function to skip multiple pages using alternate forward and backwards |
Slideshow.Builder |
setColor(java.util.function.BiFunction<java.lang.Integer,java.lang.Integer,java.awt.Color> colorBiFunction)
Sets the
Color of the MessageEmbed ,
relative to the total page number and the current page as determined by the provided
BiFunction . |
Slideshow.Builder |
setColor(java.awt.Color color)
Sets the
Color of the MessageEmbed . |
Slideshow.Builder |
setDescription(java.util.function.BiFunction<java.lang.Integer,java.lang.Integer,java.lang.String> descriptionBiFunction)
Sets the description of the
MessageEmbed
in the Message to be displayed relative to the
total page number and the current page as determined by the provided BiFunction . |
Slideshow.Builder |
setDescription(java.lang.String description)
Sets the description of the
MessageEmbed
in the Message to be displayed when the
Slideshow is built. |
Slideshow.Builder |
setFinalAction(java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> finalAction)
Sets the
Consumer to perform if the
Slideshow times out. |
Slideshow.Builder |
setLeftRightText(java.lang.String left,
java.lang.String right)
Sets the
Slideshow to traverse
left or right when a provided text input is sent in the form of a Message to
the Channel the menu is displayed in. |
Slideshow.Builder |
setText(java.util.function.BiFunction<java.lang.Integer,java.lang.Integer,java.lang.String> textBiFunction)
Sets the text of the
Message to be displayed
relative to the total page number and the current page as determined by the provided
BiFunction . |
Slideshow.Builder |
setText(java.lang.String text)
Sets the text of the
Message to be displayed
when the Slideshow is built. |
Slideshow.Builder |
setUrls(java.lang.String... items)
Sets the String list of urls to paginate.
|
Slideshow.Builder |
showPageNumbers(boolean show)
Sets whether or not the page number will be shown.
|
Slideshow.Builder |
waitOnSinglePage(boolean wait)
Sets whether the
Slideshow will instantly
timeout, and possibly run a provided Runnable , if only a single slide is available to display. |
Slideshow.Builder |
wrapPageEnds(boolean wrapPageEnds)
Sets the
Slideshow to wrap
from the last page to the first when traversing right and visa versa from the left. |
addRoles, addUsers, setEventWaiter, setRoles, setTimeout, setUsers
public Slideshow build()
Slideshow
with this Builder.build
in class Menu.Builder<Slideshow.Builder,Slideshow>
java.lang.IllegalArgumentException
- If one of the following is violated:
EventWaiter
was set.public Slideshow.Builder setColor(java.awt.Color color)
Color
of the MessageEmbed
.color
- The Color of the MessageEmbedpublic Slideshow.Builder setColor(java.util.function.BiFunction<java.lang.Integer,java.lang.Integer,java.awt.Color> colorBiFunction)
Color
of the MessageEmbed
,
relative to the total page number and the current page as determined by the provided
BiFunction
.
colorBiFunction
- A BiFunction that uses both current and total page numbers to get a Color for the MessageEmbedpublic Slideshow.Builder setText(java.lang.String text)
Message
to be displayed
when the Slideshow
is built.
This is displayed directly above the embed.
text
- The Message content to be displayed above the embed when the Slideshow is builtpublic Slideshow.Builder setText(java.util.function.BiFunction<java.lang.Integer,java.lang.Integer,java.lang.String> textBiFunction)
Message
to be displayed
relative to the total page number and the current page as determined by the provided
BiFunction
.
textBiFunction
- The BiFunction that uses both current and total page numbers to get text for the Messagepublic Slideshow.Builder setDescription(java.lang.String description)
MessageEmbed
in the Message
to be displayed when the
Slideshow
is built.description
- The description of the MessageEmbedpublic Slideshow.Builder setDescription(java.util.function.BiFunction<java.lang.Integer,java.lang.Integer,java.lang.String> descriptionBiFunction)
MessageEmbed
in the Message
to be displayed relative to the
total page number and the current page as determined by the provided BiFunction
.
descriptionBiFunction
- The BiFunction that uses both current and total page numbers to get description for the MessageEmbedpublic Slideshow.Builder setFinalAction(java.util.function.Consumer<net.dv8tion.jda.core.entities.Message> finalAction)
Consumer
to perform if the
Slideshow
times out.finalAction
- The Consumer action to perform if the Slideshow times outpublic Slideshow.Builder showPageNumbers(boolean show)
show
- true
if the page number should be shown, false
if it should notpublic Slideshow.Builder waitOnSinglePage(boolean wait)
Slideshow
will instantly
timeout, and possibly run a provided Runnable
, if only a single slide is available to display.wait
- true
if the Slideshow will still generatepublic Slideshow.Builder addItems(java.lang.String... items)
items
- The String list of items to addpublic Slideshow.Builder setUrls(java.lang.String... items)
items
- The String list of urls to paginatepublic Slideshow.Builder setBulkSkipNumber(int bulkSkipNumber)
Slideshow
's bulk-skip
function to skip multiple pages using alternate forward and backwardsbulkSkipNumber
- The number of pages to skip when the bulk-skip reactions are used.public Slideshow.Builder wrapPageEnds(boolean wrapPageEnds)
Slideshow
to wrap
from the last page to the first when traversing right and visa versa from the left.wrapPageEnds
- true
to enable wrapping.public Slideshow.Builder allowTextInput(boolean allowTextInput)
Slideshow
to allow
a slide number to be specified by a user via text.
Note that setting this doesn't mean that left and right text inputs
provided via Paginator.Builder.setLeftRightText(String, String)
will
be invalidated if they were set previously! To invalidate those, provide
null
for one or both of the parameters of that method.
allowTextInput
- true
if the Slideshow will allow slide-number text inputpublic Slideshow.Builder setLeftRightText(java.lang.String left, java.lang.String right)
Slideshow
to traverse
left or right when a provided text input is sent in the form of a Message to
the Channel
the menu is displayed in.
If one or both these parameters are provided null
this resets
both of them and they will no longer be available when the Slideshow is built.
left
- The left text input, causes the Slideshow to traverse one slide leftright
- The right text input, causes the Slideshow to traverse one slide right