Package xyz.xenondevs.invui.gui
Interface TabGui
- All Superinterfaces:
Gui
- All Known Implementing Classes:
AbstractTabGui
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTabChangeHandler(@NotNull BiConsumer<Integer, Integer> handler) Registers a page change handler.intGets the current tab index.@Nullable List<@NotNull BiConsumer<Integer, Integer>> Gets the registered tab change handlers.getTabs()Gets the configured tabs.booleanisTabAvailable(int tab) Checks if the given tab is available.static @NotNull TabGui.Buildernormal()Creates a newGui Builderfor aTabGui.static @NotNull TabGuinormal(@NotNull Consumer<@NotNull TabGui.Builder> consumer) static @NotNull TabGuiCreates a newTabGui.static @NotNull TabGuiCreates a newTabGui.voidremoveTabChangeHandler(@NotNull BiConsumer<Integer, Integer> handler) Unregisters a page change handler.voidsetTab(int tab) Sets the current tab.voidsetTabChangeHandlers(@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 Builderfor aTabGui.- Returns:
- The new
Gui Builder.
-
normal
@NotNull static @NotNull TabGui normal(@NotNull @NotNull Consumer<@NotNull TabGui.Builder> consumer) - Parameters:
consumer- TheConsumerto 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.
-