org.crsh.console
Class Console

java.lang.Object
  extended by org.crsh.console.Console

public class Console
extends Object

A console state machine, which delegates the state machine to the Plugin implementation.

Author:
Julien Viet

Field Summary
(package private)  BlockingDeque<KeyStroke> buffer
          The buffer.
(package private) static int CLOSED
          .
(package private) static int CLOSING
          .
(package private)  ConsoleDriver driver
          .
(package private)  Editor editor
          .
(package private)  AtomicReference<Plugin> handler
          The current handler.
private static Logger log
          The logger.
(package private) static int RUNNING
          .
(package private)  Shell shell
          .
(package private)  int status
          .
 
Constructor Summary
Console(Shell shell, ConsoleDriver driver)
           
 
Method Summary
 void addModeListener(Runnable runnable)
           
(package private)  void close()
           
(package private)  Editor edit()
          Switch to edit.
 Iterable<KeyStroke> getKeyBuffer()
           
 Mode getMode()
           
 void init()
          Initiali
 boolean isRunning()
           
(package private)  void iterate()
          Process the state machine.
 void on(KeyStroke keyStroke)
           
 void on(KeyStroke[] keyStrokes)
           
 void on(Operation operation, int... buffer)
           
 void setMode(Mode mode)
           
 void toEmacs()
           
 void toInsert()
           
 void toMove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final Logger log
The logger.


RUNNING

static final int RUNNING
.

See Also:
Constant Field Values

CLOSING

static final int CLOSING
.

See Also:
Constant Field Values

CLOSED

static final int CLOSED
.

See Also:
Constant Field Values

shell

final Shell shell
.


handler

final AtomicReference<Plugin> handler
The current handler.


buffer

final BlockingDeque<KeyStroke> buffer
The buffer.


driver

final ConsoleDriver driver
.


editor

final Editor editor
.


status

int status
.

Constructor Detail

Console

public Console(Shell shell,
               ConsoleDriver driver)
        throws NullPointerException
Throws:
NullPointerException
Method Detail

setMode

public void setMode(Mode mode)

toEmacs

public void toEmacs()

toMove

public void toMove()

toInsert

public void toInsert()

getMode

public Mode getMode()

addModeListener

public void addModeListener(Runnable runnable)

isRunning

public boolean isRunning()

init

public void init()
Initiali


getKeyBuffer

public Iterable<KeyStroke> getKeyBuffer()

on

public void on(Operation operation,
               int... buffer)

on

public void on(KeyStroke keyStroke)

on

public void on(KeyStroke[] keyStrokes)

close

void close()

edit

Editor edit()
Switch to edit.


iterate

void iterate()
Process the state machine.



Copyright © 2015 eXo Platform SAS. All Rights Reserved.