01: /* GroupboxDefault.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Wed Sep 5 13:18:53 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.zkmax.zul.render;
20:
21: import java.io.Writer;
22: import java.io.IOException;
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.Groupbox;
29:
30: /**
31: * {@link Groupbox}'s default mold.
32: *
33: * @author dennis.chen
34: * @since 3.0.0
35: */
36: public class GroupboxDefault implements ComponentRenderer {
37:
38: public void render(Component comp, Writer out) throws IOException {
39: final SmartWriter wh = new SmartWriter(out);
40: final Groupbox self = (Groupbox) comp;
41: wh.write("<fieldset id=\"").write(self.getUuid()).write("\"");
42: wh.write(self.getOuterAttrs()).write(self.getInnerAttrs())
43: .writeln(">");
44: wh.write(self.getCaption());
45:
46: for (Iterator it = self.getChildren().iterator(); it.hasNext();) {
47: final Component child = (Component) it.next();
48: if (self.getCaption() != child)
49: child.redraw(out);
50: }
51:
52: wh.writeln("</fieldset>");
53: }
54: }
|