org.jboss.aesh.console
public class Console extends Object
Modifier and Type | Method and Description |
---|---|
void |
addCompletion(Completion completion)
Add a Completion to the completion list
|
void |
addCompletions(List<Completion> completionList)
Add a list of completions to the completion list
|
protected void |
attachProcess(ConsoleCommand cc)
Used by ConsoleCommand to attach itself to the Console
|
void |
clear()
Clear a ansi terminal
|
void |
clear(boolean includeBuffer)
Clear an ansi terminal.
|
History |
getHistory()
Get the History object
|
Terminal |
getTerminal() |
TerminalSize |
getTerminalSize() |
boolean |
isRunning() |
void |
moveCursor(int where) |
void |
pushToStdErr(char[] input) |
void |
pushToStdErr(String input) |
void |
pushToStdOut(char[] input) |
void |
pushToStdOut(String input)
Push text to the console, note that this will not update the internal
cursor position.
|
ConsoleOutput |
read(Prompt prompt,
Character mask)
Read from the input stream, perform action according to mapped
operations/completions/etc
Return the stream when a new line is found.
|
ConsoleOutput |
read(String prompt)
Read from the input stream, perform action according to mapped
operations/completions/etc
Return the stream when a new line is found.
|
void |
reset(Settings settings)
Reset the Console with Settings
Can only be called after stop()
|
void |
stop()
Stop the Console, close streams, and reset terminals.
|
public Console() throws IOException
IOException
public Console(Settings settings) throws IOException
IOException
public void reset(Settings settings) throws IOException
settings
- with given settingsIOException
- streampublic TerminalSize getTerminalSize()
public History getHistory()
public void pushToStdOut(String input) throws IOException
input
- textIOException
- streampublic void pushToStdOut(char[] input) throws IOException
input
- charsIOException
- streampushToStdOut(java.lang.String)
public void pushToStdErr(String input) throws IOException
IOException
public void pushToStdErr(char[] input) throws IOException
IOException
public void addCompletion(Completion completion)
completion
- comppublic void addCompletions(List<Completion> completionList)
completionList
- compspublic void stop() throws IOException
IOException
- streampublic boolean isRunning()
protected void attachProcess(ConsoleCommand cc) throws IOException
cc
- commandIOException
- streampublic Terminal getTerminal()
public ConsoleOutput read(String prompt) throws IOException
prompt
- starting promptIOException
- streampublic ConsoleOutput read(Prompt prompt, Character mask) throws IOException
prompt
- starting promptmask
- if set typed chars will be masked with this specified charIOException
- streampublic final void moveCursor(int where) throws IOException
IOException
public void clear() throws IOException
IOException
- streampublic void clear(boolean includeBuffer) throws IOException
includeBuffer
- if true include the current buffer lineIOException
- streamCopyright © 2015 JBoss by Red Hat. All rights reserved.