System.err
.println("Warning: SocketException in CommunicationManager."
+ " Most likely client (browser) closed socket.");
-
- } else {
- // throw it to standard error stream too
- t.printStackTrace();
+ return;
}
// Finds the original source of the error/exception
((AbstractComponent) owner)
.setComponentError(new SystemError(e));
}
+ } else {
+ /*
+ * Can't show it to the user in any way so we print to standard
+ * error
+ */
+ t.printStackTrace();
+
}
}
import java.util.Map;\r
\r
import com.itmill.toolkit.ui.Component;\r
-import com.itmill.toolkit.ui.AbstractField.ComponentErrorEvent;\r
+import com.itmill.toolkit.ui.AbstractComponent.ComponentErrorEvent;\r
\r
public class ChangeVariablesErrorEvent implements ComponentErrorEvent {\r
\r
import com.itmill.toolkit.terminal.PaintException;
import com.itmill.toolkit.terminal.PaintTarget;
import com.itmill.toolkit.terminal.Resource;
+import com.itmill.toolkit.terminal.Terminal;
/**
* An abstract class that defines default implementation for the
private int widthUnit = UNITS_PIXELS;
private int heightUnit = UNITS_PIXELS;
+ private ComponentErrorHandler errorHandler = null;
+
/* Constructor */
/**
return values;
}
+ public interface ComponentErrorEvent extends Terminal.ErrorEvent {
+ }
+
+ public interface ComponentErrorHandler {
+ /**
+ * 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;
+ }
+
+ public boolean handleError(ComponentErrorEvent error) {
+ if (errorHandler != null) {
+ return errorHandler.handleComponentError(error);
+ }
+ return false;
+
+ }
+
}
\ No newline at end of file
import com.itmill.toolkit.terminal.ErrorMessage;
import com.itmill.toolkit.terminal.PaintException;
import com.itmill.toolkit.terminal.PaintTarget;
-import com.itmill.toolkit.terminal.Terminal;
/**
* <p>
*/
private boolean validationVisible = true;
- private ComponentErrorHandler errorHandler = null;
-
/* Component basics ************************************************ */
/*
}
}
- public interface ComponentErrorHandler {
- /**
- * 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;
- }
-
- public boolean handleError(ComponentErrorEvent error) {
- if (errorHandler != null) {
- return errorHandler.handleComponentError(error);
- }
- return false;
-
- }
-
/**
* Sets the current buffered source exception.
*
requestRepaint();
}
- public interface ComponentErrorEvent extends Terminal.ErrorEvent {
- }
-
}
\ No newline at end of file