01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/jsf/tags/sakai_2-4-1/widgets/src/java/org/sakaiproject/jsf/renderer/DynaTableRenderer.java $
03: * $Id: DynaTableRenderer.java 9278 2006-05-10 23:29:21Z ray@media.berkeley.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2003, 2004 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.jsf.renderer;
21:
22: import java.io.IOException;
23:
24: import javax.faces.component.UIComponent;
25: import javax.faces.context.FacesContext;
26: import javax.faces.context.ResponseWriter;
27:
28: import org.sakaiproject.jsf.util.RendererUtil;
29:
30: /**
31: * <p>Description: </p>
32: * <p>Render data like a dataTable but support the MultiColumn component.</p>
33: * <p>Copyright: Copyright (c) 2004</p>
34: * <p>Organization: Sakai Project</p>
35: * @author Ed Smiley
36: * @version $Id: DynaTableRenderer.java 9278 2006-05-10 23:29:21Z ray@media.berkeley.edu $
37: */
38:
39: public class DynaTableRenderer extends DynaRendererBase {
40:
41: private static RendererUtil util;
42:
43: /**
44: * <p>Faces render output method .</p>
45: * <p>Encode beginning of table.</p>
46: *
47: * @param context <code>FacesContext</code> for the current request
48: * @param component <code>UIComponent</code> being rendered
49: *
50: * @throws IOException if an input/output error occurs
51: */
52: public void encodeBegin(FacesContext context, UIComponent component)
53: throws IOException {
54: if (!component.isRendered()) {
55: return;
56: }
57:
58: ResponseWriter writer = context.getResponseWriter();
59: writer.startElement("table", component);
60: writer.writeAttribute("id", component.getClientId(context),
61: "id");
62: // util.writePassthroughs(context, component);
63: }
64:
65: /**
66: * <p>Faces render output method .</p>
67: * <p>Encode end of table.</p>
68: *
69: * @param context <code>FacesContext</code> for the current request
70: * @param component <code>UIComponent</code> being rendered
71: *
72: * @throws IOException if an input/output error occurs
73: */
74: public void encodeEnd(FacesContext context, UIComponent component)
75: throws IOException {
76: if (!component.isRendered()) {
77: return;
78: }
79: ResponseWriter writer = context.getResponseWriter();
80: writer.endElement("table");
81: }
82:
83: }
|