Package org.wildfly.security.tool.help
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 Summary
Constructors Constructor Description HelpSection()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidappendGap(StringBuilder text, int gapWidth)Appends a gap of certain widthprotected intcheckForWhitespaceIndex(CharSequence text, int maxWidth)Finds the index of text that still fits on a single line and is a whitespace.protected voidformatAndPrintSectionContext(CharSequence text)Formats and prints a simple block of text For printing commands seeCommandsSectionprotected voidformatAndPrintTitle(String sectionTitle)Formats and prints headers across all sectionsabstract voidprintHelp()Displays help of specific section
-
-
-
Method Detail
-
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 seeCommandsSection- 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 iteratemaxWidth- 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 appendedgapWidth- Width of the gap
-
-