Uses of Interface
tech.guilhermekaua.spigotboot.inventoryapi.context.ViewContext
Packages that use ViewContext
Package
Description
The spigot-boot inventory framework (3.0.0): view-based inventories with typed per-phase
contexts, reactive state, and declarative pagination.
-
Uses of ViewContext in tech.guilhermekaua.spigotboot.inventoryapi
Method parameters in tech.guilhermekaua.spigotboot.inventoryapi with type arguments of type ViewContextModifier and TypeMethodDescriptionprotected final <T> State<T>View.lazyState(@NotNull Function<ViewContext, T> computation) Declares a read-only value computed once per context on the first read, on the main thread, and stored thereafter.protected final <T> MutableState<T>View.mutableState(@NotNull Function<ViewContext, T> initialValue) Declares a per-context mutable value whose initial is computed per context on first read, e.g.protected final <T> PaginationBuilder<T>View.paginate(@NotNull Function<ViewContext, List<T>> source) Declares paginated rendering over a per-context element list: the function runs once per context at pagination initialization, on the main thread, and runs again for that context only whenPagination.refresh(context)is called.protected final <T> PaginationBuilder<T>View.paginateSource(@NotNull Function<ViewContext, PageSource<T>> factory) Escape hatch declaring paginated rendering over a customPageSource: the factory runs once per context at pagination initialization and must return the source instance serving exactly that context. -
Uses of ViewContext in tech.guilhermekaua.spigotboot.inventoryapi.component
Method parameters in tech.guilhermekaua.spigotboot.inventoryapi.component with type arguments of type ViewContextModifier and TypeMethodDescription@NotNull ItemComponentBuilderItemComponentBuilder.displayIf(@NotNull Predicate<ViewContext> condition) Shows this component only while the condition holds; a hidden component's slots are cleared and it receives no clicks.@NotNull ItemComponentBuilderItemComponentBuilder.item(@NotNull Function<ViewContext, org.bukkit.inventory.ItemStack> renderer) Sets a dynamic item renderer, re-evaluated on every re-render of this component. -
Uses of ViewContext in tech.guilhermekaua.spigotboot.inventoryapi.context
Subinterfaces of ViewContext in tech.guilhermekaua.spigotboot.inventoryapi.contextModifier and TypeInterfaceDescriptioninterfaceContext forView.onClose: the session is tearing down.interfaceContext forView.onOpen: runs before any container exists.interfaceContext forView.onFirstRender: declares this session's components.interfaceContext for component click handlers andView.onClick: one instance per interceptedInventoryClickEvent.interfaceContext forView.onUpdate: fired by scheduled ticks, state flushes, explicit updates and pagination settles. -
Uses of ViewContext in tech.guilhermekaua.spigotboot.inventoryapi.internal.component
Methods in tech.guilhermekaua.spigotboot.inventoryapi.internal.component with parameters of type ViewContextModifier and TypeMethodDescriptionbooleanComponentInstance.isVisible(@NotNull ViewContext ctx) Evaluates thedisplayIfpredicate; visible by default.@Nullable org.bukkit.inventory.ItemStackComponentInstance.renderForPaint(@NotNull ViewContext ctx) Single paint entry point: returns null to clear the slot (hidden component), theComponentInstance.RENDER_FAILUREsentinel (compare by identity) when displayIf or the renderer threw, or the item to paint.@Nullable org.bukkit.inventory.ItemStackComponentInstance.renderItem(@NotNull ViewContext ctx) Produces this component's item: the static item, or the renderer applied to the context.Method parameters in tech.guilhermekaua.spigotboot.inventoryapi.internal.component with type arguments of type ViewContextModifier and TypeMethodDescription@NotNull ItemComponentBuilderItemComponentBuilderImpl.displayIf(@NotNull Predicate<ViewContext> condition) @NotNull ItemComponentBuilderItemComponentBuilderImpl.item(@NotNull Function<ViewContext, org.bukkit.inventory.ItemStack> renderer) -
Uses of ViewContext in tech.guilhermekaua.spigotboot.inventoryapi.internal.context
Classes in tech.guilhermekaua.spigotboot.inventoryapi.internal.context that implement ViewContextModifier and TypeClassDescriptionclassBase implementation shared by every per-phase context: resolves allViewContextaccessors from the bound session and routes the mutating operations through the engine.final classContext forView.onClose: the session is tearing down.final classContext forView.onOpen: records per-open overrides and the cancel decision.final classPlain phase-less context handed out byViewService.contextOf; adds nothing on top of the base context behavior.final classContext forView.onFirstRender: collects component declarations in order and freezes them into the session's component table viaRenderContextImpl.materializeAll(), called by the first-render phase after the handler returns.final classContext for component click handlers andView.onClick: wraps one Bukkit click event.final classContext forView.onUpdate: a plain context carrying the trigger of the pass. -
Uses of ViewContext in tech.guilhermekaua.spigotboot.inventoryapi.internal.pagination
Methods in tech.guilhermekaua.spigotboot.inventoryapi.internal.pagination that return types with arguments of type ViewContextModifier and TypeMethodDescription@Nullable Function<ViewContext,org.bukkit.inventory.ItemStack> PaginationSpec.emptyStateItem()Returns the empty-state item painted atPaginationSpec.emptyStateSlots()when the current page settled with no elements.@Nullable Function<ViewContext,org.bukkit.inventory.ItemStack> PaginationSpec.fallbackItem()Returns the frame item painted into page slots not covered by an element.@Nullable Function<ViewContext,List<T>> PaginationSourceSpec.lazyFunction()Returns the lazy list function, used by thePagination.refreshpath to re-evaluate the source.@Nullable Function<ViewContext,org.bukkit.inventory.ItemStack> PaginationSpec.loadingItem()Returns the frame item painted into every page slot while an async load is in flight.Methods in tech.guilhermekaua.spigotboot.inventoryapi.internal.pagination with parameters of type ViewContextModifier and TypeMethodDescriptionvoidPaginationImpl.advance(@NotNull ViewContext context) voidPaginationImpl.back(@NotNull ViewContext context) booleanPaginationImpl.canAdvance(@NotNull ViewContext context) booleanPaginationImpl.canBack(@NotNull ViewContext context) @NotNull PageSource<T>PaginationSourceSpec.createSource(@NotNull ViewContext context, @NotNull PaginationSpec<T> spec, @NotNull PlatformScheduler scheduler) Creates (or returns) thePageSourcefor one context.intPaginationImpl.currentPage(@NotNull ViewContext context) booleanPaginationImpl.isLoading(@NotNull ViewContext context) @Nullable ThrowablePaginationImpl.lastError(@NotNull ViewContext context) voidPaginationImpl.refresh(@NotNull ViewContext context) voidPaginationBinding.refreshLazy(@NotNull ViewContext context) Re-invokes a lazy eager source's function against the given context, replaces the paginator's source with a fresh eager source over the result and re-requests the current page (forced).voidPaginationImpl.switchTo(@NotNull ViewContext context, int page) intPaginationImpl.totalElements(@NotNull ViewContext context) intPaginationImpl.totalPages(@NotNull ViewContext context) Method parameters in tech.guilhermekaua.spigotboot.inventoryapi.internal.pagination with type arguments of type ViewContextModifier and TypeMethodDescriptionstatic <T> @NotNull PaginationSourceSpec<T>PaginationSourceSpec.custom(@NotNull Function<ViewContext, PageSource<T>> factory) Declares a custom source: the factory runs once per context and its result is used as-is.@NotNull PaginationBuilder<T>PaginationBuilderImpl.emptyStateItem(@NotNull Function<ViewContext, org.bukkit.inventory.ItemStack> item, int... slots) @NotNull PaginationBuilder<T>PaginationBuilderImpl.fallbackItem(@NotNull Function<ViewContext, org.bukkit.inventory.ItemStack> item) static <T> @NotNull PaginationSourceSpec<T>PaginationSourceSpec.lazy(@NotNull Function<ViewContext, List<T>> source) Declares a lazy eager source:sourceruns once per context at initialization (and again onPagination.refresh), each result wrapped in a freshEagerPageSource.@NotNull PaginationBuilder<T>PaginationBuilderImpl.loadingItem(@NotNull Function<ViewContext, org.bukkit.inventory.ItemStack> item) @NotNull PaginationBuilder<T>PaginationBuilderImpl.loadingItem(@NotNull Function<ViewContext, org.bukkit.inventory.ItemStack> item, int... slots) -
Uses of ViewContext in tech.guilhermekaua.spigotboot.inventoryapi.internal.state
Methods in tech.guilhermekaua.spigotboot.inventoryapi.internal.state with parameters of type ViewContextModifier and TypeMethodDescriptionInitialStateImpl.get(@NotNull ViewContext context) LazyStateImpl.get(@NotNull ViewContext context) MutableStateImpl.get(@NotNull ViewContext context) voidInitialStateImpl.set(@NotNull ViewContext context, T value) voidMutableStateImpl.set(@NotNull ViewContext context, T value) static @NotNull StateStoreContextStateAccess.storeFor(@NotNull ViewContext context, @NotNull View owner) Resolves the state store of a context after validating that the context belongs to the given owning view and is still open — the single guard shared by every per-context token implementation.voidInitialStateImpl.update(@NotNull ViewContext context, @NotNull UnaryOperator<T> fn) voidMutableStateImpl.update(@NotNull ViewContext context, @NotNull UnaryOperator<T> fn) Constructor parameters in tech.guilhermekaua.spigotboot.inventoryapi.internal.state with type arguments of type ViewContextModifierConstructorDescriptionLazyStateImpl(@NotNull View owner, @NotNull TokenTable table, @NotNull Function<ViewContext, T> computation) Creates and registers the token.MutableStateImpl(@NotNull View owner, @NotNull TokenTable table, @NotNull Function<ViewContext, T> initialValue) Creates and registers the token. -
Uses of ViewContext in tech.guilhermekaua.spigotboot.inventoryapi.pagination
Methods in tech.guilhermekaua.spigotboot.inventoryapi.pagination with parameters of type ViewContextModifier and TypeMethodDescriptionvoidPagination.advance(@NotNull ViewContext context) Navigates one page forward, clamped exactly likePagination.switchTo(tech.guilhermekaua.spigotboot.inventoryapi.context.ViewContext, int).voidPagination.back(@NotNull ViewContext context) Navigates one page backward, clamped exactly likePagination.switchTo(tech.guilhermekaua.spigotboot.inventoryapi.context.ViewContext, int).booleanPagination.canAdvance(@NotNull ViewContext context) Returns whether a next page exists, i.e.booleanPagination.canBack(@NotNull ViewContext context) Returns whether a previous page exists, i.e.intPagination.currentPage(@NotNull ViewContext context) Returns the current page, 1-indexed.booleanPagination.isLoading(@NotNull ViewContext context) Returns whether the latest page request has not settled yet.@Nullable ThrowablePagination.lastError(@NotNull ViewContext context) Returns the failure of the most recently settled page load, ornull; cleared when a new request is dispatched.voidPagination.refresh(@NotNull ViewContext context) Forces a reload of the current page.voidPaginationItemRenderer.render(@NotNull ViewContext context, @NotNull ItemComponentBuilder item, int index, T value) Renders one page element.voidPagination.switchTo(@NotNull ViewContext context, int page) Switches to the given page.intPagination.totalElements(@NotNull ViewContext context) Returns the total element count of the backing source.intPagination.totalPages(@NotNull ViewContext context) Returns the total page count, always at least 1.Method parameters in tech.guilhermekaua.spigotboot.inventoryapi.pagination with type arguments of type ViewContextModifier and TypeMethodDescription@NotNull PaginationBuilder<T>PaginationBuilder.emptyStateItem(@NotNull Function<ViewContext, org.bukkit.inventory.ItemStack> item, int... slots) Sets an item painted into the given slots when the current page settled with no elements, leaving every other layout slot empty.@NotNull PaginationBuilder<T>PaginationBuilder.fallbackItem(@NotNull Function<ViewContext, org.bukkit.inventory.ItemStack> item) Sets the item painted into page slots not covered by an element (for example the tail of a short last page) and into slots whose element failed on its very first paint.@NotNull PaginationBuilder<T>PaginationBuilder.loadingItem(@NotNull Function<ViewContext, org.bukkit.inventory.ItemStack> item) Sets the item painted into every page slot while an async load is in flight.@NotNull PaginationBuilder<T>PaginationBuilder.loadingItem(@NotNull Function<ViewContext, org.bukkit.inventory.ItemStack> item, int... slots) Sets the loading item painted only into the given slots while an async load is in flight, leaving every other layout slot empty. -
Uses of ViewContext in tech.guilhermekaua.spigotboot.inventoryapi.service
Methods in tech.guilhermekaua.spigotboot.inventoryapi.service that return types with arguments of type ViewContextModifier and TypeMethodDescription@NotNull Optional<ViewContext>ViewService.contextOf(@NotNull org.bukkit.entity.Player player) Returns a live context for the player's open view, if any. -
Uses of ViewContext in tech.guilhermekaua.spigotboot.inventoryapi.state
Methods in tech.guilhermekaua.spigotboot.inventoryapi.state with parameters of type ViewContextModifier and TypeMethodDescriptionState.get(@NotNull ViewContext context) Reads this token's value for the given context.voidMutableState.set(@NotNull ViewContext context, T value) Writes this token's value for the given context and marks watchers dirty.voidMutableState.update(@NotNull ViewContext context, @NotNull UnaryOperator<T> fn) Read-modify-write convenience: appliesfnto the current value and stores the result.