Package org.jline.consoleui.prompt
Class ConsolePrompt
java.lang.Object
org.jline.consoleui.prompt.ConsolePrompt
ConsolePrompt encapsulates the prompting of a list of input questions for the user.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConsoleUI configuration: colors, cursor pointer and selected/unselected/unavailable boxes. -
Constructor Summary
ConstructorsConstructorDescriptionConsolePrompt(org.jline.reader.LineReader reader, org.jline.terminal.Terminal terminal, ConsolePrompt.UiConfig config) ConsolePrompt(org.jline.terminal.Terminal terminal) ConsolePrompt(org.jline.terminal.Terminal terminal, ConsolePrompt.UiConfig config) -
Method Summary
Modifier and TypeMethodDescriptionCreates aPromptBuilder.prompt(List<PromptableElementIF> promptableElementList) Prompt a list of choices (questions).prompt(List<org.jline.utils.AttributedString> header, List<PromptableElementIF> promptableElementList) Prompt a list of choices (questions).
-
Constructor Details
-
ConsolePrompt
public ConsolePrompt(org.jline.terminal.Terminal terminal) - Parameters:
terminal- the terminal.
-
ConsolePrompt
- Parameters:
terminal- the terminal.config- ConsolePrompt cursor pointer and checkbox configuration
-
ConsolePrompt
public ConsolePrompt(org.jline.reader.LineReader reader, org.jline.terminal.Terminal terminal, ConsolePrompt.UiConfig config) - Parameters:
reader- the lineReader.terminal- the terminal.config- ConsolePrompt cursor pointer and checkbox configuration
-
-
Method Details
-
prompt
public Map<String,PromptResultItemIF> prompt(List<PromptableElementIF> promptableElementList) throws IOException Prompt a list of choices (questions). This method takes a list of promptable elements, typically created withPromptBuilder. Each of the elements is processed and the user entries and answers are filled in to the result map. The result map contains the key of each promptable element and the user entry as an object implementingPromptResultItemIF.- Parameters:
promptableElementList- the list of questions / prompts to ask the user for.- Returns:
- a map containing a result for each element of promptableElementList
- Throws:
IOException- may be thrown by terminal
-
prompt
public Map<String,PromptResultItemIF> prompt(List<org.jline.utils.AttributedString> header, List<PromptableElementIF> promptableElementList) throws IOException Prompt a list of choices (questions). This method takes a list of promptable elements, typically created withPromptBuilder. Each of the elements is processed and the user entries and answers are filled in to the result map. The result map contains the key of each promptable element and the user entry as an object implementingPromptResultItemIF.- Parameters:
header- info to be displayed before first prompt.promptableElementList- the list of questions / prompts to ask the user for.- Returns:
- a map containing a result for each element of promptableElementList
- Throws:
IOException- may be thrown by terminal
-
getPromptBuilder
Creates aPromptBuilder.- Returns:
- a new prompt builder object.
-