01: /*
02: * Copyright 2005 Joe Walker
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.directwebremoting.proxy.browser;
17:
18: import java.util.Collection;
19:
20: import org.directwebremoting.ScriptSession;
21: import org.directwebremoting.proxy.ScriptProxy;
22:
23: /**
24: *
25: * @author Joe Walker [joe at getahead dot ltd dot uk]
26: */
27: public class Window extends ScriptProxy {
28: /**
29: * Http thread constructor, that affects no browsers.
30: * Calls to {@link Window#addScriptSession(ScriptSession)} or to
31: * {@link Window#addScriptSessions(Collection)} will be needed
32: */
33: public Window() {
34: }
35:
36: /**
37: * Http thread constructor that alters a single browser
38: * @param scriptSession The browser to alter
39: */
40: public Window(ScriptSession scriptSession) {
41: super (scriptSession);
42: }
43:
44: /**
45: * Http thread constructor that alters a number of browsers
46: * @param scriptSessions A collection of ScriptSessions that we should act on.
47: */
48: public Window(Collection<ScriptSession> scriptSessions) {
49: super (scriptSessions);
50: }
51:
52: /**
53: * Show in an 'alert' dialog
54: * @param message The text to go into the alert box
55: */
56: public void alert(String message) {
57: addFunctionCall("alert", message);
58: }
59: }
|