You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2015/09/17 12:58:47 UTC

svn commit: r1703567 [2/2] - in /myfaces/tobago/branches/tobago-3.0.x: tobago-core/src/main/java/org/apache/myfaces/tobago/component/ tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ tobago-core/src/main/java/org/apache/my...

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java?rev=1703567&r1=1703566&r2=1703567&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java Thu Sep 17 10:58:44 2015
@@ -43,22 +43,22 @@ public class SeparatorRenderer extends L
     final String label = getLabel(separator);
 
     if (label != null) {
-      writer.startElement(HtmlElements.FIELDSET, component);
+      writer.startElement(HtmlElements.FIELDSET, separator);
       writer.writeAttribute(HtmlAttributes.ROLE, HtmlRoleValues.PRESENTATION.toString(), false);
       writer.writeIdAttribute(separator.getClientId(facesContext));
-      writer.writeClassAttribute(Classes.create(component));
-      HtmlRendererUtils.writeDataAttributes(facesContext, writer, component);
+      writer.writeClassAttribute(Classes.create(separator), separator.getCustomClass());
+      HtmlRendererUtils.writeDataAttributes(facesContext, writer, separator);
 
-      writer.startElement(HtmlElements.LEGEND, component);
-      writer.writeClassAttribute(Classes.create(component, "label"));
+      writer.startElement(HtmlElements.LEGEND, separator);
+      writer.writeClassAttribute(Classes.create(separator, "label"));
       writer.writeText(label);
       writer.endElement(HtmlElements.LEGEND);
 
       writer.endElement(HtmlElements.FIELDSET);
     } else {
-      writer.startElement(HtmlElements.HR , component);
+      writer.startElement(HtmlElements.HR , separator);
       writer.writeIdAttribute(separator.getClientId(facesContext));
-      writer.writeClassAttribute(Classes.create(component));
+      writer.writeClassAttribute(Classes.create(separator), separator.getCustomClass());
       writer.endElement(HtmlElements.HR);
     }
   }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java?rev=1703567&r1=1703566&r2=1703567&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java Thu Sep 17 10:58:44 2015
@@ -148,7 +148,7 @@ public class SheetRenderer extends Layou
     writer.startElement(HtmlElements.DIV, sheet);
     writer.writeIdAttribute(sheetId);
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, sheet);
-    writer.writeClassAttribute(Classes.create(sheet));
+    writer.writeClassAttribute(Classes.create(sheet), sheet.getCustomClass());
     writer.writeStyleAttribute(sheet.getStyle());
     final UIComponent facetReload = sheet.getFacet(Facets.RELOAD);
     if (facetReload != null && facetReload instanceof UIReload && facetReload.isRendered()) {
@@ -233,7 +233,8 @@ public class SheetRenderer extends Layou
     writer.writeAttribute(HtmlAttributes.CELLSPACING, "0", false);
     writer.writeAttribute(HtmlAttributes.CELLPADDING, "0", false);
     writer.writeAttribute(HtmlAttributes.SUMMARY, "", false);
-    writer.writeClassAttribute(Classes.create(sheet, "bodyTable"),
+    writer.writeClassAttribute(
+        Classes.create(sheet, "bodyTable"),
         BootstrapClass.TABLE, BootstrapClass.TABLE_BORDERED, BootstrapClass.TABLE_STRIPED, BootstrapClass.TABLE_HOVER);
 
     writeColgroup(writer, columnWidths);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/StyleRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/StyleRenderer.java?rev=1703567&r1=1703566&r2=1703567&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/StyleRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/StyleRenderer.java Thu Sep 17 10:58:44 2015
@@ -23,6 +23,7 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.component.UIStyle;
 import org.apache.myfaces.tobago.internal.util.FacesContextUtils;
 import org.apache.myfaces.tobago.renderkit.RendererBase;
+import org.apache.myfaces.tobago.renderkit.css.CustomClass;
 import org.apache.myfaces.tobago.renderkit.css.Style;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -47,7 +48,17 @@ public class StyleRenderer extends Rende
     if (!style.isEmpty()) {
       final UIComponent parent = styleComponent.getParent();
       if (parent instanceof SupportsStyle) {
-        ((SupportsStyle)parent).setStyle(style);
+        ((SupportsStyle) parent).setStyle(style);
+      } else {
+        LOG.warn("The parent of a style component doesn't support style: " + parent.getClientId(facesContext));
+      }
+    }
+
+    final CustomClass customClass = styleComponent.getCustomClass();
+    if (customClass != null) {
+      final UIComponent parent = styleComponent.getParent();
+      if (parent instanceof SupportsStyle) {
+        ((SupportsStyle) parent).setCustomClass(customClass);
       } else {
         LOG.warn("The parent of a style component doesn't support style: " + parent.getClientId(facesContext));
       }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java?rev=1703567&r1=1703566&r2=1703567&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java Thu Sep 17 10:58:44 2015
@@ -104,7 +104,7 @@ public class TabGroupRenderer extends La
 
     writer.startElement(HtmlElements.DIV, null);
     writer.writeIdAttribute(clientId);
-    writer.writeClassAttribute(Classes.create(tabGroup));
+    writer.writeClassAttribute(Classes.create(tabGroup), tabGroup.getCustomClass());
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, tabGroup);
     writer.writeStyleAttribute(tabGroup.getStyle());
     writer.writeAttribute(HtmlAttributes.SWITCHTYPE, switchType, false);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TextareaRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TextareaRenderer.java?rev=1703567&r1=1703566&r2=1703567&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TextareaRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TextareaRenderer.java Thu Sep 17 10:58:44 2015
@@ -74,7 +74,7 @@ public class TextareaRenderer extends In
       writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
     }
 
-    writer.writeClassAttribute(Classes.create(input), BootstrapClass.FORM_CONTROL);
+    writer.writeClassAttribute(Classes.create(input), BootstrapClass.FORM_CONTROL, input.getCustomClass());
     writer.writeStyleAttribute(input.getStyle());
     int maxLength = -1;
     final String pattern = null;

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeRenderer.java?rev=1703567&r1=1703566&r2=1703567&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeRenderer.java Thu Sep 17 10:58:44 2015
@@ -81,7 +81,7 @@ public class TreeRenderer extends Layout
     final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
 
     writer.startElement(HtmlElements.DIV, tree);
-    writer.writeClassAttribute(Classes.create(tree));
+    writer.writeClassAttribute(Classes.create(tree), tree.getCustomClass());
     writer.writeStyleAttribute(tree.getStyle());
     writer.writeIdAttribute(clientId);
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, tree);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg?rev=1703567&r1=1703566&r2=1703567&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg Thu Sep 17 10:58:44 2015
@@ -332,6 +332,10 @@ StyleProperty(property) ::= <<
 <NormalProperty(property)>
 >>
 
+CustomClassProperty(property) ::= <<
+<NormalProperty(property)>
+>>
+
 OrderByProperty(property) ::= <<
 <NormalProperty(property)>
 >>