incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r463869 - /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/uinode/UIComponentUINode.java
Date Fri, 13 Oct 2006 23:45:01 GMT
Author: awiner
Date: Fri Oct 13 16:45:00 2006
New Revision: 463869

URL: http://svn.apache.org/viewvc?view=rev&rev=463869
Log:
Remove old hack for mapping renderer types to UIX localNames that was only relevant to an
Oracle usage, and replace it with something generic 

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/uinode/UIComponentUINode.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/uinode/UIComponentUINode.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/uinode/UIComponentUINode.java?view=diff&rev=463869&r1=463868&r2=463869
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/uinode/UIComponentUINode.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/uinode/UIComponentUINode.java
Fri Oct 13 16:45:00 2006
@@ -16,6 +16,8 @@
 package org.apache.myfaces.trinidadinternal.uinode;
 
 import java.io.InputStream;
+import java.net.URL;
+import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
@@ -289,11 +291,13 @@
     buffer.append(getLocalName());
     buffer.append("'");
 
-    Object component = getUIComponent();
+    UIComponent component = getUIComponent();
     if (component != null)
     {
       buffer.append('[');
       buffer.append(component.toString());
+      buffer.append(",rendererType=");
+      buffer.append(component.getRendererType());
       buffer.append(']');
     }
 
@@ -377,28 +381,31 @@
   {
     try
     {
-      InputStream propertyStream =
-        UIXComponentUINode.class.getResourceAsStream("/META-INF/renderertype-localname.properties");
-
-      Properties properties = new Properties();
-      properties.load(propertyStream);
-      propertyStream.close();
-
-      Iterator<Map.Entry<Object, Object>> keys = 
-        properties.entrySet().iterator();
-      while (keys.hasNext())
+      ClassLoader loader = Thread.currentThread().getContextClassLoader();
+      Enumeration<URL> resources = loader.getResources("META-INF/renderertype-localname.properties");
+      while (resources.hasMoreElements())
       {
-        Map.Entry<Object, Object> entry = keys.next();
-        String key = (String) entry.getKey();
-        String localName = (String) entry.getValue();
-        int indexOfBar = key.indexOf('|');
-        if (indexOfBar < 0)
-          _LOG.severe("Malformed property entry: " + key +"=" + localName);
-        else
+        InputStream propertyStream = resources.nextElement().openStream();
+        Properties properties = new Properties();
+        properties.load(propertyStream);
+        propertyStream.close();
+        
+        Iterator<Map.Entry<Object, Object>> keys = 
+          properties.entrySet().iterator();
+        while (keys.hasNext())
         {
-          String family = key.substring(0, indexOfBar);
-          String rendererType = key.substring(indexOfBar + 1);
-          _put(family, rendererType, localName);
+          Map.Entry<Object, Object> entry = keys.next();
+          String key = (String) entry.getKey();
+          String localName = (String) entry.getValue();
+          int indexOfBar = key.indexOf('|');
+          if (indexOfBar < 0)
+            _LOG.severe("Malformed property entry: " + key +"=" + localName);
+          else
+          {
+            String family = key.substring(0, indexOfBar);
+            String rendererType = key.substring(indexOfBar + 1);
+            _put(family, rendererType, localName);
+          }
         }
       }
     }
@@ -425,13 +432,6 @@
     }
 
     subMap.put(rendererType, localName);
-    // Giant hack to support unified component lib
-    subMap.put(_unifiedRendererType(rendererType), localName);
-  }
-
-  static private String _unifiedRendererType(String rendererType)
-  {
-    return "org.apache.myfaces.trinidad.rich" + rendererType.substring("org.apache.myfaces.trinidad".length());
   }
 
   private String _get(
@@ -444,6 +444,4 @@
 
     return subMap.get(rendererType);
   }
-
-
-}
\ No newline at end of file
+}



Mime
View raw message