Class StandardButtons

java.lang.Object
com.github.pinont.singularitylib.api.ui.StandardButtons

public final class StandardButtons extends Object
Factory for common menu buttons (back, close, filler, confirm, cancel). Removes the need to hand-roll identical buttons across every plugin menu.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Button
    back(org.bukkit.plugin.Plugin plugin, Menu parent, String label)
    A button that re-opens the given parent menu when clicked.
    static Button
    cancel(org.bukkit.plugin.Plugin plugin, org.bukkit.Material material, String label, Runnable action)
    A cancel-style button that runs the given action on click.
    static Button
    close(org.bukkit.plugin.Plugin plugin)
    A button that closes the open inventory.
    static Button
    confirm(org.bukkit.plugin.Plugin plugin, org.bukkit.Material material, String label, Runnable action)
    A confirmation-style button that runs the given action on click.
    static Button
    filler(org.bukkit.plugin.Plugin plugin, org.bukkit.Material material)
    A non-interactive filler item (e.g.

    Methods inherited from class Object

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

    • back

      public static Button back(org.bukkit.plugin.Plugin plugin, Menu parent, String label)
      A button that re-opens the given parent menu when clicked.
    • close

      public static Button close(org.bukkit.plugin.Plugin plugin)
      A button that closes the open inventory.
    • filler

      public static Button filler(org.bukkit.plugin.Plugin plugin, org.bukkit.Material material)
      A non-interactive filler item (e.g. stained glass pane) for decorative slots.
    • confirm

      public static Button confirm(org.bukkit.plugin.Plugin plugin, org.bukkit.Material material, String label, Runnable action)
      A confirmation-style button that runs the given action on click.
    • cancel

      public static Button cancel(org.bukkit.plugin.Plugin plugin, org.bukkit.Material material, String label, Runnable action)
      A cancel-style button that runs the given action on click.