public class DateFormat extends DisplayFormat
date
variables.Modifier and Type | Class and Description |
---|---|
private class |
DateFormat.DateBuf
Internal form of date data.
|
private static class |
DateFormat.DateComponent
The simple structure which records what places are occupied in a screen
value by the date component.
|
private class |
DateFormat.TestCase
Simple testcase wrapper to check the year autocompletion and its
string-to-number conversion.
|
DisplayFormat.Presentation
Modifier and Type | Field and Description |
---|---|
protected byte[] |
dateCompOrder
Order of date components for rendering.
|
protected int |
DAY_IDX
Index of the day component in the arrays of parsed components.
|
protected boolean |
drawSeparators
Determines whether the separators will be drawn for the unknown value
(applies to editing mode only).
|
protected DateFormat.DateComponent[] |
fmtDateComps
How date components are positioned in rendered string.
|
protected boolean |
fmtFullYear
true for a 4-digit year. |
protected int |
MONTH_IDX
Index of the month component in the arrays of parsed components.
|
protected ParsedDateFormat |
parsed
Parsed format string.
|
protected int |
YEAR_IDX
Index of the year component in the arrays of parsed components.
|
editableSource, fmtScreenWidth
Constructor and Description |
---|
DateFormat(java.lang.String pformat)
Constructs a date format from the given 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 |
fromVar(BaseDataType var)
Initializes a presentation for variable's value.
|
protected boolean |
hasFmtSeparator()
Report if the format string includes separators.
|
boolean |
isFormatCheck()
Verify if this format needs explicit validation.
|
static void |
main(java.lang.String[] args)
Start all year autocompletion and its string-to-number conversion
testcases.
|
void |
setDrawSeparators(boolean drawSeparators)
Forces separators for the unknown date value to be drawn or not in the
subsequent value rendering (applies to editing mode only).
|
void |
test()
Execute all year autocompletion and its string-to-number conversion testcases.
|
clear, formatScreenValue, generateQuestions, generateSpaces, getFormatDef, getScreenWidth, instanceOfType, instanceOfType, instanceOfType, isRightPositioning, isZapSupported, setEditableSource
protected byte[] dateCompOrder
protected ParsedDateFormat parsed
protected boolean drawSeparators
protected boolean fmtFullYear
true
for a 4-digit year.protected DateFormat.DateComponent[] fmtDateComps
protected int DAY_IDX
protected int MONTH_IDX
protected int YEAR_IDX
public DateFormat(java.lang.String pformat) throws DisplayFormatParsingException
pformat
- Progress format string.DisplayFormatParsingException
- When passed format is not a valid date format.public boolean isFormatCheck()
isFormatCheck
in class DisplayFormat
true
.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 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.public void setDrawSeparators(boolean drawSeparators)
drawSeparators
- If true
then separators will be displayed for the
unknown date value.protected boolean hasFmtSeparator()
true
if the format string had a separator.public void test()
public static void main(java.lang.String[] args) throws DisplayFormatParsingException
args
- Command line arguments.DisplayFormatParsingException