myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1659012 - in /myfaces/tobago/branches/tobago-3.0.x: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/ tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/ tobago-core/src/main/java/org/apache/myfaces/tobago...
Date Wed, 11 Feb 2015 17:37:22 GMT
Author: lofwyr
Date: Wed Feb 11 17:37:21 2015
New Revision: 1659012

URL: http://svn.apache.org/r1659012
Log:
TOBAGO-1368: Create a new theme which uses Bootstrap
- enum instead of strings for Bootstrap css class names

Added:
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/CssItem.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/TobagoClass.java
      - copied, changed from r1658978, myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/BootstrapClass.java
Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/DebugResponseWriterWrapper.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterBase.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterWrapper.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/BootstrapClass.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/BoxRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ColumnLayoutRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PopupRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SectionRenderer.java
    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
    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
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRenderer.java

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/DebugResponseWriterWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/DebugResponseWriterWrapper.java?rev=1659012&r1=1659011&r2=1659012&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/DebugResponseWriterWrapper.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/DebugResponseWriterWrapper.java
Wed Feb 11 17:37:21 2015
@@ -83,12 +83,6 @@ public class DebugResponseWriterWrapper
     responseWriter.writeAttribute(name, value, escape);
   }
 
-  @Override
-  @Deprecated
-  public String getStyleClasses() {
-    return responseWriter.getStyleClasses();
-  }
-
   /**
    * @deprecated since Tobago 1.5.0
    */

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterBase.java?rev=1659012&r1=1659011&r2=1659012&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterBase.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterBase.java
Wed Feb 11 17:37:21 2015
@@ -264,19 +264,6 @@ public abstract class TobagoResponseWrit
     writeAttributeInternal(writer, name, value, escape);
   }
 
-  @Override
-  /**
-   * @deprecated Since Tobago 2.0.0
-   */
-  @Deprecated
-  public String getStyleClasses() {
-    if (component == null) {
-      return null;
-    }
-    Deprecation.LOG.error("Can't get style classes.");
-    return null;
-  }
-
   /**
    * @deprecated since Tobago 1.5.0
    */

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterWrapper.java?rev=1659012&r1=1659011&r2=1659012&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterWrapper.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterWrapper.java
Wed Feb 11 17:37:21 2015
@@ -76,12 +76,6 @@ public class TobagoResponseWriterWrapper
     responseWriter.writeAttribute(name, value, null);
   }
 
-  @Override
-  @Deprecated
-  public String getStyleClasses() {
-    return null;
-  }
-
   /**
    * @deprecated since Tobago 1.5.0
    */

Added: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/CssItem.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/CssItem.java?rev=1659012&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/CssItem.java
(added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/CssItem.java
Wed Feb 11 17:37:21 2015
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.tobago.renderkit.css;
+
+/**
+ * TBD: preliminary
+ */
+public interface CssItem {
+
+  public String getName();
+}

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java?rev=1659012&r1=1659011&r2=1659012&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
Wed Feb 11 17:37:21 2015
@@ -21,6 +21,7 @@ package org.apache.myfaces.tobago.webapp
 
 import org.apache.myfaces.tobago.ajax.AjaxUtils;
 import org.apache.myfaces.tobago.renderkit.css.Classes;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
 import org.apache.myfaces.tobago.renderkit.css.Style;
 import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
@@ -140,15 +141,17 @@ public abstract class TobagoResponseWrit
     writeAttribute(HtmlAttributes.CLASS, classes.getStringValue(), false);
   }
 
-  @Deprecated
-  public abstract String getStyleClasses();
-
   /**
-   * Write the class attribute. The value will not escaped.
-   * @deprecated since Tobago 1.5.0
+   * TBD: preliminary
    */
-  @Deprecated
-  public abstract void writeClassAttribute() throws IOException;
+  public void writeClassAttribute(final CssItem first, final CssItem... others) throws IOException
{
+    StringBuilder builder = new StringBuilder(first.getName());
+    for (CssItem other : others) {
+      builder.append(' ');
+      builder.append(other.getName());
+    }
+    writeAttribute(HtmlAttributes.CLASS, builder.toString(), false);
+  }
 
   /**
    * Write the style attribute. The value may be escaped (depending of the content).

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/BootstrapClass.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/BootstrapClass.java?rev=1659012&r1=1659011&r2=1659012&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/BootstrapClass.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/BootstrapClass.java
Wed Feb 11 17:37:21 2015
@@ -19,17 +19,43 @@
 
 package org.apache.myfaces.tobago.renderkit.html;
 
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
+
 /**
  * @since 3.0.0
  */
-public enum BootstrapClass {
+public enum BootstrapClass implements CssItem {
 
+  ACTIVE("active"),
+  COLLAPSE("collapse"),
   CONTAINER("container"),
   CONTAINER_FLUID("container-fluid"),
+  DISABLED("disabled"),
   DROPDOWN("dropdown"),
   DROPDOWN_MENU("dropdown-menu"),
+  FADE("fade"),
+  FORM_HORIZONTAL("form-horizontal"),
+  GLYPHICON("glyphicon"),
+  ICON_BAR("icon-bar"),
+  MODAL("modal"),
+  MODAL_DIALOG("modal-dialog"),
+  MODAL_CONTENT("modal-content"),
   NAV("nav"),
-  NAVBAR_NAV("navbar-nav");
+  NAV_TABS("nav-tabs"),
+  NAVBAR("navbar"),
+  NAVBAR_BRAND("navbar-brand"),
+  NAVBAR_COLLAPSE("navbar-collapse"),
+  NAVBAR_DEFAULT("navbar-default"),
+  NAVBAR_FIXED_TOP("navbar-fixed-top"),
+  NAVBAR_FORM("navbar-form"),
+  NAVBAR_HEADER("navbar-header"),
+  NAVBAR_INVERSE("navbar-inverse"),
+  NAVBAR_NAV("navbar-nav"),
+  NAVBAR_TOGGLE("navbar-toggle"),
+  PAGE_HEADER("page-header"),
+  PANEL_HEADING("panel-heading"),
+  PANEL_BODY("panel-body"),
+  SR_ONLY("sr-only");
 
   private final String name;
 
@@ -41,4 +67,15 @@ public enum BootstrapClass {
     return name;
   }
 
+  public static CssItem glyphicon(final String name) {
+
+    return new CssItem() {
+
+      @Override
+      public String getName() {
+        return "glyphicon-" + name;
+      }
+    };
+  }
+
 }

Copied: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/TobagoClass.java
(from r1658978, myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/BootstrapClass.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/TobagoClass.java?p2=myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/TobagoClass.java&p1=myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/BootstrapClass.java&r1=1658978&r2=1659012&rev=1659012&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/BootstrapClass.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/TobagoClass.java
Wed Feb 11 17:37:21 2015
@@ -19,21 +19,20 @@
 
 package org.apache.myfaces.tobago.renderkit.html;
 
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
+
 /**
+ * TBD: preliminary
+ *
  * @since 3.0.0
  */
-public enum BootstrapClass {
+public enum TobagoClass implements CssItem {
 
-  CONTAINER("container"),
-  CONTAINER_FLUID("container-fluid"),
-  DROPDOWN("dropdown"),
-  DROPDOWN_MENU("dropdown-menu"),
-  NAV("nav"),
-  NAVBAR_NAV("navbar-nav");
+  POPUP("tobago-popup");
 
   private final String name;
 
-  private BootstrapClass(final String name) {
+  private TobagoClass(final String name) {
     this.name = name;
   }
 

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/BoxRenderer.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/BoxRenderer.java?rev=1659012&r1=1659011&r2=1659012&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/BoxRenderer.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/BoxRenderer.java
Wed Feb 11 17:37:21 2015
@@ -25,6 +25,7 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.renderkit.BoxRendererBase;
 import org.apache.myfaces.tobago.renderkit.css.Classes;
 import org.apache.myfaces.tobago.renderkit.css.Css;
+import org.apache.myfaces.tobago.renderkit.html.BootstrapClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
 import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
@@ -79,7 +80,7 @@ public class BoxRenderer extends BoxRend
 
         if (label != null || labelString != null || toolbar != null) {
             writer.startElement(HtmlElements.DIV, box);
-            writer.writeClassAttribute("panel-heading");
+            writer.writeClassAttribute(BootstrapClass.PANEL_HEADING);
 
             if (label != null) {
                 RenderUtils.encode(facesContext, label);
@@ -98,7 +99,7 @@ public class BoxRenderer extends BoxRend
         }
 
         writer.startElement(HtmlElements.DIV, box);
-        writer.writeClassAttribute("panel-body");
+        writer.writeClassAttribute(BootstrapClass.PANEL_BODY);
     }
 
     @Override

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/ColumnLayoutRenderer.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/ColumnLayoutRenderer.java?rev=1659012&r1=1659011&r2=1659012&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/ColumnLayoutRenderer.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/ColumnLayoutRenderer.java
Wed Feb 11 17:37:21 2015
@@ -26,6 +26,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.layout.LayoutContainer;
 import org.apache.myfaces.tobago.renderkit.RendererBase;
 import org.apache.myfaces.tobago.renderkit.css.Css;
+import org.apache.myfaces.tobago.renderkit.html.BootstrapClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
 import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
 import org.apache.myfaces.tobago.renderkit.util.BootstrapCssGenerator;
@@ -53,7 +54,7 @@ public class ColumnLayoutRenderer extend
 
     writer.startElement(HtmlElements.DIV, columnLayout);
 //    writer.writeClassAttribute("row");
-    writer.writeClassAttribute("form-horizontal container-fluid");
+    writer.writeClassAttribute(BootstrapClass.FORM_HORIZONTAL, BootstrapClass.CONTAINER_FLUID);
   }
 
   @Override

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/MenuRenderer.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/MenuRenderer.java?rev=1659012&r1=1659011&r2=1659012&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/MenuRenderer.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/MenuRenderer.java
Wed Feb 11 17:37:21 2015
@@ -124,7 +124,7 @@ public class MenuRenderer extends Layout
     if (isParentMenu) {
       writer.startElement(HtmlElements.OL, menu);
 
-      writer.writeClassAttribute("dropdown-menu");// fixme: this comes from BootstrapClass,
but isn't accessible
+      writer.writeClassAttribute(BootstrapClass.DROPDOWN_MENU);
     }
   }
 

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/PageRenderer.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/PageRenderer.java?rev=1659012&r1=1659011&r2=1659012&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/PageRenderer.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/PageRenderer.java
Wed Feb 11 17:37:21 2015
@@ -377,14 +377,14 @@ public class PageRenderer extends PageRe
     final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
 
     writer.startElement(HtmlElements.NAV);
-    writer.writeClassAttribute("navbar navbar-inverse navbar-fixed-top");
+    writer.writeClassAttribute(BootstrapClass.NAVBAR, BootstrapClass.NAVBAR_INVERSE, BootstrapClass.NAVBAR_FIXED_TOP);
     writer.writeAttribute(HtmlAttributes.ROLE, HtmlRoleValues.NAVIGATION.toString(), false);
 
     writer.startElement(HtmlElements.DIV);
-    writer.writeClassAttribute("container-fluid");
+    writer.writeClassAttribute(BootstrapClass.CONTAINER_FLUID);
 
     writer.startElement(HtmlElements.DIV);
-    writer.writeClassAttribute("collapse navbar-collapse");
+    writer.writeClassAttribute(BootstrapClass.COLLAPSE, BootstrapClass.NAVBAR_COLLAPSE);
 
     final UIMenuBar menuBar = ComponentUtils.findFacetDescendant(page, Facets.MENUBAR, UIMenuBar.class);
     if (menuBar != 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/PopupRenderer.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/PopupRenderer.java?rev=1659012&r1=1659011&r2=1659012&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/PopupRenderer.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/PopupRenderer.java
Wed Feb 11 17:37:21 2015
@@ -22,7 +22,9 @@ package org.apache.myfaces.tobago.render
 import org.apache.myfaces.tobago.component.UIPopup;
 import org.apache.myfaces.tobago.internal.util.FacesContextUtils;
 import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
+import org.apache.myfaces.tobago.renderkit.html.BootstrapClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
+import org.apache.myfaces.tobago.renderkit.html.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
 import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
 
@@ -46,13 +48,12 @@ public class PopupRenderer extends Layou
     final UIPopup popup = (UIPopup) component;
     final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
     writer.startElement(HtmlElements.DIV);
-    //writer.writeClassAttribute(BootstrapClass.MODAL); // XXX
-    writer.writeClassAttribute("tobago-popup modal fade"); // XXX
+    writer.writeClassAttribute(TobagoClass.POPUP, BootstrapClass.MODAL, BootstrapClass.FADE);
     writer.writeIdAttribute(popup.getClientId(facesContext));
     writer.startElement(HtmlElements.DIV);
-    writer.writeClassAttribute("modal-dialog"); // XXX
+    writer.writeClassAttribute(BootstrapClass.MODAL_DIALOG);
     writer.startElement(HtmlElements.DIV);
-    writer.writeClassAttribute("modal-content"); // XXX
+    writer.writeClassAttribute(BootstrapClass.MODAL_CONTENT);
   }
 
   @Override

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/SectionRenderer.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/SectionRenderer.java?rev=1659012&r1=1659011&r2=1659012&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/SectionRenderer.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/SectionRenderer.java
Wed Feb 11 17:37:21 2015
@@ -23,6 +23,8 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.renderkit.HtmlUtils;
 import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
 import org.apache.myfaces.tobago.renderkit.css.Classes;
+import org.apache.myfaces.tobago.renderkit.css.CssItem;
+import org.apache.myfaces.tobago.renderkit.html.BootstrapClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
 import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
 import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -44,13 +46,12 @@ public class SectionRenderer extends Lay
         HtmlRendererUtils.writeDataAttributes(facesContext, writer, component);
 
         String label = section.getLabelToRender();
-        String clazz = null;
+        CssItem clazz = null;
         final String tag;
         switch (section.getLevel()) {
             case 1:
                 tag = HtmlElements.H1;
-//                    clazz = BootstrapClass.PAGE_HEADER.getName(); TBD
-                clazz = "page-header";
+                clazz = BootstrapClass.PAGE_HEADER;
                 break;
             case 2:
                 tag = HtmlElements.H2;
@@ -75,7 +76,7 @@ public class SectionRenderer extends Lay
         final String image = section.getImage();
         if (image != null && image.startsWith("glyphicon-")) { // XXX hack: should
be integrated in the resource manager
             writer.startElement(HtmlElements.SPAN);
-            writer.writeClassAttribute("glyphicon " + image);
+            writer.writeClassAttribute(BootstrapClass.GLYPHICON, BootstrapClass.glyphicon(image));
             writer.endElement(HtmlElements.SPAN);
 
         }

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=1659012&r1=1659011&r2=1659012&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
Wed Feb 11 17:37:21 2015
@@ -58,6 +58,7 @@ import org.apache.myfaces.tobago.model.T
 import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
 import org.apache.myfaces.tobago.renderkit.css.Classes;
 import org.apache.myfaces.tobago.renderkit.css.Style;
+import org.apache.myfaces.tobago.renderkit.html.BootstrapClass;
 import org.apache.myfaces.tobago.renderkit.html.Command;
 import org.apache.myfaces.tobago.renderkit.html.CommandMap;
 import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
@@ -1143,12 +1144,10 @@ public class SheetRenderer extends Layou
 
     writer.startElement(HtmlElements.LI, null);
     if (pagingLinkType == PagingLinkType.CURRENT) {
-      // XXX hack for Bootstrap
-      writer.writeClassAttribute("active");
+      writer.writeClassAttribute(BootstrapClass.ACTIVE);
     }
     if (pagingLinkType == PagingLinkType.DISABLED) {
-      // XXX hack for Bootstrap
-      writer.writeClassAttribute("disabled");
+      writer.writeClassAttribute(BootstrapClass.DISABLED);
     }
     writer.startElement(innerElement, null);
     writer.writeClassAttribute(Classes.create(sheet, "pagingLink"));

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=1659012&r1=1659011&r2=1659012&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
Wed Feb 11 17:37:21 2015
@@ -37,6 +37,7 @@ import org.apache.myfaces.tobago.renderk
 import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
 import org.apache.myfaces.tobago.renderkit.css.Classes;
 import org.apache.myfaces.tobago.renderkit.css.Style;
+import org.apache.myfaces.tobago.renderkit.html.BootstrapClass;
 import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -181,7 +182,8 @@ public class TabGroupRenderer extends La
     writer.writeClassAttribute(Classes.create(tabGroup, "header"));
 
     writer.startElement(HtmlElements.UL, tabGroup);
-    writer.writeClassAttribute(Classes.create(tabGroup, "headerInner").getStringValue() +
" nav nav-tabs");
+    writer.writeClassAttribute(Classes.create(tabGroup, "headerInner").getStringValue()
+        + BootstrapClass.NAV + ' ' + BootstrapClass.NAV_TABS); // XXX clean up css management
     writer.writeAttribute(HtmlAttributes.ROLE, HtmlRoleValues.TABLIST.toString(), false);
 
     int index = 0;

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/ToolBarRenderer.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/ToolBarRenderer.java?rev=1659012&r1=1659011&r2=1659012&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/ToolBarRenderer.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/ToolBarRenderer.java
Wed Feb 11 17:37:21 2015
@@ -45,37 +45,37 @@ public class ToolBarRenderer extends Lay
     final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
 
     writer.startElement(HtmlElements.NAV, toolBar);
-    writer.writeClassAttribute("navbar navbar-form navbar-default");
+    writer.writeClassAttribute(BootstrapClass.NAVBAR, BootstrapClass.NAVBAR_FORM, BootstrapClass.NAVBAR_DEFAULT);
     writer.writeAttribute(HtmlAttributes.ROLE, HtmlRoleValues.NAVIGATION.toString(), false);
 
     writer.startElement(HtmlElements.DIV, toolBar);
-    writer.writeClassAttribute(BootstrapClass.CONTAINER_FLUID.getName());
+    writer.writeClassAttribute(BootstrapClass.CONTAINER_FLUID);
 
 //    Brand and toggle get grouped for better mobile display
     writer.startElement(HtmlElements.DIV);
-    writer.writeClassAttribute("navbar-header");
+    writer.writeClassAttribute(BootstrapClass.NAVBAR_HEADER);
 
     writer.startElement(HtmlElements.BUTTON);
     writer.writeAttribute(HtmlAttributes.TYPE, HtmlButtonTypes.BUTTON, false);
-    writer.writeClassAttribute("navbar-toggle");
+    writer.writeClassAttribute(BootstrapClass.NAVBAR_TOGGLE);
     writer.writeAttribute("data-toggle", "collapse", false);
     writer.writeAttribute("data-target", "#" + toolBar.getClientId(facesContext).replace(":",
"\\:"), true);
 
     writer.startElement(HtmlElements.SPAN);
-    writer.writeClassAttribute("sr-only");
+    writer.writeClassAttribute(BootstrapClass.SR_ONLY);
     writer.writeText("Toggle navigation");
     writer.endElement(HtmlElements.SPAN);
 
     for (int i = 0; i < 3; i++) {
       writer.startElement(HtmlElements.SPAN);
-      writer.writeClassAttribute("icon-bar");
+      writer.writeClassAttribute(BootstrapClass.ICON_BAR);
       writer.endElement(HtmlElements.SPAN);
     }
 
     writer.endElement(HtmlElements.BUTTON);
 
     writer.startElement(HtmlElements.A);
-    writer.writeClassAttribute("navbar-brand");
+    writer.writeClassAttribute(BootstrapClass.NAVBAR_BRAND);
     writer.writeAttribute(HtmlAttributes.HREF, "#", false);
     writer.writeText("[FIXME]"); // fixme
     writer.endElement(HtmlElements.A);
@@ -83,7 +83,7 @@ public class ToolBarRenderer extends Lay
     writer.endElement(HtmlElements.DIV);
 
     writer.startElement(HtmlElements.DIV);
-    writer.writeClassAttribute("collapse navbar-collapse");
+    writer.writeClassAttribute(BootstrapClass.COLLAPSE, BootstrapClass.NAVBAR_COLLAPSE);
     writer.writeIdAttribute(toolBar.getClientId(facesContext));
   }
 /*



Mime
View raw message