Class TextButton.Builder

java.lang.Object
com.ultikits.ultitools.abstracts.gui.declarative.widgets.TextButton.Builder
All Implemented Interfaces:
WidgetBuilder<TextButton>
Enclosing class:
TextButton

public static class TextButton.Builder extends Object implements WidgetBuilder<TextButton>
A reusable builder; text and lore remain immutable after building.
  • Field Details

    • text

      private Text text
    • color

      private String color
    • slot

      private int slot
    • lore

      private List<Text> lore
    • clickHandler

      @Nullable private @Nullable GridAction clickHandler
    • key

      @Nullable private @Nullable SlotKey key
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • text

      public TextButton.Builder text(Text text)
      Parameters:
      text - the deferred label @return this builder
    • color

      public TextButton.Builder color(String color)
      Parameters:
      color - a colour name; unknown names render plain glass @return this builder
    • slot

      public TextButton.Builder slot(int slot)
      Parameters:
      slot - the grid index @return this builder
    • lore

      public TextButton.Builder lore(List<Text> lore)
      Parameters:
      lore - deferred lore lines @return this builder
    • onClick

      public TextButton.Builder onClick(@Nullable @Nullable GridAction handler)
      Parameters:
      handler - the grid action, or null to remove it @return this builder
    • onClick

      public TextButton.Builder onClick(@Nullable @Nullable Runnable action)
      Parameters:
      action - a parameterless action, or null to remove it @return this builder
    • key

      public TextButton.Builder key(@Nullable @Nullable SlotKey key)
      Parameters:
      key - the reconciliation key @return this builder
    • key

      public TextButton.Builder key(String key)
      Parameters:
      key - the reconciliation key @return this builder
    • build

      @NotNull public @NotNull TextButton build()
      Description copied from interface: WidgetBuilder
      Builds the Widget instance.
      Specified by:
      build in interface WidgetBuilder<TextButton>
      Returns:
      the Widget instance