Package xyz.xenondevs.invui.item.impl
Class AbstractItem
java.lang.Object
xyz.xenondevs.invui.item.impl.AbstractItem
- All Implemented Interfaces:
Item
- Direct Known Subclasses:
AsyncItem
,AutoCycleItem
,ControlItem
,CycleItem
,SimpleItem
,SuppliedItem
An abstract implementation of the
Item
interface.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addWindow
(AbstractWindow window) Adds anAbstractWindow
to the window set, telling theItem
that it is currently being displayed in thatAbstractWindow
.void
Calls a refresh method on everyWindow
in which thisItem
is displayed, notifying them that theItemProvider
has been updated, thus theItemStack
inside theWindow
'sInventory
should be replaced.void
removeWindow
(AbstractWindow window) Removes anAbstractWindow
from the window set, telling theItem
that it is no longer being displayed in thatAbstractWindow
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface xyz.xenondevs.invui.item.Item
getItemProvider, getItemProvider, handleClick
-
Constructor Details
-
AbstractItem
public AbstractItem()
-
-
Method Details
-
addWindow
Description copied from interface:Item
Adds anAbstractWindow
to the window set, telling theItem
that it is currently being displayed in thatAbstractWindow
.- Specified by:
addWindow
in interfaceItem
- Parameters:
window
- TheAbstractWindow
theItem
is currently displayed in.
-
removeWindow
Description copied from interface:Item
Removes anAbstractWindow
from the window set, telling theItem
that it is no longer being displayed in thatAbstractWindow
.- Specified by:
removeWindow
in interfaceItem
- Parameters:
window
- TheAbstractWindow
theItem
is no longer displayed in.
-
getWindows
Description copied from interface:Item
- Specified by:
getWindows
in interfaceItem
- Returns:
- An immutable view of the
Set
of all theWindow
s where thisItem
is displayed in.
-
notifyWindows
public void notifyWindows()Description copied from interface:Item
Calls a refresh method on everyWindow
in which thisItem
is displayed, notifying them that theItemProvider
has been updated, thus theItemStack
inside theWindow
'sInventory
should be replaced.- Specified by:
notifyWindows
in interfaceItem
-