public class ConsoleTerm extends Object implements Term
interface.| Modifier and Type | Field and Description |
|---|---|
private TermIOBuffer |
buffer
.
|
private LinkedList<CharSequence> |
history
.
|
private CharSequence |
historyBuffer
.
|
private int |
historyCursor
.
|
private TermIO |
io
.
|
private Logger |
log
.
|
private TermIOWriter |
writer
.
|
| Constructor and Description |
|---|
ConsoleTerm(TermIO io) |
| Modifier and Type | Method and Description |
|---|---|
void |
addToHistory(CharSequence line)
Append a line to the term history.
|
Appendable |
append(char c) |
Screenable |
append(CharSequence s) |
Appendable |
append(CharSequence csq,
int start,
int end) |
Screenable |
append(Style style) |
void |
close() |
Screenable |
cls() |
void |
flush()
Flush the stream.
|
CharSequence |
getBuffer()
Returns the current buffer content to the cursor;
|
Appendable |
getDirectBuffer()
Returns the direct buffer, any char appended in the returned appendable will translate into an
insertion in the buffer.
|
int |
getHeight()
Returns the screen height in chars.
|
String |
getProperty(String name)
Retrieves the value of a property specified by this Term
|
int |
getWidth()
Returns the screen width in chars.
|
TermEvent |
read()
Read the next term event.
|
boolean |
releaseAlternateBuffer()
Release control of the alternate buffer.
|
void |
setEcho(boolean echo)
Set the echo mode on the term.
|
boolean |
takeAlternateBuffer()
Take control of the alternate buffer.
|
private final LinkedList<CharSequence> history
private CharSequence historyBuffer
private int historyCursor
private final TermIOBuffer buffer
private final TermIOWriter writer
public ConsoleTerm(TermIO io)
public int getWidth()
ScreenContextgetWidth in interface ScreenContextpublic int getHeight()
ScreenContextgetHeight in interface ScreenContextpublic String getProperty(String name)
TermgetProperty in interface Termname - name of the term propertypublic void setEcho(boolean echo)
Termpublic boolean takeAlternateBuffer() throws IOException
TermScreenContext.flush() method
is invoked.takeAlternateBuffer in interface TermIOExceptionpublic boolean releaseAlternateBuffer() throws IOException
TermScreenContext.flush() method
is invoked.releaseAlternateBuffer in interface TermIOExceptionpublic TermEvent read() throws IOException
Termread in interface TermIOException - any io exceptionpublic Appendable getDirectBuffer()
TermgetDirectBuffer in interface Termpublic void addToHistory(CharSequence line)
TermaddToHistory in interface Termline - the history line to appendpublic CharSequence getBuffer()
Termpublic void flush()
ScreenContextflush in interface ScreenContextpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic Screenable append(CharSequence s) throws IOException
append in interface AppendableIOExceptionpublic Appendable append(char c) throws IOException
append in interface AppendableIOExceptionpublic Appendable append(CharSequence csq, int start, int end) throws IOException
append in interface AppendableIOExceptionpublic Screenable append(Style style) throws IOException
append in interface ScreenableIOExceptionpublic Screenable cls() throws IOException
cls in interface ScreenableIOExceptionCopyright © 2015 eXo Platform SAS. All Rights Reserved.