org.scopemvc.view.swing
Class ValidationHelper

java.lang.Object
  |
  +--org.scopemvc.view.swing.ValidationHelper

public class ValidationHelper
extends java.lang.Object

Handles ModelBindable.validationFailed(java.lang.Exception) and ModelBindable.validationSuccess() by setting the background colour of the parent component to a new colour and being able to generate an "error tooltip" that is coloured and contains the localized error message from the validation failure.

Version:
$Revision: 1.4 $ $Date: 2002/09/05 15:41:50 $
Author:
Steve Meyfroidt

Field Summary
static java.awt.Color VALIDATION_FAILED_COLOR
          TODO: describe of the Field
 
Constructor Summary
ValidationHelper(javax.swing.JComponent inComponent)
           
 
Method Summary
 javax.swing.JToolTip createToolTip(javax.swing.JToolTip inTip)
          Parent should call this in its createTooltip() to allow helper to substitute an error tooltip.
 void validationFailed(java.lang.Exception inException)
          Signal that validation failed.
 void validationSuccess()
          Signal that validation succeeded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALIDATION_FAILED_COLOR

public static final java.awt.Color VALIDATION_FAILED_COLOR
TODO: describe of the Field

Constructor Detail

ValidationHelper

public ValidationHelper(javax.swing.JComponent inComponent)
Parameters:
inComponent - parent JComponent.
Method Detail

validationFailed

public void validationFailed(java.lang.Exception inException)
Signal that validation failed.

Parameters:
inException - what caused the validation failure. Should contain a user-readable message in getLocalizedMessage().

validationSuccess

public void validationSuccess()
Signal that validation succeeded.


createToolTip

public javax.swing.JToolTip createToolTip(javax.swing.JToolTip inTip)
Parent should call this in its createTooltip() to allow helper to substitute an error tooltip.

Parameters:
inTip - normal tooltip created by parent.
Returns:
tooltip that may be an "error tooltip" rather than the passed default tooltip.


Copyright © 2000-2002 The Scope Team. All Rights Reserved.