1 5 package org.exoplatform.faces.search.renderer.html; 6 7 import java.io.IOException ; 8 import java.util.ResourceBundle ; 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 19 public class ViewDocumentRenderer extends HtmlBasicRenderer { 20 21 public void encodeChildren(FacesContext context, UIComponent component) throws IOException { 22 UIViewDocument uiView = (UIViewDocument) component; 23 ResponseWriter w = context.getResponseWriter(); 24 ResourceBundle 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 |