Class AbstractTerminals
- java.lang.Object
-
- net.rubygrapefruit.platform.internal.AbstractTerminals
-
- All Implemented Interfaces:
NativeIntegration,Terminals
- Direct Known Subclasses:
PosixTerminals,WindowsTerminals
public abstract class AbstractTerminals extends java.lang.Object implements Terminals
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.rubygrapefruit.platform.terminal.Terminals
Terminals.Output
-
-
Constructor Summary
Constructors Constructor Description AbstractTerminals()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract TerminalInputcreateInput()protected abstract AbstractTerminalcreateTerminal(Terminals.Output output)TerminalOutputgetTerminal(Terminals.Output output)Returns the terminal attached to the given output.TerminalInputgetTerminalInput()Returns the terminal attached to system inputTerminalswithAnsiOutput()Returns a copy of this terminal access that forces terminal output to use ANSI escape sequences.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.rubygrapefruit.platform.terminal.Terminals
isTerminal, isTerminalInput
-
-
-
-
Method Detail
-
withAnsiOutput
public Terminals withAnsiOutput()
Description copied from interface:TerminalsReturns a copy of this terminal access that forces terminal output to use ANSI escape sequences. This can be used to force rich terminal output when not attached to a terminal.Terminal input is not changed.
- Specified by:
withAnsiOutputin interfaceTerminals
-
getTerminal
public TerminalOutput getTerminal(Terminals.Output output)
Description copied from interface:TerminalsReturns the terminal attached to the given output.- Specified by:
getTerminalin interfaceTerminals- Returns:
- The terminal. Never returns null.
-
getTerminalInput
public TerminalInput getTerminalInput() throws NativeException
Description copied from interface:TerminalsReturns the terminal attached to system input- Specified by:
getTerminalInputin interfaceTerminals- Returns:
- The terminal. Never returns null.
- Throws:
NativeException- When the input is not attached to a terminal.
-
createInput
protected abstract TerminalInput createInput()
-
createTerminal
protected abstract AbstractTerminal createTerminal(Terminals.Output output)
-
-