Package commandLineMenus
Interface MenuRenderer
-
public interface MenuRendererOverride it if you want to customize the display of the user dialog. A default implementation is provided with the package.- See Also:
MenuDefaultRenderer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Stringfooter()The string to print at the end of each menu.java.lang.Stringheader(java.lang.String title)Returns the header of the menu.java.lang.StringinputString()Inputs a string from the user.java.lang.StringinvalidInput(java.lang.String input)The string to print if the user made a wrong input.java.lang.StringmenusSeparator()The string to print between two menus.java.lang.Stringoption(java.lang.String shortcut, java.lang.String label)Prints an optionjava.lang.StringoptionsSeparator()The string to print between two options.voidoutputString(java.lang.String message)Outputs message to the user.java.lang.Stringprompt()The string to print to prompt the user for input.
-
-
-
Method Detail
-
outputString
void outputString(java.lang.String message)
Outputs message to the user.- Parameters:
message- The message to print.
-
inputString
java.lang.String inputString()
Inputs a string from the user.- Returns:
- The string input from the user.
-
header
java.lang.String header(java.lang.String title)
Returns the header of the menu.- Parameters:
title- The title that should appear in the header.- Returns:
- The string to print.
-
option
java.lang.String option(java.lang.String shortcut, java.lang.String label)Prints an option- Parameters:
shortcut- The shortcut to select this option.label- The label of the option.- Returns:
- The string to print.
-
optionsSeparator
java.lang.String optionsSeparator()
The string to print between two options.- Returns:
- The string to print.
-
footer
java.lang.String footer()
The string to print at the end of each menu.- Returns:
- The string to print.
-
menusSeparator
java.lang.String menusSeparator()
The string to print between two menus.- Returns:
- The string to print.
-
prompt
java.lang.String prompt()
The string to print to prompt the user for input.- Returns:
- The string to print.
-
invalidInput
java.lang.String invalidInput(java.lang.String input)
The string to print if the user made a wrong input.- Parameters:
input- The string input by the user.- Returns:
- The string to print
-
-