You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ha...@apache.org on 2008/07/16 01:23:14 UTC

svn commit: r677086 - /myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java

Author: hazems
Date: Tue Jul 15 16:23:14 2008
New Revision: 677086

URL: http://svn.apache.org/viewvc?rev=677086&view=rev
Log:
Fixing http://issues.apache.org/jira/browse/TOMAHAWK-1143

Solution : Adding a meaniful text to the tree2 generated images.

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java?rev=677086&r1=677085&r2=677086&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java Tue Jul 15 16:23:14 2008
@@ -342,6 +342,10 @@
             String lineSrc = (!lastChild && showLines)
                              ? getImageSrc(context, tree, "line-trunk.gif", true)
                              : getImageSrc(context, tree, "spacer.gif", true);
+            String altString = (!lastChild && showLines)
+                             ? "line trunk"
+                             : "spacer";             
+            
 
             out.startElement(HTML.TD_ELEM, tree);
             out.writeAttribute(HTML.WIDTH_ATTR, "19", null);
@@ -352,7 +356,7 @@
             out.writeAttribute(HTML.WIDTH_ATTR, "19", null);
             out.writeAttribute(HTML.HEIGHT_ATTR, "18", null);
             out.writeAttribute(HTML.BORDER_ATTR, "0", null);
-            out.writeAttribute(HTML.ALT_ATTR, "", null); // "alt" is a mandatory xhtml attribute
+            out.writeAttribute(HTML.ALT_ATTR, altString, null); // placing a suitable description for the alt.
             out.endElement(HTML.IMG_ELEM);
             out.endElement(HTML.TD_ELEM);
         }
@@ -512,7 +516,7 @@
         imageAttrs.put(HTML.WIDTH_ATTR, "19");
         imageAttrs.put(HTML.HEIGHT_ATTR, "18");
         imageAttrs.put(HTML.BORDER_ATTR, "0");
-        imageAttrs.put(HTML.ALT_ATTR, ""); // "alt" is a mandatory xhtml attribute
+        imageAttrs.put(HTML.ALT_ATTR, "Nav control image"); // placing a suitable description for the alt.
 
         if (clientSideToggle)
         {