Interface ContentEditor

All Known Subinterfaces:
Content
All Known Implementing Classes:
DefaultContent

public interface ContentEditor
Write operations for menu content.

This interface is separate from ContentView so read-only code does not get mutation methods by accident.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes all buttons.
    void
    fill(@NotNull SlotMask mask, @NotNull Button button)
    Fills all slots in the mask with the same button.
    default void
    placeSpanning(@NotNull SpanningButton button)
    Places the same spanning button into every slot in its footprint.
    void
    remove(@NotNull Slot slot)
    Removes the button at the given slot.
    void
    set(@NotNull Slot slot, @Nullable Button button)
    Sets or clears the button at the given slot.
    void
    update(@NotNull Slot slot, @NotNull UnaryOperator<Button> updater)
    Replaces the button at the given slot using the updater result.
  • Method Details

    • set

      void set(@NotNull @NotNull Slot slot, @Nullable @Nullable Button button)
      Sets or clears the button at the given slot.
    • remove

      void remove(@NotNull @NotNull Slot slot)
      Removes the button at the given slot.
    • update

      void update(@NotNull @NotNull Slot slot, @NotNull @NotNull UnaryOperator<Button> updater)
      Replaces the button at the given slot using the updater result.
    • fill

      void fill(@NotNull @NotNull SlotMask mask, @NotNull @NotNull Button button)
      Fills all slots in the mask with the same button.
    • placeSpanning

      default void placeSpanning(@NotNull @NotNull SpanningButton button)
      Places the same spanning button into every slot in its footprint.
    • clear

      void clear()
      Removes all buttons.