public class ItemComponent extends java.lang.Object implements Component, InteractionHandler
| Constructor and Description |
|---|
ItemComponent(VirtualView root,
int position,
java.lang.Object stack,
boolean cancelOnClick,
boolean closeOnClick,
java.util.function.Predicate<? extends IFContext> displayCondition,
java.util.function.Consumer<? super IFSlotRenderContext> renderHandler,
java.util.function.Consumer<? super IFSlotContext> updateHandler,
java.util.function.Consumer<? super IFSlotClickContext> clickHandler,
java.util.Set<State<?>> watching,
boolean isManagedExternally,
boolean updateOnClick,
boolean isVisible,
Ref<Component> reference) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear(@NotNull IFContext context)
Clears this component from the given context.
|
void |
clicked(@NotNull Component component,
@NotNull IFSlotClickContext context)
Called when a component is clicked.
|
boolean |
equals(java.lang.Object o) |
void |
forceUpdate()
Forces this component to be updated.
|
java.util.function.Consumer<? super IFSlotClickContext> |
getClickHandler() |
@NotNull InteractionHandler |
getInteractionHandler()
The interaction handler for this component.
|
java.lang.String |
getKey()
This is an internal inventory-framework API that should not be used from outside of
this library.
|
int |
getPosition()
The current position of this component relative to its root view.
|
Ref<Component> |
getReference()
Returns the reference assigned to this component.
|
java.util.function.Consumer<? super IFSlotRenderContext> |
getRenderHandler() |
@NotNull VirtualView |
getRoot()
The root of this component.
|
java.lang.Object |
getStack() |
java.util.function.Consumer<? super IFSlotContext> |
getUpdateHandler() |
java.util.Set<State<?>> |
getWatching() |
@UnmodifiableView java.util.Set<State<?>> |
getWatchingStates()
An unmodifiable set of all states that this component is watching.
|
int |
hashCode() |
void |
hide()
Hides this component.
|
boolean |
intersects(@NotNull Component other)
If this component are intersects with other component.
|
boolean |
isCancelOnClick() |
boolean |
isCloseOnClick() |
boolean |
isContainedWithin(int position)
Checks if this component is in a specific position.
|
boolean |
isManagedExternally()
This is an internal inventory-framework API that should not be used from outside of
this library.
|
boolean |
isUpdateOnClick() |
boolean |
isVisible()
If this component can be seen, it is used in interaction treatments to ensure that the viewer
does not interact with hidden components.
|
void |
render(@NotNull IFSlotRenderContext context)
Renders this component to the given context.
|
void |
setVisible(boolean visible)
Sets the visibility state of this component.
|
boolean |
shouldRender(IFContext context) |
void |
show()
Shows this component.
|
java.lang.String |
toString() |
void |
update()
Updates this component.
|
void |
updated(@NotNull IFSlotRenderContext context)
Called when this component is updated in the given context.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitintersectspublic ItemComponent(VirtualView root, int position, java.lang.Object stack, boolean cancelOnClick, boolean closeOnClick, java.util.function.Predicate<? extends IFContext> displayCondition, java.util.function.Consumer<? super IFSlotRenderContext> renderHandler, java.util.function.Consumer<? super IFSlotContext> updateHandler, java.util.function.Consumer<? super IFSlotClickContext> clickHandler, java.util.Set<State<?>> watching, boolean isManagedExternally, boolean updateOnClick, boolean isVisible, Ref<Component> reference)
public java.lang.String getKey()
Component@NotNull public @NotNull VirtualView getRoot()
Componentpublic int getPosition()
ComponentgetPosition in interface Componentpublic java.lang.Object getStack()
public boolean isCancelOnClick()
public boolean isCloseOnClick()
public boolean isUpdateOnClick()
public boolean shouldRender(IFContext context)
shouldRender in interface Componentpublic java.util.function.Consumer<? super IFSlotRenderContext> getRenderHandler()
public java.util.function.Consumer<? super IFSlotContext> getUpdateHandler()
public java.util.function.Consumer<? super IFSlotClickContext> getClickHandler()
public java.util.Set<State<?>> getWatching()
public boolean isContainedWithin(int position)
ComponentisContainedWithin in interface Componentposition - The position.public boolean intersects(@NotNull
@NotNull Component other)
Componentintersects in interface Componentother - The other component.@NotNull public @NotNull InteractionHandler getInteractionHandler()
ComponentgetInteractionHandler in interface Componentpublic void render(@NotNull
@NotNull IFSlotRenderContext context)
Componentpublic void updated(@NotNull
@NotNull IFSlotRenderContext context)
Componentpublic void clear(@NotNull
@NotNull IFContext context)
Componentpublic void update()
Componentpublic @UnmodifiableView java.util.Set<State<?>> getWatchingStates()
ComponentgetWatchingStates in interface Componentpublic void clicked(@NotNull
@NotNull Component component,
@NotNull
@NotNull IFSlotClickContext context)
InteractionHandlerclicked in interface InteractionHandlercomponent - The clicked component.context - The click context.public boolean isVisible()
Componentpublic void setVisible(boolean visible)
ComponentThis is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
setVisible in interface Componentvisible - If this component is visible.public boolean isManagedExternally()
ComponentThis is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
isManagedExternally in interface Componentpublic Ref<Component> getReference()
ComponentThis API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.
getReference in interface Componentpublic void forceUpdate()
ComponentThis API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.
forceUpdate in interface Componentpublic void hide()
ComponentThis API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.
public void show()
ComponentThis API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object