org.crsh.console.jline
Class JLineProcessor

java.lang.Object
  extended by org.crsh.console.jline.JLineProcessor
All Implemented Interfaces:
Closeable, Runnable, ConsoleDriver

public class JLineProcessor
extends Object
implements Runnable, ConsoleDriver


Constructor Summary
JLineProcessor(boolean ansi, Shell shell, jline.console.ConsoleReader reader, PrintStream out)
           
JLineProcessor(boolean ansi, Shell shell, jline.console.ConsoleReader reader, PrintStream out, String lineSeparator)
           
 
Method Summary
 void close()
           
 void closed()
           
 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.
 void interrupt()
           
 boolean moveLeft()
          Move the cursor left.
 boolean moveRight(char c)
          Move the cursor right.
 boolean releaseAlternateBuffer()
          Release control of the alternate buffer.
 void run()
           
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JLineProcessor

public JLineProcessor(boolean ansi,
                      Shell shell,
                      jline.console.ConsoleReader reader,
                      PrintStream out)

JLineProcessor

public JLineProcessor(boolean ansi,
                      Shell shell,
                      jline.console.ConsoleReader reader,
                      PrintStream out,
                      String lineSeparator)
Method Detail

interrupt

public void interrupt()

closed

public void closed()
            throws InterruptedException
Throws:
InterruptedException

run

public void run()
Specified by:
run in interface Runnable

getWidth

public int getWidth()
Description copied from interface: ConsoleDriver
Returns the term width in chars. When the value is not positive it means the value could not be determined.

Specified by:
getWidth in interface ConsoleDriver
Returns:
the term width

getHeight

public int getHeight()
Description copied from interface: ConsoleDriver
Returns the term height in chars. When the value is not positive it means the value could not be determined.

Specified by:
getHeight in interface ConsoleDriver
Returns:
the term height

getProperty

public String getProperty(String name)
Description copied from interface: ConsoleDriver
Retrieves the value of a property specified by this TermIO

Specified by:
getProperty in interface ConsoleDriver
Parameters:
name - the name of the property
Returns:
value of the property

takeAlternateBuffer

public boolean takeAlternateBuffer()
                            throws IOException
Description copied from interface: ConsoleDriver
Take control of the alternate buffer. When the alternate buffer is already used nothing happens. The buffer switch should occur when then ConsoleDriver.flush() method is invoked.

Specified by:
takeAlternateBuffer in interface ConsoleDriver
Returns:
true if the alternate buffer is shown
Throws:
IOException

releaseAlternateBuffer

public boolean releaseAlternateBuffer()
                               throws IOException
Description copied from interface: ConsoleDriver
Release control of the alternate buffer. When the normal buffer is already used nothing happens. The buffer switch should occur when then ConsoleDriver.flush() method is invoked.

Specified by:
releaseAlternateBuffer in interface ConsoleDriver
Returns:
true if the usual buffer is shown
Throws:
IOException

flush

public void flush()
           throws IOException
Description copied from interface: ConsoleDriver
Flush output.

Specified by:
flush in interface ConsoleDriver
Throws:
IOException - any io exception

write

public void write(CharSequence s)
           throws IOException
Description copied from interface: ConsoleDriver
Write a string.

Specified by:
write in interface ConsoleDriver
Parameters:
s - the string to write
Throws:
IOException - any io exception

write

public void write(CharSequence s,
                  int start,
                  int end)
           throws IOException
Description copied from interface: ConsoleDriver
Write a string.

Specified by:
write in interface ConsoleDriver
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

public void write(char c)
           throws IOException
Description copied from interface: ConsoleDriver
Write a char.

Specified by:
write in interface ConsoleDriver
Parameters:
c - the char to write
Throws:
IOException - any io exception

write

public void write(Style d)
           throws IOException
Description copied from interface: ConsoleDriver
Write a style.

Specified by:
write in interface ConsoleDriver
Parameters:
d - the data to write
Throws:
IOException - any io exception

writeDel

public void writeDel()
              throws IOException
Description copied from interface: ConsoleDriver
Delete the char under the cursor.

Specified by:
writeDel in interface ConsoleDriver
Throws:
IOException - any io exception

writeCRLF

public void writeCRLF()
               throws IOException
Description copied from interface: ConsoleDriver
Write a CRLF.

Specified by:
writeCRLF in interface ConsoleDriver
Throws:
IOException - any io exception

cls

public void cls()
         throws IOException
Description copied from interface: ConsoleDriver
Clear screen.

Specified by:
cls in interface ConsoleDriver
Throws:
IOException - any io exception

moveRight

public boolean moveRight(char c)
                  throws IOException
Description copied from interface: ConsoleDriver
Move the cursor right.

Specified by:
moveRight in interface ConsoleDriver
Parameters:
c - the char skipped over
Returns:
true if the cursor moved.
Throws:
IOException - any io exception

moveLeft

public boolean moveLeft()
                 throws IOException
Description copied from interface: ConsoleDriver
Move the cursor left.

Specified by:
moveLeft in interface ConsoleDriver
Returns:
true if the cursor moved
Throws:
IOException - any io exception

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException


Copyright © 2015 eXo Platform SAS. All Rights Reserved.