01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/osp/tags/sakai_2-4-1/jsf/widgets/src/java/org/theospi/jsf/renderer/XHeaderRenderer.java $
03: * $Id: XHeaderRenderer.java 10835 2006-06-17 03:25:03Z lance@indiana.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2005, 2006 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.theospi.jsf.renderer;
21:
22: import java.io.IOException;
23: import java.util.Iterator;
24:
25: import javax.faces.component.UIComponent;
26: import javax.faces.component.UIOutput;
27: import javax.faces.context.FacesContext;
28: import javax.faces.render.Renderer;
29:
30: import org.sakaiproject.jsf.util.RendererUtil;
31:
32: public class XHeaderRenderer extends Renderer {
33: static final protected String kHasRenderedJSAttribute = "printed_XH_JS";
34:
35: public boolean supportsComponentType(UIComponent component) {
36: return (component instanceof UIOutput);
37: }
38:
39: /**
40: * This class renders its own children and this is the function to do just that
41: * @param context FacesContext for the request we are processing
42: * @param component UIComponent to be rendered
43: * @exception IOException if an input/output error occurs while rendering
44: */
45: public void encodeChildren(FacesContext context,
46: UIComponent inComponent) throws IOException {
47: if (inComponent.isRendered()) {
48: Iterator iter = inComponent.getChildren().iterator();
49: while (iter.hasNext()) {
50: UIComponent step = (UIComponent) iter.next();
51: RendererUtil.encodeRecursive(context, step);
52: }
53: }
54: }
55:
56: /**
57: * This class renders its own children
58: *
59: * @param context
60: * @param component
61: * @throws IOException
62: */
63: public boolean getRendersChildren() {
64: return true;
65: }
66: }
|