Class TextButton


public class TextButton extends RenderObjectWidget
A coloured glass-pane button with deferred text and an optional grid action. @since 6.2.0
  • Field Details

    • text

      private final Text text
    • color

      private final String color
    • slot

      private final int slot
    • lore

      private final List<Text> lore
    • clickHandler

      @Nullable private final @Nullable GridAction clickHandler
  • Constructor Details

  • Method Details

    • builder

      public static TextButton.Builder builder()
      Returns:
      a new builder
    • getText

      public Text getText()
      Returns:
      the deferred button label
    • getColor

      public String getColor()
      Returns:
      the glass colour name
    • getSlot

      public int getSlot()
      Returns:
      the zero-based grid slot
    • getLore

      public List<Text> getLore()
      Returns:
      unmodifiable deferred lore
    • getClickHandler

      @Nullable public @Nullable GridAction getClickHandler()
      Returns:
      the optional grid action
    • createElement

      @NotNull public @NotNull RenderObjectElement createElement()
      Description copied from class: Widget
      Creates the Element corresponding to this Widget.

      This is a framework-internal method; subclasses should return the Element implementation appropriate to the Widget type.

      Specified by:
      createElement in class RenderObjectWidget
      Returns:
      the corresponding Element instance