Class RequestTreeWindowModule

java.lang.Object
com.minecolonies.core.client.gui.modules.RequestTreeWindowModule
All Implemented Interfaces:
IWindowModule, IWindowWithLayoutModule

public abstract class RequestTreeWindowModule extends Object implements IWindowWithLayoutModule
  • Field Details

    • parent

      protected final AbstractWindowSkeleton parent
      The parenting window.
    • colony

      protected final IColonyView colony
      The colony.
    • resourceList

      protected com.ldtteam.blockui.views.ScrollingList resourceList
      Scrolling list of the resources.
  • Constructor Details

    • RequestTreeWindowModule

      public RequestTreeWindowModule(AbstractWindowSkeleton parent, IColonyView colony)
      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: IWindowWithLayoutModule
      Called after the layout is mounted to the parenting window.
      Specified by:
      onLayoutMounted in interface IWindowWithLayoutModule
      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: IWindowWithLayoutModule
      Get the layout used for rendering.
      Specified by:
      getLayout in interface IWindowWithLayoutModule
      Returns:
      the id of the layout file.
    • onUpdate

      public void onUpdate()
      Description copied from interface: IWindowModule
      Called upon each render frame to update the window.
      Specified by:
      onUpdate in interface IWindowModule
    • refreshOpenRequests

      public final void refreshOpenRequests()
      Refresh the map of open requests.
    • isCancellable

      public final boolean isCancellable(IRequest<?> request)
      Checks if the request is cancellable
      Parameters:
      request - the request to check if it's cancellable
    • isFulfillable

      public final boolean isFulfillable(IRequest<?> request)
      Checks if the request is fulfillable
      Parameters:
      request - the request to check if it's fulfillable
    • getOpenRequests

      protected abstract Collection<IRequest<?>> 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

      public final void cancel(@NotNull @NotNull IRequest<?> request)
      After request cancel has been clicked cancel it and update the server side.
      Parameters:
      request - the request to cancel.
    • onCancel

      protected void onCancel(@NotNull @NotNull IRequest<?> request)
      Additional call to execute upon cancellation of a request.
    • openDetails

      public final void openDetails(IRequest<?> request)
      Open the detail page for a given request.
      Parameters:
      request - the request instance.