Class Canvas.BasicPopulator<T>

java.lang.Object
com.marcusslover.plus.lib.item.Canvas.BasicPopulator<T>
Type Parameters:
T - the type of the elements
Enclosing class:
Canvas

public static class Canvas.BasicPopulator<T> extends Object
A basic populator implementation. It holds the elements and the canvas. It also holds the view strategy.
  • Constructor Details

    • BasicPopulator

      public BasicPopulator()
  • Method Details

    • viewStrategy

      @NotNull public Canvas.BasicPopulator<T> viewStrategy(@Nullable @Nullable Canvas.BasicPopulator.DefaultViewStrategy defaultViewStrategy)
      Set the view strategy. Works only with the default view strategies.
      Parameters:
      defaultViewStrategy - the view strategy
      Returns:
      the populator context
    • viewStrategy

      @NotNull public Canvas.BasicPopulator<T> viewStrategy(@Nullable @Nullable Canvas.BasicPopulator.ViewStrategy viewStrategy)
      Set the view strategy.
      Parameters:
      viewStrategy - A custom view strategy.
      Returns:
      The populator context.
    • updateContent

      public void updateContent(@NotNull @NotNull org.bukkit.entity.Player player, Canvas.BasicPopulator.Populator<?> populator)
    • content

      @NotNull public Canvas.BasicPopulator<T> content(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull Canvas.BasicPopulator.Populator<T> populator)
      Modify how the elements are populated on the canvas. The populator is called for each element. Additionally, add the page manipulation buttons.
      Parameters:
      player - the player
      populator - the populator
      Returns:
      the populator context
    • end

      @NotNull public @NotNull Canvas end()
      Return to the canvas.
      Returns:
      the canvas