Class McbsEditorTabGUI<T extends McbsEditorTab>
java.lang.Object
com.thecsdev.common.scene.Node<com.thecsdev.commonmc.api.client.gui.TElement>
com.thecsdev.commonmc.api.client.gui.TElement
com.thecsdev.betterstats.api.mcbs.view.tab.McbsEditorTabGUI<T>
- All Implemented Interfaces:
com.thecsdev.common.scene.INode<com.thecsdev.commonmc.api.client.gui.TElement>, com.thecsdev.common.scene.INodeBounded<com.thecsdev.commonmc.api.client.gui.TElement, com.thecsdev.common.math.Bounds2i>, com.thecsdev.common.scene.INodeRenderable<com.thecsdev.commonmc.api.client.gui.TElement, com.thecsdev.commonmc.api.client.gui.render.TGuiGraphics>, Iterable<com.thecsdev.commonmc.api.client.gui.TElement>, Collection<com.thecsdev.commonmc.api.client.gui.TElement>
- Direct Known Subclasses:
McbsEditorFileTabGUI, McbsEditorHomepageTabGUI, McbsEditorNullTabGUI, McbsEditorSettingsTabGUI
@Environment(CLIENT)
public abstract class McbsEditorTabGUI<T extends McbsEditorTab>
extends com.thecsdev.commonmc.api.client.gui.TElement
This class serves as the graphical user interface (GUI) for a specific
McbsEditorTab.
As a subclass of TElement, it is tasked with initializing and rendering the user
interface associated with a particular McbsEditorTab within the context of an
McbsEditorGUI.- See Also:
-
Field Summary
Fields inherited from class com.thecsdev.commonmc.api.client.gui.TElement
eInitialized -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final voidRegisters internalMcbsEditorTabGUIfactories.static final <T extends McbsEditorTab>
@NotNull McbsEditorTabGUI<T> createTabGui(T editorTab) Creates a newMcbsEditorTabGUIinstance for the givenMcbsEditorTabusing the registered factory function.final TReturns theMcbsEditorTabinstance associated with this GUI.protected final voidprotected abstract voidSubclasses should implement this method to initialize the GUI components specific to the associatedMcbsEditorTab.static final <T extends McbsEditorTab>
voidregisterFactory(@NotNull Class<T> tabType, @NotNull Function<@NotNull T, @NotNull McbsEditorTabGUI<T>> tabGuiFactory) Registers a factoryFunctionfor creatingMcbsEditorTabGUIinstances corresponding to a specific type ofMcbsEditorTab.protected final voidMethods inherited from class com.thecsdev.commonmc.api.client.gui.TElement
addRel, boundsProperty, clearAndInit, clipsDescendantsProperty, contextMenuProperty, dragEndCallback, dragStartCallback, findElementAt, focusableProperty, focusGainedCallback, focusLostCallback, forEachVisible, getBaseType, getBounds, getClient, getContentBounds, getCursor, getSelf, getTooltip, hoverableProperty, hoverGainedCallback, hoverLostCallback, inputCallback, invalidateTooltipCache, isFocusable, isFocused, isHoverable, isHovered, isHoveredOrFocused, isVisible, move, moveChildren, moveTo, postRenderCallback, removeRel, renderCallback, screenProperty, setBounds, setBounds, setBounds, showContextMenu, tooltipProperty, toString, visiblePropertyMethods inherited from class com.thecsdev.common.scene.Node
add, addAll, childAddedCallback, childRemovedCallback, clear, contains, containsAll, equals, findChild, findParent, findSibling, forEach, get, getFirst, getLast, getParent, hashCode, indexOf, isEmpty, iterator, parentProperty, remove, remove, remove, removeAll, retainAll, rootProperty, size, toArray, toArray
-
Constructor Details
-
McbsEditorTabGUI
- Throws:
NullPointerException
-
-
Method Details
-
getEditorTab
Returns theMcbsEditorTabinstance associated with this GUI. -
tickCallback
protected final void tickCallback()- Overrides:
tickCallbackin classcom.thecsdev.commonmc.api.client.gui.TElement
-
initCallback
protected final void initCallback()- Overrides:
initCallbackin classcom.thecsdev.commonmc.api.client.gui.TElement
-
initTabGuiCallback
protected abstract void initTabGuiCallback()Subclasses should implement this method to initialize the GUI components specific to the associatedMcbsEditorTab. This method is called during the initialization phase of the GUI lifecycle.- See Also:
-
registerFactory
public static final <T extends McbsEditorTab> void registerFactory(@NotNull @NotNull Class<T> tabType, @NotNull @NotNull Function<@NotNull T, @NotNull McbsEditorTabGUI<T>> tabGuiFactory) throws NullPointerException Registers a factoryFunctionfor creatingMcbsEditorTabGUIinstances corresponding to a specific type ofMcbsEditorTab.- Type Parameters:
T- The type ofMcbsEditorTabfor which the factory is being registered.- Parameters:
tabType- The class type of theMcbsEditorTabfor which the factory is being registered.tabGuiFactory- A function that takes an instance of the specifiedMcbsEditorTabtype and returns a correspondingMcbsEditorTabGUIinstance.- Throws:
NullPointerException- If an argument isnull.
-
createTabGui
@NotNull public static final <T extends McbsEditorTab> @NotNull McbsEditorTabGUI<T> createTabGui(@Nullable T editorTab) throws NullPointerException, IllegalStateException Creates a newMcbsEditorTabGUIinstance for the givenMcbsEditorTabusing the registered factory function.- Type Parameters:
T- The type of theMcbsEditorTab.- Parameters:
editorTab- TheMcbsEditorTabinstance for which the GUI is to be created.- Returns:
- A new
McbsEditorTabGUIinstance corresponding to the providedMcbsEditorTab. - Throws:
NullPointerException- If the argument isnull.IllegalStateException- If no factory is registered for the type of the providedMcbsEditorTab.
-
bootstrap
@Internal public static final void bootstrap()Registers internalMcbsEditorTabGUIfactories.
-