KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > core > theme > render > impl > DivWindowRenderer


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9
10 package org.jboss.portal.core.theme.render.impl;
11
12 import org.jboss.portal.server.WindowContext;
13 import org.jboss.portal.server.output.FragmentResult;
14 import org.jboss.portal.server.theme.render.RenderContext;
15 import org.jboss.portal.server.theme.render.RenderException;
16 import org.jboss.portal.server.theme.render.WindowRenderer;
17
18 import javax.portlet.WindowState;
19
20 /**
21  * Implementation of a WindowRenderer, based on div tags.
22  *
23  * @author <a HREF="mailto:mholzner@novell.com>Martin Holzner</a>
24  * @version $LastChangedRevision$, $LastChangedDate$
25  * @see WindowRenderer
26  */

27 public class DivWindowRenderer
28    implements WindowRenderer
29 {
30    /**
31     * @see WindowRenderer#render
32     */

33    public void render(RenderContext renderContext, FragmentResult result)
34       throws RenderException
35    {
36       renderStart(renderContext);
37
38       WindowContext windowContext = result.getProducer();
39
40       renderContext.getDecorationRenderer().render(renderContext, windowContext, result);
41
42       if (!WindowState.MINIMIZED.equals(windowContext.getWindowState()))
43       {
44          renderContext.getPortletRenderer().render(renderContext, windowContext, result);
45       }
46
47       renderEnd(renderContext);
48    }
49
50    /**
51     * @see org.jboss.portal.server.theme.render.Renderer#renderStart(org.jboss.portal.server.theme.render.RenderContext)
52     */

53    public void renderStart(RenderContext ctx)
54    {
55       ctx.getMarkupFragment().append("<div class='portlet-window'>");
56    }
57
58    /**
59     * @see org.jboss.portal.server.theme.render.Renderer#renderEnd(org.jboss.portal.server.theme.render.RenderContext)
60     */

61    public void renderEnd(RenderContext ctx)
62    {
63       ctx.getMarkupFragment().append("</div>");
64    }
65 }
66
Popular Tags