KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > faces > search > renderer > html > ViewDocumentRenderer


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.faces.search.renderer.html;
6
7 import java.io.IOException JavaDoc;
8 import java.util.ResourceBundle JavaDoc;
9 import javax.faces.component.UIComponent;
10 import javax.faces.context.FacesContext;
11 import javax.faces.context.ResponseWriter;
12 import org.exoplatform.faces.core.renderer.html.HtmlBasicRenderer;
13 import org.exoplatform.faces.search.component.UIViewDocument;
14 /**
15  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
16  * @since Aug 27, 2004
17  * @version $Id: ViewDocumentRenderer.java,v 1.2 2004/10/27 21:27:56 benjmestrallet Exp $
18  */

19 public class ViewDocumentRenderer extends HtmlBasicRenderer {
20
21   public void encodeChildren(FacesContext context, UIComponent component) throws IOException JavaDoc {
22     UIViewDocument uiView = (UIViewDocument) component;
23     ResponseWriter w = context.getResponseWriter();
24     ResourceBundle JavaDoc res = getApplicationResourceBundle(context.getExternalContext());
25     w.write("<table class='UIViewDocument'>");
26     w. write("<tr>");
27     w. write("<td style='text-align: justify;'>");
28     w. write(uiView.getDocument());
29     w. write("</td>");
30     w. write("</tr>");
31     w. write("<tr>");
32     w. write("<td class='actions'>");
33     linkRenderer_.render(w, uiView, res.getString("UIViewDocument.button.back"), UIViewDocument.cancelParams_);
34     linkRenderer_.render(w, uiView, res.getString("UIViewDocument.button.view-as-html"), UIViewDocument.htmlFormatParams_);
35     linkRenderer_.render(w, uiView, res.getString("UIViewDocument.button.view-as-xml"), UIViewDocument.xmlFormatParams_);
36     linkRenderer_.render(w, uiView, res.getString("UIViewDocument.button.view-as-text"), UIViewDocument.textFormatParams_);
37     w. write("</td>");
38     w. write("</tr>");
39     w.write("</table>");
40   }
41 }
Popular Tags