Class ItemDisplay
java.lang.Object
com.ultikits.ultitools.abstracts.gui.declarative.core.Widget
com.ultikits.ultitools.abstracts.gui.declarative.core.RenderObjectWidget
com.ultikits.ultitools.abstracts.gui.declarative.widgets.ItemDisplay
An immutable item description displayed at a grid slot; its icon is never takeable.
Names and lore belong to the
ItemSpec and are rendered for the viewer by the UI backend.- Since:
- 6.2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA reusable builder for an item display. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable GridActionprivate final ItemSpecprivate final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ItemDisplay.Builder@NotNull RenderObjectElementCreates the Element corresponding to this Widget.@Nullable GridActiongetIcon()intgetSlot()
-
Field Details
-
icon
-
slot
private final int slot -
clickHandler
-
-
Constructor Details
-
ItemDisplay
-
-
Method Details
-
builder
- Parameters:
icon- the immutable item description @return a new builder
-
getIcon
- Returns:
- the immutable item description
-
getSlot
public int getSlot()- Returns:
- the zero-based grid slot
-
getClickHandler
- Returns:
- the optional action, independent of inventory events
-
createElement
Description copied from class:WidgetCreates the Element corresponding to this Widget.This is a framework-internal method; subclasses should return the Element implementation appropriate to the Widget type.
- StatelessWidget returns a
StatelessElement - StatefulWidget returns a
StatefulElement - RenderObjectWidget returns a
RenderObjectElement
- Specified by:
createElementin classRenderObjectWidget- Returns:
- the corresponding Element instance
- StatelessWidget returns a
-