Example usage for com.jgoodies.validation ValidationResult getMessages

List of usage examples for com.jgoodies.validation ValidationResult getMessages

Introduction

In this page you can find the example usage for com.jgoodies.validation ValidationResult getMessages.

Prototype

public List<ValidationMessage> getMessages() 

Source Link

Document

Returns an unmodifiable List of all validation messages.

Usage

From source file:org.openthinclient.console.wizards.newdirobject.ConfigurationPanel.java

License:Open Source License

public boolean isValid() {
    final ValidationResult validate = validator.validate();
    if (!validate.hasErrors()) {
        if (validate.hasMessages()) {
            final PropertyValidationMessage m = (PropertyValidationMessage) validate.getMessages().get(0);
            wd.putProperty("WizardPanel_errorMessage", m.formattedText()); //$NON-NLS-1$
        } else// w  w w . j  av  a2s  .  c  om
            wd.putProperty("WizardPanel_errorMessage", null); //$NON-NLS-1$
        return true;
    } else {
        final PropertyValidationMessage m = (PropertyValidationMessage) validate.getErrors().iterator().next();
        wd.putProperty("WizardPanel_errorMessage", m.formattedText()); //$NON-NLS-1$
        return false;
    }
}