|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jline.Terminal jline.WindowsTerminal
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(java.io.InputStream)
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
.
Field Summary |
Fields inherited from interface jline.ConsoleOperations |
ADD, BACKSPACE, CHANGE_CASE, CHANGE_META, CLEAR_SCREEN, COMPLETE, CR, CTRL_A, CTRL_B, CTRL_C, CTRL_D, CTRL_E, CTRL_F, CTRL_N, CTRL_P, DELETE_META, DELETE_NEXT_CHAR, DELETE_PREV_CHAR, DELETE_PREV_WORD, END_WORD, EXIT, INSERT, KEYBOARD_BELL, KILL_LINE, KILL_LINE_PREV, MOVE_TO_BEG, MOVE_TO_END, NEWLINE, NEXT_CHAR, NEXT_HISTORY, NEXT_SPACE_WORD, NEXT_WORD, PASTE, PASTE_NEXT, PASTE_PREV, PREV_CHAR, PREV_HISTORY, PREV_SPACE_WORD, PREV_WORD, REDISPLAY, REPEAT_NEXT_CHAR, REPEAT_PREV_CHAR, REPEAT_SEARCH_NEXT, REPEAT_SEARCH_PREV, REPLACE_CHAR, REPLACE_MODE, RESET_LINE, SEARCH_NEXT, SEARCH_PREV, SUBSTITUTE_CHAR, SUBSTITUTE_LINE, TO_END_WORD, TO_NEXT_CHAR, TO_PREV_CHAR, UNDO, UNKNOWN |
Constructor Summary | |
WindowsTerminal()
|
Method Summary | |
Boolean |
getDirectConsole()
Whether or not to allow the use of the JNI console interaction. |
boolean |
getEcho()
Returns true if the terminal will echo all characters type. |
int |
getTerminalHeight()
Unsupported; return the default. |
int |
getTerminalWidth()
Unsupported; return the default. |
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()
Windows doesn't support ANSI codes by default; disable them. |
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. |
void |
setDirectConsole(Boolean directConsole)
Whether or not to allow the use of the JNI console interaction. |
Methods inherited from class jline.Terminal |
getTerminal, setupTerminal |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WindowsTerminal()
Method Detail |
public int readCharacter(InputStream in) throws IOException
Terminal
readCharacter
in class Terminal
IOException
public void initializeTerminal() throws Exception
Terminal
initializeTerminal
in class Terminal
Exception
public int readVirtualKey(InputStream in) throws IOException
Terminal
readVirtualKey
in class Terminal
in
- the InputStream to read from
ConsoleOperations#VK_UP
)
IOException
public boolean isSupported()
Terminal
isSupported
in class Terminal
public boolean isANSISupported()
isANSISupported
in class Terminal
public boolean getEcho()
Terminal
getEcho
in class Terminal
public int getTerminalWidth()
getTerminalWidth
in class Terminal
Terminal.getTerminalWidth()
public int getTerminalHeight()
getTerminalHeight
in class Terminal
Terminal.getTerminalHeight()
public void setDirectConsole(Boolean directConsole)
public Boolean getDirectConsole()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |