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 Object
implements Terminal

Provides support for Terminal instances.

Since:
2.0
Author:
Jason Dillon

Field Summary
static int DEFAULT_HEIGHT
           
static int DEFAULT_WIDTH
           
 
Constructor Summary
protected TerminalSupport(boolean supported)
           
 
Method Summary
 int getHeight()
           
 int getWidth()
           
 boolean hasWeirdWrap()
          Defaults to true which was the behaviour before this method was added.
 void init()
           
 boolean isAnsiSupported()
           
 boolean isEchoEnabled()
           
 boolean isSupported()
           
 void reset()
           
 void restore()
           
protected  void setAnsiSupported(boolean supported)
           
 void setEchoEnabled(boolean enabled)
           
 InputStream wrapInIfNeeded(InputStream in)
          When using native support, return the InputStream to use for reading characters else return the input stream passed as a parameter.
 OutputStream wrapOutIfNeeded(OutputStream out)
          Subclass to change behavior if needed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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 Exception
Specified by:
init in interface Terminal
Throws:
Exception

restore

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

reset

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

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)

wrapOutIfNeeded

public OutputStream wrapOutIfNeeded(OutputStream out)
Subclass to change behavior if needed.

Specified by:
wrapOutIfNeeded in interface Terminal
Returns:
the passed out

hasWeirdWrap

public boolean hasWeirdWrap()
Defaults to true which was the behaviour before this method was added.

Specified by:
hasWeirdWrap in interface Terminal

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

wrapInIfNeeded

public InputStream wrapInIfNeeded(InputStream in)
                           throws IOException
Description copied from interface: Terminal
When using native support, return the InputStream to use for reading characters else return the input stream passed as a parameter.

Specified by:
wrapInIfNeeded in interface Terminal
Throws:
IOException


Copyright © 2013. All Rights Reserved.