Package xyz.xenondevs.invui.gui
Interface TabGui
- All Superinterfaces:
Gui
- All Known Implementing Classes:
AbstractTabGui
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addTabChangeHandler
(@NotNull BiConsumer<Integer, Integer> handler) Registers a page change handler.int
Gets the current tab index.@Nullable List
<@NotNull BiConsumer<Integer, Integer>> Gets the registered tab change handlers.getTabs()
Gets the configured tabs.boolean
isTabAvailable
(int tab) Checks if the given tab is available.static @NotNull TabGui.Builder
normal()
Creates a newGui Builder
for aTabGui
.static @NotNull TabGui
normal
(@NotNull Consumer<@NotNull TabGui.Builder> consumer) static @NotNull TabGui
Creates a newTabGui
.static @NotNull TabGui
Creates a newTabGui
.void
removeTabChangeHandler
(@NotNull BiConsumer<Integer, Integer> handler) Unregisters a page change handler.void
setTab
(int tab) Sets the current tab.void
setTabChangeHandlers
(@Nullable List<@NotNull BiConsumer<Integer, Integer>> handlers) Replaces the currently registered tab change handlers with the given list.Methods inherited from interface xyz.xenondevs.invui.gui.Gui
addItems, addSlotElements, applyStructure, cancelAnimation, closeForAllViewers, fill, fill, fillBorders, fillColumn, fillRectangle, fillRectangle, fillRectangle, fillRectangle, fillRow, findAllCurrentViewers, findAllWindows, getBackground, getHeight, getItem, getItem, getSize, getSlotElement, getSlotElement, getSlotElements, getWidth, hasSlotElement, hasSlotElement, isFrozen, isIgnoreObscuredInventorySlots, playAnimation, remove, remove, setBackground, setFrozen, setIgnoreObscuredInventorySlots, setItem, setItem, setSlotElement, setSlotElement
-
Method Details
-
normal
Creates a newGui Builder
for aTabGui
.- Returns:
- The new
Gui Builder
.
-
normal
@NotNull static @NotNull TabGui normal(@NotNull @NotNull Consumer<@NotNull TabGui.Builder> consumer) - Parameters:
consumer
- TheConsumer
to configure theGui Builder
.- Returns:
- The created
TabGui
.
-
of
@NotNull static @NotNull TabGui of(int width, int height, @NotNull @NotNull List<@Nullable Gui> tabs, int... contentListSlots) Creates a newTabGui
. -
of
Creates a newTabGui
. -
getCurrentTab
int getCurrentTab()Gets the current tab index.- Returns:
- The current tab index.
-
setTab
void setTab(int tab) Sets the current tab.- Parameters:
tab
- The index of the tab to show.
-
isTabAvailable
boolean isTabAvailable(int tab) Checks if the given tab is available.- Parameters:
tab
- The index of the tab to check.- Returns:
- Whether the given tab is available.
-
getTabs
Gets the configured tabs.- Returns:
- The configured tabs.
-
getTabChangeHandlers
Gets the registered tab change handlers.- Returns:
- The registered tab change handlers.
-
setTabChangeHandlers
Replaces the currently registered tab change handlers with the given list.- Parameters:
handlers
- The new page change handlers.
-
addTabChangeHandler
Registers a page change handler.- Parameters:
handler
- The handler to register.
-
removeTabChangeHandler
Unregisters a page change handler.- Parameters:
handler
- The handler to unregister.
-