Class SGDefaultToolbarBuilder

java.lang.Object
com.samjakob.spigui.toolbar.SGDefaultToolbarBuilder
All Implemented Interfaces:
SGToolbarBuilder

public class SGDefaultToolbarBuilder extends Object implements SGToolbarBuilder
The default implementation of SGToolbarBuilder.
This class is used by default by SpiGUI, but you can override this class by extending it and passing your custom implementation to SpiGUI.setDefaultToolbarBuilder(SGToolbarBuilder) (or to use it for a specific menu, pass it to SGMenu.setToolbarBuilder(SGToolbarBuilder)).
  • Constructor Details

    • SGDefaultToolbarBuilder

      public SGDefaultToolbarBuilder()
      Construct the default implementation of SGToolbarBuilder.
  • Method Details

    • buildToolbarButton

      public SGButton buildToolbarButton(int slot, int page, SGToolbarButtonType type, SGMenu menu)
      Description copied from interface: SGToolbarBuilder
      Specifies the toolbar button builder for an SGMenu. This can be customized to render different toolbar buttons for a GUI.
      Specified by:
      buildToolbarButton in interface SGToolbarBuilder
      Parameters:
      slot - The slot being rendered.
      page - The current page of the inventory being rendered.
      type - The default button type of the current slot.
      menu - The inventory the toolbar is being rendered in.
      Returns:
      The button to be rendered for that slot, or null if no button should be rendered.