Show
Ignore:
Timestamp:
08/25/08 05:59:54 (5 months ago)
Author:
artur.signell@…
Message:

Made #1642 fix more generic by moving implementation to AbstractComponent?

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/com/itmill/toolkit/ui/AbstractField.java

    r5242 r5250  
    2222import com.itmill.toolkit.terminal.PaintException; 
    2323import com.itmill.toolkit.terminal.PaintTarget; 
    24 import com.itmill.toolkit.terminal.Terminal; 
    2524 
    2625/** 
     
    123122    private boolean validationVisible = true; 
    124123 
    125     private ComponentErrorHandler errorHandler = null; 
    126  
    127124    /* Component basics ************************************************ */ 
    128125 
     
    10861083    } 
    10871084 
    1088     public interface ComponentErrorHandler { 
    1089         /** 
    1090          * Handle the component error 
    1091          *  
    1092          * @param event 
    1093          * @return True if the error has been handled False, otherwise 
    1094          */ 
    1095         public boolean handleComponentError(ComponentErrorEvent event); 
    1096     } 
    1097  
    1098     /** 
    1099      * Gets the error handler for the component. 
    1100      *  
    1101      * The error handler is dispatched whenever there is an error processing the 
    1102      * data coming from the client. 
    1103      *  
    1104      * @return 
    1105      */ 
    1106     public ComponentErrorHandler getErrorHandler() { 
    1107         return errorHandler; 
    1108     } 
    1109  
    1110     /** 
    1111      * Sets the error handler for the component. 
    1112      *  
    1113      * The error handler is dispatched whenever there is an error processing the 
    1114      * data coming from the client. 
    1115      *  
    1116      * If the error handler is not set, the application error handler is used to 
    1117      * handle the exception. 
    1118      *  
    1119      * @param errorHandler 
    1120      *                AbstractField specific error handler 
    1121      */ 
    1122     public void setErrorHandler(ComponentErrorHandler errorHandler) { 
    1123         this.errorHandler = errorHandler; 
    1124     } 
    1125  
    1126     public boolean handleError(ComponentErrorEvent error) { 
    1127         if (errorHandler != null) { 
    1128             return errorHandler.handleComponentError(error); 
    1129         } 
    1130         return false; 
    1131  
    1132     } 
    1133  
    11341085    /** 
    11351086     * Sets the current buffered source exception. 
     
    11431094    } 
    11441095 
    1145     public interface ComponentErrorEvent extends Terminal.ErrorEvent { 
    1146     } 
    1147  
    11481096}