private class StringFormat.CharBuf extends DisplayFormat.Presentation
Modifier and Type | Field and Description |
---|---|
private java.lang.StringBuffer |
buf
Value chars.
|
presCursorPos, presInsertMode
Constructor and Description |
---|
CharBuf()
Constructs clear presentation.
|
CharBuf(character varChar)
Constructs from variable's value.
|
Modifier and Type | Method and Description |
---|---|
void |
checkFormat()
Checks format rules.
|
StringFormat.CharBuf |
clear(boolean zapClear)
Makes new buffer with removed all value chars after cursor.
|
boolean |
deleteBack()
Erases one symbol before the cursor position.
|
boolean |
deleteCurrent()
Erases one symbol in the cursor position.
|
boolean |
finishEdit()
Indicates completion of an edit.
|
private char |
getChar(int pos) |
boolean |
input(char ch)
Inputs character.
|
private boolean |
insert(char ch)
Inputs character with the insert mode.
|
private java.lang.StringBuffer |
internalScreenValue()
Generate full screen representation.
|
boolean |
isFixedFont()
Determine if this format must use the DEFAULT-FIXED-FONT, if no font is specified.
|
boolean |
isUnknown()
Returns if the presentation currently represents the
unknown value . |
boolean |
moveCursorBegin()
Moves cursor to the beginning of the field.
|
boolean |
moveCursorEnd()
Moves cursor to the end of the field.
|
boolean |
moveCursorLeft()
Moves cursor one character to the left.
|
boolean |
moveCursorRight()
Moves cursor one character to the right.
|
private boolean |
overwrite(char ch)
Inputs character with the overwrite mode.
|
private void |
setChar(int pos,
char ch)
Places given char into given buffer position.
|
java.lang.String |
toScreenValue()
Formats the data as a string that is ready for display.
|
void |
toVar(BaseDataType var)
Instantiates a variable that is equivalent to the presentation's
internal representation.
|
ErrorManager.ErrorEntry[] |
validateFormat()
Validate representation according to format rules and return error
message if there is an error.
|
activate, getCursorPos, getInitialCursorPos, getInsertMode, getLastPos, isFixedNumeric, isLastCharEntered, isNegative, isOptionalLeftSign, setCursorPos, setInsertMode, setLastCharEntered, toScreenValue
private java.lang.StringBuffer buf
null
which means UNKNOWN value.public CharBuf()
public CharBuf(character varChar)
varChar
- Variable's value.public boolean isFixedFont()
isFixedFont
in class DisplayFormat.Presentation
StringFormat.fixedFont
flag.public ErrorManager.ErrorEntry[] validateFormat()
validateFormat
in class DisplayFormat.Presentation
null
if no error or error message if there is an
error.public void checkFormat() throws DisplayFormatCheckException
checkFormat
in class DisplayFormat.Presentation
DisplayFormatCheckException
- When data is incompatible with formatpublic boolean isUnknown()
unknown value
. If any editing has occurred, then this
will return false
even if the editing is not complete.isUnknown
in class DisplayFormat.Presentation
true
if this is unknown
.public boolean deleteBack()
deleteBack
in class DisplayFormat.Presentation
true
if input is accepted (nevertheless it
may be silently ignored in reality).public boolean deleteCurrent()
deleteCurrent
in class DisplayFormat.Presentation
true
if input is accepted (nevertheless it
may be silently ignored in reality).public boolean input(char ch)
input
in class DisplayFormat.Presentation
ch
- Input charactertrue
if input is accepted (nevertheless it
may be silently ignored in reality).public boolean moveCursorLeft()
moveCursorLeft
in class DisplayFormat.Presentation
true
if input is accepted (nevertheless it
may be silently ignored in reality).public boolean moveCursorRight()
moveCursorRight
in class DisplayFormat.Presentation
true
if input is accepted (nevertheless it
may be silently ignored in reality).public boolean moveCursorBegin()
moveCursorBegin
in class DisplayFormat.Presentation
true
if input is accepted (nevertheless it
may be silently ignored in reality).public boolean moveCursorEnd()
moveCursorEnd
in class DisplayFormat.Presentation
true
if input is accepted (nevertheless it
may be silently ignored in reality).public boolean finishEdit()
finishEdit
in class DisplayFormat.Presentation
true
if rendering is necessary.public java.lang.String toScreenValue()
toScreenValue
in class DisplayFormat.Presentation
public void toVar(BaseDataType var)
toVar
in class DisplayFormat.Presentation
var
- A variable which must be compatible with the format.public StringFormat.CharBuf clear(boolean zapClear)
zapClear
- If true
then presentation is cleared completely,
like if zap mode is ON. If false
then it is
cleared like if CLEAR event was applied (that means it is
cleared from the current cursor position).private java.lang.StringBuffer internalScreenValue()
private boolean insert(char ch)
ch
- Input characterprivate boolean overwrite(char ch)
ch
- Input characterprivate char getChar(int pos)
pos
- Position.private void setChar(int pos, char ch)
pos
- Position.ch
- Char.