|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConsoleDelegate
Represents the user console in the context of an active connection. It is a collection of
getter methods that inform the caller of the state of the console, such as getEOLN()
or getRightMargin()
; as well as methods that will affect the state of the console:
write*
.
Field Summary | |
---|---|
static int |
OFFSET_UPDATE_LOCK_ALL
Use to prevent user from editing all text entered so far. |
static int |
OFFSET_UPDATE_LOCK_PREVIOUS
Use to allow the user to only edit newly entered text (on the same line) |
static int |
OFFSET_UPDATE_NO_LOCK
Use to allow the user to edit both previously entered text (on the same line) and newly written text |
Method Summary | |
---|---|
void |
backspaceActiveText(int count)
Remove the last count characters from the active text |
OutputStream |
getConsoleOutputStream()
Convenience getter for situations where integrating application already takes a writer for output of processing results. |
Writer |
getConsoleWriter()
Convenience getter for situations where integrating application already takes a writer for output of processing results. |
String |
getEOLN()
Is called by the Session to know what to print for the end-of-line character
sequence |
int |
getRightMargin()
Is called by the Session when negociating telnet options window width.Note that there is no garantie that this right margin be honored by the client. |
void |
setRightMargin(int rightMargin)
Is called by the Session when the client requests a specific window width. |
void |
setSuppressOutput(boolean suppressOutput)
Use this method to turn character echo to the user on/off. Note: the password prompt is automatically configured with suppressOutput = true while typing password, and turned back off afterwards. |
void |
updateActiveText(String txt,
boolean append,
int offsetUpdateMask)
Write txt to the telnet console current active text. |
void |
write(byte[] bbuf,
int off,
int len)
Write a subsequence of the given byte buffer to the console, starting at off
and of length len . |
void |
write(char[] cbuf,
int off,
int len)
Write a subsequence of the given character buffer to the console, starting at off
and of length len . |
void |
write(String txt)
Write the given text string to the console. |
void |
writeln(String txt)
Write txt to the telnet console. |
void |
writeNewLine()
Request a new line on the telnet console as defined by the assigned display handler. The controller will be asked for the prompt to show once the newline is output. Note: in the current implementation, this will automatically lock the previous line from user edit. |
void |
writePrompt()
Request the display of the prompt after having written to output |
Field Detail |
---|
static final int OFFSET_UPDATE_NO_LOCK
static final int OFFSET_UPDATE_LOCK_PREVIOUS
static final int OFFSET_UPDATE_LOCK_ALL
Method Detail |
---|
String getEOLN()
Session
to know what to print for the end-of-line character
sequence
"\n\r"
;int getRightMargin()
Session
when negociating telnet options window width.setRightMargin(int)
.
void setRightMargin(int rightMargin)
Session
when the client requests a specific window width.
rightMargin
- the requested right marginvoid setSuppressOutput(boolean suppressOutput)
suppressOutput
- set to true
to suppress console echo, and false
to
turn it back onvoid updateActiveText(String txt, boolean append, int offsetUpdateMask)
txt
to the telnet console current active text. Use offsetUpdateMask to
specify the behaviour with respect to already entered text.
txt
- the message to writeappend
- true
if the text is to append to existing active text,
false
if the text is to be replaced.offsetUpdateMask
- the cursor update instructions, one of OFFSET_UPDATE_*
declared in
this interfacevoid backspaceActiveText(int count)
count
characters from the active text
count
- Writer getConsoleWriter()
OutputStream getConsoleOutputStream()
void write(char[] cbuf, int off, int len)
off
and of length len
.
void write(byte[] bbuf, int off, int len)
off
and of length len
.
void write(String txt)
void writeln(String txt)
txt
to the telnet console.
txt
- the message to write followed by a newline sequence as defined by the assigned
display handler.void writeNewLine()
void writePrompt()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |