01: /* MenubarHorizontal.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Thu Sep 6 2007, Created by Jeff.Liu
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.Menubar;
28:
29: /**
30: * {@link Menubar}'s horizontal mold.
31: * @author Jeff Liu
32: * @since 3.0.0
33: */
34: public class MenubarHorizontal implements ComponentRenderer {
35:
36: public void render(Component comp, Writer out) throws IOException {
37: final SmartWriter wh = new SmartWriter(out);
38: final Menubar self = (Menubar) comp;
39: final String uuid = self.getUuid();
40: wh.write("<div id=\"").write(uuid).write(
41: "\" z.type=\"zul.menu.Menubar\"");
42: wh.write(self.getOuterAttrs()).write(self.getInnerAttrs())
43: .write('>');
44: wh.writeln("<table cellpadding=\"0\" cellspacing=\"0\">");
45: wh.write("<tr valign=\"bottom\" id=\"").write(uuid).writeln(
46: "!cave\">");
47: wh.writeChildren(self);
48: wh.write("</tr>\n</table></div>");
49: }
50: }
|