Class ItemDisplay.Builder

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

public static class ItemDisplay.Builder extends Object implements WidgetBuilder<ItemDisplay>
A reusable builder for an item display.
Since:
6.2.0
  • Field Details

    • icon

      private final ItemSpec icon
    • slot

      private int slot
    • clickHandler

      @Nullable private @Nullable GridAction clickHandler
    • key

      @Nullable private @Nullable SlotKey key
  • Constructor Details

  • Method Details

    • slot

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

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

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

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

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

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