You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2014/02/17 13:30:09 UTC
svn commit: r1568962 - in /myfaces/tobago/trunk:
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/myfaces/tobago/rende...
Author: lofwyr
Date: Mon Feb 17 12:30:09 2014
New Revision: 1568962
URL: http://svn.apache.org/r1568962
Log:
TOBAGO-1356: Avoid error logging for missing hover images
Modified:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtils.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuCommandRenderer.java
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtils.java?rev=1568962&r1=1568961&r2=1568962&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtils.java Mon Feb 17 12:30:09 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/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java?rev=1568962&r1=1568961&r2=1568962&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java Mon Feb 17 12:30:09 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/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java?rev=1568962&r1=1568961&r2=1568962&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java Mon Feb 17 12:30:09 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/trunk/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/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuCommandRenderer.java?rev=1568962&r1=1568961&r2=1568962&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuCommandRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuCommandRenderer.java Mon Feb 17 12:30:09 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);