1 5 package org.exoplatform.portal.faces.renderer.html.portlet; 6 7 import java.util.List ; 8 import java.util.ResourceBundle ; 9 import java.io.IOException ; 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 23 public class InfoPortletRenderer extends PortletRenderer { 24 25 protected void renderPortletHeaderBar(ResponseWriter w, UIPortlet uiPortlet, 26 String portletTitle, String baseUrl) throws IOException { 27 if (uiPortlet.getPortletModel().getShowInfoBar()) { 28 w.write("<tr>"); 29 w. write("<td valign='bottom' width='*' class='portlet-info-bar'>"); 30 w. write(portletTitle); 31 w. write("</td>"); 32 w.write("</tr>"); 33 } 34 } 35 36 protected void renderPortletBody(ResponseWriter w, UIPortlet uiPortlet, String content) throws IOException { 37 w.write("<tr>"); 38 w. write("<td height='100%' class='>"); 39 w. write(uiPortlet.getDecorator()); w.write("-portlet>"); 40 w. write(content) ; 41 w. write("</td>"); 42 w.write("</tr>"); 43 } 44 45 protected void renderPortletFooterBar(ResponseWriter w, UIPortlet uiPortlet, ResourceBundle res, 46 String portletTitle, String baseUrl) throws IOException { 47 Portlet model = uiPortlet.getPortletModel() ; 48 w.write("<tr>"); 49 w. write("<td class='portlet-footer-bar'>"); 50 if (model.getShowInfoBar()) { 51 if(model.getShowPortletMode()) { 53 List modes = uiPortlet.getHtmlSupportModes() ; 54 if (uiPortlet.hasComponentAdminRole()) { 55 for (int i =0 ; i < modes.size() ; i++) { 56 String mode = (String ) modes.get(i) ; 57 renderModeLink(w, uiPortlet,res, mode, baseUrl) ; 58 } 59 } else { 60 for (int i =0 ; i < modes.size() ; i++) { 61 String mode = (String ) modes.get(i) ; 62 if("help".equals(mode)) { 63 renderModeLink(w, uiPortlet, res, mode, baseUrl) ; 64 } 65 } 66 } 67 } 68 if (model.getShowWindowState()) { 70 renderWindowStateLink(w, uiPortlet, res, WindowState.MAXIMIZED, baseUrl) ; 71 } 72 } 73 w. write("</td>"); 74 w.write("</tr>"); 75 } 76 } | Popular Tags |