public class StringFormat extends DisplayFormat
character
variables.Modifier and Type | Class and Description |
---|---|
private static class |
StringFormat.AlphanumCharInfo
Info about value char which should be digit or letter.
|
private static class |
StringFormat.AnyCharInfo
Info about value char which may be any char.
|
private class |
StringFormat.CharBuf
Presentation implementation as ScreenBuffer wrapper.
|
private static class |
StringFormat.CharInfo
Base for format chars info.
|
private static class |
StringFormat.DigitCharInfo
Info about value char which should be digit.
|
private static class |
StringFormat.FillCharInfo
Info about fill char.
|
private static class |
StringFormat.LetterCharInfo
Info about value char which should be letter.
|
private static class |
StringFormat.UpperLetterCharInfo
Info about value char which should be letter.
|
private static class |
StringFormat.ValueCharInfo
Base class for info about value char.
|
DisplayFormat.Presentation
Modifier and Type | Field and Description |
---|---|
private boolean |
fixedFont
Flag indicating the drawing needs to use the DEFAULT-FIXED-FONT, if no font is specified.
|
protected StringFormat.CharInfo[] |
fmtChars
Info about characters in screen value.
|
private boolean |
formatCheck
Flag to check if this format needs special validation.
|
protected int |
maxPresLength
Maximum number of value chars.
|
private static int |
PS_FILL
The state constant for the Progress format string parser.
|
private static int |
PS_FILL_ESCAPE
The state constant for the Progress format string parser.
|
private static int |
PS_FORMAT_CHAR
The state constant for the Progress format string parser.
|
private static int |
PS_FORMAT_DUPES
The state constant for the Progress format string parser.
|
private static int |
PS_FORMAT_LPAREN
The state constant for the Progress format string parser.
|
editableSource, fmtScreenWidth
Constructor and Description |
---|
StringFormat(java.lang.String pformat)
Constructs character format from the Progress format string.
|
Modifier and Type | Method and Description |
---|---|
DisplayFormat.Presentation |
clear(DisplayFormat.Presentation pres)
Returns a new presentation instance with a default initialized insert
mode and cursor position.
|
DisplayFormat.Presentation |
clear(DisplayFormat.Presentation pres,
boolean zapClear)
Returns a new presentation instance with a default initialized insert
mode and cursor position.
|
private StringFormat.ValueCharInfo |
createValueCharInfo(char ch,
int valueIndex)
Creates
ValueCharInfo from format char. |
DisplayFormat.Presentation |
fromVar(BaseDataType var)
Initializes a presentation for variable's value.
|
boolean |
isFormatCheck()
Verify if this format needs explicit validation.
|
protected static void |
rightTrimStringBuf(java.lang.StringBuffer sb)
Removes final spaces from string buffer.
|
formatScreenValue, generateQuestions, generateSpaces, getFormatDef, getScreenWidth, instanceOfType, instanceOfType, instanceOfType, isRightPositioning, isZapSupported, setEditableSource
private static final int PS_FILL
private static final int PS_FILL_ESCAPE
private static final int PS_FORMAT_CHAR
private static final int PS_FORMAT_LPAREN
private static final int PS_FORMAT_DUPES
protected final StringFormat.CharInfo[] fmtChars
protected int maxPresLength
private final boolean fixedFont
This can happen only if the widget's format is fully numeric.
private boolean formatCheck
public StringFormat(java.lang.String pformat) throws DisplayFormatParsingException
pformat
- Progress format string.DisplayFormatParsingException
- Format string is invalid.public boolean isFormatCheck()
isFormatCheck
in class DisplayFormat
formatCheck
flag.public DisplayFormat.Presentation clear(DisplayFormat.Presentation pres)
clear
in class DisplayFormat
pres
- A Presentation instance which was constructed by this format.
May be null
. This presentation instance is not
changed in this method.public DisplayFormat.Presentation clear(DisplayFormat.Presentation pres, boolean zapClear)
clear
in class DisplayFormat
pres
- A Presentation instance which was constructed by this format.
May be null
. This presentation instance is not
changed in this method.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).public DisplayFormat.Presentation fromVar(BaseDataType var) throws DisplayFormatCheckException
fromVar
in class DisplayFormat
var
- Variable which should be compatible with format.DisplayFormatCheckException
- Variable's value is incompatible with format.protected static void rightTrimStringBuf(java.lang.StringBuffer sb)
sb
- Buffer to scan.private StringFormat.ValueCharInfo createValueCharInfo(char ch, int valueIndex)
ValueCharInfo
from format char.ch
- Format char.valueIndex
- Index in value.ValueCharInfo
or null
if provided
char is not for value formatting.