frysk.util
Class ObservingTerminal

java.lang.Object
  extended by jline.Terminal
      extended by frysk.util.PtyTerminal
          extended by frysk.util.ObservingTerminal
All Implemented Interfaces:
ConsoleOperations

public class ObservingTerminal
extends PtyTerminal


Nested Class Summary
 class ObservingTerminal.Observable
           
 
Field Summary
(package private)  boolean inputEntered
           
(package private)  ObservingTerminal.Observable observable
           
 
Fields inherited from interface jline.ConsoleOperations
ADD, BACKSPACE, CHANGE_CASE, CHANGE_META, CLEAR_SCREEN, COMPLETE, CR, CTRL_B, CTRL_F, CTRL_N, CTRL_P, DELETE_META, DELETE_NEXT_CHAR, DELETE_PREV_CHAR, DELETE_PREV_WORD, END_WORD, EXIT, INSERT, KEYBOARD_BELL, KILL_LINE, KILL_LINE_PREV, MOVE_TO_BEG, MOVE_TO_END, NEWLINE, NEXT_CHAR, NEXT_HISTORY, NEXT_SPACE_WORD, NEXT_WORD, PASTE, PASTE_NEXT, PASTE_PREV, PREV_CHAR, PREV_HISTORY, PREV_SPACE_WORD, PREV_WORD, REDISPLAY, REPEAT_NEXT_CHAR, REPEAT_PREV_CHAR, REPEAT_SEARCH_NEXT, REPEAT_SEARCH_PREV, REPLACE_CHAR, REPLACE_MODE, RESET_LINE, SEARCH_NEXT, SEARCH_PREV, SUBSTITUTE_CHAR, SUBSTITUTE_LINE, TO_END_WORD, TO_NEXT_CHAR, TO_PREV_CHAR, UNDO, UNKNOWN
 
Constructor Summary
ObservingTerminal(File file)
           
ObservingTerminal(FileDescriptor fd)
           
ObservingTerminal(String string)
           
 
Method Summary
 void afterReadLine(ConsoleReader reader, String prompt, Character mask)
          Invokes after the console reads a line with the prompt and mask.
 void beforeReadLine(ConsoleReader reader, String prompt, Character mask)
          Invokes before the console reads a line with the prompt and mask.
 boolean getInputEntered()
           
 ObservingTerminal.Observable getObservable()
           
 int readVirtualKey(InputStream in)
          Reads a virtual key from the console.
 
Methods inherited from class frysk.util.PtyTerminal
getEcho, getFd, getTerminalHeight, getTerminalWidth, initializeTerminal, isSupported, setToCharBufferedConsole, setToInitConsole
 
Methods inherited from class jline.Terminal
getTerminal, isANSISupported, readCharacter, setupTerminal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

observable

final ObservingTerminal.Observable observable

inputEntered

boolean inputEntered
Constructor Detail

ObservingTerminal

public ObservingTerminal(FileDescriptor fd)

ObservingTerminal

public ObservingTerminal(File file)

ObservingTerminal

public ObservingTerminal(String string)
Method Detail

getInputEntered

public boolean getInputEntered()

beforeReadLine

public void beforeReadLine(ConsoleReader reader,
                           String prompt,
                           Character mask)
Description copied from class: Terminal
Invokes before the console reads a line with the prompt and mask.

Overrides:
beforeReadLine in class Terminal

readVirtualKey

public int readVirtualKey(InputStream in)
                   throws IOException
Description copied from class: Terminal
Reads a virtual key from the console. Typically, this will just be the raw character that was entered, but in some cases, multiple input keys will need to be translated into a single virtual key.

Overrides:
readVirtualKey in class PtyTerminal
Parameters:
in - the InputStream to read from
Returns:
the virtual key (e.g., ConsoleOperations#VK_UP)
Throws:
IOException

afterReadLine

public void afterReadLine(ConsoleReader reader,
                          String prompt,
                          Character mask)
Description copied from class: Terminal
Invokes after the console reads a line with the prompt and mask.

Overrides:
afterReadLine in class Terminal

getObservable

public ObservingTerminal.Observable getObservable()