info.joseluismartin.gui.validation
Class BackgroundErrorProcessor

java.lang.Object
  extended by info.joseluismartin.gui.validation.BackgroundErrorProcessor
All Implemented Interfaces:
ErrorProcessor

public class BackgroundErrorProcessor
extends Object
implements ErrorProcessor

ErrorProcessor that change background color of JComponent and add a tooltip with error message on binding errors.

Since:
1.1
Author:
Jose Luis Martin - (jlm@joseluismartin.info)
See Also:
ErrorProcessor, AbstractView

Constructor Summary
BackgroundErrorProcessor()
           
 
Method Summary
 Color getErrorColor()
           
 org.springframework.context.MessageSource getMessageSource()
           
 void processError(Binder<?> binder, org.springframework.validation.FieldError error)
           
 void processError(Object control, org.springframework.validation.FieldError error)
          Process binding error.
 void reset()
          clear state of ErrorProcessor.
 void setErrorColor(Color errorColor)
           
 void setMessageSource(org.springframework.context.MessageSource messageSource)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BackgroundErrorProcessor

public BackgroundErrorProcessor()
Method Detail

processError

public void processError(Binder<?> binder,
                         org.springframework.validation.FieldError error)

processError

public void processError(Object control,
                         org.springframework.validation.FieldError error)
Process binding error. Usefull for do control interaction on binding erros, like set a tooltip with error, change background and so.

Specified by:
processError in interface ErrorProcessor
Parameters:
control - the control that generate the error
error - the spring validation error Object

reset

public void reset()
clear state of ErrorProcessor. Usefull for undo control changes made in processError.

Specified by:
reset in interface ErrorProcessor

getErrorColor

public Color getErrorColor()
Returns:
the errorColor

setErrorColor

public void setErrorColor(Color errorColor)
Parameters:
errorColor - the errorColor to set

getMessageSource

public org.springframework.context.MessageSource getMessageSource()
Returns:
the messageSource

setMessageSource

public void setMessageSource(org.springframework.context.MessageSource messageSource)
Parameters:
messageSource - the messageSource to set


Copyright © 2013 JDAL. All Rights Reserved.