public class WebTextTerminal extends Object implements TextTerminal, DataApi
DataApi
(such as SparkDataServer
)
and a web component that accesses this API (typically via textterm.js).Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_TIMEOUT_HAS_ACTION |
static long |
DEFAULT_TIMEOUT_NOT_EMPTY |
Constructor and Description |
---|
WebTextTerminal() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
This method is typically called at the end of a text-based input/output session in order to allow the terminal to release its screen resources.
|
TextTerminalData |
getTextTerminalData()
This method is called by the web component while polling for data
|
void |
postUserInput(String newInput)
This method is called by the web component to post the user input
|
void |
println()
Terminates the current line by writing the line separator string.
|
void |
rawPrint(String message)
Prints the message in its raw form.
|
String |
read(boolean masking)
Reads a line of text
|
protected void |
setAction(TextTerminalData.Action action) |
void |
setOnDispose(Runnable onDispose) |
void |
setTimeoutHasAction(long timeoutHasAction) |
void |
setTimeoutNotEmpty(long timeoutNotEmpty) |
public static final long DEFAULT_TIMEOUT_NOT_EMPTY
public static final long DEFAULT_TIMEOUT_HAS_ACTION
public void setTimeoutNotEmpty(long timeoutNotEmpty)
public void setTimeoutHasAction(long timeoutHasAction)
public void dispose()
TextTerminal
dispose
in interface TextTerminal
public void setOnDispose(Runnable onDispose)
public String read(boolean masking)
TextTerminal
read
in interface TextTerminal
masking
- true, if the input should be masked (for example to enter a password)protected void setAction(TextTerminalData.Action action)
public void rawPrint(String message)
TextTerminal
rawPrint
in interface TextTerminal
public void println()
TextTerminal
println
in interface TextTerminal
public TextTerminalData getTextTerminalData()
DataApi
getTextTerminalData
in interface DataApi
public void postUserInput(String newInput)
DataApi
postUserInput
in interface DataApi