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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWindow(AbstractWindow window) Adds anAbstractWindowto the window set, telling theItemthat it is currently being displayed in thatAbstractWindow.voidCalls a refresh method on everyWindowin which thisItemis displayed, notifying them that theItemProviderhas been updated, thus theItemStackinside theWindow'sInventoryshould be replaced.voidremoveWindow(AbstractWindow window) Removes anAbstractWindowfrom the window set, telling theItemthat 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, waitMethods inherited from interface xyz.xenondevs.invui.item.Item
getItemProvider, getItemProvider, handleClick
-
Constructor Details
-
AbstractItem
public AbstractItem()
-
-
Method Details
-
addWindow
Description copied from interface:ItemAdds anAbstractWindowto the window set, telling theItemthat it is currently being displayed in thatAbstractWindow.- Specified by:
addWindowin interfaceItem- Parameters:
window- TheAbstractWindowtheItemis currently displayed in.
-
removeWindow
Description copied from interface:ItemRemoves anAbstractWindowfrom the window set, telling theItemthat it is no longer being displayed in thatAbstractWindow.- Specified by:
removeWindowin interfaceItem- Parameters:
window- TheAbstractWindowtheItemis no longer displayed in.
-
getWindows
Description copied from interface:Item- Specified by:
getWindowsin interfaceItem- Returns:
- An immutable view of the
Setof all theWindows where thisItemis displayed in.
-
notifyWindows
public void notifyWindows()Description copied from interface:ItemCalls a refresh method on everyWindowin which thisItemis displayed, notifying them that theItemProviderhas been updated, thus theItemStackinside theWindow'sInventoryshould be replaced.- Specified by:
notifyWindowsin interfaceItem
-