KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlet > faces > XHTMLMPRendererConfiguration


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.portlet.faces;
6
7 import javax.faces.FactoryFinder;
8 import javax.faces.render.RenderKit;
9 import javax.faces.render.RenderKitFactory;
10 import org.exoplatform.faces.core.component.*;
11 import org.exoplatform.faces.core.renderer.html.NodeTabbedPaneRenderer;
12 import org.exoplatform.faces.core.renderer.xhtmlmp.*;
13 import com.sun.faces.renderkit.RenderKitImpl ;
14
15 /**
16  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
17  * @since Aug 4, 2004
18  * @version $Id: XHTMLMPRendererConfiguration.java,v 1.2 2004/08/08 19:37:01 tuan08 Exp $
19  */

20 public class XHTMLMPRendererConfiguration {
21   static public void confiure() throws Exception JavaDoc {
22     RenderKitFactory rfactory =
23       (RenderKitFactory) FactoryFinder.getFactory( FactoryFinder.RENDER_KIT_FACTORY );
24     RenderKit rkit =
25       rfactory.getRenderKit(null, UIExoComponent.XHTMLMP_KIT);
26     if(rkit == null) {
27       rkit = new RenderKitImpl() ;
28       rfactory.addRenderKit(UIExoComponent.XHTMLMP_KIT, rkit) ;
29     }
30     rkit =
31       rfactory.getRenderKit(null, UIExoComponent.XHTMLMP_KIT);
32     if(rkit.getRenderer(UISimpleForm.COMPONENT_FAMILY, "SimpleFormRenderer") == null) {
33       rkit.addRenderer(UISimpleForm.COMPONENT_FAMILY, "SimpleFormRenderer", new SimpleFormRenderer());
34     }
35     if(rkit.getRenderer(UIExoComponent.COMPONENT_FAMILY, "TabbedPaneRenderer") == null) {
36       rkit.addRenderer(UIExoComponent.COMPONENT_FAMILY, "TabbedPaneRenderer", new NodeTabbedPaneRenderer());
37     }
38   }
39 }
Popular Tags