Class MultiButton

java.lang.Object
io.github.projectunified.craftux.button.MultiButton
All Implemented Interfaces:
Button, Element
Direct Known Subclasses:
AnimatedButton, ListButton

public abstract class MultiButton extends Object implements Element, Button
A base button that handles multiple child buttons
  • Field Details

  • Constructor Details

    • MultiButton

      public MultiButton()
  • Method Details

    • requireChildButtons

      protected boolean requireChildButtons()
      Whether to require child buttons
      Returns:
      true if child buttons are required
    • addButton

      public final <T extends Button> void addButton(@NotNull @NotNull Collection<@NotNull T> buttons)
      Add child buttons
      Type Parameters:
      T - the type of the button
      Parameters:
      buttons - the child buttons
    • addButton

      public final void addButton(@NotNull @NotNull Button... button)
      Add child buttons
      Parameters:
      button - the button
    • getButtons

      public final List<Button> getButtons()
      Get the list of child buttons
      Returns:
      the list of child buttons
    • init

      public void init()
      Description copied from interface: Element
      Initialize the element. Should be called before adding to the GUI.
      Specified by:
      init in interface Element
    • stop

      public void stop()
      Description copied from interface: Element
      Stop the element. Should be called after removing from the GUI.
      Specified by:
      stop in interface Element