com.jgoodies.validation.tutorial.validator
Class ValidatingOrderEditor

java.lang.Object
  extended by com.jgoodies.validation.tutorial.util.TutorialApplication
      extended by com.jgoodies.validation.tutorial.validator.ValidatingOrderEditor
All Implemented Interfaces:
com.jgoodies.validation.Validatable

public final class ValidatingOrderEditor
extends TutorialApplication
implements com.jgoodies.validation.Validatable

A view that validates its GUI state. On OK pressed the GUI state is validated, and a modal dialog shows the errors and warnings - if any. The domain model will be updated only, if the GUI state has no errors - though it may have warnings.

This class exists for learning and demonstration purposes only. Typically you won't validate the GUI state, but validate the domain object properties or the presentation model state. See the SimpleDomainValidationExample for a similar example that validates the domain object, not the GUI state.

Version:
$Revision: 1.18 $
Author:
Karsten Lentzsch
See Also:
SimpleDomainValidationExample

Constructor Summary
ValidatingOrderEditor()
           
 
Method Summary
 JComponent buildPanel()
          Builds the whole editor.
protected  void initComponents()
          Creates and initializes the UI components.
static void main(String[] args)
           
protected  void startup(String[] args)
          Starts this application when the application is launched.
 com.jgoodies.validation.ValidationResult validate()
          Validates the order and returns a ValidationResult.
 
Methods inherited from class com.jgoodies.validation.tutorial.util.TutorialApplication
createFrame, initializeLookAndFeel, launch, locateOnOpticalScreenCenter, packAndShowOnScreenCenter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatingOrderEditor

public ValidatingOrderEditor()
Method Detail

main

public static void main(String[] args)

startup

protected void startup(String[] args)
Description copied from class: TutorialApplication
Starts this application when the application is launched. A typical application creates and shows the GUI in this method. This method runs on the event dispatching thread.

Called by the static launch method.

Specified by:
startup in class TutorialApplication
Parameters:
args - optional launch arguments, often the main method's arguments.
See Also:
TutorialApplication.launch(Class, String[])

initComponents

protected void initComponents()
Creates and initializes the UI components.


buildPanel

public JComponent buildPanel()
Builds the whole editor.

Returns:
the editor panel with a report area at the bottom

validate

public com.jgoodies.validation.ValidationResult validate()
Validates the order and returns a ValidationResult.

Specified by:
validate in interface com.jgoodies.validation.Validatable
Returns:
the ValidationResult of the pure order validation


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