Example usage for com.jgoodies.validation ValidationResult hasMessages

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

Introduction

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

Prototype

public boolean hasMessages() 

Source Link

Document

Checks and answers whether this validation result has messages or not.

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/*  ww  w . j  a v  a2 s.c  o  m*/
            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;
    }
}