Package jline
Class TerminalSupport
- java.lang.Object
-
- jline.TerminalSupport
-
- All Implemented Interfaces:
Terminal
- Direct Known Subclasses:
OSvTerminal,UnixTerminal,UnsupportedTerminal,WindowsTerminal
public abstract class TerminalSupport extends java.lang.Object implements Terminal
Provides support forTerminalinstances.- Since:
- 2.0
- Author:
- Jason Dillon
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_HEIGHTstatic intDEFAULT_WIDTH
-
Constructor Summary
Constructors Modifier Constructor Description protectedTerminalSupport(boolean supported)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisableInterruptCharacter()voidenableInterruptCharacter()intgetHeight()java.lang.StringgetOutputEncoding()intgetWidth()booleanhasWeirdWrap()Defaults to true which was the behaviour before this method was added.voidinit()booleanisAnsiSupported()booleanisEchoEnabled()booleanisSupported()voidreset()voidrestore()protected voidsetAnsiSupported(boolean supported)voidsetEchoEnabled(boolean enabled)java.io.InputStreamwrapInIfNeeded(java.io.InputStream in)When using native support, return the InputStream to use for reading characters else return the input stream passed as a parameter.java.io.OutputStreamwrapOutIfNeeded(java.io.OutputStream out)Subclass to change behavior if needed.
-
-
-
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
-
-
Method Detail
-
init
public void init() throws java.lang.Exception
-
restore
public void restore() throws java.lang.Exception
-
reset
public void reset() throws java.lang.Exception
-
isSupported
public final boolean isSupported()
- Specified by:
isSupportedin interfaceTerminal
-
isAnsiSupported
public boolean isAnsiSupported()
- Specified by:
isAnsiSupportedin interfaceTerminal
-
setAnsiSupported
protected void setAnsiSupported(boolean supported)
-
wrapOutIfNeeded
public java.io.OutputStream wrapOutIfNeeded(java.io.OutputStream out)
Subclass to change behavior if needed.- Specified by:
wrapOutIfNeededin interfaceTerminal- Returns:
- the passed out
-
hasWeirdWrap
public boolean hasWeirdWrap()
Defaults to true which was the behaviour before this method was added.- Specified by:
hasWeirdWrapin interfaceTerminal
-
isEchoEnabled
public boolean isEchoEnabled()
- Specified by:
isEchoEnabledin interfaceTerminal
-
setEchoEnabled
public void setEchoEnabled(boolean enabled)
- Specified by:
setEchoEnabledin interfaceTerminal
-
disableInterruptCharacter
public void disableInterruptCharacter()
- Specified by:
disableInterruptCharacterin interfaceTerminal
-
enableInterruptCharacter
public void enableInterruptCharacter()
- Specified by:
enableInterruptCharacterin interfaceTerminal
-
wrapInIfNeeded
public java.io.InputStream wrapInIfNeeded(java.io.InputStream in) throws java.io.IOExceptionDescription copied from interface:TerminalWhen using native support, return the InputStream to use for reading characters else return the input stream passed as a parameter.- Specified by:
wrapInIfNeededin interfaceTerminal- Throws:
java.io.IOException
-
getOutputEncoding
public java.lang.String getOutputEncoding()
- Specified by:
getOutputEncodingin interfaceTerminal
-
-