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()
TextTerminaldispose in interface TextTerminalpublic void setOnDispose(Runnable onDispose)
public String read(boolean masking)
TextTerminalread in interface TextTerminalmasking - true, if the input should be masked (for example to enter a password)protected void setAction(TextTerminalData.Action action)
public void rawPrint(String message)
TextTerminalrawPrint in interface TextTerminalpublic void println()
TextTerminalprintln in interface TextTerminalpublic TextTerminalData getTextTerminalData()
DataApigetTextTerminalData in interface DataApipublic void postUserInput(String newInput)
DataApipostUserInput in interface DataApi