myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hno...@apache.org
Subject svn commit: r1794955 - in /myfaces/tobago/trunk: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/ tobago-tool/tobago-tool-annotation/src/main/java/org/ap...
Date Fri, 12 May 2017 11:33:56 GMT
Author: hnoeth
Date: Fri May 12 11:33:56 2017
New Revision: 1794955

URL: http://svn.apache.org/viewvc?rev=1794955&view=rev
Log:
TOBAGO-1721 Optimize HTML output when two renderer are involved
* fix markups

Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BoxRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ButtonsRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/CommandRendererBase.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FigureRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FlowLayoutRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FooterRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/GridLayoutRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/HeaderRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ImageRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/InRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/MessagesRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ObjectRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/OutRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PanelRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PopupRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ProgressRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SectionRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SegmentLayoutRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectBooleanCheckboxRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyCheckboxRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyListboxRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyShuttleRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneChoiceRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneListboxRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneRadioRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SeparatorRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TabGroupRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TextareaRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeLabelRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeListboxRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeSelectRenderer.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
    myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Preliminary.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BoxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BoxRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BoxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BoxRenderer.java Fri May 12 11:33:56 2017
@@ -24,6 +24,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.internal.util.RenderUtils;
 import org.apache.myfaces.tobago.model.CollapseMode;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -33,6 +34,9 @@ import org.apache.myfaces.tobago.webapp.
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 public class BoxRenderer extends PanelRendererBase {
 
@@ -48,11 +52,17 @@ public class BoxRenderer extends PanelRe
 
     writer.startElement(HtmlElements.DIV);
     final boolean collapsed = box.isCollapsed();
-    writer.writeClassAttribute(
-        TobagoClass.BOX,
-        collapsed ? TobagoClass.COLLAPSED : null,
-        BootstrapClass.CARD,
-        box.getCustomClass());
+
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.BOX);
+    if (box.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.BOX.createMarkup(box.getMarkup())));
+    }
+    classAttributes.add(collapsed ? TobagoClass.COLLAPSED : null);
+    classAttributes.add(BootstrapClass.CARD);
+    classAttributes.add(box.getCustomClass());
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
     final String clientId = box.getClientId(facesContext);
     writer.writeIdAttribute(clientId);
     final String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, box);

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ButtonsRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ButtonsRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ButtonsRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ButtonsRenderer.java Fri May 12 11:33:56 2017
@@ -23,6 +23,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
 import org.apache.myfaces.tobago.renderkit.RendererBase;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -32,6 +33,9 @@ import org.apache.myfaces.tobago.webapp.
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 public class ButtonsRenderer extends RendererBase {
 
@@ -43,10 +47,16 @@ public class ButtonsRenderer extends Ren
 
     writer.startElement(HtmlElements.DIV);
     writer.writeIdAttribute(buttons.getClientId(facesContext));
-    writer.writeClassAttribute(
-        TobagoClass.BUTTONS,
-        buttons.getCustomClass(),
-        BootstrapClass.BTN_GROUP);
+
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.BUTTONS);
+    if (buttons.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.BUTTONS.createMarkup(buttons.getMarkup())));
+    }
+    classAttributes.add(buttons.getCustomClass());
+    classAttributes.add(BootstrapClass.BTN_GROUP);
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
     writer.writeAttribute(HtmlAttributes.ROLE, HtmlRoleValues.GROUP.toString(), false);
     writer.writeStyleAttribute(buttons.getStyle());
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, buttons);

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/CommandRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/CommandRendererBase.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/CommandRendererBase.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/CommandRendererBase.java Fri May 12 11:33:56 2017
@@ -51,6 +51,7 @@ import javax.faces.component.UIParameter
 import javax.faces.context.FacesContext;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 public abstract class CommandRendererBase extends DecodingCommandRendererBase {
@@ -123,10 +124,14 @@ public abstract class CommandRendererBas
 
     cssItems.add(command.getCustomClass());
 
-    writer.writeClassAttribute(
-        getRendererCssClass(),
-        null,
-        cssItems.toArray(new CssItem[cssItems.size()]));
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(getRendererCssClass());
+    if (command.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(getRendererCssClass().createMarkup(command.getMarkup())));
+    }
+    classAttributes.addAll(cssItems);
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
 
     final boolean defaultCommand = ComponentUtils.getBooleanAttribute(command, Attributes.defaultCommand);
     if (defaultCommand) {

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FigureRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FigureRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FigureRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FigureRenderer.java Fri May 12 11:33:56 2017
@@ -24,6 +24,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.internal.util.RenderUtils;
 import org.apache.myfaces.tobago.renderkit.RendererBase;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -33,6 +34,9 @@ import org.apache.myfaces.tobago.webapp.
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 public class FigureRenderer extends RendererBase {
 
@@ -41,7 +45,16 @@ public class FigureRenderer extends Rend
     final AbstractUIFigure figure = (AbstractUIFigure) component;
     final TobagoResponseWriter writer = getResponseWriter(facesContext);
     writer.startElement(HtmlElements.FIGURE);
-    writer.writeClassAttribute(TobagoClass.FIGURE, BootstrapClass.FIGURE, figure.getCustomClass());
+
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.FIGURE);
+    if (figure.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.FIGURE.createMarkup(figure.getMarkup())));
+    }
+    classAttributes.add(BootstrapClass.FIGURE);
+    classAttributes.add(figure.getCustomClass());
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
     writer.writeStyleAttribute(figure.getStyle());
     final String tip = figure.getTip();
     if (tip != null) {

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java Fri May 12 11:33:56 2017
@@ -121,7 +121,10 @@ public class FileRenderer extends Messag
     final TobagoResponseWriter writer = getResponseWriter(facesContext);
 
     writer.startElement(HtmlElements.DIV);
-    writer.writeClassAttribute(TobagoClass.FILE, file.getCustomClass());
+    writer.writeClassAttribute(
+        TobagoClass.FILE,
+        file.getCustomClass(),
+        TobagoClass.FILE.createMarkup(file.getMarkup()));
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, file);
     writer.writeStyleAttribute(file.getStyle());
 

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FlowLayoutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FlowLayoutRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FlowLayoutRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FlowLayoutRenderer.java Fri May 12 11:33:56 2017
@@ -42,8 +42,10 @@ public class FlowLayoutRenderer extends
 
     writer.startElement(HtmlElements.DIV);
     writer.writeIdAttribute(layout.getClientId());
-    writer.writeClassAttribute(TobagoClass.FLOW_LAYOUT, layout.getCustomClass());
-
+    writer.writeClassAttribute(
+        TobagoClass.FLOW_LAYOUT,
+        layout.getCustomClass(),
+        TobagoClass.FLOW_LAYOUT.createMarkup(layout.getMarkup()));
     Style style = layout.getStyle();
     final TextAlign textAlign = layout.getTextAlign();
     if (style == null && textAlign != null) {

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FooterRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FooterRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FooterRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FooterRenderer.java Fri May 12 11:33:56 2017
@@ -23,6 +23,7 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
 import org.apache.myfaces.tobago.renderkit.RendererBase;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -31,6 +32,9 @@ import org.apache.myfaces.tobago.webapp.
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 public class FooterRenderer extends RendererBase {
 
@@ -40,10 +44,16 @@ public class FooterRenderer extends Rend
     final UIFooter footer = (UIFooter) component;
     writer.startElement(HtmlElements.FOOTER);
     writer.writeIdAttribute(component.getClientId(facesContext));
-    writer.writeClassAttribute(
-        TobagoClass.FOOTER,
-        footer.isFixed() ? BootstrapClass.FIXED_BOTTOM : null,
-        footer.getCustomClass());
+
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.FOOTER);
+    if (footer.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.FOOTER.createMarkup(footer.getMarkup())));
+    }
+    classAttributes.add(footer.isFixed() ? BootstrapClass.FIXED_BOTTOM : null);
+    classAttributes.add(footer.getCustomClass());
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
     writer.writeAttribute(HtmlAttributes.TITLE, footer.getTip(), true);
     writer.writeStyleAttribute(footer.getStyle());
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, footer);

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/GridLayoutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/GridLayoutRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/GridLayoutRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/GridLayoutRenderer.java Fri May 12 11:33:56 2017
@@ -57,7 +57,10 @@ public class GridLayoutRenderer extends
 
     writer.startElement(HtmlElements.TABLE);
     writer.writeAttribute(HtmlAttributes.ROLE, HtmlRoleValues.PRESENTATION.toString(), false);
-    writer.writeClassAttribute(TobagoClass.GRID_LAYOUT);
+    writer.writeClassAttribute(
+        TobagoClass.GRID_LAYOUT,
+        null,
+        TobagoClass.GRID_LAYOUT.createMarkup(gridLayout.getMarkup()));
 
     final StringBuilder builder = new StringBuilder();
 

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/HeaderRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/HeaderRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/HeaderRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/HeaderRenderer.java Fri May 12 11:33:56 2017
@@ -23,6 +23,7 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
 import org.apache.myfaces.tobago.renderkit.RendererBase;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -31,6 +32,9 @@ import org.apache.myfaces.tobago.webapp.
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 public class HeaderRenderer extends RendererBase {
 
@@ -42,10 +46,16 @@ public class HeaderRenderer extends Rend
     writer.writeIdAttribute(component.getClientId(facesContext));
     // TBD: NAVBAR_DARK and BG_INVERSE should not be the default
     // TBD: how to configure it when it is needed, with customClass, or with markup?
-    writer.writeClassAttribute(
-        TobagoClass.HEADER,
-        header.isFixed() ? BootstrapClass.FIXED_TOP : null,
-        header.getCustomClass());
+
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.HEADER);
+    if (header.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.HEADER.createMarkup(header.getMarkup())));
+    }
+    classAttributes.add(header.isFixed() ? BootstrapClass.FIXED_TOP : null);
+    classAttributes.add(header.getCustomClass());
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
 // TBD: should NAVBAR class be in the LinksRenderer?
     writer.writeAttribute(HtmlAttributes.TITLE, header.getTip(), true);
     writer.writeStyleAttribute(header.getStyle());

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ImageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ImageRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ImageRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ImageRenderer.java Fri May 12 11:33:56 2017
@@ -25,6 +25,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.internal.util.StringUtils;
 import org.apache.myfaces.tobago.renderkit.RendererBase;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.FontAwesomeIconEncoder;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
@@ -34,6 +35,9 @@ import org.apache.myfaces.tobago.webapp.
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 public class ImageRenderer extends RendererBase {
 
@@ -59,10 +63,16 @@ public class ImageRenderer extends Rende
       if (title != null) {
         writer.writeAttribute(HtmlAttributes.TITLE, title, true);
       }
-      writer.writeClassAttribute(
-          TobagoClass.IMAGE,
-          isDisabled(image) ? BootstrapClass.DISABLED : null,
-          image.getCustomClass());
+
+      // TODO: optimize class attribute writing
+      final List<CssItem> classAttributes = new ArrayList<CssItem>();
+      classAttributes.add(TobagoClass.IMAGE);
+      if (image.getMarkup() != null) {
+        classAttributes.addAll(Arrays.asList(TobagoClass.IMAGE.createMarkup(image.getMarkup())));
+      }
+      classAttributes.add(isDisabled(image) ? BootstrapClass.DISABLED : null);
+      classAttributes.add(image.getCustomClass());
+      writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
       writer.writeStyleAttribute(image.getStyle());
       writer.endElement(HtmlElements.IMG);
     }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/InRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/InRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/InRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/InRenderer.java Fri May 12 11:33:56 2017
@@ -47,6 +47,8 @@ import javax.faces.context.FacesContext;
 import javax.faces.validator.LengthValidator;
 import javax.faces.validator.Validator;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
@@ -129,10 +131,15 @@ public class InRenderer extends MessageL
       writer.writeAttribute(HtmlAttributes.PLACEHOLDER, placeholder, true);
     }
 
-    writer.writeClassAttribute(
-        getRendererCssClass(),
-        BootstrapClass.FORM_CONTROL,
-        input.getCustomClass());
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(getRendererCssClass());
+    if (input.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(getRendererCssClass().createMarkup(input.getMarkup())));
+    }
+    classAttributes.add(BootstrapClass.FORM_CONTROL);
+    classAttributes.add(input.getCustomClass());
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
     writer.writeAttribute(HtmlAttributes.REQUIRED, required);
     HtmlRendererUtils.renderFocus(clientId, input.isFocus(), ComponentUtils.isError(input), facesContext, writer);
     writeAdditionalAttributes(facesContext, writer, input);

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/MessagesRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/MessagesRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/MessagesRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/MessagesRenderer.java Fri May 12 11:33:56 2017
@@ -77,7 +77,10 @@ public class MessagesRenderer extends Re
 
     writer.startElement(HtmlElements.DIV);
     writer.writeIdAttribute(messages.getClientId(facesContext));
-    writer.writeClassAttribute(TobagoClass.MESSAGES, messages.getCustomClass());
+    writer.writeClassAttribute(
+        TobagoClass.MESSAGES,
+        messages.getCustomClass(),
+        TobagoClass.MESSAGES.createMarkup(messages.getMarkup()));
 
     FacesMessage.Severity lastSeverity = null;
     boolean first = true;

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ObjectRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ObjectRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ObjectRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ObjectRenderer.java Fri May 12 11:33:56 2017
@@ -49,7 +49,10 @@ public class ObjectRenderer extends Rend
     writer.writeNameAttribute(name);
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, object);
     writer.writeAttribute(HtmlAttributes.SRC, object.getSrc(), true);
-    writer.writeClassAttribute(TobagoClass.OBJECT, object.getCustomClass());
+    writer.writeClassAttribute(
+        TobagoClass.OBJECT,
+        object.getCustomClass(),
+        TobagoClass.OBJECT.createMarkup(object.getMarkup()));
     writer.writeStyleAttribute(object.getStyle());
 
     String noframes = TobagoResourceBundle.getString(facesContext, "browser.noframe.message.prefix");

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/OutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/OutRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/OutRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/OutRenderer.java Fri May 12 11:33:56 2017
@@ -24,6 +24,7 @@ import org.apache.myfaces.tobago.config.
 import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
 import org.apache.myfaces.tobago.internal.util.RenderUtils;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -34,6 +35,9 @@ import org.apache.myfaces.tobago.webapp.
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 import java.util.StringTokenizer;
 
 public class OutRenderer extends MessageLayoutRendererBase {
@@ -57,7 +61,16 @@ public class OutRenderer extends Message
       writer.startElement(HtmlElements.SPAN);
       HtmlRendererUtils.writeDataAttributes(facesContext, writer, out);
       writer.writeStyleAttribute(out.getStyle());
-      writer.writeClassAttribute(TobagoClass.OUT, BootstrapClass.FORM_CONTROL_STATIC, out.getCustomClass());
+
+      // TODO: optimize class attribute writing
+      final List<CssItem> classAttributes = new ArrayList<CssItem>();
+      classAttributes.add(TobagoClass.OUT);
+      if (out.getMarkup() != null) {
+        classAttributes.addAll(Arrays.asList(TobagoClass.OUT.createMarkup(out.getMarkup())));
+      }
+      classAttributes.add(BootstrapClass.FORM_CONTROL_STATIC);
+      classAttributes.add(out.getCustomClass());
+      writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
       final String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, out);
       if (title != null) {
         writer.writeAttribute(HtmlAttributes.TITLE, title, true);

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java Fri May 12 11:33:56 2017
@@ -40,6 +40,7 @@ import org.apache.myfaces.tobago.portlet
 import org.apache.myfaces.tobago.renderkit.RendererBase;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
 import org.apache.myfaces.tobago.renderkit.css.Classes;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
@@ -63,6 +64,8 @@ import javax.portlet.ResourceURL;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 import java.util.Locale;
@@ -248,11 +251,20 @@ public class PageRenderer extends Render
     }
 
     writer.startElement(portlet ? HtmlElements.DIV : HtmlElements.BODY);
-    writer.writeClassAttribute(
-        portlet ? Classes.create(page, Markup.PORTLET) : TobagoClass.PAGE,
-        BootstrapClass.CONTAINER_FLUID,
-        spread,
-        page.getCustomClass());
+
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.PAGE);
+    if (page.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.PAGE.createMarkup(page.getMarkup())));
+    }
+    if (portlet) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.PAGE.createMarkup(Markup.PORTLET)));
+    }
+    classAttributes.add(BootstrapClass.CONTAINER_FLUID);
+    classAttributes.add(spread);
+    classAttributes.add(page.getCustomClass());
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
     writer.writeIdAttribute(clientId);
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, page);
     writer.writeStyleAttribute(page.getStyle());

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PanelRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PanelRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PanelRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PanelRenderer.java Fri May 12 11:33:56 2017
@@ -26,6 +26,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.internal.util.JsonUtils;
 import org.apache.myfaces.tobago.internal.util.RenderUtils;
 import org.apache.myfaces.tobago.model.CollapseMode;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
@@ -36,6 +37,9 @@ import org.apache.myfaces.tobago.webapp.
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 public class PanelRenderer extends PanelRendererBase {
 
@@ -49,10 +53,16 @@ public class PanelRenderer extends Panel
 
     writer.startElement(HtmlElements.DIV);
     writer.writeIdAttribute(clientId);
-    writer.writeClassAttribute(
-        TobagoClass.PANEL,
-        panel.getCustomClass(),
-        collapsed ? TobagoClass.COLLAPSED : null);
+
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.PANEL);
+    if (panel.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.PANEL.createMarkup(panel.getMarkup())));
+    }
+    classAttributes.add(panel.getCustomClass());
+    classAttributes.add(collapsed ? TobagoClass.COLLAPSED : null);
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
     writer.writeStyleAttribute(panel.getStyle());
 
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, panel);

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PopupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PopupRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PopupRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PopupRenderer.java Fri May 12 11:33:56 2017
@@ -24,6 +24,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
 import org.apache.myfaces.tobago.model.CollapseMode;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -34,6 +35,9 @@ import org.apache.myfaces.tobago.webapp.
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 public class PopupRenderer extends PanelRendererBase {
 
@@ -49,13 +53,19 @@ public class PopupRenderer extends Panel
     ComponentUtils.putDataAttribute(popup, "backdrop", "static");
 
     writer.startElement(HtmlElements.DIV);
-    writer.writeClassAttribute(
-        TobagoClass.POPUP,
-        BootstrapClass.MODAL,
-        //XXX fade class removed due to a bug in bootstrap-alpha6
-        //https://github.com/twbs/bootstrap/issues/21607
-        //BootstrapClass.FADE,
-        popup.getCustomClass());
+
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.POPUP);
+    if (popup.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.POPUP.createMarkup(popup.getMarkup())));
+    }
+    classAttributes.add(BootstrapClass.MODAL);
+    //XXX fade class removed due to a bug in bootstrap-alpha6
+    //https://github.com/twbs/bootstrap/issues/21607
+    //    classAttributes.add(BootstrapClass.FADE);
+    classAttributes.add(popup.getCustomClass());
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
     writer.writeIdAttribute(clientId);
     writer.writeAttribute(HtmlAttributes.TABINDEX, -1);
     writer.writeAttribute(HtmlAttributes.ROLE, HtmlRoleValues.DIALOG.toString(), false);

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ProgressRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ProgressRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ProgressRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ProgressRenderer.java Fri May 12 11:33:56 2017
@@ -26,6 +26,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.layout.Measure;
 import org.apache.myfaces.tobago.renderkit.RendererBase;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.Style;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.Arias;
@@ -39,6 +40,9 @@ import org.slf4j.LoggerFactory;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 public class ProgressRenderer extends RendererBase {
 
@@ -56,7 +60,16 @@ public class ProgressRenderer extends Re
 
     writer.startElement(HtmlElements.DIV);
     writer.writeIdAttribute(progress.getClientId(facesContext));
-    writer.writeClassAttribute(TobagoClass.PROGRESS, progress.getCustomClass(), BootstrapClass.PROGRESS);
+
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.PROGRESS);
+    if (progress.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.PROGRESS.createMarkup(progress.getMarkup())));
+    }
+    classAttributes.add(progress.getCustomClass());
+    classAttributes.add(BootstrapClass.PROGRESS);
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, progress);
     writer.writeStyleAttribute(progress.getStyle());
 

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SectionRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SectionRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SectionRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SectionRenderer.java Fri May 12 11:33:56 2017
@@ -24,6 +24,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
 import org.apache.myfaces.tobago.internal.util.RenderUtils;
 import org.apache.myfaces.tobago.model.CollapseMode;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
 import org.apache.myfaces.tobago.util.ComponentUtils;
@@ -32,6 +33,9 @@ import org.apache.myfaces.tobago.webapp.
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 public class SectionRenderer extends PanelRendererBase {
 
@@ -45,10 +49,16 @@ public class SectionRenderer extends Pan
 
     writer.startElement(HtmlElements.DIV);
     writer.writeIdAttribute(clientId);
-    writer.writeClassAttribute(
-        TobagoClass.SECTION,
-        collapsed ? TobagoClass.COLLAPSED : null,
-        section.getCustomClass());
+
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.SECTION);
+    if (section.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.SECTION.createMarkup(section.getMarkup())));
+    }
+    classAttributes.add(collapsed ? TobagoClass.COLLAPSED : null);
+    classAttributes.add(section.getCustomClass());
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, section);
 
     String label = section.getLabelToRender();

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SegmentLayoutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SegmentLayoutRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SegmentLayoutRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SegmentLayoutRenderer.java Fri May 12 11:33:56 2017
@@ -56,7 +56,10 @@ public class SegmentLayoutRenderer exten
 
     writer.startElement(HtmlElements.DIV);
 //    writer.writeClassAttribute(BootstrapClass.FORM_HORIZONTAL, BootstrapClass.CONTAINER_FLUID);
-    writer.writeClassAttribute(TobagoClass.SEGMENT_LAYOUT, BootstrapClass.ROW);
+    writer.writeClassAttribute(
+        TobagoClass.SEGMENT_LAYOUT,
+        BootstrapClass.ROW,
+        TobagoClass.SEGMENT_LAYOUT.createMarkup(layout.getMarkup()));
 //    writer.writeClassAttribute(Classes.create(layout), BootstrapClass.FORM_GROUP);
     writer.writeIdAttribute(layout.getClientId(facesContext));
   }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectBooleanCheckboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectBooleanCheckboxRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectBooleanCheckboxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectBooleanCheckboxRenderer.java Fri May 12 11:33:56 2017
@@ -41,6 +41,7 @@ import javax.faces.component.UIInput;
 import javax.faces.context.FacesContext;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 public class SelectBooleanCheckboxRenderer extends MessageLayoutRendererBase {
@@ -90,11 +91,17 @@ public class SelectBooleanCheckboxRender
 
     final List<CssItem> outerCssItems = new ArrayList<CssItem>();
     addOuterCssItems(facesContext, select, outerCssItems);
-    outerCssItems.add(select.getCustomClass());
-    writer.writeClassAttribute(
-        TobagoClass.SELECT_BOOLEAN_CHECKBOX,
-        disabled ? BootstrapClass.DISABLED : null,
-        outerCssItems.toArray(new CssItem[outerCssItems.size()]));
+
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.SELECT_BOOLEAN_CHECKBOX);
+    if (select.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.SELECT_BOOLEAN_CHECKBOX.createMarkup(select.getMarkup())));
+    }
+    classAttributes.add(disabled ? BootstrapClass.DISABLED : null);
+    classAttributes.add(select.getCustomClass());
+    classAttributes.addAll(outerCssItems);
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
 
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, select);
     if (title != null) {

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyCheckboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyCheckboxRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyCheckboxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyCheckboxRenderer.java Fri May 12 11:33:56 2017
@@ -38,6 +38,7 @@ import javax.faces.context.FacesContext;
 import javax.faces.model.SelectItem;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 public class SelectManyCheckboxRenderer extends SelectManyRendererBase {
@@ -59,10 +60,16 @@ public class SelectManyCheckboxRenderer
       writer.writeIdAttribute(id);
     }
     writer.writeStyleAttribute(select.getStyle());
-    writer.writeClassAttribute(
-        TobagoClass.SELECT_MANY_CHECKBOX,
-        inline ? TobagoClass.SELECT_MANY_CHECKBOX__INLINE : null,
-        select.getCustomClass());
+
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.SELECT_MANY_CHECKBOX);
+    if (select.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.SELECT_MANY_CHECKBOX.createMarkup(select.getMarkup())));
+    }
+    classAttributes.add(inline ? TobagoClass.SELECT_MANY_CHECKBOX__INLINE : null);
+    classAttributes.add(select.getCustomClass());
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, select);
     if (title != null) {
       writer.writeAttribute(HtmlAttributes.TITLE, title, true);

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyListboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyListboxRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyListboxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyListboxRenderer.java Fri May 12 11:33:56 2017
@@ -25,6 +25,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.internal.util.RenderUtils;
 import org.apache.myfaces.tobago.internal.util.SelectItemUtils;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -35,6 +36,8 @@ import javax.faces.component.UIComponent
 import javax.faces.context.FacesContext;
 import javax.faces.model.SelectItem;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 public class SelectManyListboxRenderer extends SelectManyRendererBase {
@@ -68,7 +71,16 @@ public class SelectManyListboxRenderer e
     HtmlRendererUtils.renderFocus(clientId, select.isFocus(), ComponentUtils.isError(select), facesContext, writer);
     writer.writeAttribute(HtmlAttributes.TABINDEX, select.getTabIndex());
     writer.writeStyleAttribute(select.getStyle());
-    writer.writeClassAttribute(TobagoClass.SELECT_MANY_LISTBOX, BootstrapClass.FORM_CONTROL, select.getCustomClass());
+
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.SELECT_MANY_LISTBOX);
+    if (select.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.SELECT_MANY_LISTBOX.createMarkup(select.getMarkup())));
+    }
+    classAttributes.add(BootstrapClass.FORM_CONTROL);
+    classAttributes.add(select.getCustomClass());
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
     writer.writeAttribute(HtmlAttributes.MULTIPLE, true);
     writer.writeAttribute(HtmlAttributes.SIZE, size);
     writer.writeAttribute(HtmlAttributes.TITLE, title, true);

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyShuttleRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyShuttleRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyShuttleRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyShuttleRenderer.java Fri May 12 11:33:56 2017
@@ -47,7 +47,10 @@ public class SelectManyShuttleRenderer e
     final String clientId = select.getClientId(facesContext);
     final TobagoResponseWriter writer = getResponseWriter(facesContext);
     writer.startElement(HtmlElements.DIV);
-    writer.writeClassAttribute(TobagoClass.SELECT_MANY_SHUTTLE, select.getCustomClass());
+    writer.writeClassAttribute(
+        TobagoClass.SELECT_MANY_SHUTTLE,
+        select.getCustomClass(),
+        TobagoClass.SELECT_MANY_SHUTTLE.createMarkup(select.getMarkup()));
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, select);
     final String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, select);
     if (title != null) {

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneChoiceRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneChoiceRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneChoiceRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneChoiceRenderer.java Fri May 12 11:33:56 2017
@@ -25,6 +25,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.internal.util.RenderUtils;
 import org.apache.myfaces.tobago.internal.util.SelectItemUtils;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -35,6 +36,9 @@ import javax.faces.component.UIComponent
 import javax.faces.context.FacesContext;
 import javax.faces.model.SelectItem;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 public class SelectOneChoiceRenderer extends SelectOneRendererBase {
 
@@ -61,7 +65,16 @@ public class SelectOneChoiceRenderer ext
     writer.writeAttribute(HtmlAttributes.DISABLED, disabled);
     writer.writeAttribute(HtmlAttributes.TABINDEX, select.getTabIndex());
     writer.writeStyleAttribute(select.getStyle());
-    writer.writeClassAttribute(TobagoClass.SELECT_ONE_CHOICE, BootstrapClass.FORM_CONTROL, select.getCustomClass());
+
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.SELECT_ONE_CHOICE);
+    if (select.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.SELECT_ONE_CHOICE.createMarkup(select.getMarkup())));
+    }
+    classAttributes.add(BootstrapClass.FORM_CONTROL);
+    classAttributes.add(select.getCustomClass());
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
     if (title != null) {
       writer.writeAttribute(HtmlAttributes.TITLE, title, true);
     }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneListboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneListboxRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneListboxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneListboxRenderer.java Fri May 12 11:33:56 2017
@@ -25,6 +25,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.internal.util.RenderUtils;
 import org.apache.myfaces.tobago.internal.util.SelectItemUtils;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -35,6 +36,8 @@ import javax.faces.component.UIComponent
 import javax.faces.context.FacesContext;
 import javax.faces.model.SelectItem;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 public class SelectOneListboxRenderer extends SelectOneRendererBase {
@@ -67,7 +70,16 @@ public class SelectOneListboxRenderer ex
 
     writer.writeAttribute(HtmlAttributes.TABINDEX, select.getTabIndex());
     writer.writeStyleAttribute(select.getStyle());
-    writer.writeClassAttribute(TobagoClass.SELECT_ONE_LISTBOX, BootstrapClass.FORM_CONTROL, select.getCustomClass());
+
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.SELECT_ONE_LISTBOX);
+    if (select.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.SELECT_ONE_LISTBOX.createMarkup(select.getMarkup())));
+    }
+    classAttributes.add(BootstrapClass.FORM_CONTROL);
+    classAttributes.add(select.getCustomClass());
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
     final String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, select);
     writer.writeAttribute(HtmlAttributes.TITLE, title, true);
     writer.writeAttribute(HtmlAttributes.SIZE, size);

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneRadioRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneRadioRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneRadioRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneRadioRenderer.java Fri May 12 11:33:56 2017
@@ -39,6 +39,7 @@ import javax.faces.context.FacesContext;
 import javax.faces.model.SelectItem;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 public class SelectOneRadioRenderer extends SelectOneRendererBase {
@@ -61,10 +62,16 @@ public class SelectOneRadioRenderer exte
       writer.writeIdAttribute(id);
     }
     writer.writeStyleAttribute(select.getStyle());
-    writer.writeClassAttribute(
-        TobagoClass.SELECT_ONE_RADIO,
-        inline ? TobagoClass.SELECT_ONE_RADIO__INLINE : null,
-        select.getCustomClass());
+
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.SELECT_ONE_RADIO);
+    if (select.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.SELECT_ONE_RADIO.createMarkup(select.getMarkup())));
+    }
+    classAttributes.add(inline ? TobagoClass.SELECT_ONE_RADIO__INLINE : null);
+    classAttributes.add(select.getCustomClass());
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, select);
     if (title != null) {
       writer.writeAttribute(HtmlAttributes.TITLE, title, true);

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SeparatorRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SeparatorRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SeparatorRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SeparatorRenderer.java Fri May 12 11:33:56 2017
@@ -45,13 +45,19 @@ public class SeparatorRenderer extends R
     if (label != null) {
       writer.startElement(HtmlElements.P);
       writer.writeIdAttribute(clientId);
-      writer.writeClassAttribute(TobagoClass.SEPARATOR, separator.getCustomClass());
+      writer.writeClassAttribute(
+          TobagoClass.SEPARATOR,
+          separator.getCustomClass(),
+          TobagoClass.SEPARATOR.createMarkup(separator.getMarkup()));
       writer.writeText(label);
       writer.endElement(HtmlElements.P);
     } else {
       writer.startElement(HtmlElements.HR);
       writer.writeIdAttribute(clientId);
-      writer.writeClassAttribute(TobagoClass.SEPARATOR, separator.getCustomClass());
+      writer.writeClassAttribute(
+          TobagoClass.SEPARATOR,
+          separator.getCustomClass(),
+          TobagoClass.SEPARATOR.createMarkup(separator.getMarkup()));
       writer.endElement(HtmlElements.HR);
     }
   }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java Fri May 12 11:33:56 2017
@@ -185,7 +185,10 @@ public class SheetRenderer extends Rende
     writer.startElement(HtmlElements.DIV);
     writer.writeIdAttribute(sheetId);
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, sheet);
-    writer.writeClassAttribute(TobagoClass.SHEET, sheet.getCustomClass());
+    writer.writeClassAttribute(
+        TobagoClass.SHEET,
+        sheet.getCustomClass(),
+        TobagoClass.SHEET.createMarkup(sheet.getMarkup()));
     writer.writeStyleAttribute(sheet.getStyle());
     final UIComponent facetReload = ComponentUtils.getFacet(sheet, Facets.reload);
     if (facetReload != null && facetReload instanceof UIReload && facetReload.isRendered()) {

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TabGroupRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TabGroupRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TabGroupRenderer.java Fri May 12 11:33:56 2017
@@ -150,7 +150,10 @@ public class TabGroupRenderer extends Re
 
     writer.startElement(HtmlElements.DIV);
     writer.writeIdAttribute(clientId);
-    writer.writeClassAttribute(TobagoClass.TAB_GROUP, tabGroup.getCustomClass());
+    writer.writeClassAttribute(
+        TobagoClass.TAB_GROUP,
+        tabGroup.getCustomClass(),
+        TobagoClass.TAB_GROUP.createMarkup(tabGroup.getMarkup()));
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, tabGroup);
     writer.writeStyleAttribute(tabGroup.getStyle());
     writer.writeAttribute(HtmlAttributes.SWITCHTYPE, switchType.name(), false);

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TextareaRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TextareaRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TextareaRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TextareaRenderer.java Fri May 12 11:33:56 2017
@@ -26,6 +26,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.internal.util.JsonUtils;
 import org.apache.myfaces.tobago.internal.util.RenderUtils;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -41,6 +42,9 @@ import javax.faces.context.FacesContext;
 import javax.faces.validator.LengthValidator;
 import javax.faces.validator.Validator;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 public class TextareaRenderer extends MessageLayoutRendererBase {
 
@@ -76,7 +80,15 @@ public class TextareaRenderer extends Me
       AccessKeyLogger.addAccessKey(facesContext, input.getAccessKey(), clientId);
     }
 
-    writer.writeClassAttribute(TobagoClass.TEXTAREA, BootstrapClass.FORM_CONTROL, input.getCustomClass());
+    // TODO: optimize class attribute writing
+    final List<CssItem> classAttributes = new ArrayList<CssItem>();
+    classAttributes.add(TobagoClass.TEXTAREA);
+    if (input.getMarkup() != null) {
+      classAttributes.addAll(Arrays.asList(TobagoClass.TEXTAREA.createMarkup(input.getMarkup())));
+    }
+    classAttributes.add(BootstrapClass.FORM_CONTROL);
+    classAttributes.add(input.getCustomClass());
+    writer.writeClassAttribute(null, null, classAttributes.toArray(new CssItem[classAttributes.size()]));
     writer.writeStyleAttribute(input.getStyle());
     int maxLength = -1;
     final String pattern = null;

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeLabelRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeLabelRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeLabelRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeLabelRenderer.java Fri May 12 11:33:56 2017
@@ -55,7 +55,10 @@ public class TreeLabelRenderer extends R
       writer.writeText(text);
     } else {
       writer.startElement(HtmlElements.LABEL);
-      writer.writeClassAttribute(TobagoClass.TREE_LABEL);
+      writer.writeClassAttribute(
+          TobagoClass.TREE_LABEL,
+          null,
+          TobagoClass.TREE_LABEL.createMarkup(label.getMarkup()));
       HtmlRendererUtils.writeDataAttributes(facesContext, writer, label);
       writer.writeStyleAttribute(label.getStyle());
       final String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, label);

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeListboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeListboxRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeListboxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeListboxRenderer.java Fri May 12 11:33:56 2017
@@ -65,7 +65,10 @@ public class TreeListboxRenderer extends
 //    writer.writeStyleAttribute(scrollDivStyle);
 
     writer.startElement(HtmlElements.DIV);
-    writer.writeClassAttribute(TobagoClass.TREE_LISTBOX);
+    writer.writeClassAttribute(
+        TobagoClass.TREE_LISTBOX,
+        null,
+        TobagoClass.TREE_LISTBOX.createMarkup(tree.getMarkup()));
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, tree);
     writer.writeStyleAttribute(tree.getStyle());
 

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeRenderer.java Fri May 12 11:33:56 2017
@@ -86,7 +86,10 @@ public class TreeRenderer extends Render
     final TobagoResponseWriter writer = getResponseWriter(facesContext);
 
     writer.startElement(HtmlElements.DIV);
-    writer.writeClassAttribute(TobagoClass.TREE, tree.getCustomClass());
+    writer.writeClassAttribute(
+        TobagoClass.TREE,
+        tree.getCustomClass(),
+        TobagoClass.TREE.createMarkup(tree.getMarkup()));
     writer.writeStyleAttribute(tree.getStyle());
     writer.writeIdAttribute(clientId);
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, tree);

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeSelectRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeSelectRenderer.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeSelectRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeSelectRenderer.java Fri May 12 11:33:56 2017
@@ -106,7 +106,10 @@ public class TreeSelectRenderer extends
     final Selectable selectable = data.getSelectable();
 
     writer.startElement(HtmlElements.SPAN);
-    writer.writeClassAttribute(TobagoClass.TREE_SELECT);
+    writer.writeClassAttribute(
+        TobagoClass.TREE_SELECT,
+        null,
+        TobagoClass.TREE_SELECT.createMarkup(select.getMarkup()));
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, select);
 
     if (select.isShowCheckbox()

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java Fri May 12 11:33:56 2017
@@ -19,11 +19,20 @@
 
 package org.apache.myfaces.tobago.renderkit.css;
 
+import org.apache.myfaces.tobago.apt.annotation.Preliminary;
+import org.apache.myfaces.tobago.context.Markup;
+import org.apache.myfaces.tobago.context.Theme;
+import org.apache.myfaces.tobago.context.TobagoContext;
+import org.apache.myfaces.tobago.internal.util.Deprecation;
 import org.apache.myfaces.tobago.layout.AlignItems;
 import org.apache.myfaces.tobago.layout.JustifyContent;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.faces.context.FacesContext;
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * Declaration of the Tobago CSS classes.
  *
@@ -211,4 +220,47 @@ public enum TobagoClass implements CssIt
     }
   }
 
+  @Preliminary
+  public CssItem[] createMarkup(final Markup markup) {
+    if (markup != null) {
+      final List<CssItem> markups = new ArrayList<CssItem>();
+      for (final String markupString : markup) {
+        markups.add(new MarkupClass(this, markupString));
+      }
+      return markups.toArray(new CssItem[markups.size()]);
+    } else {
+      return null;
+    }
+  }
+
+  private static class MarkupClass implements CssItem {
+
+    final TobagoClass rendererClass;
+    final String markup;
+
+    private MarkupClass(final TobagoClass rendererClass, final String markup) {
+      this.rendererClass = rendererClass;
+      this.markup = markup;
+    }
+
+    @Override
+    public String getName() {
+      // These values are statistically tested length of the html class attribute
+      final StringBuilder builder = new StringBuilder(80);
+      final String rendererName = rendererClass.getName().substring("tobago-".length());
+      final Theme theme = TobagoContext.getInstance(FacesContext.getCurrentInstance()).getTheme();
+
+      if (theme.getRenderersConfig().isMarkupSupported(rendererName, markup)) {
+        builder.append(rendererClass.getName());
+        builder.append("-markup-");
+        builder.append(markup);
+      } else if ("none".equals(markup)) {
+        Deprecation.LOG.warn("Markup 'none' is deprecated, please use a NULL pointer instead.");
+      } else {
+        LOG.warn("Ignoring unknown markup='" + markup + "' for rendererClass='" + rendererClass + "'");
+      }
+
+      return builder.toString();
+    }
+  }
 }

Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Preliminary.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Preliminary.java?rev=1794955&r1=1794954&r2=1794955&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Preliminary.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Preliminary.java Fri May 12 11:33:56 2017
@@ -30,7 +30,7 @@ import java.lang.annotation.ElementType;
  *
  */
 @Retention(value = RetentionPolicy.SOURCE)
-@Target(value = ElementType.TYPE)
+@Target(value = {ElementType.TYPE, ElementType.METHOD})
 public @interface Preliminary {
   String value() default "";
 }



Mime
View raw message