jline
public abstract class Terminal extends Object implements ConsoleOperations
Method Summary | |
---|---|
void | afterReadLine(ConsoleReader reader, String prompt, Character mask)
Invokes after the console reads a line with the prompt and mask. |
void | beforeReadLine(ConsoleReader reader, String prompt, Character mask)
Invokes before the console reads a line with the prompt and mask. |
abstract void | disableEcho()
Disable character echoing. |
abstract void | enableEcho()
Enable character echoing. |
InputStream | getDefaultBindings() |
abstract boolean | getEcho()
Returns true if the terminal will echo all characters type. |
static Terminal | getTerminal() |
abstract int | getTerminalHeight()
Returns the current height of the terminal (in lines) |
abstract int | getTerminalWidth()
Returns the current width of the terminal (in characters) |
abstract void | initializeTerminal()
Initialize any system settings
that are required for the console to be able to handle
input correctly, such as setting tabtop, buffered input, and
character echo. |
boolean | isANSISupported()
Returns true if the current console supports ANSI
codes. |
abstract boolean | isEchoEnabled()
Returns false if character echoing is disabled. |
abstract boolean | isSupported()
Returns true if this terminal is capable of initializing the
terminal to use jline. |
int | readCharacter(InputStream in)
Read a single character from the input stream. |
int | readVirtualKey(InputStream in)
Reads a virtual key from the console. |
static void | resetTerminal()
Reset the current terminal to null. |
static Terminal | setupTerminal() Configure and return the Terminal instance for the current platform. |
See Also: Terminal
Parameters: in the InputStream to read from
Returns: the virtual key (e.g., ConsoleOperations)
Configure and return the Terminal instance for the current platform. This will initialize any system settings that are required for the console to be able to handle input correctly, such as setting tabtop, buffered input, and character echo.
This class will use the Terminal implementation specified in the jline.terminal system property, or, if it is unset, by detecting the operating system from the os.name system property and instantiating either the WindowsTerminalTest or UnixTerminal.
See Also: Terminal