DEFAULT_DISPLAY_USAGE_SETTINGS
public static final Set DEFAULT_DISPLAY_USAGE_SETTINGS
The default DisplaySettings used to select the help lines in the main
body of help
DEFAULT_FULL_USAGE_SETTINGS
public static final Set DEFAULT_FULL_USAGE_SETTINGS
The default DisplaySettings used to select the elements to display in the
displayed line of full usage information.
DEFAULT_GUTTER_CENTER
public static final String DEFAULT_GUTTER_CENTER
The default screen furniture right of screen
DEFAULT_GUTTER_LEFT
public static final String DEFAULT_GUTTER_LEFT
The default screen furniture left of screen
DEFAULT_GUTTER_RIGHT
public static final String DEFAULT_GUTTER_RIGHT
The default screen furniture between columns
DEFAULT_LINE_USAGE_SETTINGS
public static final Set DEFAULT_LINE_USAGE_SETTINGS
The default DisplaySettings used to select the elements of usage per help
line in the main body of help
HelpFormatter
public HelpFormatter()
Creates a new HelpFormatter using the defaults
HelpFormatter
public HelpFormatter(String gutterLeft,
String gutterCenter,
String gutterRight,
int fullWidth)
Creates a new HelpFormatter using the specified parameters
gutterLeft
- the string marking left of screengutterCenter
- the string marking center of screengutterRight
- the string marking right of screenfullWidth
- the width of the screen
HelpFormatter
public HelpFormatter(String gutterLeft,
String gutterCenter,
String gutterRight,
int fullWidth,
int descriptionWidth)
Creates a new HelpFormatter using the specified parameters
gutterLeft
- the string marking left of screengutterCenter
- the string marking center of screengutterRight
- the string marking right of screenfullWidth
- the width of the screendescriptionWidth
- the minimum description width
getComparator
public Comparator getComparator()
Return the comparator.
- the Comparator used to sort the Group
getDisplaySettings
public Set getDisplaySettings()
Return the display settings.
- the DisplaySettings used to select HelpLines
getDivider
public String getDivider()
Return the divider.
- the String used as a horizontal section m_divider
getFooter
public String getFooter()
Return the footer text.
- the help screen footer text
getFullUsageSettings
public Set getFullUsageSettings()
Return the full usage display settings.
- the DisplaySettings used in the full usage string
getGroup
public Group getGroup()
Return the group.
- the group documented by this HelpFormatter
getGutterCenter
public String getGutterCenter()
Return the gutter center string.
- the String used as the central gutter
getGutterLeft
public String getGutterLeft()
Return the gutter left string.
- the String used as the left gutter
getGutterRight
public String getGutterRight()
Return the gutter right string.
- the String used as the right gutter
getHeader
public String getHeader()
Return the header string.
- the help screen header text
getLineUsageSettings
public Set getLineUsageSettings()
Return the line usage settings.
- the DisplaySettings used in the per help line usage strings
getPageWidth
public int getPageWidth()
Return the page width.
- the width of the screen in characters
getPrintWriter
public PrintWriter getPrintWriter()
Return the print writer.
- the PrintWriter that will be written to
getShellCommand
public String getShellCommand()
Return the shell command.
- the command used to execute the application
pad
protected static void pad(String text,
int width,
Writer writer)
throws IOException
Pad the supplied string.
text
- the text to padwidth
- the padding widthwriter
- the writer
print
public void print()
throws IOException
Prints the Option help.
printDivider
public void printDivider()
Prints the m_divider text
printException
public void printException()
throws IOException
Prints any error message.
printFooter
public void printFooter()
throws IOException
Prints a m_footer string if necessary
printHeader
public void printHeader()
throws IOException
Prints a m_header string if necessary
printHelp
public void printHelp()
throws IOException
Prints detailed help per option.
printUsage
public void printUsage()
throws IOException
Prints a single line of usage information (wrapping if necessary)
printWrapped
protected void printWrapped(String text)
throws IOException
Prints a string wrapped if necessary
text
- the string to wrap
setComparator
public void setComparator(Comparator comparator)
The Comparator to use when sorting Options
comparator
- Comparator to use when sorting Options
setDisplaySettings
public void setDisplaySettings(Set displaySettings)
The DisplaySettings used to select the help lines in the main body of
help
displaySettings
- the settings to use
setDivider
public void setDivider(String divider)
Sets the string to use as a m_divider between sections of help
divider
- the dividing string
setFooter
public void setFooter(String footer)
Sets the footer text of the help screen
setFullUsageSettings
public void setFullUsageSettings(Set fullUsageSettings)
The DisplaySettings used to select the elements to display in the
displayed line of full usage information.
fullUsageSettings
- the full usage settings
setGroup
public void setGroup(Group group)
Sets the Group of Options to document
group
- the options to document
setHeader
public void setHeader(String header)
Sets the header text of the help screen
header
- the m_footer text
setLineUsageSettings
public void setLineUsageSettings(Set lineUsageSettings)
Sets the DisplaySettings used to select elements in the per helpline
usage strings.
lineUsageSettings
- the DisplaySettings to use
setPrintWriter
public void setPrintWriter(PrintWriter out)
Set the print writer.
out
- the PrintWriter to write to
setShellCommand
public void setShellCommand(String shellCommand)
Sets the command string used to invoke the application
shellCommand
- the invocation command
wrap
protected static List wrap(String text,
int width)
Return a list of strings resulting from the wrapping of a supplied
target string.
text
- the target string to wrapwidth
- the wrappping width
- the list of wrapped fragments