Interface PaginationList.Builder
-
- All Superinterfaces:
AbstractBuilder<PaginationList>
,Buildable.Builder<PaginationList>
,Builder<PaginationList,PaginationList.Builder>
,CopyableBuilder<PaginationList,PaginationList.Builder>
,ResettableBuilder<PaginationList,PaginationList.Builder>
- Enclosing interface:
- PaginationList
public static interface PaginationList.Builder extends Builder<PaginationList,PaginationList.Builder>, CopyableBuilder<PaginationList,PaginationList.Builder>
Builds a paginated output for an iterable ofComponent
s.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description PaginationList
build()
Creates aPaginationList
from this pagination builder.PaginationList.Builder
contents(java.lang.Iterable<Component> contents)
Sets the contents of this output as an iterable.PaginationList.Builder
contents(Component... contents)
Sets the contents of this output to be the given array of contents.PaginationList.Builder
footer(@Nullable Component footer)
Sets the footer to be displayed for this output on all pages after the contents and page navigation bar.PaginationList.Builder
header(@Nullable Component header)
Sets the header to be displayed for this output on all pages after the title bar but before the contents.PaginationList.Builder
linesPerPage(int linesPerPage)
Sets the maximum number of lines that can be displayed per page.PaginationList.Builder
padding(Component padding)
Sets the padding character to be used when centering headers and footers.default PaginationList
sendTo(java.lang.Iterable<Audience> receivers)
Sends the constructed pagination list to allAudience
s within anIterable
.default PaginationList
sendTo(Audience receiver)
Sends the constructed pagination list to the given receiver.PaginationList.Builder
title(@Nullable Component title)
Sets the title text to be used in the title bar of this pagination.-
Methods inherited from interface org.spongepowered.api.util.CopyableBuilder
from
-
-
-
-
Method Detail
-
contents
PaginationList.Builder contents(java.lang.Iterable<Component> contents)
Sets the contents of this output as an iterable.If this
Iterable
is aList
, bidirectional navigation is supported. Otherwise, only going to the next page will be supported.- Parameters:
contents
- The contents to output- Returns:
- This builder
-
contents
PaginationList.Builder contents(Component... contents)
Sets the contents of this output to be the given array of contents.- Parameters:
contents
- The contents to output- Returns:
- This builder
-
title
PaginationList.Builder title(@Nullable Component title)
Sets the title text to be used in the title bar of this pagination.This should be less than one line long.
- Parameters:
title
- The title to use- Returns:
- This builder
-
header
PaginationList.Builder header(@Nullable Component header)
Sets the header to be displayed for this output on all pages after the title bar but before the contents.The header and footer will use this Text's style and color for formatting.
If the header is not specified, or passed in as
null
, it will be omitted when displaying the list.- Parameters:
header
- The header to set- Returns:
- This builder
-
footer
PaginationList.Builder footer(@Nullable Component footer)
Sets the footer to be displayed for this output on all pages after the contents and page navigation bar.If the footer is not specified, or passed in as
null
, it will be omitted when displaying the list.- Parameters:
footer
- The footer to set- Returns:
- This builder
-
padding
PaginationList.Builder padding(Component padding)
Sets the padding character to be used when centering headers and footers.- Parameters:
padding
- The padding to use- Returns:
- This builder
-
linesPerPage
PaginationList.Builder linesPerPage(int linesPerPage)
Sets the maximum number of lines that can be displayed per page.This defaults to the maximum amount of lines that can be displayed on a source's screen at one time if not specified.
- Parameters:
linesPerPage
- The maximum number of lines to display per page- Returns:
- This builder
-
build
PaginationList build()
Creates aPaginationList
from this pagination builder.- Specified by:
build
in interfaceAbstractBuilder<PaginationList>
- Specified by:
build
in interfaceBuildable.Builder<PaginationList>
- Returns:
- The pagination list
- Throws:
java.lang.IllegalStateException
- If no contents were specified
-
sendTo
default PaginationList sendTo(Audience receiver)
Sends the constructed pagination list to the given receiver.- Parameters:
receiver
- The receiver to send the list to- Returns:
- The constructed pagination list
-
sendTo
default PaginationList sendTo(java.lang.Iterable<Audience> receivers)
Sends the constructed pagination list to allAudience
s within anIterable
.- Parameters:
receivers
- The message receivers to send the list to- Returns:
- The constructed pagination list
-
-