Class PageFrame

All Implemented Interfaces:
ReactivityProvider
Direct Known Subclasses:
Modal.ModalFrame

public class PageFrame extends ParamFrame<PageFrame.Props>
A Frame implementation used within DefaultPagination
  • Constructor Details

    • PageFrame

      protected PageFrame(@NotNull @NotNull PageFrame.Props params)
  • Method Details

    • onClick

      public void onClick(PageFrame.SimpleClickHandler simple)
      Adds a generic click handler
      Parameters:
      simple - Generic click handler
    • cancellingOnShiftClick

      public void cancellingOnShiftClick(PageFrame.SimpleClickHandler simple)
      Adds a cancelling shift click handler
      Parameters:
      simple - The handler
    • onShiftClick

      public void onShiftClick(PageFrame.BooleanReturningClickHandler bool)
      Adds a shift click handler
      Parameters:
      bool - The handler
    • cancellingOnLeftClick

      public void cancellingOnLeftClick(PageFrame.SimpleClickHandler simple)
      Adds a cancelling left click handler
      Parameters:
      simple - The handler
    • onLeftClick

      public void onLeftClick(PageFrame.BooleanReturningClickHandler bool)
      Adds a left click handler
      Parameters:
      bool - The handler
    • cancellingOnRightClick

      public void cancellingOnRightClick(PageFrame.SimpleClickHandler simple)
      Adds a cancelling right click handler
      Parameters:
      simple - The handler
    • onRightClick

      public void onRightClick(PageFrame.BooleanReturningClickHandler bool)
      Adds a right click handler
      Parameters:
      bool - The handler
    • onDrag

      public void onDrag(PageFrame.DragHandler drag)
      Adds a drag event handler
      Parameters:
      drag - The handler
    • useTitle

      public void useTitle(@Nullable @Nullable String title)
      Sets the default title of this page
      Parameters:
      title - Title of the page
    • init

      public void init()
      Description copied from class: Frame
      Called once inside the constructor
      Specified by:
      init in class ParamFrame<PageFrame.Props>
    • load

      @Internal public void load()
    • genericClick

      public void genericClick(@NotNull @NotNull Slot slot, @NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent e)
      Description copied from class: Frame
      Called every time this frame is clicked.
      Overrides:
      genericClick in class Frame
      Parameters:
      slot - Slot that was clicked
      e - The click event
    • shiftClick

      public boolean shiftClick(@NotNull @NotNull Slot slot, @NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent e)
      Description copied from class: Frame
      Called when this frame is shift clicked
      Overrides:
      shiftClick in class Frame
      Parameters:
      slot - Slot that was clicked
      e - The click event
      Returns:
      True if the event should be cancelled, false otherwise
    • leftClick

      public boolean leftClick(@NotNull @NotNull Slot slot, @NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent e)
      Description copied from class: Frame
      Called when this frame is left clicked
      Overrides:
      leftClick in class Frame
      Parameters:
      slot - Slot that was clicked
      e - The click event
      Returns:
      True if the event should be cancelled, false otherwise
    • rightClick

      public boolean rightClick(@NotNull @NotNull Slot slot, @NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent e)
      Description copied from class: Frame
      Called when this frame is right clicked
      Overrides:
      rightClick in class Frame
      Parameters:
      slot - Slot that was clicked
      e - The click event
      Returns:
      True if the event should be cancelled, false otherwise
    • drag

      public boolean drag(@NotNull @NotNull Map<Slot,org.bukkit.inventory.ItemStack> newItems, @NotNull @NotNull org.bukkit.event.inventory.InventoryDragEvent e)
      Description copied from class: Frame
      Called when items are dragged across this frame. This method is currently experimental and may not work correctly
      Overrides:
      drag in class Frame
      Parameters:
      newItems - Items that are dragged inside this frame
      e - The drag event
      Returns:
      True if the event should be cancelled, false otherwise.
    • setTitle

      public void setTitle(org.bukkit.entity.Player viewer, String title)
      Description copied from class: Frame
      Sets the title of this frame and broadcasts it to the provided viewer
      Overrides:
      setTitle in class Frame
      Parameters:
      viewer - Viewer to broadcast the title to
      title - New title of this frame
    • getTitle

      public String getTitle()
      Description copied from class: Frame
      Gets the default title of this frame. `A Flare $className` by default.
      Overrides:
      getTitle in class Frame
      Returns:
      The title of this frame
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object