1 5 package org.exoplatform.portal.faces.renderer.xhtmlmp.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 ContainerRenderer 20 extends org.exoplatform.portal.faces.renderer.html.container.ContainerRenderer { 21 22 protected void renderViewMode(FacesContext context, UIContainer uiContainer) throws IOException { 23 ResponseWriter w = context.getResponseWriter(); 24 List children = uiContainer.getChildren(); 25 int childrenSize = children.size() ; 26 if(childrenSize == 0 ) return ; 27 w.write("<div class='"); w.write(uiContainer.getDecorator()); w.write("-container'"); 28 w.write(" id='") ; w.write(uiContainer.getId());w.write("'>") ; 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 uiChild.setFloat(UIBasicComponent.FLOAT_RIGHT) ; 34 uiChild.encodeBegin(context); 35 uiChild.encodeChildren(context); 36 uiChild.encodeEnd(context); 37 } 38 } 39 w.write("</div>") ; 40 } 41 } | Popular Tags |