Package net.tnemc.menu.core.builder
Class PageBuilder
java.lang.Object
net.tnemc.menu.core.builder.PageBuilder
Builder class for creating instances of the
Page
class.- Since:
- 1.5.0.0
- Author:
- creatorfromhell
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate Function<MenuClickHandler,
Boolean> protected Consumer<PageOpenCallback>
private final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds and returns thePage
instance based on the provided configuration.withClickHandler
(Function<MenuClickHandler, Boolean> clickHandler) Sets the click handler for the page.withColumn
(int menuRows, int startingRow, int endingRow, int column, IconBuilder iconBuilder) Adds the specifiedIconBuilder
to the specified column.withColumn
(int menuRows, int startingRow, int column, IconBuilder iconBuilder) Adds the specifiedIconBuilder
to the specified column.withColumn
(int menuRows, int column, IconBuilder iconBuilder) Adds the specifiedIconBuilder
to the specified column.Adds icons to the page.Sets the open handler for the page.withRow
(int row, IconBuilder iconBuilder) Adds the specifiedIconBuilder
to the specified row.
-
Field Details
-
icons
-
clickHandler
-
open
-
pageNumber
private final int pageNumber
-
-
Constructor Details
-
PageBuilder
public PageBuilder(int pageNumber)
-
-
Method Details
-
withClickHandler
Sets the click handler for the page.- Parameters:
clickHandler
- The click handler to be set for the page.- Returns:
- This
PageBuilder
instance for method chaining.
-
withOpenHandler
Sets the open handler for the page.- Parameters:
open
- The click handler to be set for the page.- Returns:
- This
PageBuilder
instance for method chaining.
-
build
Builds and returns thePage
instance based on the provided configuration.- Returns:
- The constructed
Page
instance.