private class StringFormat.CharBuf extends DisplayFormat.Presentation
| Modifier and Type | Field and Description |
|---|---|
private java.lang.StringBuilder |
buf
Value chars.
|
private ErrorManager.ErrorEntry |
error
Parsing error
|
private boolean |
unknownValueDisplayed
Indicates that ? mark should be displayed as an unknown value.
|
forFieldValue, presCursorPos, presInsertMode| Constructor and Description |
|---|
CharBuf()
Constructs clear presentation.
|
CharBuf(character varChar,
boolean forFieldValue)
Constructs from variable's value.
|
| Modifier and Type | Method and Description |
|---|---|
private boolean |
checkFixedCharsPrefixedByRepeatedFillCharFormatAndParse(java.lang.String value)
Check that this CharBuf has the following special format specification started from
the repeated fill characters and ended up with fixed characters (*)+X(N) and
parse incomplete screen value for this special format specification.
|
void |
checkFormat()
Checks format rules.
|
void |
clear()
Delete the screen value.
|
StringFormat.CharBuf |
clear(boolean zapClear)
Makes new buffer with removed all value chars after cursor.
|
private void |
clearDisplayedUnknownChar()
Clears displayed unknown char.
|
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.
|
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 |
parseFieldValue(java.lang.String val)
Apply format to the new String value before assignment to the FIELD-VALUE
|
private boolean |
parseIncompleteScreenValue(java.lang.String value)
Parse incomplete valid screen values.
|
private void |
parseScreenValue(java.lang.String text)
Apply format to the new String value before assignment to the Screen-VALUE
|
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.
|
java.lang.String |
toScreenValue(boolean edit)
Formats the data as a string that is ready for display.
|
private java.lang.String |
toScreenValueInt(boolean edit)
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, deleteRegion, forFieldValue, getCursorPos, getInitialCursorPos, getInsertMode, getLastPos, isFixedNumeric, isLastCharEntered, isNegative, isOptionalLeftSign, setCursorPos, setInsertMode, setLastCharEnteredprivate java.lang.StringBuilder buf
null which means UNKNOWN value.private boolean unknownValueDisplayed
private ErrorManager.ErrorEntry error
public CharBuf()
public CharBuf(character varChar, boolean forFieldValue)
varChar - Variable's value.forFieldValue - true if this presentation is for buffer field valuepublic void clear()
clear in class DisplayFormat.Presentationpublic boolean isFixedFont()
isFixedFont in class DisplayFormat.PresentationStringFormat.fixedFont flag.public ErrorManager.ErrorEntry[] validateFormat()
validateFormat in class DisplayFormat.Presentationnull if no error or error message if there is an
error.public void checkFormat()
throws DisplayFormatCheckException
checkFormat in class DisplayFormat.PresentationDisplayFormatCheckException - 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.Presentationtrue if this is unknown.public boolean deleteBack()
deleteBack in class DisplayFormat.Presentationtrue if input is accepted (nevertheless it
may be silently ignored in reality).public boolean deleteCurrent()
deleteCurrent in class DisplayFormat.Presentationtrue if input is accepted (nevertheless it
may be silently ignored in reality).public boolean input(char ch)
input in class DisplayFormat.Presentationch - Input charactertrue if input is accepted (nevertheless it
may be silently ignored in reality).public boolean moveCursorLeft()
moveCursorLeft in class DisplayFormat.Presentationtrue if input is accepted (nevertheless it
may be silently ignored in reality).public boolean moveCursorRight()
moveCursorRight in class DisplayFormat.Presentationtrue if input is accepted (nevertheless it
may be silently ignored in reality).public boolean moveCursorBegin()
moveCursorBegin in class DisplayFormat.Presentationtrue if input is accepted (nevertheless it
may be silently ignored in reality).public boolean moveCursorEnd()
moveCursorEnd in class DisplayFormat.Presentationtrue if input is accepted (nevertheless it
may be silently ignored in reality).public boolean finishEdit()
finishEdit in class DisplayFormat.Presentationtrue if rendering is necessary.public java.lang.String toScreenValue(boolean edit)
toScreenValue in class DisplayFormat.Presentationedit - true if the screen value is being generated
for interactive editing purposes.public java.lang.String toScreenValue()
toScreenValue in class DisplayFormat.Presentationpublic void toVar(BaseDataType var)
toVar in class DisplayFormat.Presentationvar - 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 void clearDisplayedUnknownChar()
private final java.lang.String toScreenValueInt(boolean edit)
edit - true if the screen value is being generated
for interactive editing purposes.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.private boolean checkFixedCharsPrefixedByRepeatedFillCharFormatAndParse(java.lang.String value)
value - Input screen valueprivate boolean parseIncompleteScreenValue(java.lang.String value)
value - Input screen valueprivate void parseScreenValue(java.lang.String text)
text - new String valueprivate void parseFieldValue(java.lang.String val)
val - new String value