public interface IFContext extends VirtualView, StateValueHost, ComponentContainer
| Modifier and Type | Method and Description |
|---|---|
void |
addComponent(@NotNull Component component)
Adds a new component to this context.
|
void |
addViewer(@NotNull Viewer viewer)
Adds a new viewer to this context.
|
void |
closeForEveryone()
Closes this context's container to all viewers who are viewing it.
|
java.util.List<Component> |
getComponentsAt(int position)
Gets the component that is at a certain position.
|
@NotNull ViewConfig |
getConfig()
The configuration for this context.
|
@NotNull java.util.UUID |
getId()
An unique id for this context.
|
@NotNull java.util.Map<java.lang.String,Viewer> |
getIndexedViewers()
A Map containing all viewers in that context.
|
java.lang.Object |
getInitialData()
Data defined when a context is created, usually this is data set when the context is
opened for a viewer.
|
@NotNull java.lang.String |
getInitialTitle()
The initial title of this context, that is, even if it has been changed, it will return the
title that has been initially defined.
|
@NotNull RootView |
getRoot()
View root from which this context originated.
|
@NotNull @UnmodifiableView java.util.List<Viewer> |
getViewers()
An unmodifiable copy of all viewers that are tied to this context.
|
boolean |
isActive()
This is an internal inventory-framework API that should not be used from outside of
this library.
|
boolean |
isShared()
This 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.
|
void |
openForEveryone(@NotNull java.lang.Class<? extends RootView> other)
Opens a new view for all viewers in that context.
|
void |
openForEveryone(@NotNull java.lang.Class<? extends RootView> other,
java.lang.Object initialData)
Opens a new view for all viewers in that context with an initially defined data.
|
void |
removeComponent(@NotNull Component component)
Removes a component from this context.
|
void |
removeViewer(@NotNull Viewer viewer)
Removes a new viewer to this context.
|
void |
renderComponent(@NotNull Component component)
Renders a component in this context.
|
void |
resetTitleForEveryone()
Updates the container title to all viewers in this context, to the initially defined title.
|
void |
setActive(boolean active)
This is an internal inventory-framework API that should not be used from outside of
this library.
|
void |
setInitialData(java.lang.Object initialData)
This 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.
|
void |
update()
Updates all components for all viewers in this context.
|
void |
updateComponent(@NotNull Component component,
boolean force)
Updates a component in this context.
|
void |
updateTitleForEveryone(@NotNull java.lang.String title)
Updates the container title for everyone that's viewing it.
|
getInternalStateValue, getRawStateValue, getStateValues, getUninitializedStateValue, initializeState, updateState, watchStategetComponents, getInternalComponents@ApiStatus.Internal @NotNull @NotNull java.util.UUID getId()
This is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
@NotNull @NotNull ViewConfig getConfig()
By default, contexts inherit their root configuration.
@NotNull @NotNull @UnmodifiableView java.util.List<Viewer> getViewers()
@NotNull @ApiStatus.Internal @NotNull java.util.Map<java.lang.String,Viewer> getIndexedViewers()
This is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
@ApiStatus.Internal
void addViewer(@NotNull
@NotNull Viewer viewer)
This is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
viewer - The viewer that'll be added.@ApiStatus.Internal
void removeViewer(@NotNull
@NotNull Viewer viewer)
This is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
viewer - The viewer that'll be removed.@NotNull @NotNull RootView getRoot()
@NotNull @NotNull java.lang.String getInitialTitle()
@ApiStatus.Internal java.util.List<Component> getComponentsAt(int position)
This is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
position - The position.null.@ApiStatus.Internal
void addComponent(@NotNull
@NotNull Component component)
This is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
component - The component to be added.@ApiStatus.Internal
void removeComponent(@NotNull
@NotNull Component component)
This is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
component - The component to be removed.@ApiStatus.Internal
void renderComponent(@NotNull
@NotNull Component component)
This is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
component - The component to be rendered.@ApiStatus.Internal
void updateComponent(@NotNull
@NotNull Component component,
boolean force)
This is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
component - The component to be updated.force - If update should be forced.void update()
java.lang.Object getInitialData()
@ApiStatus.Internal void setInitialData(java.lang.Object initialData)
@ApiStatus.Experimental boolean isShared()
This 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.
void updateTitleForEveryone(@NotNull
@NotNull java.lang.String title)
This should not be used before the container is opened, if you need to set the __initial
title__ use IFOpenContext.modifyConfig() on open handler instead.
This method is version dependant, so it may be that your server version is not yet supported, if you try to use this method and fail (can fail silently), report it to the library developers to add support to your version.
title - The new container title.void resetTitleForEveryone()
updateTitleForEveryone(String) to take effect.void closeForEveryone()
void openForEveryone(@NotNull
@NotNull java.lang.Class<? extends RootView> other)
This context will be immediately invalidated if there are no viewers left after opening.
other - The view to be opened.void openForEveryone(@NotNull
@NotNull java.lang.Class<? extends RootView> other,
java.lang.Object initialData)
This context will be immediately invalidated if there are no viewers left after opening.
other - The view to be opened.initialData - The initial data.@ApiStatus.Internal boolean isActive()
@ApiStatus.Internal void setActive(boolean active)