myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hno...@apache.org
Subject [myfaces-tobago] branch master updated: TOBAGO-1911 Markup CSS classes for tc:label
Date Mon, 30 Jul 2018 12:17:54 GMT
This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new 33a5e87  TOBAGO-1911 Markup CSS classes for tc:label
33a5e87 is described below

commit 33a5e87ce0cf07bdca6f5ca2f10f4e3669758619
Author: Henning Noeth <hnoeth@apache.org>
AuthorDate: Mon Jul 30 12:03:02 2018 +0200

    TOBAGO-1911 Markup CSS classes for tc:label
    
    * markups are now rendered as CSS classes (tobago-label-markup-[name])
---
 .../myfaces/tobago/internal/renderkit/renderer/LabelRenderer.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LabelRenderer.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LabelRenderer.java
index 78f91be..859b9c1 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LabelRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LabelRenderer.java
@@ -21,6 +21,7 @@ package org.apache.myfaces.tobago.internal.renderkit.renderer;
 
 import org.apache.myfaces.tobago.component.SupportFieldId;
 import org.apache.myfaces.tobago.component.UILabel;
+import org.apache.myfaces.tobago.context.Markup;
 import org.apache.myfaces.tobago.internal.util.AccessKeyLogger;
 import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
 import org.apache.myfaces.tobago.internal.util.JsonUtils;
@@ -64,15 +65,17 @@ public class LabelRenderer extends RendererBase implements ComponentSystemEventL
       forId = corresponding != null ? corresponding.getClientId(facesContext) : null;
     }
     final String clientId = label.getClientId(facesContext);
+    final Markup markup = label.getMarkup();
 
     writer.startElement(HtmlElements.LABEL);
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, label);
     writer.writeClassAttribute(
         TobagoClass.LABEL,
+        TobagoClass.LABEL.createMarkup(markup),
         BootstrapClass.COL_FORM_LABEL,
         label.getCustomClass());
     writer.writeIdAttribute(clientId);
-    writer.writeAttribute(DataAttributes.MARKUP, JsonUtils.encode(label.getMarkup()), false);
+    writer.writeAttribute(DataAttributes.MARKUP, JsonUtils.encode(markup), false);
     if (forId != null) {
       writer.writeAttribute(HtmlAttributes.FOR, forId, false);
     }
@@ -86,7 +89,8 @@ public class LabelRenderer extends RendererBase implements ComponentSystemEventL
     writer.endElement(HtmlElements.LABEL);
   }
 
-  /** Encodes the text inside of the label.
+  /**
+   * Encodes the text inside of the label.
    * Can be overwritten in other themes.
    */
   protected void encodeTextContent(


Mime
View raw message