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 PageColumnRenderer 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 w.write("<tr>") ; 40 for(int i=0 ; i < childrenSize; i++) { 41 UIBasicComponent uiChild = (UIBasicComponent) children.get(i) ; 42 String width = uiChild.getComponentModel().getWidth() ; 43 w.write("<td"); 44 if (width != null && width.length() > 0) { 45 w.write(" style='width: "); w.write(width); w.write("'") ; 46 } 47 w. write(">"); 48 uiChild.setFloat(UIBasicComponent.FLOAT_RIGHT) ; 49 uiChild.encodeBegin(context); 50 uiChild.encodeChildren(context); 51 uiChild.encodeEnd(context); 52 w.write("</td>"); 53 } 54 w.write("</tr>") ; 55 } 56 w.write("</table>") ; 57 } 58 } | Popular Tags |