public interface TerminalOutput
On UNIX based platforms, this provides access to the terminal. On Windows platforms, this provides access to the console.
To create an instance of this interface use the Terminals.getTerminal(Terminals.Output) method.
| Modifier and Type | Interface and Description |
|---|---|
static class |
TerminalOutput.Color
Basic colors supported by a terminal.
|
| Modifier and Type | Method and Description |
|---|---|
TerminalOutput |
bold()
Switches the terminal to bold text mode, if supported.
|
TerminalOutput |
bright()
Switches the terminal to high intensity, if supported.
|
TerminalOutput |
clearToEndOfLine()
Clears characters from the cursor position to the end of the current line.
|
TerminalOutput |
cursorDown(int count)
Moves the cursor the given number of characters down.
|
TerminalOutput |
cursorLeft(int count)
Moves the cursor the given number of characters to the left.
|
TerminalOutput |
cursorRight(int count)
Moves the cursor the given number of characters to the right.
|
TerminalOutput |
cursorStartOfLine()
Moves the cursor to the start of the current line.
|
TerminalOutput |
cursorUp(int count)
Moves the cursor the given number of characters up.
|
TerminalOutput |
defaultForeground()
Sets the terminal foreground color to the default, if supported.
|
TerminalOutput |
dim()
Switches the terminal to dim intensity, if supported.
|
TerminalOutput |
foreground(TerminalOutput.Color color)
Sets the terminal foreground color, if supported.
|
java.io.OutputStream |
getOutputStream()
Returns an
OutputStream that writes to this terminal. |
TerminalSize |
getTerminalSize()
Returns the size of the terminal.
|
TerminalOutput |
hideCursor()
Hides the cursor.
|
TerminalOutput |
newline()
Writes line separator.
|
TerminalOutput |
normal()
Switches the terminal to normal text mode.
|
TerminalOutput |
reset()
Resets this terminal.
|
TerminalOutput |
showCursor()
Shows the cursor, if hidden.
|
boolean |
supportsColor()
Returns true if this terminal supports setting output colors.
|
boolean |
supportsCursorMotion()
Returns true if this terminal supports moving the cursor.
|
boolean |
supportsCursorVisibility()
Returns true if this terminal supports hiding the cursor.
|
boolean |
supportsTextAttributes()
Returns true if this terminal supports setting text attributes, such as bold.
|
TerminalOutput |
write(char ch)
Writes a character to this terminal.
|
TerminalOutput |
write(java.lang.CharSequence text)
Writes some text to this terminal.
|
boolean supportsTextAttributes()
boolean supportsColor()
boolean supportsCursorMotion()
boolean supportsCursorVisibility()
TerminalSize getTerminalSize() throws NativeException
NativeException - On failure.java.io.OutputStream getOutputStream()
OutputStream that writes to this terminal. The output stream is not buffered.TerminalOutput write(java.lang.CharSequence text) throws NativeException
NativeException - On failure.TerminalOutput write(char ch) throws NativeException
NativeException - On failure.TerminalOutput newline() throws NativeException
NativeException - On failure.TerminalOutput foreground(TerminalOutput.Color color) throws NativeException
NativeException - On failure.TerminalOutput defaultForeground() throws NativeException
NativeException - On failure.TerminalOutput bold() throws NativeException
Often the same as bright().
NativeException - On failure.TerminalOutput dim() throws NativeException
NativeException - On failure.TerminalOutput bright() throws NativeException
NativeException - On failure.TerminalOutput normal() throws NativeException
NativeException - On failure.TerminalOutput reset() throws NativeException
NativeException - On failure.TerminalOutput hideCursor() throws NativeException
NativeException - On failure.TerminalOutput showCursor() throws NativeException
NativeException - On failure.TerminalOutput cursorLeft(int count) throws NativeException
NativeException - On failure, or if this terminal does not support cursor motion.TerminalOutput cursorRight(int count) throws NativeException
NativeException - On failure, or if this terminal does not support cursor motion.TerminalOutput cursorUp(int count) throws NativeException
NativeException - On failure, or if this terminal does not support cursor motion.TerminalOutput cursorDown(int count) throws NativeException
NativeException - On failure, or if this terminal does not support cursor motion.TerminalOutput cursorStartOfLine() throws NativeException
NativeException - On failure, or if this terminal does not support cursor motion.TerminalOutput clearToEndOfLine() throws NativeException
NativeException - On failure, or if this terminal does not support clearing.