Author: abelevich
Date: 2007-05-05 11:59:04 -0400 (Sat, 05 May 2007)
New Revision: 658
Added:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/utils/
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/utils/TemplateLoader.java
Log:
Added:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/utils/TemplateLoader.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/utils/TemplateLoader.java
(rev 0)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/utils/TemplateLoader.java 2007-05-05
15:59:04 UTC (rev 658)
@@ -0,0 +1,32 @@
+/**
+ * (c) 2006 Exadel Inc.
+ */
+package org.richfaces.utils;
+
+import org.ajax4jsf.framework.renderer.RendererBase;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class TemplateLoader {
+
+ private static final Log log = LogFactory.getLog(TemplateLoader.class);
+
+ public static RendererBase loadTemplate(String className) {
+ RendererBase template = null;
+ try{
+ template = (RendererBase)Class.forName(className).newInstance();
+ } catch (ClassNotFoundException e) {
+ log.error("class not found: " + className );
+ throw new RuntimeException(e);
+ } catch (Exception e) {
+ log.error("exception in loading class : " + className);
+ throw new RuntimeException(e);
+ }
+ return template;
+ }
+
+}
Show replies by date