01: /*************************************************************************
02: * *
03: * 1) This source code file, in unmodified form, and compiled classes *
04: * derived from it can be used and distributed without restriction, *
05: * including for commercial use. (Attribution is not required *
06: * but is appreciated.) *
07: * *
08: * 2) Modified versions of this file can be made and distributed *
09: * provided: the modified versions are put into a Java package *
10: * different from the original package, edu.hws; modified *
11: * versions are distributed under the same terms as the original; *
12: * and the modifications are documented in comments. (Modification *
13: * here does not include simply making subclasses that belong to *
14: * a package other than edu.hws, which can be done without any *
15: * restriction.) *
16: * *
17: * David J. Eck *
18: * Department of Mathematics and Computer Science *
19: * Hobart and William Smith Colleges *
20: * Geneva, New York 14456, USA *
21: * Email: eck@hws.edu WWW: http://math.hws.edu/eck/ *
22: * *
23: *************************************************************************/package edu.hws.jcm.awt;
24:
25: /**
26: * To allow different styles of reporting errors, a
27: * Controller uses an ErrorReporter to report any
28: * errors that are thrown during its checkInput/compute
29: * cycle. The DisplayCanvas and MessagePopup classes
30: * implement this interface.
31: *
32: * @author David Eck
33: */
34: public interface ErrorReporter {
35:
36: /**
37: * Report the specifed message as an error. If source is non-null,
38: * then it is the Controller that called this routine. In that case,
39: * if the error reporter is capable of clearing its own error
40: * condition, it should call source.errorCleared() when it does so.
41: *
42: * @param source Controller that called this method (if non-null).
43: * @param message error message to report.
44: */
45: public void setErrorMessage(Controller source, String message);
46:
47: /**
48: * Clear the error reprort, if there is one.
49: */
50: public void clearErrorMessage();
51:
52: /**
53: * Get the error message that is currently being displayed, or
54: * return null if there is no error message.
55: */
56: public String getErrorMessage();
57:
58: }
|