org.crsh.term
Interface Term

All Superinterfaces:
Closeable, Consumer<Chunk>, Flushable, ScreenContext<Chunk>
All Known Implementing Classes:
ConsoleTerm

public interface Term
extends Closeable, ScreenContext<Chunk>


Method Summary
 void addToHistory(CharSequence line)
          Append a line to the term history.
 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.
 String getProperty(String name)
          Retrieves the value of a property specified by this Term
 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.
 
Methods inherited from interface java.io.Closeable
close
 
Methods inherited from interface org.crsh.shell.ScreenContext
getHeight, getWidth
 
Methods inherited from interface org.crsh.io.Consumer
getConsumedType, provide
 
Methods inherited from interface java.io.Flushable
flush
 

Method Detail

getProperty

String getProperty(String name)
Retrieves the value of a property specified by this Term

Parameters:
name - name of the term property
Returns:
value of the term property

takeAlternateBuffer

boolean takeAlternateBuffer()
                            throws IOException
Take control of the alternate buffer. When the alternate buffer is already used nothing happens. The buffer switch should occur when then Flushable.flush() method is invoked.

Returns:
true if the alternate buffer is shown
Throws:
IOException

releaseAlternateBuffer

boolean releaseAlternateBuffer()
                               throws IOException
Release control of the alternate buffer. When the normal buffer is already used nothing happens. The buffer switch should occur when then Flushable.flush() method is invoked.

Returns:
true if the usual buffer is shown
Throws:
IOException

setEcho

void setEcho(boolean echo)
Set the echo mode on the term.

Parameters:
echo - the echo mode

read

TermEvent read()
               throws IOException
Read the next term event. This operation is a blocking operation that blocks until data is available or until term is closed.

Returns:
the next term event
Throws:
IOException - any io exception

getDirectBuffer

Appendable getDirectBuffer()
Returns the direct buffer, any char appended in the returned appendable will translate into an insertion in the buffer.

Returns:
the insert buffer.

getBuffer

CharSequence getBuffer()
Returns the current buffer content to the cursor;

Returns:
the buffer

addToHistory

void addToHistory(CharSequence line)
Append a line to the term history.

Parameters:
line - the history line to append


Copyright © 2014 eXo Platform SAS. All Rights Reserved.