1 package org.exoplatform.portal.faces.renderer.html.portlet; 2 3 4 import javax.faces.context.ResponseWriter; 5 import javax.portlet.WindowState; 6 import org.exoplatform.portal.faces.component.UIPortlet; 7 import org.exoplatform.services.portal.model.Portlet; 8 import java.util.List ; 9 import java.util.ResourceBundle ; 10 import java.io.IOException ; 11 16 public class BoxPortletRenderer extends PortletRenderer { 17 18 protected void renderPortletHeaderBar(ResponseWriter w, UIPortlet uiPortlet, ResourceBundle res, 19 String portletTitle, String baseUrl) throws IOException { 20 Portlet model = uiPortlet.getPortletModel() ; 21 w.write("<tr>"); 22 w. write("<td class='top-left-corner'>"); 24 w. write("<img SRC='/skin/blank.gif'/>"); 25 w. write("</td>"); 26 w. write("<td class='left-portlet-info-bar'>"); 28 if (model.getShowInfoBar()) { 29 w. write(portletTitle); 30 } 31 w. write("</td>\n"); 32 w. write("<td align='right' class='right-portlet-info-bar'>"); 34 if (model.getShowInfoBar()) { 35 if(model.getShowPortletMode()) { 37 List modes = uiPortlet.getHtmlSupportModes() ; 38 if (uiPortlet.hasComponentAdminRole()) { 39 for (int i =0 ; i < modes.size() ; i++) { 40 String mode = (String ) modes.get(i) ; 41 renderModeLink(w, uiPortlet,res, mode, baseUrl) ; 42 } 43 } else { 44 for (int i =0 ; i < modes.size() ; i++) { 45 String mode = (String ) modes.get(i) ; 46 if("help".equals(mode)) { 47 renderModeLink(w, uiPortlet, res, mode, baseUrl) ; 48 } 49 } 50 } 51 } 52 if (model.getShowWindowState()) { 53 renderWindowStateLink(w, uiPortlet, res, WindowState.MINIMIZED, baseUrl) ; 54 renderWindowStateLink(w, uiPortlet, res, WindowState.MAXIMIZED, baseUrl) ; 55 } 56 } 57 w. write("</td>"); 58 w. write("<td class='top-right-corner'>"); 60 w. write("<img SRC='/skin/blank.gif'/>"); 61 w. write("</td>"); 62 w.write("</tr>"); 63 } 64 65 protected void renderPortletBody(ResponseWriter w, UIPortlet uiPortlet, 66 String content) throws IOException { 67 w.write("<tr>"); 68 w. write("<td class='left-border'>"); 69 w. write("<img SRC='/skin/blank.gif'/>"); 70 w. write("</td>\n"); 71 w. write("<td colspan='2' width='*' height='100%' class='"); 72 w.write(uiPortlet.getDecorator()); w.write("-portlet'>"); 73 w. write(content); 74 w. write("</td>\n"); 75 w. write("<td class='right-border'>"); 76 w. write("<img SRC='/skin/blank.gif'/>"); 77 w. write("</td>"); 78 w.write("</tr>\n"); 79 } 80 81 protected void renderPortletFooterBar(ResponseWriter w, UIPortlet uiPortlet, 82 String portletTitle, String baseUrl) throws IOException { 83 w.write("<tr>"); 84 w. write("<td class='bottom-left-corner'>"); 86 w. write("<img SRC='/skin/blank.gif'/>"); 87 w. write("</td>\n"); 88 w. write("<td class='portlet-footer-bar'>"); 90 w. write("<img SRC='/skin/blank.gif'/>"); 91 w. write("</td>\n"); 92 w. write("<td class='portlet-footer-bar'>"); 93 w. write("<img SRC='/skin/blank.gif'/>"); 94 w. write("</td>\n"); 95 w. write("<td class='bottom-right-corner'>"); 97 w. write("<img SRC='/skin/blank.gif'/>"); 98 w. write("</td>"); 99 w.write("</tr>"); 100 } 101 } | Popular Tags |