Package de.clickism.clickgui.menu
Class MenuView
java.lang.Object
de.clickism.clickgui.menu.MenuView
Represents a menu view.
-
Constructor Summary
ConstructorsConstructorDescriptionMenuView(Menu menu, org.bukkit.inventory.Inventory inventory, MenuManager menuManager) Creates a new menu view. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the menu.org.bukkit.inventory.InventoryGets the inventory.getMenu()Gets the menu.Gets the menu manager.org.bukkit.entity.PlayerGets the player viewing the menu.protected voidonClick(org.bukkit.event.inventory.InventoryClickEvent event) Handles a click event on the menu view.protected voidonClose()Handles the closing of the menu view.protected voidonDrag(org.bukkit.event.inventory.InventoryDragEvent event) Handles a drag event on the menu view.voidOpens the given menu.voidrefresh()Refreshes all buttons in the menu.voidrefresh(int slot) Refreshes the button at the given slot.voidreopen()Opens the menu of the menu view again.
-
Constructor Details
-
Method Details
-
close
public void close()Closes the menu. -
reopen
public void reopen()Opens the menu of the menu view again. -
refresh
public void refresh(int slot) Refreshes the button at the given slot.- Parameters:
slot- the slot to refresh
-
refresh
public void refresh()Refreshes all buttons in the menu. -
onClick
protected void onClick(org.bukkit.event.inventory.InventoryClickEvent event) Handles a click event on the menu view.- Parameters:
event- the event to handle
-
onDrag
protected void onDrag(org.bukkit.event.inventory.InventoryDragEvent event) Handles a drag event on the menu view.- Parameters:
event- the event to handle
-
onClose
protected void onClose()Handles the closing of the menu view. -
getPlayer
public org.bukkit.entity.Player getPlayer()Gets the player viewing the menu.- Returns:
- the player
-
getMenu
Gets the menu.- Returns:
- the menu
-
getInventory
public org.bukkit.inventory.Inventory getInventory()Gets the inventory.- Returns:
- the inventory
-
getMenuManager
Gets the menu manager.- Returns:
- the menu manager
-