1 5 package org.exoplatform.portal.faces.renderer.html.page; 6 7 import java.io.IOException ; 8 import java.util.List ; 9 import javax.faces.component.UIComponent; 10 import javax.faces.context.FacesContext; 11 import javax.faces.context.ResponseWriter; 12 import org.exoplatform.faces.core.component.UIToolbar; 13 import org.exoplatform.faces.core.renderer.html.HtmlBasicRenderer; 14 import org.exoplatform.portal.faces.component.UIPagePreview; 15 20 public class PagePreviewRenderer extends HtmlBasicRenderer { 21 22 final public void encodeChildren(FacesContext context, UIComponent component) 23 throws IOException { 24 UIPagePreview uiComponent = (UIPagePreview) component; 25 ResponseWriter w = context.getResponseWriter(); 26 w.write("<div class='UIPagePreview'>"); 27 UIComponent uiToolbar = uiComponent.getUIToolbar(); 28 uiToolbar.encodeBegin(context); 29 uiToolbar.encodeChildren(context); 30 uiToolbar.encodeEnd(context); 31 w.write("<div class='page'>"); 32 33 List children = component.getChildren(); 34 for (int i = 0; i < children.size(); i++) { 35 UIComponent uiChild = (UIComponent) children.get(i); 36 if (uiChild.isRendered() && !(uiChild instanceof UIToolbar)) { 37 uiChild.encodeBegin(context); 38 uiChild.encodeChildren(context); 39 uiChild.encodeEnd(context); 40 } 41 } 42 43 w.write("</div>"); 44 w.write("</div>"); 45 } 46 } | Popular Tags |