You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2007/05/16 17:26:44 UTC

svn commit: r538630 - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/context/ theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/

Author: weber
Date: Wed May 16 08:26:43 2007
New Revision: 538630

URL: http://svn.apache.org/viewvc?view=rev&rev=538630
Log:
TOBAGO-400 : tc:link did not support disabled images

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtil.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtil.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtil.java?view=diff&rev=538630&r1=538629&r2=538630
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtil.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtil.java Wed May 16 08:26:43 2007
@@ -17,6 +17,8 @@
  * limitations under the License.
  */
 
+import org.apache.myfaces.tobago.renderkit.html.CommandRendererHelper;
+
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 import java.util.ArrayList;
@@ -126,5 +128,16 @@
     String name = image.substring(0, dotIndex);
     String postfix = image.substring(dotIndex);
     return getImageWithPath(facesContext, name + "Disabled" + postfix, true);
+  }
+
+  public static String getImageWithPath(FacesContext facesContext, String image, CommandRendererHelper helper) {
+    String imageWithPath = null;
+    if (helper.isDisabled()) {
+      imageWithPath = getDisabledImageWithPath(facesContext, image);
+    }
+    if (imageWithPath == null) {
+      imageWithPath = getImageWithPath(facesContext, image);
+    }
+    return imageWithPath;
   }
 }

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java?view=diff&rev=538630&r1=538629&r2=538630
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java Wed May 16 08:26:43 2007
@@ -82,12 +82,7 @@
         image = imageName;
         // absolute Path to image : nothing to do
       } else {
-        if (helper.isDisabled()) {
-          image = ResourceManagerUtil.getDisabledImageWithPath(facesContext, imageName);
-        }
-        if (image == null) {
-          image = ResourceManagerUtil.getImageWithPath(facesContext, imageName);
-        }
+        image = ResourceManagerUtil.getImageWithPath(facesContext, imageName, helper);
       }
       writer.startElement(HtmlConstants.IMG, null);
       writer.writeAttribute(HtmlAttributes.SRC, image, true);

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java?view=diff&rev=538630&r1=538629&r2=538630
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java Wed May 16 08:26:43 2007
@@ -83,7 +83,7 @@
       if (image.startsWith("HTTP:") || image.startsWith("FTP:") || image.startsWith("/")) {
         // absolute Path to image : nothing to do
       } else {
-        image = ResourceManagerUtil.getImageWithPath(facesContext, image);
+        image = ResourceManagerUtil.getImageWithPath(facesContext, image, helper);
       }
       writer.startElement(HtmlConstants.IMG, null);
       writer.writeAttribute(HtmlAttributes.SRC, image, true);