Package xyz.xenondevs.invui.window
Class WindowManager
java.lang.Object
xyz.xenondevs.invui.window.WindowManager
- All Implemented Interfaces:
org.bukkit.event.Listener
Manages all
Windows
and provides methods for searching them.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addWindow
(AbstractWindow window) Adds anAbstractWindow
to the list of windows.static WindowManager
Gets theWindowManager
instance or creates a new one if there isn't one.@Nullable Window
getOpenWindow
(org.bukkit.entity.Player player) Gets theWindow
thePlayer
has currently open.Deprecated.@Nullable Window
getWindow
(org.bukkit.inventory.Inventory inventory) Finds theWindow
to anInventory
.Gets a set of all openWindows
.void
removeWindow
(AbstractWindow window) Removes anAbstractWindow
from the list of windows.
-
Method Details
-
getInstance
Gets theWindowManager
instance or creates a new one if there isn't one.- Returns:
- The
WindowManager
instance
-
addWindow
Adds anAbstractWindow
to the list of windows. This method is usually called by theWindow
itself.- Parameters:
window
- TheAbstractWindow
to add
-
removeWindow
Removes anAbstractWindow
from the list of windows. This method is usually called by theWindow
itself.- Parameters:
window
- TheAbstractWindow
to remove
-
getWindow
Finds theWindow
to anInventory
.- Parameters:
inventory
- TheInventory
- Returns:
- The
Window
that belongs to thatInventory
-
getOpenWindow
Gets theWindow
thePlayer
has currently open.- Parameters:
player
- ThePlayer
- Returns:
- The
Window
thePlayer
has currently open
-
getWindows
Gets a set of all openWindows
.- Returns:
- A set of all
Windows
-
getOpenWindows
Deprecated.UsegetWindows()
insteadGets a set of all openWindows
.
-
getWindows()
instead