96 |
96 |
** HC 20211102 Implemented i18n support.
|
97 |
97 |
** AL2 20220124 Make all control set entities to check for screen-value validity.
|
98 |
98 |
** ME 20220201 Allow for multiple values list when setting screen-value (delimiter is used).
|
|
99 |
** ME 20220202 Do not split value using delimiter on validateScreenValue - only selection-list
|
99 |
100 |
*/
|
100 |
101 |
/*
|
101 |
102 |
** This program is free software: you can redistribute it and/or modify
|
... | ... | |
2866 |
2867 |
}
|
2867 |
2868 |
|
2868 |
2869 |
/**
|
2869 |
|
* Validate the value(s) for SCREEN-VALUE attribute, the delimiter is used
|
2870 |
|
* to split it into an array.
|
|
2870 |
* Validate the value(s) for SCREEN-VALUE attribute.
|
2871 |
2871 |
*
|
2872 |
2872 |
* @param value
|
2873 |
2873 |
* The to be validated as SCREEN-VALUE attribute.
|
... | ... | |
2876 |
2876 |
*/
|
2877 |
2877 |
boolean validateScreenValue(character value)
|
2878 |
2878 |
{
|
2879 |
|
if (!value.isUnknown())
|
|
2879 |
if (!isValidScreenValue(value))
|
2880 |
2880 |
{
|
2881 |
|
char delimiter = getAttr("delimiter", () -> config.delimiter);
|
2882 |
|
character[] values = TextOps.entries(character.class, value.getValue(),
|
2883 |
|
String.valueOf(delimiter));
|
2884 |
|
|
2885 |
|
if (!isValidScreenValue(values))
|
|
2881 |
if (_isRealized())
|
2886 |
2882 |
{
|
2887 |
|
if (_isRealized())
|
2888 |
|
{
|
2889 |
|
ErrorManager.recordOrShowWarning(4058, String.format(
|
2890 |
|
"Attribute SCREEN-VALUE for the %s %s has an invalid value of %s", type(),
|
2891 |
|
widgetName(), (value.isUnknown() ? "UNKNOWN" : value.getValue())), true,
|
2892 |
|
false, false, true);
|
2893 |
|
}
|
2894 |
|
|
2895 |
|
return false;
|
|
2883 |
ErrorManager.recordOrShowWarning(4058, String.format(
|
|
2884 |
"Attribute SCREEN-VALUE for the %s %s has an invalid value of %s", type(),
|
|
2885 |
widgetName(), (value.isUnknown() ? "UNKNOWN" : value.getValue())), true,
|
|
2886 |
false, false, true);
|
2896 |
2887 |
}
|
|
2888 |
|
|
2889 |
return false;
|
2897 |
2890 |
}
|
2898 |
2891 |
|
2899 |
2892 |
return true;
|
... | ... | |
2936 |
2929 |
|
2937 |
2930 |
for (character value : values)
|
2938 |
2931 |
{
|
2939 |
|
if (!value.isUnknown() &&
|
|
2932 |
if (value.isUnknown() ||
|
2940 |
2933 |
!Arrays.stream(items).anyMatch(item -> CompareOps._isEqual(item.getCharacterValue(), value)))
|
2941 |
2934 |
{
|
2942 |
2935 |
return false;
|