Class HelpSection

java.lang.Object
org.wildfly.security.tool.help.HelpSection
Direct Known Subclasses:
CommandsSection, DescriptionSection, OptionsSection, UsageSection

public abstract class HelpSection extends Object
General section of Elytron help command All Elytron help command sections should extend this one
Author:
Petr Beran
  • Constructor Details

    • HelpSection

      public HelpSection()
  • Method Details

    • printHelp

      public abstract void printHelp()
      Displays help of specific section
    • formatAndPrintSectionContext

      protected void formatAndPrintSectionContext(CharSequence text)
      Formats and prints a simple block of text For printing commands see CommandsSection
      Parameters:
      text - Text to print
    • formatAndPrintTitle

      protected void formatAndPrintTitle(String sectionTitle)
      Formats and prints headers across all sections
      Parameters:
      sectionTitle - Title to format and print
    • checkForWhitespaceIndex

      protected int checkForWhitespaceIndex(CharSequence text, int maxWidth)
      Finds the index of text that still fits on a single line and is a whitespace. We don't want to break words at the end of the line
      Parameters:
      text - Text to iterate
      maxWidth - Max width of the line, start of the iteration
      Returns:
      Last whitespace index before the end of the line
    • appendGap

      protected void appendGap(StringBuilder text, int gapWidth)
      Appends a gap of certain width
      Parameters:
      text - Text to which the gap should be appended
      gapWidth - Width of the gap