Package space.maxus.flare.ui.frames
Class PaginatedFrame
java.lang.Object
space.maxus.flare.ui.Frame
space.maxus.flare.ui.frames.PaginatedFrame
- All Implemented Interfaces:
ReactivityProvider,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 Summary
FieldsModifier and TypeFieldDescriptionprotected final @NotNull Dimensionsprotected @NotNull ReactiveInventoryHolderprotected final @NotNull Pagination<Consumer<PageFrame>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandrag(@NotNull Map<Slot, org.bukkit.inventory.ItemStack> newItems, @NotNull org.bukkit.event.inventory.InventoryDragEvent e) Called when items are dragged across this frame.voidgenericClick(@NotNull Slot slot, @NotNull org.bukkit.event.inventory.InventoryClickEvent e) Called every time this frame is clicked.@NotNull DimensionsGets the dimensions of this frame's inventory@NotNull ReactiveInventoryHolderGets the Flare InventoryHolder for this frame@NotNull Pagination<Consumer<PageFrame>>Gets the pagination of this structurefinal booleanCalled when this frame is left clickedvoidonClose()Called when this frame is closed.voidonOpen(@NotNull org.bukkit.entity.Player player) Called when this frame is opened to the playerbooleanrightClick(@NotNull Slot slot, @NotNull org.bukkit.event.inventory.InventoryClickEvent e) Called when this frame is right clicked@NotNull org.bukkit.inventory.InventoryGets the inventory of this frame.voidsetHolder(@NotNull ReactiveInventoryHolder holder) Sets the holder for this frame This is an internal method, it is only used for frame-switchingbooleanshiftClick(@NotNull Slot slot, @NotNull org.bukkit.event.inventory.InventoryClickEvent e) Called when this frame is shift clickedbooleanshiftRequest(@NotNull org.bukkit.inventory.ItemStack stack, @NotNull org.bukkit.event.inventory.InventoryClickEvent e) Called when this frame is attempted to put items into by shift click.Methods inherited from class space.maxus.flare.ui.Frame
bindViewer, close, composableMap, compose, compose, composeAll, context, contextOrNull, fireDrag, fireGenericClick, fireLeftClick, fireRightClick, fireShiftClick, fireShiftRequest, getTitle, getViewer, goBack, init, markDirty, markDirty, markDirty, open, refreshTitle, render, renderPart, restorePreviousState, setTitle, switchFrame, useBoundState, useContext, useStateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface space.maxus.flare.ui.page.PaginationProxy
createPage, createPage, nextPage, previousPage, switchPage, usePaginationDisplay, usePaginationDisplay, useTabulation, useTabulationMethods inherited from interface space.maxus.flare.react.ReactivityProvider
useMemo, useUnboundState
-
Field Details
-
dimensions
-
pagination
-
holder
-
-
Constructor Details
-
PaginatedFrame
public PaginatedFrame() -
PaginatedFrame
-
-
Method Details
-
leftClick
public final boolean leftClick(@NotNull @NotNull Slot slot, @NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent e) Description copied from class:FrameCalled when this frame is left clicked -
rightClick
public boolean rightClick(@NotNull @NotNull Slot slot, @NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent e) Description copied from class:FrameCalled when this frame is right clicked- Overrides:
rightClickin classFrame- Parameters:
slot- Slot that was clickede- 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:FrameCalled every time this frame is clicked.- Overrides:
genericClickin classFrame- Parameters:
slot- Slot that was clickede- The click event
-
shiftClick
public boolean shiftClick(@NotNull @NotNull Slot slot, @NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent e) Description copied from class:FrameCalled when this frame is shift clicked- Overrides:
shiftClickin classFrame- Parameters:
slot- Slot that was clickede- 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:FrameCalled 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:
shiftRequestin classFrame- 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:FrameCalled when items are dragged across this frame. This method is currently experimental and may not work correctly -
onClose
public void onClose()Description copied from class:FrameCalled when this frame is closed.The frame may be reopened later, see
Frame.restorePreviousState(Player)for more info -
onOpen
public void onOpen(@NotNull @NotNull org.bukkit.entity.Player player) Description copied from class:FrameCalled when this frame is opened to the player -
selfInventory
@NotNull public @NotNull org.bukkit.inventory.Inventory selfInventory()Description copied from class:FrameGets the inventory of this frame.- Specified by:
selfInventoryin classFrame- Returns:
- the inventory of this frame.
-
getDimensions
Description copied from class:FrameGets the dimensions of this frame's inventory- Specified by:
getDimensionsin classFrame- Returns:
- the dimensions of this frame's inventory
-
getPagination
Description copied from interface:PaginationProxyGets the pagination of this structure- Specified by:
getPaginationin interfacePaginationProxy- Returns:
- Pagination suitable for
PageFramecreation
-
getHolder
Description copied from class:FrameGets the Flare InventoryHolder for this frame -
setHolder
Description copied from class:FrameSets the holder for this frame This is an internal method, it is only used for frame-switching
-