RelativeDateValueNode dateValueNode = (RelativeDateValueNode) valueEntryPanel.getValueNode();
// Check. If it's parseable, then it's valid (of course!).
// If not parseable, then give a default value of the date in ValueNode.
DateFormat dateFormat = RelativeTemporalValueNode.getDateFormat(DateFormat.FULL, -1);
try {
dateFormat.parse(currentText);
} catch (ParseException pe) {
currentText = dateFormat.format(dateValueNode.getDateValue());
changed = true;
}
} else if (typeExpr.isNonParametricType(CAL_RelativeTime.TypeConstructors.RelativeTime)) {
RelativeTimeValueNode timeValueNode = (RelativeTimeValueNode) valueEntryPanel.getValueNode();
// Check. If it's parseable, then it's valid (of course!).
// If not parseable, then give a default value of the time in ValueNode.
DateFormat timeFormat = RelativeTemporalValueNode.getDateFormat(-1, DateFormat.MEDIUM);
try {
timeFormat.parse(currentText);
} catch (ParseException pe) {
currentText = timeFormat.format(timeValueNode.getTimeValue());
changed = true;
}
} else if (typeExpr.isNonParametricType(CAL_RelativeTime.TypeConstructors.RelativeDateTime)) {
RelativeDateTimeValueNode dateTimeValueNode = (RelativeDateTimeValueNode) valueEntryPanel.getValueNode();
// Check. If it's parseable, then it's valid (of course!).
// If not parseable, then give a default value of the date time in ValueNode.
DateFormat dateTimeFormat = RelativeTemporalValueNode.getDateFormat(DateFormat.FULL, DateFormat.MEDIUM);
try {
dateTimeFormat.parse(currentText);
} catch (ParseException pe) {
currentText = dateTimeFormat.format(dateTimeValueNode.getDateTimeValue());
changed = true;
}
} else if (typeExpr.isNonParametricType(CAL_Time.TypeConstructors.Time)) {
JTimeValueNode valueNode = (JTimeValueNode) valueEntryPanel.getValueNode();
// Check. If it's parseable, then it's valid (of course!).
// If not parseable, then give a default value of the date time in ValueNode.
DateFormat fmt=DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.LONG);
fmt.setTimeZone(TimeZone.getDefault());
try {
fmt.parse(currentText);
} catch (ParseException pe) {
currentText = fmt.format(valueNode.getJavaDate());
changed = true;
}
} else if (typeExpr.sameType(typeConstants.getCharListType())) {