public static final class Prompt.TermStream extends Object
PrintStream
which may or may
not support colored output via ANSI terminal control sequences.Constructor and Description |
---|
TermStream(PrintStream out,
boolean colorSupport)
Returns a wrapper around the given print stream
out
with support for ANSI control sequences if colorSupport
is true . |
Modifier and Type | Method and Description |
---|---|
Prompt.TermStream |
bg(Prompt.Colors c)
Sets the background text color to
c . |
Prompt.TermStream |
blink()
Enables the 'blink' text style.
|
Prompt.TermStream |
bold()
Enables the 'bold' text style.
|
Prompt.TermStream |
clear()
Reset the current text attributes to default.
|
Prompt.TermStream |
dim()
Enables the 'dim' text style.
|
Prompt.TermStream |
fg(Prompt.Colors c)
Sets the foreground text color to
c . |
Prompt.TermStream |
newline()
Prints a system line separator.
|
Prompt.TermStream |
print(char c)
Prints the given character to the stream.
|
Prompt.TermStream |
print(String s)
Prints the given string to the stream.
|
Prompt.TermStream |
println(String s)
Prints the given string followed by a system line separator.
|
Prompt.TermStream |
reverse()
Enables the 'reverse' text style.
|
Prompt.TermStream |
spaces(int nspaces)
Prints the given number of spaces (' ').
|
Prompt.TermStream |
underlined()
Enables the 'underlined' text style.
|
public TermStream(PrintStream out, boolean colorSupport)
out
with support for ANSI control sequences if colorSupport
is true
. If instead, colorSupport
is false
,
methods such as clear()
, dim()
or Prompt.fg(Colors)
will simply do nothing.out
- colorSupport
- public Prompt.TermStream print(char c)
c
- public Prompt.TermStream print(String s)
s
- public Prompt.TermStream println(String s)
s
- public Prompt.TermStream newline()
public Prompt.TermStream spaces(int nspaces)
nspaces
- public Prompt.TermStream clear()
public Prompt.TermStream bold()
public Prompt.TermStream dim()
public Prompt.TermStream underlined()
public Prompt.TermStream blink()
public Prompt.TermStream reverse()
public Prompt.TermStream fg(Prompt.Colors c)
c
.c
- public Prompt.TermStream bg(Prompt.Colors c)
c
.c
-