public class ReadlineConsole extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ReadlineConsole.Settings |
static class |
ReadlineConsole.SettingsBuilder |
| Modifier and Type | Method and Description |
|---|---|
void |
addCompleter(org.aesh.readline.completion.Completion<? extends org.aesh.readline.completion.CompleteOperation> completer) |
void |
clearScreen() |
void |
forcePagingOutput(boolean forcePaging) |
String |
formatColumns(Collection<String> list) |
org.aesh.terminal.Connection |
getConnection() |
CommandHistory |
getHistory() |
org.aesh.readline.Prompt |
getPrompt() |
int |
getTerminalHeight() |
int |
getTerminalWidth() |
String |
handleBuiltins(String line) |
boolean |
isPagingOutputActive() |
boolean |
isPagingOutputEnabled()
Public for testing purpose only.
|
void |
print(String line,
boolean collect) |
void |
printNewLine(boolean collect) |
int[] |
read() |
org.aesh.readline.terminal.Key |
readKey() |
String |
readLine(org.aesh.readline.Prompt prompt) |
String |
readLine(org.aesh.readline.Prompt prompt,
org.aesh.readline.completion.Completion completer) |
String |
readLine(String prompt) |
String |
readLine(String prompt,
Character mask)
Prompt a user.
|
boolean |
running() |
void |
setActionCallback(Consumer<String> callback) |
void |
setCompletionHandler(org.aesh.readline.completion.CompletionHandler<? extends org.aesh.readline.completion.CompleteOperation> ch)
This has the side effect to create the internal readline instance.
|
void |
setPrompt(org.aesh.readline.Prompt prompt) |
void |
setPrompt(String prompt) |
void |
start() |
void |
stop() |
public void setCompletionHandler(org.aesh.readline.completion.CompletionHandler<? extends org.aesh.readline.completion.CompleteOperation> ch)
ch - The Completion Handler.public void addCompleter(org.aesh.readline.completion.Completion<? extends org.aesh.readline.completion.CompleteOperation> completer)
public CommandHistory getHistory()
public void clearScreen()
public String formatColumns(Collection<String> list)
public void print(String line, boolean collect)
public org.aesh.readline.terminal.Key readKey()
throws InterruptedException,
IOException
InterruptedExceptionIOExceptionpublic int[] read()
throws InterruptedException,
IOException
InterruptedExceptionIOExceptionpublic void printNewLine(boolean collect)
public String readLine(String prompt) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic String readLine(String prompt, Character mask) throws InterruptedException, IOException
We have 2 cases.
1) prompting prior to have started the console: - Must start a new connection. - Make it non blocking. - Wait on latch to resync and to catch Thread.interrupt.
2) prompting after to have started the console: - No need to open the connection. - Wait on latch to resync and to catch Thread.interrupt.
prompt - mask - IOExceptionInterruptedExceptionpublic String readLine(org.aesh.readline.Prompt prompt) throws InterruptedException, IOException
InterruptedExceptionIOExceptionpublic String readLine(org.aesh.readline.Prompt prompt, org.aesh.readline.completion.Completion completer) throws InterruptedException, IOException
InterruptedExceptionIOExceptionpublic int getTerminalWidth()
public int getTerminalHeight()
public void start()
throws IOException
IOExceptionpublic void stop()
public boolean running()
public void setPrompt(String prompt)
public void setPrompt(org.aesh.readline.Prompt prompt)
public boolean isPagingOutputEnabled()
public boolean isPagingOutputActive()
public void forcePagingOutput(boolean forcePaging)
public org.aesh.readline.Prompt getPrompt()
public org.aesh.terminal.Connection getConnection()
Copyright © 2018 JBoss by Red Hat. All rights reserved.