Changeset 5250
- Timestamp:
- 08/25/08 05:59:54 (3 months ago)
- Location:
- trunk/src/com/itmill/toolkit
- Files:
-
- 4 modified
-
Application.java (modified) (2 diffs)
-
terminal/gwt/server/ChangeVariablesErrorEvent.java (modified) (1 diff)
-
ui/AbstractComponent.java (modified) (3 diffs)
-
ui/AbstractField.java (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/com/itmill/toolkit/Application.java
r5242 r5250 1089 1089 .println("Warning: SocketException in CommunicationManager." 1090 1090 + " Most likely client (browser) closed socket."); 1091 1092 } else { 1093 // throw it to standard error stream too 1094 t.printStackTrace(); 1091 return; 1095 1092 } 1096 1093 … … 1116 1113 .setComponentError(new SystemError(e)); 1117 1114 } 1115 } else { 1116 /* 1117 * Can't show it to the user in any way so we print to standard 1118 * error 1119 */ 1120 t.printStackTrace(); 1121 1118 1122 } 1119 1123 } -
trunk/src/com/itmill/toolkit/terminal/gwt/server/ChangeVariablesErrorEvent.java
r5242 r5250 4 4 5 5 import com.itmill.toolkit.ui.Component; 6 import com.itmill.toolkit.ui.Abstract Field.ComponentErrorEvent;6 import com.itmill.toolkit.ui.AbstractComponent.ComponentErrorEvent; 7 7 8 8 public class ChangeVariablesErrorEvent implements ComponentErrorEvent { -
trunk/src/com/itmill/toolkit/ui/AbstractComponent.java
r5235 r5250 20 20 import com.itmill.toolkit.terminal.PaintTarget; 21 21 import com.itmill.toolkit.terminal.Resource; 22 import com.itmill.toolkit.terminal.Terminal; 22 23 23 24 /** … … 121 122 private int widthUnit = UNITS_PIXELS; 122 123 private int heightUnit = UNITS_PIXELS; 124 125 private ComponentErrorHandler errorHandler = null; 123 126 124 127 /* Constructor */ … … 1171 1174 } 1172 1175 1176 public interface ComponentErrorEvent extends Terminal.ErrorEvent { 1177 } 1178 1179 public interface ComponentErrorHandler { 1180 /** 1181 * Handle the component error 1182 * 1183 * @param event 1184 * @return True if the error has been handled False, otherwise 1185 */ 1186 public boolean handleComponentError(ComponentErrorEvent event); 1187 } 1188 1189 /** 1190 * Gets the error handler for the component. 1191 * 1192 * The error handler is dispatched whenever there is an error processing the 1193 * data coming from the client. 1194 * 1195 * @return 1196 */ 1197 public ComponentErrorHandler getErrorHandler() { 1198 return errorHandler; 1199 } 1200 1201 /** 1202 * Sets the error handler for the component. 1203 * 1204 * The error handler is dispatched whenever there is an error processing the 1205 * data coming from the client. 1206 * 1207 * If the error handler is not set, the application error handler is used to 1208 * handle the exception. 1209 * 1210 * @param errorHandler 1211 * AbstractField specific error handler 1212 */ 1213 public void setErrorHandler(ComponentErrorHandler errorHandler) { 1214 this.errorHandler = errorHandler; 1215 } 1216 1217 public boolean handleError(ComponentErrorEvent error) { 1218 if (errorHandler != null) { 1219 return errorHandler.handleComponentError(error); 1220 } 1221 return false; 1222 1223 } 1224 1173 1225 } -
trunk/src/com/itmill/toolkit/ui/AbstractField.java
r5242 r5250 22 22 import com.itmill.toolkit.terminal.PaintException; 23 23 import com.itmill.toolkit.terminal.PaintTarget; 24 import com.itmill.toolkit.terminal.Terminal;25 24 26 25 /** … … 123 122 private boolean validationVisible = true; 124 123 125 private ComponentErrorHandler errorHandler = null;126 127 124 /* Component basics ************************************************ */ 128 125 … … 1086 1083 } 1087 1084 1088 public interface ComponentErrorHandler {1089 /**1090 * Handle the component error1091 *1092 * @param event1093 * @return True if the error has been handled False, otherwise1094 */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 the1102 * data coming from the client.1103 *1104 * @return1105 */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 the1114 * data coming from the client.1115 *1116 * If the error handler is not set, the application error handler is used to1117 * handle the exception.1118 *1119 * @param errorHandler1120 * AbstractField specific error handler1121 */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 1134 1085 /** 1135 1086 * Sets the current buffered source exception. … … 1143 1094 } 1144 1095 1145 public interface ComponentErrorEvent extends Terminal.ErrorEvent {1146 }1147 1148 1096 }
