com.silvermindsoftware.hitch.validation.response
Class DefaultValidationResponder

java.lang.Object
  extended by com.silvermindsoftware.hitch.validation.response.DefaultValidationResponder
All Implemented Interfaces:
ValidationResponder

public class DefaultValidationResponder
extends Object
implements ValidationResponder

A default ValidationResponder that makes the background of the corresponding GUI element red.

Author:
Stefan Wismer (SWI)
File-location:
DefaultValidationResponder
Last check-in date:
2009-08-04 14:25:40 +0200 (Di, 04. Aug 2009) by swismer for revision 3874

Field Summary
protected  Color m_invalidColor
          Color to mark value as invalid.
protected static String VALID_COLOR
          Identifier for valid color in component's client property.
 
Constructor Summary
DefaultValidationResponder()
          The default constructor reading the invalidColor from Spring config.
DefaultValidationResponder(Color color)
           
 
Method Summary
 void setInvalid(Object object, JComponent component, String message)
          The value in the component is invalid.
 void setValid(Object object, JComponent component)
          The value in the component is valid.
 void setValid(Object object, JComponent component, boolean valid)
          The value in the component is valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALID_COLOR

protected static final String VALID_COLOR
Identifier for valid color in component's client property.

See Also:
Constant Field Values

m_invalidColor

protected final Color m_invalidColor
Color to mark value as invalid.

Constructor Detail

DefaultValidationResponder

public DefaultValidationResponder()
The default constructor reading the invalidColor from Spring config.


DefaultValidationResponder

public DefaultValidationResponder(Color color)
Parameters:
color - the background color if value is invalid
Method Detail

setValid

public void setValid(Object object,
                     JComponent component,
                     boolean valid)
The value in the component is valid.

Specified by:
setValid in interface ValidationResponder
Parameters:
object - the validated object
component - the component holding the validated value
valid - true if values is valid

setValid

public void setValid(Object object,
                     JComponent component)
The value in the component is valid.

Specified by:
setValid in interface ValidationResponder
Parameters:
object - the validated object
component - the component holding the validated value

setInvalid

public void setInvalid(Object object,
                       JComponent component,
                       String message)
The value in the component is invalid.

Specified by:
setInvalid in interface ValidationResponder
Parameters:
object - the validated object
component - the component holding the invalidated value
message - the message explaining why the value is invalid


Copyright © 2005-2011 ELCA. All Rights Reserved.