public class DatetimeFormat extends DisplayFormat
datetime
and datetime-tz
variables.Modifier and Type | Class and Description |
---|---|
private class |
DatetimeFormat.DatetimeBuf
Internal form of datetime data.
|
private static class |
DatetimeFormat.DatetimeComponent
The simple structure which records what places are occupied in a screen
value by the datetime component.
|
DisplayFormat.Presentation
Modifier and Type | Field and Description |
---|---|
protected boolean |
allQMark
If a value cannot be correctly represented with current format a string of question marks
will be used instead.
|
protected boolean |
amPmUppercase |
protected byte[] |
dateCompOrder
Order of date components for rendering.
|
protected byte[] |
datetimeCompOrder
Order of datetime(-tz) components for rendering.
|
protected boolean |
drawSeparators
Determines whether the separators will be drawn for the unknown value
(applies to editing mode only).
|
protected DatetimeFormat.DatetimeComponent[] |
fmtDatetimeComps
How date components are positioned in rendered string.
|
protected boolean |
fmtFullYear
true for a 4-digit year. |
protected char |
fmtSeparator
Date components separator.
|
private boolean |
isDatetimeTz
If set, SESSION:DISPLAY-TIMEZONE will be taken into consideration when displaying
values if the format misses the timezone component.
|
editableSource, fmtScreenWidth
Constructor and Description |
---|
DatetimeFormat(java.lang.String pformat,
boolean isDatetimeTz)
Constructs a datetime 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.
|
boolean |
isFormatCheck()
Verify if this format needs explicit validation.
|
private static java.lang.String |
safeSubstring(java.lang.String s,
int start,
int len)
Safely extract a substring from a string.
|
void |
setDrawSeparators(boolean drawSeparators)
Forces separators for the unknown datetime value to be drawn or not in the
subsequent value rendering (applies to editing mode only).
|
clear, formatScreenValue, generateQuestions, generateSpaces, getFormatDef, getScreenWidth, instanceOfType, instanceOfType, instanceOfType, isRightPositioning, isZapSupported, setEditableSource
protected byte[] dateCompOrder
protected byte[] datetimeCompOrder
protected char fmtSeparator
protected boolean amPmUppercase
protected boolean drawSeparators
protected boolean fmtFullYear
true
for a 4-digit year.protected DatetimeFormat.DatetimeComponent[] fmtDatetimeComps
protected boolean allQMark
private boolean isDatetimeTz
public DatetimeFormat(java.lang.String pformat, boolean isDatetimeTz) throws DisplayFormatParsingException
pformat
- Progress format string.isDatetimeTz
- This format will be used with a datetimetz instance.DisplayFormatParsingException
- When passed format is not a valid datetime 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 datetime value.private static java.lang.String safeSubstring(java.lang.String s, int start, int len)
s
- The string to cut.start
- The offset to start the returning substring.len
- The maximum length of the substring to be returned.start
having len
chars.
If arguments are wrong, an empty string is returned but never null object.