KickJava   Java API By Example, From Geeks To Geeks.

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


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
11 import org.exoplatform.faces.core.component.*;
12 import org.exoplatform.faces.core.renderer.html.*;
13 import org.exoplatform.faces.search.component.*;
14 import org.exoplatform.faces.search.renderer.html.*;
15 import org.exoplatform.faces.user.component.UILanguageSelector;
16 import org.exoplatform.faces.user.renderer.html.LanguageSelectorRenderer;
17 import org.exoplatform.portlet.faces.renderer.* ;
18 /**
19  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
20  * @since Aug 4, 2004
21  * @version $Id: XHTMLRendererConfiguration.java,v 1.8 2004/10/25 03:53:06 tuan08 Exp $
22  */

23 public class XHTMLRendererConfiguration {
24   static public void confiure() throws Exception JavaDoc {
25     RenderKitFactory rfactory =
26       (RenderKitFactory) FactoryFinder.getFactory( FactoryFinder.RENDER_KIT_FACTORY );
27     RenderKit rkit =
28       rfactory.getRenderKit(null, RenderKitFactory.HTML_BASIC_RENDER_KIT);
29     if(rkit.getRenderer(UIExoComponent.COMPONENT_FAMILY, "TemplateRenderer") == null) {
30       rkit.addRenderer(UIExoComponent.COMPONENT_FAMILY, "TemplateRenderer", new TemplateRenderer());
31     }
32     if(rkit.getRenderer(UIStringInput.COMPONENT_FAMILY, "StringInputRenderer") == null) {
33       rkit.addRenderer(UIStringInput.COMPONENT_FAMILY, "StringInputRenderer", new StringInputRenderer());
34     }
35     if(rkit.getRenderer(UIDateInput.COMPONENT_FAMILY, "DateInputRenderer") == null) {
36       rkit.addRenderer(UIDateInput.COMPONENT_FAMILY, "DateInputRenderer", new DateInputRenderer());
37     }
38     if(rkit.getRenderer(UITextArea.COMPONENT_FAMILY, "TextAreaRenderer") == null) {
39       rkit.addRenderer(UITextArea.COMPONENT_FAMILY, "TextAreaRenderer", new TextAreaRenderer());
40     }
41     if(rkit.getRenderer(UISimpleForm.COMPONENT_FAMILY, "SimpleFormRenderer") == null) {
42       rkit.addRenderer(UISimpleForm.COMPONENT_FAMILY, "SimpleFormRenderer", new SimpleFormRenderer());
43     }
44     if(rkit.getRenderer(UISimpleForm.COMPONENT_FAMILY, "SimpleFormButtonRenderer") == null) {
45       rkit.addRenderer(UISimpleForm.COMPONENT_FAMILY, "SimpleFormButtonRenderer", new SimpleFormButtonRenderer());
46     }
47     if(rkit.getRenderer(UIForm.COMPONENT_FAMILY, "FormRenderer") == null) {
48       rkit.addRenderer(UIForm.COMPONENT_FAMILY, "FormRenderer", new FormRenderer());
49     }
50     if(rkit.getRenderer(UIPageListIterator.COMPONENT_FAMILY, "PageListIteratorRenderer") == null) {
51       rkit.addRenderer(UIPageListIterator.COMPONENT_FAMILY, "PageListIteratorRenderer", new PageListIteratorRenderer());
52     }
53     if(rkit.getRenderer(UIToolbar.COMPONENT_FAMILY, "ToolbarRenderer") == null) {
54       rkit.addRenderer(UIToolbar.COMPONENT_FAMILY, "ToolbarRenderer", new ToolbarRenderer());
55     }
56     if(rkit.getRenderer(UIGrid.COMPONENT_FAMILY, "GridRenderer") == null) {
57       rkit.addRenderer(UIGrid.COMPONENT_FAMILY, "GridRenderer", new GridRenderer());
58     }
59     if(rkit.getRenderer(UIExoComponent.COMPONENT_FAMILY, "ChildrenRenderer") == null) {
60       rkit.addRenderer(UIExoComponent.COMPONENT_FAMILY, "ChildrenRenderer", new ChildrenRenderer());
61     }
62     if(rkit.getRenderer(UIExoComponent.COMPONENT_FAMILY, "TabbedPaneRenderer") == null) {
63       rkit.addRenderer(UIExoComponent.COMPONENT_FAMILY, "TabbedPaneRenderer", new NodeTabbedPaneRenderer());
64     }
65     if(rkit.getRenderer(UIExoComponent.COMPONENT_FAMILY, "SimpleTabRenderer") == null) {
66       rkit.addRenderer(UIExoComponent.COMPONENT_FAMILY, "SimpleTabRenderer", new SimpleTabRenderer());
67     }
68     if(rkit.getRenderer(UIExoComponent.COMPONENT_FAMILY, "PyramidTabBarRenderer") == null) {
69       rkit.addRenderer(UIExoComponent.COMPONENT_FAMILY, "PyramidTabBarRenderer", new PyramidTabBarRenderer());
70     }
71     if(rkit.getRenderer(UIExoComponent.COMPONENT_FAMILY, "PortletPreferencesRenderer") == null) {
72       rkit.addRenderer(UIExoComponent.COMPONENT_FAMILY, "PortletPreferencesRenderer", new PortletPreferencesRenderer());
73     }
74     if(rkit.getRenderer(UIExoComponent.COMPONENT_FAMILY, "FileUploadRenderer") == null) {
75       rkit.addRenderer(UIExoComponent.COMPONENT_FAMILY, "FileUploadRenderer", new FileUploadRenderer());
76     }
77     if(rkit.getRenderer(UISearchSummary.COMPONENT_FAMILY, "SearchSummaryRenderer") == null) {
78       rkit.addRenderer(UISearchSummary.COMPONENT_FAMILY, "SearchSummaryRenderer", new SearchSummaryRenderer());
79     }
80     if(rkit.getRenderer(UIViewDocument.COMPONENT_FAMILY, "ViewDocumentRenderer") == null) {
81       rkit.addRenderer(UIViewDocument.COMPONENT_FAMILY, "ViewDocumentRenderer", new ViewDocumentRenderer());
82     }
83     if(rkit.getRenderer(UILanguageSelector.COMPONENT_FAMILY, "LanguageSelectorRenderer") == null) {
84       rkit.addRenderer(UILanguageSelector.COMPONENT_FAMILY, "LanguageSelectorRenderer", new LanguageSelectorRenderer());
85     }
86   }
87 }
Popular Tags