Class ScrollingModal
java.lang.Object
io.rhythmknights.coreapi.component.modal.BaseModal
io.rhythmknights.coreapi.component.modal.PaginatedModal
io.rhythmknights.coreapi.component.modal.ScrollingModal
- All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder
Modal that allows you to scroll through items
-
Constructor Summary
ConstructorsConstructorDescriptionScrollingModal(@NotNull ModalContainer modalContainer, int pageSize, @NotNull ScrollType scrollType, @NotNull Set<InteractionModifier> interactionModifiers) ScrollingModal(@NotNull ModalContainer modalContainer, @NotNull PaginationRegion paginationRegion, @NotNull ScrollType scrollType, @NotNull Set<InteractionModifier> interactionModifiers) Constructor with pagination region -
Method Summary
Modifier and TypeMethodDescriptionbooleannext()OverridesPaginatedModal.next()to make it work with the specific scrollsvoidopen(@NotNull org.bukkit.entity.HumanEntity player) OverridesPaginatedModal.open(HumanEntity)to make it work with the specific scrollsvoidopen(@NotNull org.bukkit.entity.HumanEntity player, int openPage) OverridesPaginatedModal.open(HumanEntity, int)to make it work with the specific scrollsbooleanprevious()OverridesPaginatedModal.previous()to make it work with the specific scrollssetDynamicTitle(@NotNull String baseTitle) Sets a dynamic title that updates with scrolling positionMethods inherited from class io.rhythmknights.coreapi.component.modal.PaginatedModal
addItem, addItem, clearPageItems, clearPageItems, getCurrentPageItems, getCurrentPageNum, getNextPageNum, getPageItems, getPagesNum, getPaginationRegion, getPrevPageNum, removePageItem, removePageItem, setPageNum, setPageSize, setPaginationRegion, update, updatePageItem, updatePageItem, updatePageItem, updatePageItem, updateTitleMethods inherited from class io.rhythmknights.coreapi.component.modal.BaseModal
addItem, addSlotAction, addSlotAction, allInteractionsDisabled, allowsOtherActions, canDropItems, canPlaceItems, canSwapItems, canTakeItems, close, close, disableAllInteractions, disableItemDrop, disableItemPlace, disableItemSwap, disableItemTake, disableOtherActions, enableAllInteractions, enableItemDrop, enableItemPlace, enableItemSwap, enableItemTake, enableOtherActions, getFiller, getInventory, getModalItem, getModalItems, getRows, isUpdating, modalContainer, modalType, removeItem, removeItem, removeItem, removeItem, setCloseModalAction, setDefaultClickAction, setDefaultTopClickAction, setDragAction, setInventory, setItem, setItem, setItem, setOpenModalAction, setOutsideClickAction, setPlayerInventoryAction, setUpdateTitleOnItemClick, setUpdating, shouldUpdateTitleOnItemClick, title, updateItem, updateItem, updateItem, updateItem, updateTitleOnItemClick
-
Constructor Details
-
ScrollingModal
public ScrollingModal(@NotNull @NotNull ModalContainer modalContainer, int pageSize, @NotNull @NotNull ScrollType scrollType, @NotNull @NotNull Set<InteractionModifier> interactionModifiers) -
ScrollingModal
public ScrollingModal(@NotNull @NotNull ModalContainer modalContainer, @NotNull @NotNull PaginationRegion paginationRegion, @NotNull @NotNull ScrollType scrollType, @NotNull @NotNull Set<InteractionModifier> interactionModifiers) Constructor with pagination region- Parameters:
modalContainer- Modal containerpaginationRegion- Region for pagination itemsscrollType- Scrolling directioninteractionModifiers- Interaction modifiers
-
-
Method Details
-
setDynamicTitle
Sets a dynamic title that updates with scrolling position- Overrides:
setDynamicTitlein classPaginatedModal- Parameters:
baseTitle- Base title text- Returns:
- The modal
-
next
public boolean next()OverridesPaginatedModal.next()to make it work with the specific scrolls- Overrides:
nextin classPaginatedModal- Returns:
- False if there is no next page.
-
previous
public boolean previous()OverridesPaginatedModal.previous()to make it work with the specific scrolls- Overrides:
previousin classPaginatedModal- Returns:
- False if there is no previous page.
-
open
public void open(@NotNull @NotNull org.bukkit.entity.HumanEntity player) OverridesPaginatedModal.open(HumanEntity)to make it work with the specific scrolls- Overrides:
openin classPaginatedModal- Parameters:
player- TheHumanEntityto open the modal to
-
open
public void open(@NotNull @NotNull org.bukkit.entity.HumanEntity player, int openPage) OverridesPaginatedModal.open(HumanEntity, int)to make it work with the specific scrolls- Overrides:
openin classPaginatedModal- Parameters:
player- TheHumanEntityto open the modal toopenPage- The page to open on
-