01: package org.uispec4j.interception;
02:
03: import org.uispec4j.Trigger;
04: import org.uispec4j.Window;
05:
06: /**
07: * Interface used for defining modal dialog handlers.
08: *
09: * @see WindowInterceptor
10: * @see <a href="http://www.uispec4j.org/interception.html">Intercepting windows</a>
11: */
12: public abstract class WindowHandler {
13: private String name;
14:
15: protected WindowHandler() {
16: }
17:
18: /**
19: * Gives a name to the handler, for description purposes only.
20: * The name is used to clarify the test code, and it will be used by UISpec4J
21: * when displaying error messages.
22: */
23: protected WindowHandler(String stepName) {
24: this .name = stepName;
25: }
26:
27: /**
28: * Handles the shown window and returns a trigger that will close it.
29: */
30: public abstract Trigger process(Window window) throws Exception;
31:
32: public String getName() {
33: return name;
34: }
35:
36: public void setName(String name) {
37: this.name = name;
38: }
39: }
|