1 5 package org.exoplatform.portal.faces.renderer.html.container; 6 7 import java.util.* ; 8 import java.io.IOException ; 9 import javax.faces.context.FacesContext; 10 import javax.faces.context.ResponseWriter ; 11 import org.exoplatform.portal.faces.component.*; 12 13 19 public class ContainerRowRenderer extends ContainerRenderer { 20 21 protected void renderViewMode(FacesContext context, UIContainer uiContainer) throws IOException { 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 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 |