001    package org.apache.myfaces.tobago.renderkit.wml.standard.standard.tag;
002    
003    /*
004     * Licensed to the Apache Software Foundation (ASF) under one or more
005     * contributor license agreements.  See the NOTICE file distributed with
006     * this work for additional information regarding copyright ownership.
007     * The ASF licenses this file to You under the Apache License, Version 2.0
008     * (the "License"); you may not use this file except in compliance with
009     * the License.  You may obtain a copy of the License at
010     *
011     *      http://www.apache.org/licenses/LICENSE-2.0
012     *
013     * Unless required by applicable law or agreed to in writing, software
014     * distributed under the License is distributed on an "AS IS" BASIS,
015     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016     * See the License for the specific language governing permissions and
017     * limitations under the License.
018     */
019    
020    /*
021      * Created 28.04.2003 at 15:29:36.
022      * $Id:PanelRenderer.java 472227 2006-11-07 21:05:00 +0100 (Tue, 07 Nov 2006) bommel $
023      */
024    
025    import org.apache.myfaces.tobago.component.UIPanel;
026    import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
027    import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
028    
029    import javax.faces.component.UIComponent;
030    import javax.faces.context.FacesContext;
031    import java.io.IOException;
032    import java.util.Iterator;
033    
034    public class PanelRenderer extends LayoutableRendererBase {
035    
036      public boolean getRendersChildren() {
037        return true;
038      }
039    
040      public void encodeChildren(FacesContext facesContext,
041          UIComponent uiComponent) throws IOException {
042    
043        UIPanel component = (UIPanel) uiComponent;
044        for (Iterator i = component.getChildren().iterator(); i.hasNext();) {
045          UIComponent child = (UIComponent) i.next();
046          RenderUtil.encode(facesContext, child);
047        }
048      }
049    
050      public void encodeEnd(FacesContext facesContext,
051          UIComponent uiComponent) throws IOException {
052    
053        //UIPanel component = (UIPanel) uiComponent ;
054        //BodyContentHandler bodyContentHandler = (BodyContentHandler)
055        //    component.getAttributes().get(ATTR_BODY_CONTENT);
056    
057        //if (bodyContentHandler != null) {
058        //  ResponseWriter writer = facesContext.getResponseWriter();
059        //  writer.write(bodyContentHandler.getBodyContent());
060        //}
061      }
062    
063    }
064