Class RequestTreeWindowModule
java.lang.Object
com.minecolonies.core.client.gui.modules.RequestTreeWindowModule
- All Implemented Interfaces:
IWindowModule,IWindowWithLayoutModule
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final recordRequest wrapper class used to construct the request tree. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final IColonyViewThe colony.protected final AbstractWindowSkeletonThe parenting window.protected com.ldtteam.blockui.views.ScrollingListScrolling list of the resources. -
Constructor Summary
ConstructorsConstructorDescriptionRequestTreeWindowModule(AbstractWindowSkeleton parent, IColonyView colony) Constructor to initiate the window request tree windows. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAfter request cancel has been clicked cancel it and update the server side.protected booleanIf the request can show child requests as well.protected List<RequestTreeWindowModule.RequestWrapper> Internal method that allows safe reloading of the open requests.final @NotNull net.minecraft.resources.ResourceLocationGet the layout used for rendering.protected abstract Collection<IRequest<?>> Get the open requests for this module to handle.final booleanisCancellable(IRequest<?> request) Checks if the request is cancellablebooleanisFulfillable(IRequest<?> request) Checks if the request is fulfillableprotected voidAdditional call to execute upon cancellation of a request.voidFulfills, needs to be implemented by windows that can do it.voidonLayoutMounted(com.ldtteam.blockui.Pane rootPane) Called after the layout is mounted to the parenting window.voidonUpdate()Called upon each render frame to update the window.final voidopenDetails(IRequest<?> request) Open the detail page for a given request.final voidRefresh the map of open requests.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.core.client.gui.modules.IWindowModule
onButtonClicked, onClosed, onOpened
-
Field Details
-
parent
The parenting window. -
colony
The colony. -
resourceList
protected com.ldtteam.blockui.views.ScrollingList resourceListScrolling list of the resources.
-
-
Constructor Details
-
RequestTreeWindowModule
Constructor to initiate the window request tree windows.- Parameters:
parent- the parenting window.colony- the colony we're located in.
-
-
Method Details
-
onLayoutMounted
public void onLayoutMounted(com.ldtteam.blockui.Pane rootPane) Description copied from interface:IWindowWithLayoutModuleCalled after the layout is mounted to the parenting window.- Specified by:
onLayoutMountedin interfaceIWindowWithLayoutModule- Parameters:
rootPane- the root pane that was made from the layout.
-
getLayout
@NotNull public final @NotNull net.minecraft.resources.ResourceLocation getLayout()Description copied from interface:IWindowWithLayoutModuleGet the layout used for rendering.- Specified by:
getLayoutin interfaceIWindowWithLayoutModule- Returns:
- the id of the layout file.
-
onUpdate
public void onUpdate()Description copied from interface:IWindowModuleCalled upon each render frame to update the window.- Specified by:
onUpdatein interfaceIWindowModule
-
refreshOpenRequests
public final void refreshOpenRequests()Refresh the map of open requests. -
getCachedOpenRequests
Internal method that allows safe reloading of the open requests.- Returns:
- the list of requests.
-
isCancellable
Checks if the request is cancellable- Parameters:
request- the request to check if it's cancellable
-
isFulfillable
Checks if the request is fulfillable- Parameters:
request- the request to check if it's fulfillable
-
onFulfill
Fulfills, needs to be implemented by windows that can do it.- Parameters:
request- the request to fulfill.
-
getOpenRequests
Get the open requests for this module to handle.- Returns:
- an immutable list containing it.
-
canDisplayChildRequests
protected boolean canDisplayChildRequests()If the request can show child requests as well.- Returns:
- true if so.
-
cancel
After request cancel has been clicked cancel it and update the server side.- Parameters:
request- the request to cancel.
-
onCancel
Additional call to execute upon cancellation of a request. -
openDetails
Open the detail page for a given request.- Parameters:
request- the request instance.
-