boolean retval = true;
if (validator != null)
{
try
{
final ValidationResult validationResult = validator.validate
(new ValidationResult(), report.getParameterDefinition(), parameterContext);
final ValidationMessage[] messages = validationResult.getErrors();
globalErrorMessage.setText(formatMessages(messages));
final String[] propertyNames = validationResult.getProperties();
for (int i = 0; i < propertyNames.length; i++)
{
final String propertyName = propertyNames[i];
final JLabel o = errorLabels.get(propertyName);
final ValidationMessage[] validationMessages = validationResult.getErrors(propertyName);
final String message = formatMessages(validationMessages);
if (o == null)
{
final String s = globalErrorMessage.getText();
if (StringUtils.isEmpty(s))
{
globalErrorMessage.setText(propertyName + ": " + message);
}
else
{
globalErrorMessage.setText(s + "\n" + propertyName + ": " + message);
}
}
else
{
o.setText(message);
}
}
// Set the updated and validated parameter values as new values.
final ReportParameterValues parameterValues = validationResult.getParameterValues();
for (final String columnName : parameterValues.getColumnNames())
{
final Object value = parameterValues.get(columnName);
if (value != null)
{