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/05/27 14:18:34 UTC

svn commit: r1681997 - in /myfaces/tobago/branches/tobago-3.0.x: tobago-core/src/main/java/org/apache/myfaces/tobago/context/ tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ tobago-theme/...

Author: lofwyr
Date: Wed May 27 12:18:33 2015
New Revision: 1681997

URL: http://svn.apache.org/r1681997
Log:
TOBAGO-1368: Create a new theme which uses Bootstrap
 - align in sheet columns

Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.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/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/style/tobago.css

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java?rev=1681997&r1=1681996&r2=1681997&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java Wed May 27 12:18:33 2015
@@ -68,6 +68,7 @@ public final class Markup implements Ser
   public static final Markup FOLDER = valueOf("folder");
   public static final Markup INFO = valueOf("info");
   public static final Markup INLINE = valueOf("inline");
+  public static final Markup JUSTIFY = valueOf("justify");
   public static final Markup LEFT = valueOf("left");
   public static final Markup MARKED = valueOf("marked");
   public static final Markup MODAL = valueOf("modal");

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=1681997&r1=1681996&r2=1681997&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 May 27 12:18:33 2015
@@ -325,13 +325,15 @@ public class SheetRenderer extends Layou
         if (isPure(column)) {
           markup = markup.add(Markup.PURE);
         }
-        writer.writeClassAttribute(Classes.create(sheet, "cell", markup));
         final TextAlign align = TextAlign.parse((String) column.getAttributes().get(Attributes.ALIGN));
-        if (align != null) {
-          final Style alignStyle = new Style();
-          alignStyle.setTextAlign(align);
-          writer.writeStyleAttribute(alignStyle);
+        if (align == TextAlign.RIGHT) {
+          markup = markup.add(Markup.RIGHT);
+        } else if (align == TextAlign.CENTER) {
+          markup = markup.add(Markup.CENTER);
+        } else if (align == TextAlign.JUSTIFY) {
+          markup = markup.add(Markup.JUSTIFY);
         }
+        writer.writeClassAttribute(Classes.create(sheet, "cell", markup));
 
         if (column instanceof UIColumnSelector) {
           final boolean disabled = ComponentUtils.getBooleanAttribute(column, Attributes.DISABLED);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/style/tobago.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/style/tobago.css?rev=1681997&r1=1681996&r2=1681997&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/style/tobago.css (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/style/tobago.css Wed May 27 12:18:33 2015
@@ -102,6 +102,18 @@ body > form > .navbar-fixed-top + * {
 
 /* sheet -------------------------------------------------------------- */
 
+.tobago-sheet-cell-markup-right {
+  text-align: right;
+}
+
+.tobago-sheet-cell-markup-center {
+  text-align: center;
+}
+
+.tobago-sheet-cell-markup-justify {
+  text-align: justify;
+}
+
 .tobago-sheet-footer {
   text-align: center;
 }