01: /* TabsDefaultV.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Sep 6, 2007 6:21:35 PM , Created by robbiecheng
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:
24: import org.zkoss.zk.ui.Component;
25: import org.zkoss.zk.ui.render.ComponentRenderer;
26: import org.zkoss.zk.ui.render.SmartWriter;
27: import org.zkoss.zul.Tabs;
28:
29: /**
30: * {@link Tabs}'s default mold for vertial orient only.
31: *
32: * @author robbiecheng
33: *
34: * @since 3.0.0
35: */
36: public class TabsDefaultV implements ComponentRenderer {
37: public void render(Component comp, Writer out) throws IOException {
38: final SmartWriter wh = new SmartWriter(out);
39: final Tabs self = (Tabs) comp;
40: final String look = self.getTabbox().getTabLook() + '-';
41:
42: wh
43: .write("<td id=\"")
44: .write(self.getUuid())
45: .write("\" align=\"right\" z.type=\"zul.tab.Tabs\"")
46: .write(self.getOuterAttrs())
47: .write(self.getInnerAttrs())
48: .write('>')
49: .writeln(
50: "<table class=\"vtabsi\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
51:
52: /* prefix row */
53: wh
54: .writeln(
55: "<tr><td align=\"right\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">")
56: .write("<tr><td class=\"").write(look).writeln(
57: "first1\"></td></tr>").write("<tr id=\"")
58: .write(self.getUuid()).write("!first\"><td class=\"")
59: .write(look).writeln(
60: "first2\"></td></tr></table></td></tr>");
61:
62: wh.writeChildren(self);
63:
64: wh.write("<tr style=\"display:none\" id=\"").write(
65: self.getUuid()).writeln("!child\"><td></td></tr>"); //bookmark for adding children
66:
67: /* postfix row */
68: wh
69: .writeln(
70: "<tr><td align=\"right\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">")
71: .write("<tr id=\"").write(self.getUuid()).write(
72: "!last\">").write("<td class=\"").write(look)
73: .writeln("last1\"></td></tr>")
74: .write("<tr><td class=\"").write(look).writeln(
75: "last2\"></td></tr>").writeln(
76: "</table></td></tr>");
77:
78: wh.writeln("</table></td>");
79: }
80: }
|