Class StatefulDeclarativeGui<T extends StatefulDeclarativeGui<T>.State>

java.lang.Object
mc.obliviate.inventory.Gui
com.ultikits.ultitools.abstracts.gui.declarative.engine.DeclarativeGui
com.ultikits.ultitools.abstracts.gui.declarative.engine.StatefulDeclarativeGui<T>
Type Parameters:
T - the State type
All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder

public abstract class StatefulDeclarativeGui<T extends StatefulDeclarativeGui<T>.State> extends DeclarativeGui
StatefulDeclarativeGui is the base class for a declarative GUI that carries state.

It manages a State object internally, providing setState(Runnable) to trigger a rebuild.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    The base class for a declarative GUI's state.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private T
     

    Fields inherited from class com.ultikits.ultitools.abstracts.gui.declarative.engine.DeclarativeGui

    id

    Fields inherited from class mc.obliviate.inventory.Gui

    player
  • Constructor Summary

    Constructors
    Constructor
    Description
    StatefulDeclarativeGui(@NotNull org.bukkit.entity.Player player, @NotNull String id, @NotNull String title, int rows)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract T
    Creates the state object.
    protected T
    Gets the state object.
    protected void
    setState(@NotNull Runnable action)
    Sets state and triggers a rebuild.

    Methods inherited from class com.ultikits.ultitools.abstracts.gui.declarative.engine.DeclarativeGui

    build, getPlayer, getRenderer, isInitialized, markNeedsBuild, onClick, onClose, onGuiClick, onGuiClose, onGuiOpen, onOpen

    Methods inherited from class mc.obliviate.inventory.Gui

    addItem, addItem, addItem, addItem, addItem, addItem, addItem, addItem, createInventory, createInventory, fillColumn, fillGui, fillGui, fillGui, fillGui, fillRow, getId, getInventory, getItems, getLastSlot, getPlugin, getSize, getTaskList, getTitle, isClosed, onDrag, open, runTaskLater, sendSizeUpdate, sendTitleUpdate, setClosed, setInventory, setSize, setTitle, stopAllTasks, stopTask, updateTask

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • StatefulDeclarativeGui

      public StatefulDeclarativeGui(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id, @NotNull @NotNull String title, int rows)
  • Method Details

    • createState

      @NotNull protected abstract T createState()
      Creates the state object.
      Returns:
      the state object
    • getState

      @NotNull protected T getState()
      Gets the state object.
      Returns:
      the state object
    • setState

      protected void setState(@NotNull @NotNull Runnable action)
      Sets state and triggers a rebuild.
      Overrides:
      setState in class DeclarativeGui
      Parameters:
      action - the state-modifying operation