myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1568964 - in /myfaces/tobago/branches/tobago-3.0.x: tobago-core/src/main/java/org/apache/myfaces/tobago/context/ tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/ tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfa...
Date Mon, 17 Feb 2014 12:31:40 GMT
Author: lofwyr
Date: Mon Feb 17 12:31:40 2014
New Revision: 1568964

URL: http://svn.apache.org/r1568964
Log:
TOBAGO-1356: Avoid error logging for missing hover images

Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtils.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuCommandRenderer.java

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtils.java?rev=1568964&r1=1568963&r2=1568964&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtils.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtils.java
Mon Feb 17 12:31:40 2014
@@ -118,9 +118,10 @@ public final class ResourceManagerUtils 
     return "[" + sb.toString() + "]";
   }
 
-  public static String getDisabledImageWithPath(final FacesContext facesContext, final String
image) {
+  public static String getDisabledImageWithPath(final FacesContext facesContext, final String
image,
+                                                final boolean ignoreMissing) {
     final String filename = ResourceUtils.addPostfixToFilename(image, "Disabled");
-    return getImageWithPath(facesContext, filename, true);
+    return getImageWithPath(facesContext, filename, ignoreMissing);
   }
 
   /**
@@ -162,12 +163,17 @@ public final class ResourceManagerUtils 
 
   public static String getImageOrDisabledImageWithPath(
       final FacesContext facesContext, final String image, final boolean disabled) {
+    return getImageOrDisabledImageWithPath(facesContext, image, disabled, false);
+  }
+
+  public static String getImageOrDisabledImageWithPath(
+          final FacesContext facesContext, final String image, final boolean disabled, final
boolean ignoreMissing) {
     String imageWithPath = null;
     if (disabled) {
-      imageWithPath = ResourceManagerUtils.getDisabledImageWithPath(facesContext, image);
+      imageWithPath = ResourceManagerUtils.getDisabledImageWithPath(facesContext, image,
ignoreMissing);
     }
     if (imageWithPath == null) {
-      imageWithPath = ResourceManagerUtils.getImageWithPath(facesContext, image);
+      imageWithPath = ResourceManagerUtils.getImageWithPath(facesContext, image, ignoreMissing);
     }
     return imageWithPath;
   }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java?rev=1568964&r1=1568963&r2=1568964&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java
Mon Feb 17 12:31:40 2014
@@ -54,7 +54,7 @@ public class TobagoComponentHandler exte
   private static final Logger LOG = LoggerFactory.getLogger(TobagoComponentHandler.class);
 
   static {
-    LOG.error("init");
+    LOG.info("init");
   }
 
   public TobagoComponentHandler(final ComponentConfig componentConfig) {

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java?rev=1568964&r1=1568963&r2=1568964&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java
Mon Feb 17 12:31:40 2014
@@ -58,14 +58,7 @@ public abstract class CommandRendererBas
   }
 
   public String getImageWithPath(final FacesContext facesContext, final String image, final
boolean disabled) {
-    String imageWithPath = null;
-    if (disabled) {
-      imageWithPath = ResourceManagerUtils.getDisabledImageWithPath(facesContext, image);
-    }
-    if (imageWithPath == null) {
-      imageWithPath = ResourceManagerUtils.getImageWithPath(facesContext, image);
-    }
-    return imageWithPath;
+    return ResourceManagerUtils.getImageOrDisabledImageWithPath(facesContext, image, disabled);
   }
 
 }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuCommandRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuCommandRenderer.java?rev=1568964&r1=1568963&r2=1568964&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuCommandRenderer.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuCommandRenderer.java
Mon Feb 17 12:31:40 2014
@@ -172,7 +172,7 @@ public class MenuCommandRenderer extends
             = ResourceManagerUtils.getImageOrDisabledImageWithPath(facesContext, image, disabled);
         writer.writeAttribute(HtmlAttributes.SRC, imageWithPath, false);
         final String imageHover = ResourceManagerUtils
-            .getImageOrDisabledImageWithPath(facesContext, HtmlRendererUtils.createSrc(image,
"Hover"), disabled);
+            .getImageOrDisabledImageWithPath(facesContext, HtmlRendererUtils.createSrc(image,
"Hover"), disabled, true);
         if (imageHover != null) {
           writer.writeAttribute(DataAttributes.SRC_DEFAULT, imageWithPath, false);
           writer.writeAttribute(DataAttributes.SRC_HOVER, imageHover, false);



Mime
View raw message