org.crsh.console
Interface ConsoleDriver

All Superinterfaces:
Closeable

public interface ConsoleDriver
extends Closeable

The contract between the console and the underlying stream.


Method Summary
 void cls()
          Clear screen.
 void flush()
          Flush output.
 int getHeight()
          Returns the term height in chars.
 String getProperty(String name)
          Retrieves the value of a property specified by this TermIO
 int getWidth()
          Returns the term width in chars.
 boolean moveLeft()
          Move the cursor left.
 boolean moveRight(char c)
          Move the cursor right.
 boolean releaseAlternateBuffer()
          Release control of the alternate buffer.
 boolean takeAlternateBuffer()
          Take control of the alternate buffer.
 void write(char c)
          Write a char.
 void write(CharSequence s)
          Write a string.
 void write(CharSequence s, int start, int end)
          Write a string.
 void write(Style d)
          Write a style.
 void writeCRLF()
          Write a CRLF.
 void writeDel()
          Delete the char under the cursor.
 
Methods inherited from interface java.io.Closeable
close
 

Method Detail

getWidth

int getWidth()
Returns the term width in chars. When the value is not positive it means the value could not be determined.

Returns:
the term width

getHeight

int getHeight()
Returns the term height in chars. When the value is not positive it means the value could not be determined.

Returns:
the term height

getProperty

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

Parameters:
name - the name of the property
Returns:
value of the 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 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 flush() method is invoked.

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

flush

void flush()
           throws IOException
Flush output.

Throws:
IOException - any io exception

write

void write(CharSequence s)
           throws IOException
Write a string.

Parameters:
s - the string to write
Throws:
IOException - any io exception

write

void write(CharSequence s,
           int start,
           int end)
           throws IOException
Write a string.

Parameters:
s - the string to write
start - the index of the first char
end - the index of the last char
Throws:
IOException - any io exception

write

void write(char c)
           throws IOException
Write a char.

Parameters:
c - the char to write
Throws:
IOException - any io exception

write

void write(Style d)
           throws IOException
Write a style.

Parameters:
d - the data to write
Throws:
IOException - any io exception

writeDel

void writeDel()
              throws IOException
Delete the char under the cursor.

Throws:
IOException - any io exception

writeCRLF

void writeCRLF()
               throws IOException
Write a CRLF.

Throws:
IOException - any io exception

cls

void cls()
         throws IOException
Clear screen.

Throws:
IOException - any io exception

moveRight

boolean moveRight(char c)
                  throws IOException
Move the cursor right.

Parameters:
c - the char skipped over
Returns:
true if the cursor moved.
Throws:
IOException - any io exception

moveLeft

boolean moveLeft()
                 throws IOException
Move the cursor left.

Returns:
true if the cursor moved
Throws:
IOException - any io exception


Copyright © 2015 eXo Platform SAS. All Rights Reserved.