Class HelpCoordinator<S extends Source>

java.lang.Object
studio.mevera.imperat.command.tree.help.HelpCoordinator<S>

public class HelpCoordinator<S extends Source> extends Object
  • Method Details

    • create

      public static <S extends Source> HelpCoordinator<S> create(TreeHelpVisitor<S> provider, HelpLayoutRenderer<S,?> renderer)
      A factory method to create a new HelpCoordinator with custom settings.
      Type Parameters:
      S - The type of the Source.
      Parameters:
      provider - The provider responsible for fetching help entries.
      renderer - The renderer responsible for displaying help entries.
      Returns:
      A new instance of HelpCoordinator.
    • create

      public static <S extends Source> HelpCoordinator<S> create()
      A factory method to create a new HelpCoordinator with default settings.
      Type Parameters:
      S - The type of the Source.
      Returns:
      A new instance of HelpCoordinator with default provider and renderer.
    • showHelp

      public <C> void showHelp(ExecutionContext<S> context, HelpQuery<S> query, HelpTheme<S,C> theme)
      Displays the help documentation based on the given context and query.

      This method fetches the relevant help entries, then uses the configured renderer to display the information to the source.

      Parameters:
      context - The execution context of the command.
      query - The help query, specifying what help information is needed.
      theme - The theme that controls how the help is displayed.