You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2012/06/24 00:34:15 UTC
svn commit: r1353208 - in /myfaces/tobago/branches/tobago-1.5.x: ./
tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java
Author: bommel
Date: Sat Jun 23 22:34:14 2012
New Revision: 1353208
URL: http://svn.apache.org/viewvc?rev=1353208&view=rev
Log:
Merged from trunk
(TOBAGO-1162)
Missing accessKey support in tc:selectBooleanCheckbox [from revision 1353071]
Modified:
myfaces/tobago/branches/tobago-1.5.x/ (props changed)
myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java
Propchange: myfaces/tobago/branches/tobago-1.5.x/
------------------------------------------------------------------------------
Merged /myfaces/tobago/trunk:r1353071
Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java?rev=1353208&r1=1353207&r2=1353208&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java Sat Jun 23 22:34:14 2012
@@ -19,6 +19,8 @@ package org.apache.myfaces.tobago.render
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UISelectBooleanCheckbox;
+import org.apache.myfaces.tobago.internal.util.AccessKeyMap;
+import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
@@ -109,10 +111,18 @@ public class SelectBooleanCheckboxRender
label = select.getLabel(); // compatibility since TOBAGO-1093
}
if (label != null) {
+ LabelWithAccessKey labelWithAccessKey = new LabelWithAccessKey(label);
writer.startElement(HtmlElements.LABEL, select);
writer.writeAttribute(HtmlAttributes.FOR, id, false);
- writer.writeText(label);
+ HtmlRendererUtils.writeLabelWithAccessKey(writer, labelWithAccessKey);
writer.endElement(HtmlElements.LABEL);
+ if (labelWithAccessKey.getAccessKey() != null) {
+ if (LOG.isInfoEnabled()
+ && !AccessKeyMap.addAccessKey(facesContext, labelWithAccessKey.getAccessKey())) {
+ LOG.info("duplicated accessKey : " + labelWithAccessKey.getAccessKey());
+ }
+ HtmlRendererUtils.addClickAcceleratorKey(facesContext, id, labelWithAccessKey.getAccessKey());
+ }
}
writer.endElement(HtmlElements.DIV);