You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by jw...@apache.org on 2009/05/01 00:01:17 UTC

svn commit: r770465 - in /myfaces/trinidad/branches/jwaldman_StyleMap/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal: renderkit/core/xhtml/StyleSheetRenderer.java style/cache/FileSystemStyleCache.java

Author: jwaldman
Date: Thu Apr 30 22:01:17 2009
New Revision: 770465

URL: http://svn.apache.org/viewvc?rev=770465&view=rev
Log:
remove TODO from FileSystemStyleCache
Remove test code from StyleSheetRenderer

Modified:
    myfaces/trinidad/branches/jwaldman_StyleMap/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/StyleSheetRenderer.java
    myfaces/trinidad/branches/jwaldman_StyleMap/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java

Modified: myfaces/trinidad/branches/jwaldman_StyleMap/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/StyleSheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/jwaldman_StyleMap/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/StyleSheetRenderer.java?rev=770465&r1=770464&r2=770465&view=diff
==============================================================================
--- myfaces/trinidad/branches/jwaldman_StyleMap/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/StyleSheetRenderer.java (original)
+++ myfaces/trinidad/branches/jwaldman_StyleMap/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/StyleSheetRenderer.java Thu Apr 30 22:01:17 2009
@@ -91,13 +91,7 @@
 
     StyleContext sContext = ((CoreRenderingContext) arc).getStyleContext();
     StyleProvider provider = sContext.getStyleProvider();
-    // TODO This will move to Rich Client
-    if (!_supportsExternalStylesheet(arc))
-    {
-      System.out.println("TEST THE GET SELECTOR STYLE MAP");
 
-      _testGetSelectorStyleMap(context, arc);
-    }
     if (provider != null)
     {
       List<String> uris = provider.getStyleSheetURIs(sContext);
@@ -175,84 +169,6 @@
     }
   }
 
-
-
-  // TODO DELETE THIS TEST
-  private void _testGetSelectorStyleMap(FacesContext context, RenderingContext arc)
-    throws IOException
-  {
-      StyleContext sContext = ((CoreRenderingContext) arc).getStyleContext();
-      StyleProvider provider = sContext.getStyleProvider();
-      if (provider != null)
-      {
-
-
-        ResponseWriter writer = context.getResponseWriter();
-        // Check if we want to write out the css into the page or not. In portlet mode the
-        // producer tries to share the consumer's stylesheet if it matches exactly.
-        // jmw
-        Styles styles = arc.getStyles();
-        String[] selectors = {".AFInstructionText", // selector
-                              "af|inputText::content", // selector
-                              "af|treeTable::expansion", // selector
-                              "af|treeTable::locator", // selector
-                              "af|inputText:disabled.AFFieldTextMarker::content",  // selector
-                              "af|foo af|bar", // selector
-                              ".AFDefaultFont:alias", // nothing, since currently it's in the wrong format to be a named sele ctor
-                              ".AFDefaultFont",// nothing, since currently it's in the wrong format to be a named sele ctor
-                              "AFDefaultFont"};// name
-
-        System.out.println("getSelectorStyleMap NEW. Gets all the selectors, then find the one you want");
-        Map<Selector, Style> selectorStyleMap = styles.getSelectorStyleMap();
-
-        for (int i=0; i< selectors.length; i++)
-        {
-          String selector = selectors[i];
-          Style style = selectorStyleMap.get(selector);
-          if (style != null)
-            System.out.println(selector+" inlineString is " + style.toInlineString());
-          else
-            System.out.println("no styles for " + selector);
-        }
-
-
-        String[] simpleSelectorsToInline = {"af|document",
-                                            "af|panelHeader",
-                                            "af|showDetailHeader",
-                                            "af|inputText",
-                                            "af|selectOneChoice",
-                                            "af|panelLabelAndMessage",
-                                            "af|image",
-                                            "af|table",
-                                            "af|column",
-                                            "af|goLink"};
-
-        // now try to get the getSelectorsForSimpleSelector to see if we can get the selectors with a certain key like af|inputText
-        writer.startElement("style", null);
-        for (int i=0; i< simpleSelectorsToInline.length; i++)
-        {
-          System.out.println("xGet styles for " + simpleSelectorsToInline[i]);
-          Set<Selector> selectorSet = styles.getSelectorsForSimpleSelector(simpleSelectorsToInline[i]);
-          for (Selector eachSelector : selectorSet)
-          {
-            String validSelector = styles.getNativeSelectorString(eachSelector);
-            System.out.print(validSelector + "{");
-            writer.write(validSelector);
-            writer.write("{");
-            String cssInlineProperties = selectorStyleMap.get(eachSelector).toInlineString();
-            System.out.print(cssInlineProperties);
-            System.out.println("}");
-            writer.write(cssInlineProperties);
-            writer.write("}");
-          }
-        }
-        writer.endElement("style");
-
-
-      }
-    }
-
-
   // In the portlet environment, the consumer might like the producers to share its stylesheet
   // for performance reasons. To indicate this the producer sends a
   // suppress stylesheet parameter on the request map.

Modified: myfaces/trinidad/branches/jwaldman_StyleMap/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/jwaldman_StyleMap/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java?rev=770465&r1=770464&r2=770465&view=diff
==============================================================================
--- myfaces/trinidad/branches/jwaldman_StyleMap/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java (original)
+++ myfaces/trinidad/branches/jwaldman_StyleMap/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java Thu Apr 30 22:01:17 2009
@@ -1538,9 +1538,6 @@
      */
     public Style _convertStyleNodeToStyle(StyleNode styleNode)
     {
-      // TODO Do I need ConcurrentHashMap? Do I need more than that? Note the icon
-      // and property map only use ConcurrentHashMap, but the cache maps use Hashtable (maybe 
-      // because the code is old?)
       Map<String, String> styleProperties = new ConcurrentHashMap<String, String>();
       // Add in the properties for the style
       Iterable<PropertyNode> propertyNodeList = styleNode.getProperties();