Java Doc for WindowsTerminal.java in  » Development » jLine » jline » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » jLine » jline 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   jline.Terminal
      jline.WindowsTerminal

WindowsTerminal
public class WindowsTerminal extends Terminal (Code)

Terminal implementation for Microsoft Windows. Terminal initialization in WindowsTerminal.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 WindowsTerminal.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

Inner Class :static class ReplayPrefixOneCharInputStream extends InputStream

Field Summary
final public static  intDELETE_KEY
     When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates that the delete key was pressed.
final public static  intDOWN_ARROW_KEY
     When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates an down arrow key press.
final public static  charEND_KEY
     When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates that the end key was pressed.
final public static  charESCAPE_KEY
     When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR, this character indicates that the escape key was pressed.
final public static  intHOME_KEY
     When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates that the home key was pressed.
final public static  charINSERT_KEY
     When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates that the insert key was pressed.
final public static  intLEFT_ARROW_KEY
     When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR, this character indicates an left arrow key press.
final public static  intNUMPAD_KEY_INDICATOR
     On windows terminals, this character indicates that a special key on the number pad has been pressed.
final public static  charPAGE_DOWN_KEY
     When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates that the page down key was pressed.
final public static  charPAGE_UP_KEY
     When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates that the page up key was pressed.
final public static  intRIGHT_ARROW_KEY
     When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates an right arrow key press.
final public static  intSPECIAL_KEY_INDICATOR
     On windows terminals, this character indicates that a 'special' key has been pressed.
final public static  intUP_ARROW_KEY
     When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates an up arrow key press.
 Stringencoding
    
 InputStreamReaderreplayReader
    
 ReplayPrefixOneCharInputStreamreplayStream
    

Constructor Summary
public  WindowsTerminal()
    

Method Summary
public synchronized  voiddisableEcho()
    
public synchronized  voidenableEcho()
    
public  InputStreamgetDefaultBindings()
    
public  BooleangetDirectConsole()
     Whether or not to allow the use of the JNI console interaction.
public  booleangetEcho()
    
public  intgetTerminalHeight()
     Unsupported; return the default.
public  intgetTerminalWidth()
     Unsupported; return the default.
public  voidinitializeTerminal()
    
public  booleanisANSISupported()
     Windows doesn't support ANSI codes by default; disable them.
public synchronized  booleanisEchoEnabled()
    
public  booleanisSupported()
    
public  intreadCharacter(InputStream in)
    
public  intreadVirtualKey(InputStream in)
    
public  voidsetDirectConsole(Boolean directConsole)
     Whether or not to allow the use of the JNI console interaction.

Field Detail
DELETE_KEY
final public static int DELETE_KEY(Code)
When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates that the delete key was pressed.



DOWN_ARROW_KEY
final public static int DOWN_ARROW_KEY(Code)
When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates an down arrow key press.



END_KEY
final public static char END_KEY(Code)
When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates that the end key was pressed.



ESCAPE_KEY
final public static char ESCAPE_KEY(Code)
When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR, this character indicates that the escape key was pressed.



HOME_KEY
final public static int HOME_KEY(Code)
When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates that the home key was pressed.



INSERT_KEY
final public static char INSERT_KEY(Code)
When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates that the insert key was pressed.



LEFT_ARROW_KEY
final public static int LEFT_ARROW_KEY(Code)
When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR, this character indicates an left arrow key press.



NUMPAD_KEY_INDICATOR
final public static int NUMPAD_KEY_INDICATOR(Code)
On windows terminals, this character indicates that a special key on the number pad has been pressed.



PAGE_DOWN_KEY
final public static char PAGE_DOWN_KEY(Code)
When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates that the page down key was pressed.



PAGE_UP_KEY
final public static char PAGE_UP_KEY(Code)
When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates that the page up key was pressed.



RIGHT_ARROW_KEY
final public static int RIGHT_ARROW_KEY(Code)
When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates an right arrow key press.



SPECIAL_KEY_INDICATOR
final public static int SPECIAL_KEY_INDICATOR(Code)
On windows terminals, this character indicates that a 'special' key has been pressed. This means that a key such as an arrow key, or delete, or home, etc. will be indicated by the next character.



UP_ARROW_KEY
final public static int UP_ARROW_KEY(Code)
When following the SPECIAL_KEY_INDICATOR or NUMPAD_KEY_INDICATOR this character indicates an up arrow key press.



encoding
String encoding(Code)



replayReader
InputStreamReader replayReader(Code)



replayStream
ReplayPrefixOneCharInputStream replayStream(Code)




Constructor Detail
WindowsTerminal
public WindowsTerminal()(Code)




Method Detail
disableEcho
public synchronized void disableEcho()(Code)



enableEcho
public synchronized void enableEcho()(Code)



getDefaultBindings
public InputStream getDefaultBindings()(Code)



getDirectConsole
public Boolean getDirectConsole()(Code)
Whether or not to allow the use of the JNI console interaction.



getEcho
public boolean getEcho()(Code)



getTerminalHeight
public int getTerminalHeight()(Code)
Unsupported; return the default.
See Also:   Terminal.getTerminalHeight



getTerminalWidth
public int getTerminalWidth()(Code)
Unsupported; return the default.
See Also:   Terminal.getTerminalWidth



initializeTerminal
public void initializeTerminal() throws Exception(Code)



isANSISupported
public boolean isANSISupported()(Code)
Windows doesn't support ANSI codes by default; disable them.



isEchoEnabled
public synchronized boolean isEchoEnabled()(Code)



isSupported
public boolean isSupported()(Code)



readCharacter
public int readCharacter(InputStream in) throws IOException(Code)



readVirtualKey
public int readVirtualKey(InputStream in) throws IOException(Code)



setDirectConsole
public void setDirectConsole(Boolean directConsole)(Code)
Whether or not to allow the use of the JNI console interaction.



Methods inherited from jline.Terminal
public void afterReadLine(ConsoleReader reader, String prompt, Character mask)(Code)(Java Doc)
public void beforeReadLine(ConsoleReader reader, String prompt, Character mask)(Code)(Java Doc)
abstract public void disableEcho()(Code)(Java Doc)
abstract public void enableEcho()(Code)(Java Doc)
public InputStream getDefaultBindings()(Code)(Java Doc)
abstract public boolean getEcho()(Code)(Java Doc)
public static Terminal getTerminal()(Code)(Java Doc)
abstract public int getTerminalHeight()(Code)(Java Doc)
abstract public int getTerminalWidth()(Code)(Java Doc)
abstract public void initializeTerminal() throws Exception(Code)(Java Doc)
public boolean isANSISupported()(Code)(Java Doc)
abstract public boolean isEchoEnabled()(Code)(Java Doc)
abstract public boolean isSupported()(Code)(Java Doc)
public int readCharacter(InputStream in) throws IOException(Code)(Java Doc)
public int readVirtualKey(InputStream in) throws IOException(Code)(Java Doc)
public static void resetTerminal()(Code)(Java Doc)
public static synchronized Terminal setupTerminal()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.