KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portal > faces > renderer > xhtmlmp > portlet > PortletRenderer


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.portlet;
6
7 import java.io.IOException JavaDoc;
8 import java.util.ResourceBundle JavaDoc;
9
10 import javax.faces.context.ResponseWriter;
11 import javax.portlet.WindowState;
12 import org.exoplatform.portal.faces.component.UIPortlet;
13 import org.exoplatform.services.portal.model.Portlet;
14
15 /**
16  * Fri, Aug 7th, 2004
17  * @author: Tuan Nguyen
18  * @email: tuan08@users.sourceforge.net
19  * @version: $Id: PortletRenderer.java,v 1.1 2004/08/08 19:25:39 tuan08 Exp $
20  */

21 public class PortletRenderer
22     extends org.exoplatform.portal.faces.renderer.html.portlet.PortletRenderer {
23  
24   protected void renderViewMode(ResponseWriter w, UIPortlet uiPortlet, ResourceBundle JavaDoc res,
25                                 String JavaDoc title, String JavaDoc content, String JavaDoc baseUrl) throws IOException JavaDoc {
26      Portlet model = uiPortlet.getPortletModel() ;
27      w.write("<table class='default-decorator'") ;
28      w.write(" id='") ; w.write(uiPortlet.getId());w.write("'>") ;
29      renderPortletHeaderBar(w, uiPortlet, res, title, baseUrl) ;
30      if (uiPortlet.getWindowState() != WindowState.MINIMIZED) {
31        renderPortletBody(w, uiPortlet, content) ;
32      }
33      renderPortletFooterBar(w, uiPortlet, title, baseUrl) ;
34      w.write("</table>\n");
35   }
36   
37   protected void renderPortletBody(ResponseWriter w, UIPortlet uiPortlet, String JavaDoc content) throws IOException JavaDoc {
38     w.write("<tr>\n<td colspan='2' class='default-portlet'>");
39     w.write(content) ;
40     w.write("\n</td>\n</tr>\n");
41   }
42 }
Popular Tags