Example usage for com.jgoodies.validation ValidationResult isEmpty

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

Introduction

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

Prototype

public boolean isEmpty() 

Source Link

Document

Checks and answers whether this validation result contains no messages.

Usage

From source file:ru.goodfil.catalog.ui.forms.FilterWindow.java

private static void showValidationPanel(JList list, ValidationResult result) {
    list.setBorder(new LineBorder(Color.BLACK));
    list.setBackground(Color.YELLOW);

    list.setCellRenderer(new MessagesRenderer());

    if (result.isEmpty()) {
        list.setVisibleRowCount(0);//from  w w  w.  ja  va 2s . co  m
        list.setVisible(false);
    } else {
        list.setVisibleRowCount(result.getErrors().size());
        list.setModel(new ArrayListModel<ValidationMessage>(result.getErrors()));
    }

    list.repaint();
}