Class LimitedGUIPopulator
java.lang.Object
me.eddie.inventoryguiapi.gui.contents.LimitedGUIPopulator
- All Implemented Interfaces:
GUIPopulator
Responsible for Calculating the positions that GUIElements need to go into in the displayed, size-limited GUI,
adding page changing buttons if necessary and then updating the current inventory state.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenNextPageButton(InventoryGUI gui, GUISession session) Generate a new next page buttongenPrevPageButton(InventoryGUI gui, GUISession session) Generate a new previous page buttonvoidpopulateGUI(GUISession session, org.bukkit.entity.Player viewer, Callback<Void> callback) Gets, via GUI's contents provider, the items a player should be viewing; figures out what slots they should be displayed in within the inventory; updates the current InventoryState with this and then calls back to the callback.
-
Constructor Details
-
LimitedGUIPopulator
public LimitedGUIPopulator()
-
-
Method Details
-
populateGUI
public void populateGUI(GUISession session, org.bukkit.entity.Player viewer, Callback<Void> callback) Gets, via GUI's contents provider, the items a player should be viewing; figures out what slots they should be displayed in within the inventory; updates the current InventoryState with this and then calls back to the callback.- Specified by:
populateGUIin interfaceGUIPopulator- Parameters:
session- The GUISession of the GUI being populatedviewer- The viewer of the GUISessioncallback- Callback to be called back to on completion
-
genPrevPageButton
Generate a new previous page button- Parameters:
gui- The GUI to generate it forsession- The Session to generate it for- Returns:
- An ActionItem, without desired position, that when clicked will go back a page in the GUI
-
genNextPageButton
Generate a new next page button- Parameters:
gui- The GUI to generate it forsession- The Session to generate it for- Returns:
- An ActionItem, without desired position, that when clicked will go forward a page in the GUI
-