01: /* PageComponent.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Aug 8, 2007 5:48:27 PM 2007, Created by Dennis.Chen
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.jsf.zul;
20:
21: import org.zkoss.jsf.zul.impl.RootComponent;
22: import org.zkoss.zk.ui.Execution;
23:
24: /**
25: * Defines a ZK page.
26: * It is responsible for handling the lifecycle for ZK components, such
27: * as event processing and rendering,
28: *
29: * <p>All other ZULJSF Component must be placed inside a {@link org.zkoss.jsf.zul.Page}.
30: * Nested page component are not allowed.
31: *
32: * @author Dennis.Chen
33: *
34: */
35: public class Page extends RootComponent {
36:
37: private String _style;
38:
39: /** Returns the style.
40: * Default: null (no style at all).
41: */
42: public String getStyle() {
43: return _style;
44: }
45:
46: /** Sets the style.
47: */
48: public void setStyle(String style) {
49: _style = style != null && style.length() > 0 ? style : null;
50: }
51:
52: /** Creates and returns the page.
53: */
54: protected void init(Execution exec, org.zkoss.zk.ui.Page page) {
55: super.init(exec, page);
56:
57: page.setStyle(_style);
58: }
59: }
|