1 5 package org.exoplatform.portal.faces.renderer.html.page; 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 21 public class PageRowRenderer extends PageRenderer { 22 23 protected void renderViewMode(FacesContext context, UIPage uiPage) throws IOException { 24 ResponseWriter w = context.getResponseWriter(); 25 UIPortlet maximizedPortlet = uiPage.getMaximizedPortlet() ; 26 w.write("<table class='"); w.write(uiPage.getDecorator()); w.write("-container'"); 27 w.write(" id='") ; w.write(uiPage.getId());w.write("'>") ; 28 if (maximizedPortlet != null) { 29 w.write("<tr>") ; 30 w. write("<td style='height: 100%;'>"); 31 maximizedPortlet.encodeBegin(context); 32 maximizedPortlet.encodeChildren(context); 33 maximizedPortlet.encodeEnd(context); 34 w. write("</td>"); 35 w.write("</tr>") ; 36 } else { 37 List children = uiPage.getChildren(); 38 int childrenSize = children.size() ; 39 for(int i=0 ; i < childrenSize; i++) { 40 UIBasicComponent uiChild = (UIBasicComponent) children.get(i) ; 41 String height = uiChild.getComponentModel().getHeight() ; 42 w.write("<tr>") ; 43 w. write("<td"); 44 if (height != null && height.length() > 0) { 45 w.write(" style='height: "); w.write(height); w.write("'") ; 46 } 47 w. write(">"); 48 uiChild.setFloat(UIBasicComponent.FLOAT_BOTTOM) ; 49 uiChild.encodeBegin(context); 50 uiChild.encodeChildren(context); 51 uiChild.encodeEnd(context); 52 w. write("</td>"); 53 w.write("</tr>") ; 54 } 55 } 56 w.write("</table>") ; 57 } 58 } | Popular Tags |