org.jtheque.core.utils.ui
Class ValidationUtils

java.lang.Object
  extended by org.jtheque.core.utils.ui.ValidationUtils

public final class ValidationUtils
extends Object

Validation utils.

Author:
Baptiste Wicht

Method Summary
static void rejectIfEmpty(CharSequence field, String name, Collection<JThequeError> errors)
          Reject the field if empty.
static void rejectIfEmpty(Collection<?> list, String name, Collection<JThequeError> errors)
          Reject the list if empty.
static void rejectIfEmpty(JList list, String name, Collection<JThequeError> errors)
          Reject the list if there is empty.
static void rejectIfLongerThan(CharSequence field, String name, int max, Collection<JThequeError> errors)
          Reject the field if longer than a max.
static void rejectIfNothingSelected(ComboBoxModel model, String name, Collection<JThequeError> errors)
          Reject the model if nothing is selected.
static void rejectIfNothingSelected(JList list, String name, Collection<JThequeError> errors)
          Reject the list if nothing is selected.
static void rejectIfNotNumerical(String field, String name, Collection<JThequeError> errors)
          Reject the field if not numerical.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

rejectIfEmpty

public static void rejectIfEmpty(CharSequence field,
                                 String name,
                                 Collection<JThequeError> errors)
Reject the field if empty.

Parameters:
field - The field to test.
name - The name of the field.
errors - The errors list.

rejectIfLongerThan

public static void rejectIfLongerThan(CharSequence field,
                                      String name,
                                      int max,
                                      Collection<JThequeError> errors)
Reject the field if longer than a max.

Parameters:
field - The field to test.
name - The name of the field.
max - The max length of the field.
errors - The errors list.

rejectIfNothingSelected

public static void rejectIfNothingSelected(JList list,
                                           String name,
                                           Collection<JThequeError> errors)
Reject the list if nothing is selected.

Parameters:
list - The list to test.
name - The name of the field.
errors - The errors list.

rejectIfNothingSelected

public static void rejectIfNothingSelected(ComboBoxModel model,
                                           String name,
                                           Collection<JThequeError> errors)
Reject the model if nothing is selected.

Parameters:
model - The model to test.
name - The name of the field.
errors - The errors list.

rejectIfNotNumerical

public static void rejectIfNotNumerical(String field,
                                        String name,
                                        Collection<JThequeError> errors)
Reject the field if not numerical.

Parameters:
field - The field to test.
name - The name of the field.
errors - The errors list.

rejectIfEmpty

public static void rejectIfEmpty(Collection<?> list,
                                 String name,
                                 Collection<JThequeError> errors)
Reject the list if empty.

Parameters:
list - The list to test.
name - The name of the field.
errors - The errors list.

rejectIfEmpty

public static void rejectIfEmpty(JList list,
                                 String name,
                                 Collection<JThequeError> errors)
Reject the list if there is empty.

Parameters:
list - The list to test.
name - The name of the list.
errors - The errors to fill.


Copyright © 2010 JTheque. All Rights Reserved.