KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlets > iframe > component > UIIframe


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.component;
6
7 import javax.faces.context.FacesContext;
8 import javax.faces.context.ExternalContext;
9 import javax.portlet.PortletRequest ;
10 import javax.portlet.PortletPreferences ;
11
12 import org.apache.commons.logging.Log;
13 import org.exoplatform.faces.core.component.UIExoComponentBase;
14 /**
15  * Sat, Jan 03, 2004 @ 11:16
16  * @author: Tuan Nguyen
17  * @email: tuan08@users.sourceforge.net
18  * @version: $Id: UIIframe.java,v 1.1.1.1 2004/03/02 19:00:43 benjmestrallet Exp $
19  */

20 public class UIIframe extends UIExoComponentBase {
21   public static final String JavaDoc COMPONENT_TYPE = "UIIframe";
22   public static final String JavaDoc VIEW_ID = "rss";
23   
24   private String JavaDoc frameSource_ ;
25   private String JavaDoc frameWidth_ ;
26   private String JavaDoc frameHeight_ ;
27   
28   public UIIframe() throws Exception JavaDoc {
29     FacesContext context = FacesContext.getCurrentInstance() ;
30     PortletRequest request = (PortletRequest) context.getExternalContext().getRequest();
31     PortletPreferences prefs = request.getPreferences() ;
32     frameSource_ = prefs.getValue("iframe-src" , "/web/iframe-info.html") ;
33     frameWidth_ = prefs.getValue("iframe-width", "*") ;
34     frameHeight_ = prefs.getValue("iframe-height", "*") ;
35     setId(VIEW_ID) ;
36   }
37   
38   public String JavaDoc getFrameSource() { return frameSource_ ; }
39   public String JavaDoc getFrameWidth() { return frameWidth_ ; }
40   public String JavaDoc getFrameHeight() { return frameHeight_ ; }
41   
42   public String JavaDoc getComponentType() { return COMPONENT_TYPE; }
43   public String JavaDoc getRendererType() { return "IframeRenderer"; }
44
45   public void decode(FacesContext context) {
46   }
47 }
48
Popular Tags