| java.lang.Object jline.Terminal
All known Subclasses: jline.UnixTerminal, jline.WindowsTerminal, jline.UnsupportedTerminal,
Terminal | abstract public class Terminal implements ConsoleOperations(Code) | | Representation of the input terminal for a platform. Handles
any initialization that the platform may need to perform
in order to allow the
ConsoleReader to correctly handle
input.
author: Marc Prud'hommeaux |
disableEcho | abstract public void disableEcho()(Code) | | Disable character echoing. This can be used to manually re-enable
character if the ConsoleReader has been disabled.
|
enableEcho | abstract public void enableEcho()(Code) | | Enable character echoing. This can be used to re-enable character
if the ConsoleReader is no longer being used.
|
getEcho | abstract public boolean getEcho()(Code) | | Returns true if the terminal will echo all characters type.
|
getTerminalHeight | abstract public int getTerminalHeight()(Code) | | Returns the current height of the terminal (in lines)
|
getTerminalWidth | abstract public int getTerminalWidth()(Code) | | Returns the current width of the terminal (in characters)
|
initializeTerminal | abstract public void initializeTerminal() throws Exception(Code) | | 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.
|
isANSISupported | public boolean isANSISupported()(Code) | | Returns true if the current console supports ANSI
codes.
|
isEchoEnabled | abstract public boolean isEchoEnabled()(Code) | | Returns false if character echoing is disabled.
|
isSupported | abstract public boolean isSupported()(Code) | | Returns true if this terminal is capable of initializing the
terminal to use jline.
|
readCharacter | public int readCharacter(InputStream in) throws IOException(Code) | | Read a single character from the input stream. This might
enable a terminal implementation to better handle nuances of
the console.
|
readVirtualKey | public int readVirtualKey(InputStream in) throws IOException(Code) | | Reads a virtual key from the console. Typically, this will
just be the raw character that was entered, but in some cases,
multiple input keys will need to be translated into a single
virtual key.
Parameters: in - the InputStream to read from the virtual key (e.g., ConsoleOperations.VK_UP) |
resetTerminal | public static void resetTerminal()(Code) | | Reset the current terminal to null.
|
setupTerminal | public static synchronized Terminal setupTerminal()(Code) | | 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.initializeTerminal |
|
|