Class WTabPanel.Tab.Builder

java.lang.Object
io.github.cottonmc.cotton.gui.widget.WTabPanel.Tab.Builder
Enclosing class:
WTabPanel.Tab

public static final class WTabPanel.Tab.Builder extends Object
A builder for tab data.
  • Constructor Details

    • Builder

      public Builder(WWidget widget)
      Constructs a new tab data builder.
      Parameters:
      widget - the contained widget
      Throws:
      NullPointerException - if the widget is null
  • Method Details

    • title

      public WTabPanel.Tab.Builder title(net.minecraft.text.Text title)
      Sets the tab title.
      Parameters:
      title - the new title
      Returns:
      this builder
      Throws:
      NullPointerException - if the title is null
    • icon

      public WTabPanel.Tab.Builder icon(Icon icon)
      Sets the tab icon.
      Parameters:
      icon - the new icon
      Returns:
      this builder
      Throws:
      NullPointerException - if the icon is null
    • tooltip

      public WTabPanel.Tab.Builder tooltip(net.minecraft.text.Text... lines)
      Adds lines to the tab's tooltip.
      Parameters:
      lines - the added lines
      Returns:
      this builder
      Throws:
      NullPointerException - if the line array is null
    • tooltip

      public WTabPanel.Tab.Builder tooltip(Collection<? extends net.minecraft.text.Text> lines)
      Adds lines to the tab's tooltip.
      Parameters:
      lines - the added lines
      Returns:
      this builder
      Throws:
      NullPointerException - if the line collection is null
    • build

      public WTabPanel.Tab build()
      Builds a tab from this builder.
      Returns:
      the built tab