KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portal > faces > renderer > xhtmlmp > page > PageRenderer


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.portal.faces.renderer.xhtmlmp.page;
6
7 import java.util.* ;
8 import java.io.IOException JavaDoc;
9 import javax.faces.context.FacesContext;
10 import javax.faces.context.ResponseWriter ;
11 import org.exoplatform.portal.faces.component.*;
12
13 /**
14  * Date: Aug 11, 2003
15  * @author : Mestrallet Benjamin
16  * @email: benjmestrallet@users.sourceforge.net
17  * @author: Tuan Nguyen
18  * @email: tuan08@users.sourceforge.net
19  * @version: $Id: PageRenderer.java,v 1.1 2004/08/08 19:25:39 tuan08 Exp $
20  */

21 public class PageRenderer
22     extends org.exoplatform.portal.faces.renderer.html.page.PageRenderer {
23
24   protected void renderViewMode(FacesContext context, UIPage uiPage) throws IOException JavaDoc {
25     ResponseWriter w = context.getResponseWriter();
26     UIPortlet maximizedPortlet = uiPage.getMaximizedPortlet() ;
27     w.write("<div class='"); w.write(uiPage.getDecorator()); w.write("-page'");
28     w.write(" id='") ; w.write(uiPage.getId());w.write("'>") ;
29     if (maximizedPortlet != null) {
30       maximizedPortlet.encodeBegin(context);
31       maximizedPortlet.encodeChildren(context);
32       maximizedPortlet.encodeEnd(context);
33     } else {
34       List children = uiPage.getChildren();
35       int childrenSize = children.size() ;
36       for(int i=0 ; i < childrenSize; i++) {
37         UIBasicComponent uiChild = (UIBasicComponent) children.get(i) ;
38         uiChild.encodeBegin(context);
39         uiChild.encodeChildren(context);
40         uiChild.encodeEnd(context);
41       }
42     }
43     w.write("</div>") ;
44   }
45 }
Popular Tags