jline
Class TerminalSupport

java.lang.Object
  extended by jline.TerminalSupport
All Implemented Interfaces:
Terminal
Direct Known Subclasses:
UnixTerminal, UnsupportedTerminal, WindowsTerminal

public abstract class TerminalSupport
extends java.lang.Object
implements Terminal

Provides support for Terminal instances.

Since:
2.0
Author:
Jason Dillon

Nested Class Summary
protected  class TerminalSupport.RestoreHook
           
 
Field Summary
static int DEFAULT_HEIGHT
           
static java.lang.String DEFAULT_KEYBINDINGS_PROPERTIES
           
static int DEFAULT_WIDTH
           
 
Constructor Summary
protected TerminalSupport(boolean supported)
           
 
Method Summary
 java.io.InputStream getDefaultBindings()
           
 int getHeight()
           
 int getWidth()
           
 void init()
           
protected  void installShutdownHook(java.lang.Thread hook)
           
 boolean isAnsiSupported()
           
 boolean isEchoEnabled()
           
 boolean isSupported()
           
 int readCharacter(java.io.InputStream in)
           
 int readVirtualKey(java.io.InputStream in)
           
protected  void removeShutdownHook()
           
 void reset()
           
 void restore()
           
protected  void setAnsiSupported(boolean supported)
           
 void setEchoEnabled(boolean enabled)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_KEYBINDINGS_PROPERTIES

public static java.lang.String DEFAULT_KEYBINDINGS_PROPERTIES

DEFAULT_WIDTH

public static final int DEFAULT_WIDTH
See Also:
Constant Field Values

DEFAULT_HEIGHT

public static final int DEFAULT_HEIGHT
See Also:
Constant Field Values
Constructor Detail

TerminalSupport

protected TerminalSupport(boolean supported)
Method Detail

init

public void init()
          throws java.lang.Exception
Specified by:
init in interface Terminal
Throws:
java.lang.Exception

restore

public void restore()
             throws java.lang.Exception
Specified by:
restore in interface Terminal
Throws:
java.lang.Exception

reset

public void reset()
           throws java.lang.Exception
Specified by:
reset in interface Terminal
Throws:
java.lang.Exception

installShutdownHook

protected void installShutdownHook(java.lang.Thread hook)

removeShutdownHook

protected void removeShutdownHook()

isSupported

public final boolean isSupported()
Specified by:
isSupported in interface Terminal

isAnsiSupported

public boolean isAnsiSupported()
Specified by:
isAnsiSupported in interface Terminal

setAnsiSupported

protected void setAnsiSupported(boolean supported)

getWidth

public int getWidth()
Specified by:
getWidth in interface Terminal

getHeight

public int getHeight()
Specified by:
getHeight in interface Terminal

isEchoEnabled

public boolean isEchoEnabled()
Specified by:
isEchoEnabled in interface Terminal

setEchoEnabled

public void setEchoEnabled(boolean enabled)
Specified by:
setEchoEnabled in interface Terminal

readCharacter

public int readCharacter(java.io.InputStream in)
                  throws java.io.IOException
Specified by:
readCharacter in interface Terminal
Throws:
java.io.IOException

readVirtualKey

public int readVirtualKey(java.io.InputStream in)
                   throws java.io.IOException
Specified by:
readVirtualKey in interface Terminal
Throws:
java.io.IOException

getDefaultBindings

public java.io.InputStream getDefaultBindings()
Specified by:
getDefaultBindings in interface Terminal