KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlets > content > explorer > renderer > html > ImageRenderer


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.portlets.content.explorer.renderer.html;
6
7 import java.io.IOException JavaDoc;
8 import javax.faces.component.UIComponent;
9 import javax.faces.context.FacesContext;
10 import javax.faces.context.ResponseWriter;
11 import org.exoplatform.faces.core.renderer.html.HtmlBasicRenderer;
12 import org.exoplatform.portlets.content.explorer.component.UIContentViewer;
13
14 /**
15
16  * @email: tuan08@users.sourceforge.net
17
18  * @version: $Id: ImageRenderer.java,v 1.1 2004/07/16 09:51:34 oranheim Exp $
19
20  */

21 public class ImageRenderer extends HtmlBasicRenderer {
22  
23   final public void encodeBegin(FacesContext context, UIComponent component) throws IOException JavaDoc {
24     UIContentViewer uiDisplayer = (UIContentViewer) component;
25     ResponseWriter w = context.getResponseWriter() ;
26     w. write("<div style='margin: auto 0px; '>") ;
27     w. write("<img SRC='" + uiDisplayer.getContent() + "'/>") ;
28     w. write("</div>") ;
29   }
30 }
Popular Tags