Example usage for com.jgoodies.validation ValidationResult get

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

Introduction

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

Prototype

public ValidationMessage get(int index) 

Source Link

Document

Returns the message at the specified position in this result.

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 a  v a 2 s .  com
            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;
    }
}