Interface PaginationList.Builder
- All Superinterfaces:
AbstractBuilder<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 of
Component
s.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates aPaginationList
from this pagination builder.Sets the contents of this output as an iterable.Sets the contents of this output to be the given array of contents.Sets the footer to be displayed for this output on all pages after the contents and page navigation bar.Sets the header to be displayed for this output on all pages after the title bar but before the contents.linesPerPage
(int linesPerPage) Sets the maximum number of lines that can be displayed per page.Sets the padding character to be used when centering headers and footers.default PaginationList
default PaginationList
Sends the constructed pagination list to the given receiver.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 Details
-
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
Sets the contents of this output to be the given array of contents.- Parameters:
contents
- The contents to output- Returns:
- This builder
-
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
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
-
padding
Sets the padding character to be used when centering headers and footers.- Parameters:
padding
- The padding to use- Returns:
- This builder
-
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>
- Returns:
- The pagination list
- Throws:
IllegalStateException
- If no contents were specified
-
sendTo
Sends the constructed pagination list to the given receiver.- Parameters:
receiver
- The receiver to send the list to- Returns:
- The constructed pagination list
-
sendTo
- Parameters:
receivers
- The message receivers to send the list to- Returns:
- The constructed pagination list
-