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