Package xyz.xenondevs.invui.gui
Class AbstractTabGui
java.lang.Object
xyz.xenondevs.invui.gui.AbstractGui
xyz.xenondevs.invui.gui.AbstractTabGui
A
Gui with tabs.
Only in very rare circumstances should this class be used directly.
Instead, use the static factory or builder functions from the TabGui interface,
such as TabGui.normal() to create a new TabGui.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface xyz.xenondevs.invui.gui.Gui
Gui.Builder<G extends Gui,S extends Gui.Builder<G, S>> Nested classes/interfaces inherited from interface xyz.xenondevs.invui.gui.TabGui
TabGui.Builder -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTabGui(int width, int height, int tabAmount, int... listSlots) Creates a newAbstractTabGui.AbstractTabGui(int width, int height, int tabAmount, Structure structure) Creates a newAbstractTabGui. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTabChangeHandler(@NotNull BiConsumer<Integer, Integer> tabChangeHandler) Registers a page change handler.intGets the current tab index.intprotected abstract List<SlotElement> getSlotElements(int tab) @Nullable List<@NotNull BiConsumer<Integer, Integer>> Gets the registered tab change handlers.abstract booleanisTabAvailable(int tab) Checks if the given tab is available.voidremoveTabChangeHandler(@NotNull BiConsumer<Integer, Integer> tabChangeHandler) Unregisters a page change handler.voidsetTab(int tab) Sets the current tab.voidsetTabChangeHandlers(@Nullable List<@NotNull BiConsumer<Integer, Integer>> tabChangeHandlers) Replaces the currently registered tab change handlers with the given list.protected voidupdate()Methods inherited from class xyz.xenondevs.invui.gui.AbstractGui
addItems, addParent, addSlotElements, applyStructure, cancelAnimation, closeForAllViewers, fill, fill, fillBorders, fillColumn, fillRectangle, fillRectangle, fillRectangle, fillRectangle, fillRow, findAllCurrentViewers, findAllWindows, getAllInventories, getAllInventorySlots, getBackground, getHeight, getItem, getItem, getParents, getSize, getSlotElement, getSlotElement, getSlotElements, getWidth, handleClick, handleInvDoubleClick, handleInvDrop, handleInvItemShift, handleInvLeftClick, handleInvMiddleClick, handleInvNumberKey, handleInvOffHandKey, handleInvRightClick, handleInvSlotElementClick, handleItemDrag, handleItemShift, handleSlotElementUpdate, hasSlotElement, hasSlotElement, isFrozen, isIgnoreObscuredInventorySlots, playAnimation, putIntoFirstInventory, remove, remove, removeParent, setBackground, setFrozen, setIgnoreObscuredInventorySlots, setItem, setItem, setSlotElement, setSlotElement, updateControlItemsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
Constructor Details
-
AbstractTabGui
public AbstractTabGui(int width, int height, int tabAmount, int... listSlots) Creates a newAbstractTabGui.- Parameters:
width- The width of the gui.height- The height of the gui.tabAmount- The amount of tabs.listSlots- The slots to be used for the content.
-
AbstractTabGui
Creates a newAbstractTabGui.- Parameters:
width- The width of the gui.height- The height of the gui.tabAmount- The amount of tabs.structure- The structure of the gui.
-
-
Method Details
-
setTab
public void setTab(int tab) Description copied from interface:TabGuiSets the current tab. -
update
protected void update() -
getFirstAvailableTab
public int getFirstAvailableTab() -
getCurrentTab
public int getCurrentTab()Description copied from interface:TabGuiGets the current tab index.- Specified by:
getCurrentTabin interfaceTabGui- Returns:
- The current tab index.
-
getTabChangeHandlers
Description copied from interface:TabGuiGets the registered tab change handlers.- Specified by:
getTabChangeHandlersin interfaceTabGui- Returns:
- The registered tab change handlers.
-
setTabChangeHandlers
public void setTabChangeHandlers(@Nullable @Nullable List<@NotNull BiConsumer<Integer, Integer>> tabChangeHandlers) Description copied from interface:TabGuiReplaces the currently registered tab change handlers with the given list.- Specified by:
setTabChangeHandlersin interfaceTabGui- Parameters:
tabChangeHandlers- The new page change handlers.
-
addTabChangeHandler
Description copied from interface:TabGuiRegisters a page change handler.- Specified by:
addTabChangeHandlerin interfaceTabGui- Parameters:
tabChangeHandler- The handler to register.
-
removeTabChangeHandler
Description copied from interface:TabGuiUnregisters a page change handler.- Specified by:
removeTabChangeHandlerin interfaceTabGui- Parameters:
tabChangeHandler- The handler to unregister.
-
isTabAvailable
public abstract boolean isTabAvailable(int tab) Description copied from interface:TabGuiChecks if the given tab is available.- Specified by:
isTabAvailablein interfaceTabGui- Parameters:
tab- The index of the tab to check.- Returns:
- Whether the given tab is available.
-
getSlotElements
-