Class WTabPanel.Tab
java.lang.Object
io.github.cottonmc.cotton.gui.widget.WTabPanel.Tab
- Enclosing class:
- WTabPanel
The data of a tab.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionTab(@Nullable net.minecraft.text.Text title, @Nullable Icon icon, WWidget widget, @Nullable Consumer<TooltipBuilder> tooltip)Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTooltip(TooltipBuilder tooltip)Adds this widget's tooltip to thetooltipbuilder.@Nullable IcongetIcon()Gets the icon of this tab.@Nullable net.minecraft.text.TextgetTitle()Gets the title of this tab.Gets the contained widget of this tab.
-
Constructor Details
-
Tab
@Deprecated public Tab(@Nullable @Nullable net.minecraft.text.Text title, @Nullable @Nullable Icon icon, WWidget widget, @Nullable @Nullable Consumer<TooltipBuilder> tooltip)Deprecated.UseWTabPanel.Tab.Builderinstead.Constructs a tab.- Parameters:
title- the tab titleicon- the tab iconwidget- the widget contained in the tabtooltip- the tab tooltip- Throws:
IllegalArgumentException- if both the title and the icon are nullNullPointerException- if the widget is null
-
-
Method Details
-
getTitle
@Nullable public @Nullable net.minecraft.text.Text getTitle()Gets the title of this tab.- Returns:
- the title, or null if there's no title
-
getIcon
Gets the icon of this tab.- Returns:
- the icon, or null if there's no title
-
getWidget
Gets the contained widget of this tab.- Returns:
- the contained widget
-
addTooltip
Adds this widget's tooltip to thetooltipbuilder.- Parameters:
tooltip- the tooltip builder
-
WTabPanel.Tab.Builderinstead.