public class ConsoleMenu extends Object
Constructor and Description |
---|
ConsoleMenu(Repeater containingObject) |
Modifier and Type | Method and Description |
---|---|
void |
addMenuItem(String menuDisplay,
String methodName,
boolean repeat)
add an entry in the menu, sequentially
|
void |
displayMenu()
display the menu, the application goes into a loop which provides the
menu and fires the entries selected.
|
static BigDecimal |
getBigDecimal(String title,
BigDecimal defaultValue)
Gets an BigDecimal from the System.in
|
static boolean |
getBoolean(String title,
boolean defaultValue)
Gets a boolean from the System.in
|
static Date |
getDate(String title,
Date defaultValue) |
static int |
getInt(String title,
int defaultValue)
Gets an int from the System.in
|
static String |
getPassword(String prompt) |
static String |
getString(String msg)
Gets a String from the System.in.
|
static String |
getString(String msg,
String defaultVal)
Gets a String from the System.in
|
static LocalDate |
getYMD(String title,
LocalDate defaultValue) |
static String |
selectOne(String title,
String[] optionNames,
String[] optionValues,
int defaultOption)
Generates a menu with a list of options and return the value selected.
|
void |
setScreenColumns(int width) |
public ConsoleMenu(Repeater containingObject)
containingObject
- the object that will be called back once an option is chosen
in the menupublic void addMenuItem(String menuDisplay, String methodName, boolean repeat)
menuDisplay
- how the entry will be displayed in the menumethodName
- name of the public methodrepeat
- call back for repeatpublic void setScreenColumns(int width)
public void displayMenu()
public static int getInt(String title, int defaultValue)
title
- for the command linedefaultValue
- defaultValue if title not foundpublic static boolean getBoolean(String title, boolean defaultValue)
title
- for the command linepublic static BigDecimal getBigDecimal(String title, BigDecimal defaultValue)
title
- for the command linepublic static String getString(String msg)
msg
- for the command linepublic static String getString(String msg, String defaultVal)
msg
- for the command linepublic static String selectOne(String title, String[] optionNames, String[] optionValues, int defaultOption)
title
- for the command lineoptionNames
- name for each optionoptionValues
- value for each optionCopyright © 2006–2022 Appendium - Portfolio Financing Platform. All rights reserved.