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/02/12 13:37:16 UTC
svn commit: r1659240 - in /myfaces/tobago/branches/tobago-3.0.x:
tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/
tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/
tobago-theme/tobago-theme-st...
Author: lofwyr
Date: Thu Feb 12 12:37:15 2015
New Revision: 1659240
URL: http://svn.apache.org/r1659240
Log:
TOBAGO-1368: Create a new theme which uses Bootstrap
TOBAGO-1435: New Layout: ColumnLayout which uses 12 columns (like Bootstrap)
Modified:
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlElements.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/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/OutRenderer.java
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlElements.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlElements.java?rev=1659240&r1=1659239&r2=1659240&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlElements.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlElements.java Thu Feb 12 12:37:15 2015
@@ -55,6 +55,7 @@ public final class HtmlElements {
public static final String OL = "ol";
public static final String OPTGROUP = "optgroup";
public static final String OPTION = "option";
+ public static final String P = "p";
public static final String PARAM = "param";
public static final String SCRIPT = "script";
public static final String SELECT = "select";
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=1659240&r1=1659239&r2=1659240&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 Thu Feb 12 12:37:15 2015
@@ -41,6 +41,8 @@ public enum BootstrapClass implements Cs
DROPDOWN("dropdown"),
DROPDOWN_MENU("dropdown-menu"),
FADE("fade"),
+ FORM_CONTROL_STATIC("form-control-static"),
+ FORM_GROUP("form-group"),
FORM_HORIZONTAL("form-horizontal"),
GLYPHICON("glyphicon"),
ICON_BAR("icon-bar"),
@@ -64,6 +66,7 @@ public enum BootstrapClass implements Cs
PANEL_HEADING("panel-heading"),
PANEL_BODY("panel-body"),
RADIO("radio"),
+ ROW("row"),
SR_ONLY("sr-only");
private final String 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/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=1659240&r1=1659239&r2=1659240&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 Thu Feb 12 12:37:15 2015
@@ -75,9 +75,13 @@ public class ColumnLayoutRenderer extend
for (UIComponent child : children) {
if (child.isRendered()) {
if (child instanceof UIExtensionPanel) {
+// writer.startElement(HtmlElements.DIV, null);
+// writer.writeClassAttribute(BootstrapClass.FORM_GROUP); or
+// writer.writeClassAttribute(BootstrapClass.ROW);
for (UIComponent subChild : child.getChildren()) {
encodeChild(facesContext, writer, generator, subChild);
}
+// writer.endElement(HtmlElements.DIV);
} else {
encodeChild(facesContext, writer, generator, child);
}
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/OutRenderer.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/OutRenderer.java?rev=1659240&r1=1659239&r2=1659240&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/OutRenderer.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/OutRenderer.java Thu Feb 12 12:37:15 2015
@@ -20,6 +20,7 @@
package org.apache.myfaces.tobago.renderkit.html.standard.standard.tag;
import org.apache.myfaces.tobago.component.UIOut;
+import org.apache.myfaces.tobago.renderkit.html.BootstrapClass;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.sanitizer.Sanitizer;
import org.apache.myfaces.tobago.config.TobagoConfig;
@@ -55,12 +56,13 @@ public class OutRenderer extends LayoutC
if (createSpan) {
final String id = out.getClientId(facesContext);
- writer.startElement(HtmlElements.SPAN, out);
+ writer.startElement(HtmlElements.P, out);
writer.writeIdAttribute(id);
HtmlRendererUtils.writeDataAttributes(facesContext, writer, out);
final Style style = new Style(facesContext, out);
writer.writeStyleAttribute(style);
- writer.writeClassAttribute(Classes.create(out));
+ writer.writeClassAttribute(
+ Classes.create(out).getStringValue() + " " + BootstrapClass.FORM_CONTROL_STATIC.getName());
final String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, out);
if (title != null) {
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
@@ -85,7 +87,7 @@ public class OutRenderer extends LayoutC
writer.write(text);
}
if (createSpan) {
- writer.endElement(HtmlElements.SPAN);
+ writer.endElement(HtmlElements.P);
}
}
}