1 9 10 package org.jboss.portal.core.theme.render.impl; 11 12 import org.apache.log4j.Logger; 13 import org.jboss.portal.server.WindowContext; 14 import org.jboss.portal.server.output.FragmentResult; 15 import org.jboss.portal.server.theme.render.RenderContext; 16 import org.jboss.portal.server.theme.render.RenderException; 17 import org.jboss.portal.server.theme.render.WindowRenderer; 18 19 import javax.portlet.WindowState; 20 21 28 public class TableWindowRenderer 29 implements WindowRenderer 30 { 31 private static Logger log = Logger.getLogger(TableWindowRenderer.class); 32 33 public TableWindowRenderer() 34 { 35 } 36 37 40 public void render(RenderContext renderContext, FragmentResult result) throws RenderException 41 { 42 log.debug("starting with: " + renderContext.getMarkupFragment()); 43 44 renderStart(renderContext); 45 WindowContext windowContext = result.getProducer(); 46 47 renderContext.getMarkupFragment().append("<tr><td>"); 48 renderContext.getDecorationRenderer().render(renderContext, windowContext, result); 49 renderContext.getMarkupFragment().append("</td></tr>"); 50 51 if (!WindowState.MINIMIZED.equals(windowContext.getWindowState())) 52 { 53 renderContext.getMarkupFragment().append("<tr><td>"); 54 renderContext.getPortletRenderer().render(renderContext, windowContext, result); 55 renderContext.getMarkupFragment().append("</td></tr>"); 56 renderEnd(renderContext); 57 } 58 59 log.debug("ending with: " + renderContext.getMarkupFragment()); 60 } 61 62 65 public void renderStart(RenderContext ctx) 66 { 67 ctx.getMarkupFragment().append("<table class='portletWindow'>"); 68 } 69 70 73 public void renderEnd(RenderContext ctx) 74 { 75 ctx.getMarkupFragment().append("</table>"); 76 } 77 } 78 | Popular Tags |