Package jline
Class TerminalSupport
java.lang.Object
jline.TerminalSupport
- All Implemented Interfaces:
Terminal
- Direct Known Subclasses:
OSvTerminal
,UnixTerminal
,UnsupportedTerminal
,WindowsTerminal
Provides support for
Terminal
instances.- Since:
- 2.0
- Author:
- Jason Dillon
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
int
int
getWidth()
boolean
Defaults to true which was the behaviour before this method was added.void
init()
boolean
boolean
final boolean
void
reset()
void
restore()
protected void
setAnsiSupported
(boolean supported) void
setEchoEnabled
(boolean enabled) When using native support, return the InputStream to use for reading characters else return the input stream passed as a parameter.Subclass to change behavior if needed.
-
Field Details
-
DEFAULT_WIDTH
public static final int DEFAULT_WIDTH- See Also:
-
DEFAULT_HEIGHT
public static final int DEFAULT_HEIGHT- See Also:
-
-
Constructor Details
-
TerminalSupport
protected TerminalSupport(boolean supported)
-
-
Method Details
-
init
-
restore
-
reset
-
isSupported
public final boolean isSupported()- Specified by:
isSupported
in interfaceTerminal
-
isAnsiSupported
public boolean isAnsiSupported()- Specified by:
isAnsiSupported
in interfaceTerminal
-
setAnsiSupported
protected void setAnsiSupported(boolean supported) -
wrapOutIfNeeded
Subclass to change behavior if needed.- Specified by:
wrapOutIfNeeded
in interfaceTerminal
- Returns:
- the passed out
-
hasWeirdWrap
public boolean hasWeirdWrap()Defaults to true which was the behaviour before this method was added.- Specified by:
hasWeirdWrap
in interfaceTerminal
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
isEchoEnabled
public boolean isEchoEnabled()- Specified by:
isEchoEnabled
in interfaceTerminal
-
setEchoEnabled
public void setEchoEnabled(boolean enabled) - Specified by:
setEchoEnabled
in interfaceTerminal
-
disableInterruptCharacter
public void disableInterruptCharacter()- Specified by:
disableInterruptCharacter
in interfaceTerminal
-
enableInterruptCharacter
public void enableInterruptCharacter()- Specified by:
enableInterruptCharacter
in interfaceTerminal
-
wrapInIfNeeded
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 interfaceTerminal
- Throws:
IOException
-
getOutputEncoding
- Specified by:
getOutputEncoding
in interfaceTerminal
-