Package org.wildfly.security.tool.help
Class HelpSection
java.lang.Object
org.wildfly.security.tool.help.HelpSection
- Direct Known Subclasses:
CommandsSection,DescriptionSection,OptionsSection,UsageSection
General section of Elytron help command
All Elytron help command sections should extend this one
- Author:
- Petr Beran
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 voidFormats and prints a simple block of text For printing commands seeCommandsSectionprotected voidformatAndPrintTitle(String sectionTitle) Formats and prints headers across all sectionsabstract voidDisplays help of specific section
-
Constructor Details
-
HelpSection
public HelpSection()
-
-
Method Details
-
printHelp
public abstract void printHelp()Displays help of specific section -
formatAndPrintSectionContext
Formats and prints a simple block of text For printing commands seeCommandsSection- Parameters:
text- Text to print
-
formatAndPrintTitle
Formats and prints headers across all sections- Parameters:
sectionTitle- Title to format and print
-
checkForWhitespaceIndex
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
Appends a gap of certain width- Parameters:
text- Text to which the gap should be appendedgapWidth- Width of the gap
-