01: /* AuPopup.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Thu Oct 18 16:53:37 2007, Created by tomyeh
10: }}IS_NOTE
11:
12: Copyright (C) 2007 Potix Corporation. All Rights Reserved.
13:
14: {{IS_RIGHT
15: This program is distributed under GPL Version 2.0 in the hope that
16: it will be useful, but WITHOUT ANY WARRANTY.
17: }}IS_RIGHT
18: */
19: package org.zkoss.zul.au.out;
20:
21: import org.zkoss.zk.ui.Component;
22: import org.zkoss.zk.au.AuResponse;
23:
24: /**
25: * A response to ask the client to open or to close a popup.
26: *
27: * <p>data[0]: the component UUID<br/>
28: * data[1]: what operation to do. 0: close, 1: open by ref, 2: open by (x,y)
29: * data[2]: the x coordination<br/>
30: * data[3]: the y coordination
31: *
32: * <p>Note: the first argument is always the component itself.
33: *
34: * @author tomyeh
35: * @since 3.0.0
36: */
37: public class AuPopup extends AuResponse {
38: /** Constructs an instance to open the popup at specified location.
39: * Note: the component must implement the zkType.context JavaScript function.
40: *
41: * @param comp the component that this script depends on.
42: * It cannot be null.
43: * @param x the x coordination
44: * @param y the y coordination
45: */
46: public AuPopup(Component comp, String x, String y) {
47: super ("popup", comp, new String[] { comp.getUuid(), "2", x, y });
48: }
49:
50: /** Constructs an instance to open the popup at specified location.
51: * Note: the component must implement the zkType.context JavaScript function.
52: *
53: * @param comp the component that this script depends on.
54: * It cannot be null.
55: * @param ref the reference component
56: */
57: public AuPopup(Component comp, Component ref) {
58: super ("popup", comp, new String[] { comp.getUuid(), "1",
59: ref.getUuid() });
60: }
61:
62: /** Constructs an instance to close the popup.
63: *
64: * @param comp the component that this script depends on.
65: * It cannot be null.
66: * @param option ignored.
67: */
68: public AuPopup(Component comp, boolean option) {
69: super ("popup", comp, new String[] { comp.getUuid(), "0" });
70: }
71:
72: }
|