Class WTabPanel
java.lang.Object
io.github.cottonmc.cotton.gui.widget.WWidget
io.github.cottonmc.cotton.gui.widget.WPanel
io.github.cottonmc.cotton.gui.widget.WTabPanel
A panel that contains creative inventory-style tabs on the top.
- Since:
- 3.0.0
-
Nested Class Summary
Nested Classes -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(WTabPanel.Tab tab) Adds a tab to this panel.voidadd(WWidget widget, Consumer<WTabPanel.Tab.Builder> configurator) Configures and adds a tab to this panel.voidAdds the default background painters to this widget and all children.voidsetSize(int x, int y) Sets the size of this widget.Methods inherited from class io.github.cottonmc.cotton.gui.widget.WPanel
canResize, cycleFocus, cycleFocus, expandToFit, expandToFit, getBackgroundPainter, hit, layout, onHidden, onShown, paint, remove, setBackgroundPainter, streamChildren, tick, toString, validateMethods inherited from class io.github.cottonmc.cotton.gui.widget.WWidget
addNarrations, addTooltip, canFocus, canHover, getAbsoluteX, getAbsoluteY, getHeight, getHost, getParent, getWidth, getX, getY, hoveredProperty, isActivationKey, isFocused, isHovered, isNarratable, isWithinBounds, onCharTyped, onClick, onFocusGained, onFocusLost, onKeyPressed, onKeyReleased, onMouseDown, onMouseDrag, onMouseMove, onMouseScroll, onMouseUp, releaseFocus, renderTooltip, requestFocus, setHost, setHovered, setLocation, setParent
-
Constructor Details
-
WTabPanel
public WTabPanel()Constructs a new tab panel.
-
-
Method Details
-
add
Adds a tab to this panel.- Parameters:
tab- the added tab
-
add
Configures and adds a tab to this panel.- Parameters:
widget- the contained widgetconfigurator- the tab configurator
-
setSize
public void setSize(int x, int y) Description copied from class:WWidgetSets the size of this widget.Overriding methods may restrict one of the dimensions to be a constant value, for example
super.setSize(x, 20). -
addPainters
@Environment(CLIENT) public void addPainters()Description copied from class:WPanelAdds the default background painters to this widget and all children.Always called before
GuiDescription.addPainters()to allow users to modify painters.Subclasses should call
super.addPainters()to ensure that children have proper default painters.- Overrides:
addPaintersin classWPanel
-