KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlets > iframe > renderer > html > IframeRenderer


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.iframe.renderer.html;
6
7 import javax.faces.component.UIComponent;
8 import javax.faces.context.FacesContext;
9 import javax.faces.context.ResponseWriter;
10 import org.exoplatform.faces.core.renderer.html.HtmlBasicRenderer;
11 import org.exoplatform.portlets.iframe.component.*;
12 import java.io.IOException JavaDoc;
13
14 /**
15  * @email: tuan08@users.sourceforge.net
16  * @version: $Id: IframeRenderer.java,v 1.2 2004/04/07 02:28:29 tuan08 Exp $
17  */

18 public class IframeRenderer extends HtmlBasicRenderer {
19
20   final public void encodeBegin( FacesContext context, UIComponent component ) throws IOException JavaDoc {
21     ResponseWriter w = context.getResponseWriter() ;
22     UIIframe uiIframe = (UIIframe) component ;
23     w.write("<iframe style='border: none' SRC='"+ uiIframe.getFrameSource() + "'" +
24                    " width='"+ uiIframe.getFrameWidth() + "'" +
25                    " height='"+uiIframe.getFrameHeight()+"'" +
26                    " scrolling='auto' frameborder='0'>") ;
27     w. write("[Your user agent does not support frames or is currently configured " +
28               "not to display frames. However, you may visit") ;
29     w.write("</iframe>");
30   }
31 }
32
Popular Tags