Class PaginatedFrame

java.lang.Object
space.maxus.flare.ui.Frame
space.maxus.flare.ui.frames.PaginatedFrame
All Implemented Interfaces:
ReactivityProvider, PaginationProxy

public abstract class PaginatedFrame extends Frame implements PaginationProxy
PaginatedFrame is a simple frame that supports pagination. Composition inside the Frame.init() method will not have effect. Use PaginationProxy.createPage(java.util.function.Consumer<space.maxus.flare.ui.page.PageFrame>) instead.
  • Field Details

  • Constructor Details

    • PaginatedFrame

      public PaginatedFrame()
    • PaginatedFrame

      public PaginatedFrame(Dimensions dimensions)
  • Method Details

    • leftClick

      public final 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
    • 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
    • shiftRequest

      public boolean shiftRequest(@NotNull @NotNull org.bukkit.inventory.ItemStack stack, @NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent e)
      Description copied from class: Frame
      Called when this frame is attempted to put items into by shift click. This means that a player clicked on an item inside their inventory, and Flare attempts to fit item inside this frame.
      Overrides:
      shiftRequest in class Frame
      Parameters:
      stack - Stack that is attempted to be moved.
      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.
    • onClose

      public void onClose()
      Description copied from class: Frame
      Called when this frame is closed.

      The frame may be reopened later, see Frame.restorePreviousState(Player) for more info

      Overrides:
      onClose in class Frame
      See Also:
    • onOpen

      public void onOpen(@NotNull @NotNull org.bukkit.entity.Player player)
      Description copied from class: Frame
      Called when this frame is opened to the player
      Overrides:
      onOpen in class Frame
      Parameters:
      player - Player this frame is opened to
    • selfInventory

      @NotNull public @NotNull org.bukkit.inventory.Inventory selfInventory()
      Description copied from class: Frame
      Gets the inventory of this frame.
      Specified by:
      selfInventory in class Frame
      Returns:
      the inventory of this frame.
    • getDimensions

      @NotNull public @NotNull Dimensions getDimensions()
      Description copied from class: Frame
      Gets the dimensions of this frame's inventory
      Specified by:
      getDimensions in class Frame
      Returns:
      the dimensions of this frame's inventory
    • getPagination

      @NotNull public @NotNull Pagination<Consumer<PageFrame>> getPagination()
      Description copied from interface: PaginationProxy
      Gets the pagination of this structure
      Specified by:
      getPagination in interface PaginationProxy
      Returns:
      Pagination suitable for PageFrame creation
    • getHolder

      @NotNull public @NotNull ReactiveInventoryHolder getHolder()
      Description copied from class: Frame
      Gets the Flare InventoryHolder for this frame
      Specified by:
      getHolder in class Frame
      Returns:
      Flare InventoryHolder
    • setHolder

      public void setHolder(@NotNull @NotNull ReactiveInventoryHolder holder)
      Description copied from class: Frame
      Sets the holder for this frame This is an internal method, it is only used for frame-switching
      Specified by:
      setHolder in class Frame
      Parameters:
      holder - Holder to be set