diff options
author | Artur Signell <artur@vaadin.com> | 2012-11-19 13:40:14 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-11-21 15:18:31 +0200 |
commit | c454797201969a03fa43000d8bb8ccb30ef5b437 (patch) | |
tree | 34f69ce9af70a7112ae69008d6eb8f03c7d961b8 /server/src/com/vaadin/ui/AbstractComponent.java | |
parent | 6ed87c1b6ce280082c2dee21a6f87c1620e0ea79 (diff) | |
download | vaadin-framework-c454797201969a03fa43000d8bb8ccb30ef5b437.tar.gz vaadin-framework-c454797201969a03fa43000d8bb8ccb30ef5b437.zip |
Replaced ComponentErrorHandler with generic ErrorHandler (#10231)
* Replaced AbstractComponent ErrorHandler with ClientConnector level error handler. Now uses the same ErrorHandler as other parts of the framework.
* Made error handling hierarchical so that the error handler of the connector where the error occured or its ancestors is used. Falls back to VaadinSession ErrorHandler.
* Changed ErrorEvent to be a class as all other events in the framework
* Renamed ErrorListener to ErrorHandler and DefaultErrorListener to DefaultErrorHandler for consistency
* Unified error handling in AbstractCommunicationManager
* Unified error handling in VaadinServlet and VaadinPortlet
* Removed superfluous ErrorEvent implementations (#10232)
Change-Id: Ied518e05209fe54685f4bebab0709b1cd5584fd1
Diffstat (limited to 'server/src/com/vaadin/ui/AbstractComponent.java')
-rw-r--r-- | server/src/com/vaadin/ui/AbstractComponent.java | 61 |
1 files changed, 2 insertions, 59 deletions
diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index 2ce3e25b2a..811a1dc2f6 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -30,6 +30,7 @@ import com.vaadin.event.ShortcutListener; import com.vaadin.server.AbstractClientConnector; import com.vaadin.server.ClientConnector; import com.vaadin.server.ComponentSizeValidator; +import com.vaadin.server.ErrorHandler; import com.vaadin.server.ErrorMessage; import com.vaadin.server.Resource; import com.vaadin.server.VaadinSession; @@ -83,7 +84,7 @@ public abstract class AbstractComponent extends AbstractClientConnector private static final Pattern sizePattern = Pattern .compile("^(-?\\d+(\\.\\d+)?)(%|px|em|ex|in|cm|mm|pt|pc)?$"); - private ComponentErrorHandler errorHandler = null; + private ErrorHandler errorHandler = null; /** * Keeps track of the Actions added to this component; the actual @@ -891,64 +892,6 @@ public abstract class AbstractComponent extends AbstractClientConnector } } - public interface ComponentErrorEvent extends com.vaadin.server.ErrorEvent { - } - - public interface ComponentErrorHandler extends Serializable { - /** - * Handle the component error - * - * @param event - * @return True if the error has been handled False, otherwise - */ - public boolean handleComponentError(ComponentErrorEvent event); - } - - /** - * Gets the error handler for the component. - * - * The error handler is dispatched whenever there is an error processing the - * data coming from the client. - * - * @return - */ - public ComponentErrorHandler getErrorHandler() { - return errorHandler; - } - - /** - * Sets the error handler for the component. - * - * The error handler is dispatched whenever there is an error processing the - * data coming from the client. - * - * If the error handler is not set, the application error handler is used to - * handle the exception. - * - * @param errorHandler - * AbstractField specific error handler - */ - public void setErrorHandler(ComponentErrorHandler errorHandler) { - this.errorHandler = errorHandler; - } - - /** - * Handle the component error event. - * - * @param error - * Error event to handle - * @return True if the error has been handled False, otherwise. If the error - * haven't been handled by this component, it will be handled in the - * application error handler. - */ - public boolean handleError(ComponentErrorEvent error) { - if (errorHandler != null) { - return errorHandler.handleComponentError(error); - } - return false; - - } - /* * Actions */ |