KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portal > faces > renderer > BaseRenderer


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.portal.faces.renderer;
6
7 import java.util.Map JavaDoc;
8 import javax.faces.component.UIComponent;
9 import javax.faces.context.FacesContext;
10 import org.exoplatform.container.SessionContainer;
11 import org.exoplatform.faces.core.event.ExoActionEvent;
12 import org.exoplatform.faces.core.renderer.html.HtmlBasicRenderer;
13 import org.exoplatform.portal.faces.component.UIBasicComponent;
14 import org.exoplatform.portal.session.RequestInfo;
15 /**
16  * Created by The eXo Platform SARL .
17  * Date: Mar 15, 2003
18  * Time: 11:30:40 AM
19  */

20 abstract public class BaseRenderer extends HtmlBasicRenderer {
21   
22   public void decode(FacesContext context, UIComponent uiComponent) {
23     RequestInfo rinfo = (RequestInfo) SessionContainer.getComponent(RequestInfo.class);
24     String JavaDoc portalAction = rinfo.getPortalAction();
25     if(portalAction != null) {
26       UIBasicComponent basicComponent = (UIBasicComponent) uiComponent ;
27       Map JavaDoc paramMap = context.getExternalContext().getRequestParameterMap() ;
28       basicComponent.broadcast(new ExoActionEvent(uiComponent, portalAction, paramMap)) ;
29     } else {
30       decodeComponentAction(context, uiComponent) ;
31     }
32   }
33   
34   protected void decodeComponentAction(FacesContext context, UIComponent uiComponent) {
35   }
36   
37 }
Popular Tags