Logo Search packages:      
Sourcecode: jline version File versions  Download package

jline::WindowsTerminal Class Reference

Inheritance diagram for jline::WindowsTerminal:

jline::Terminal jline::ConsoleOperations

List of all members.


Detailed Description

Terminal implementation for Microsoft Windows. Terminal initialization in initializeTerminal is accomplished by extracting the jline_version.dll, saving it to the system temporary directoy (determined by the setting of the java.io.tmpdir System property), loading the library, and then calling the Win32 APIs SetConsoleMode and GetConsoleMode to disable character echoing.

By default, the readCharacter method will attempt to test to see if the specified InputStream is System#in or a wrapper around FileDescriptor#in, and if so, will bypass the character reading to directly invoke the readc() method in the JNI library. This is so the class can read special keys (like arrow keys) which are otherwise inaccessible via the System#in stream. Using JNI reading can be bypassed by setting the jline.WindowsTerminal.disableDirectConsole system property to true.

Author:
Marc Prud'hommeaux

Definition at line 75 of file WindowsTerminal.java.


Public Member Functions

Boolean getDirectConsole ()
boolean getEcho ()
int getTerminalHeight ()
int getTerminalWidth ()
void initializeTerminal () throws Exception
boolean isANSISupported ()
boolean isSupported ()
int readCharacter (final InputStream in) throws IOException
int readVirtualKey (InputStream in) throws IOException
void setDirectConsole (Boolean directConsole)

Static Public Member Functions

static Terminal getTerminal ()
static synchronized Terminal setupTerminal ()

Public Attributes

short ADD = -42
char BACKSPACE = '\b'
short CHANGE_CASE = -57
short CHANGE_META = -44
short CLEAR_SCREEN = -8
short COMPLETE = -58
char CTRL_B = 2
char CTRL_F = 6
char CTRL_N = 14
char CTRL_P = 16
short DELETE_META = -45
short DELETE_NEXT_CHAR = -56
short DELETE_PREV_CHAR = -41
short DELETE_PREV_WORD = -16
short END_WORD = -46
short EXIT = -59
short INSERT = -48
char KEYBOARD_BELL = '\07'
short KILL_LINE = -7
short KILL_LINE_PREV = -15
short MOVE_TO_BEG = -1
short MOVE_TO_END = -3
short NEWLINE = -6
short NEXT_CHAR = -19
short NEXT_HISTORY = -9
short NEXT_SPACE_WORD = -40
short NEXT_WORD = -55
short PASTE = -60
short PASTE_NEXT = -50
short PASTE_PREV = -36
short PREV_CHAR = -4
short PREV_HISTORY = -11
short PREV_SPACE_WORD = -27
short PREV_WORD = -43
short REDISPLAY = -13
short REPEAT_NEXT_CHAR = -24
short REPEAT_PREV_CHAR = -20
short REPEAT_SEARCH_NEXT = -49
short REPEAT_SEARCH_PREV = -34
short REPLACE_CHAR = -51
short REPLACE_MODE = -37
char RESET_LINE = '\r'
short SEARCH_NEXT = -25
short SEARCH_PREV = -21
short SUBSTITUTE_CHAR = -52
short SUBSTITUTE_LINE = -38
short TO_END_WORD = -29
short TO_NEXT_CHAR = -53
short TO_PREV_CHAR = -39
short UNDO = -54
short UNKNOWN = -99

Package Attributes

String CR = System.getProperty ("line.separator")

Private Member Functions

void consumeException (final Throwable e)
native int getConsoleMode ()
native int getWindowsTerminalHeight ()
native int getWindowsTerminalWidth ()
void loadLibrary (final String name) throws IOException
native int readByte ()
native void setConsoleMode (final int mode)

Private Attributes

Boolean directConsole

Static Private Attributes

static final int ENABLE_ECHO_INPUT = 4
static final int ENABLE_LINE_INPUT = 2
static final int ENABLE_MOUSE_INPUT = 16
static final int ENABLE_PROCESSED_INPUT = 1
static final int ENABLE_PROCESSED_OUTPUT = 1
static final int ENABLE_WINDOW_INPUT = 8
static final int ENABLE_WRAP_AT_EOL_OUTPUT = 2

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index