01: /* RowDefault.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Sep 7, 2007 11:12:19 AM , Created by jumperchen
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.zkmax.zul.render;
20:
21: import java.io.IOException;
22: import java.io.Writer;
23: import java.util.Iterator;
24:
25: import org.zkoss.zk.ui.Component;
26: import org.zkoss.zk.ui.render.ComponentRenderer;
27: import org.zkoss.zk.ui.render.SmartWriter;
28: import org.zkoss.zul.Row;
29:
30: /*
31: * {@link Row}'s default mold.
32: *
33: * @author jumperchen
34: *
35: * @since 3.0.0
36: */
37: public class RowDefault implements ComponentRenderer {
38:
39: public void render(Component comp, Writer out) throws IOException {
40: final SmartWriter wh = new SmartWriter(out);
41: final Row self = (Row) comp;
42: final String uuid = self.getUuid();
43: wh.write("<tr z.type=\"Grw\" id=\"").write(uuid).write('"')
44: .write(self.getOuterAttrs())
45: .write(self.getInnerAttrs()).write('>');
46:
47: int i = 0;
48: for (Iterator it = self.getChildren().iterator(); it.hasNext(); i++) {
49: final Component child = (Component) it.next();
50: wh.write("<td z.type=\"Gcl\" id=\"").write(child.getUuid())
51: .write("!chdextr\"").write(self.getChildAttrs(i))
52: .write("><div id=\"").write(child.getUuid()).write(
53: "!cell\" class=\"gc cell-inner\">");
54:
55: child.redraw(out);
56:
57: wh.writeln("</div></td>");
58: }
59:
60: wh.writeln("</tr>");
61: }
62:
63: }
|