KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portal > faces > renderer > html > container > ContainerRowRenderer


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.portal.faces.renderer.html.container;
6
7 import java.util.* ;
8 import java.io.IOException JavaDoc;
9 import javax.faces.context.FacesContext;
10 import javax.faces.context.ResponseWriter ;
11 import org.exoplatform.portal.faces.component.*;
12
13 /**
14  * Date: Aug 11, 2003
15  * @author: Tuan Nguyen
16  * @email: tuan08@users.sourceforge.net
17  * @version: $Id: ContainerRowRenderer.java,v 1.1 2004/07/02 17:52:05 tuan08 Exp $
18  */

19 public class ContainerRowRenderer extends ContainerRenderer {
20
21   protected void renderViewMode(FacesContext context, UIContainer uiContainer) throws IOException JavaDoc {
22     ResponseWriter w = context.getResponseWriter();
23     List children = uiContainer.getChildren();
24     if(children.size() == 0 ) return ;
25     w.write("<table class='"); w.write(uiContainer.getDecorator()); w.write("-container'");
26     w.write(" id='") ; w.write(uiContainer.getId());w.write("'>") ;
27     int childrenSize = children.size() ;
28     for(int i=0 ; i < childrenSize; i++) {
29       UIBasicComponent uiChild = (UIBasicComponent) children.get(i) ;
30       if(uiChild.isRendered()) {
31         String JavaDoc height = uiChild.getComponentModel().getHeight() ;
32         w.write("<tr>") ;
33         w. write("<td");
34         if (height != null && height.length() > 0) {
35           w.write(" style='height: "); w.write(height); w.write("'") ;
36         }
37         w. write(">");
38         uiChild.setFloat(UIBasicComponent.FLOAT_BOTTOM) ;
39         uiChild.encodeBegin(context);
40         uiChild.encodeChildren(context);
41         uiChild.encodeEnd(context);
42         w. write("</td>");
43         w.write("</tr>") ;
44       }
45     }
46     w.write("</table>") ;
47   }
48 }
Popular Tags