Class Canvas.PopulatorContext<T>

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

public static class Canvas.PopulatorContext<T> extends Object
Represents the context of the population. It holds the elements and the canvas. It also holds the view strategy.
  • Constructor Details

    • PopulatorContext

      public PopulatorContext()
  • Method Details

    • viewStrategy

      @NotNull public @NotNull Canvas.PopulatorContext<T> viewStrategy(@Nullable @Nullable Canvas.PopulatorContext.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 @NotNull Canvas.PopulatorContext<T> viewStrategy(@Nullable @Nullable Canvas.PopulatorContext.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.PopulatorContext.Populator<?> populator)
    • content

      @NotNull public @NotNull Canvas.PopulatorContext<T> content(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull Canvas.PopulatorContext.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