com.jgoodies.validation.tutorial.util
Class TutorialUtils

java.lang.Object
  extended by com.jgoodies.validation.tutorial.util.TutorialUtils

public final class TutorialUtils
extends Object

Consists only of static convenience methods used throughout the examples of the JGoodies Validation tutorial.

Version:
$Revision: 1.12 $
Author:
Karsten Lentzsch

Method Summary
static PropertyChangeListener createDebugPropertyChangeListener()
          Returns a listener that writes bean property changes to the console.
static Action getCloseAction()
          Creates and returns an Action that exists the system if performed.
static com.jgoodies.validation.ValidationResult getErrorsResult()
          Lazily creates and returns an example ValidationResult that contains only errors.
static com.jgoodies.validation.ValidationResult getMixedResult()
          Lazily creates and returns an example ValidationResult that contains errors and warnings.
static com.jgoodies.validation.ValidationResult getWarningsResult()
          Lazily creates and returns an example ValidationResult that contains only warnings.
static void showValidationMessage(ActionEvent e, String headerText, com.jgoodies.validation.ValidationResult validationResult)
          Opens a message dialog that shows the validation result, things the user must fix, before the selection can change.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createDebugPropertyChangeListener

public static PropertyChangeListener createDebugPropertyChangeListener()
Returns a listener that writes bean property changes to the console. The log entry includes the PropertyChangeEvent's source, property name, old value, and new value.

Returns:
a debug listener that logs bean changes to the console

getCloseAction

public static Action getCloseAction()
Creates and returns an Action that exists the system if performed.

Returns:
an Action that exists the system if performed
See Also:
System.exit(int)

getErrorsResult

public static com.jgoodies.validation.ValidationResult getErrorsResult()
Lazily creates and returns an example ValidationResult that contains only errors.

Returns:
a ValidationResult that contains only errors

getMixedResult

public static com.jgoodies.validation.ValidationResult getMixedResult()
Lazily creates and returns an example ValidationResult that contains errors and warnings.

Returns:
a ValidationResult that contains errors and warnings

getWarningsResult

public static com.jgoodies.validation.ValidationResult getWarningsResult()
Lazily creates and returns an example ValidationResult that contains only warnings.

Returns:
a ValidationResult that contains only warnings

showValidationMessage

public static void showValidationMessage(ActionEvent e,
                                         String headerText,
                                         com.jgoodies.validation.ValidationResult validationResult)
Opens a message dialog that shows the validation result, things the user must fix, before the selection can change.

Parameters:
headerText - the text displayed above the validation message
validationResult - the validation result to be displayed
Throws:
IllegalArgumentException - if the validation result is empty


Copyright © 2003-2008 JGoodies Karsten Lentzsch. All Rights Reserved.