You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2017/07/07 08:45:32 UTC
svn commit: r1801131 - in /myfaces/tobago/trunk:
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BarRenderer.java
tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/60-bar/bar.xhtml
Author: hnoeth
Date: Fri Jul 7 08:45:32 2017
New Revision: 1801131
URL: http://svn.apache.org/viewvc?rev=1801131&view=rev
Log:
TOBAGO-1746 Allow tc:style on tc:bar
* styles can be set on tc:bar
* add example for demo
Modified:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BarRenderer.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/60-bar/bar.xhtml
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BarRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BarRenderer.java?rev=1801131&r1=1801130&r2=1801131&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BarRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BarRenderer.java Fri Jul 7 08:45:32 2017
@@ -56,7 +56,11 @@ public class BarRenderer extends Rendere
writer.startElement(HtmlElements.NAV);
writer.writeIdAttribute(clientId);
- writer.writeClassAttribute(BootstrapClass.NAVBAR, BootstrapClass.NAVBAR_TOGGLEABLE);
+ writer.writeClassAttribute(
+ BootstrapClass.NAVBAR,
+ BootstrapClass.NAVBAR_TOGGLEABLE,
+ bar.getCustomClass());
+ writer.writeStyleAttribute(bar.getStyle());
writer.writeAttribute(HtmlAttributes.ROLE, HtmlRoleValues.NAVIGATION.toString(), false);
HtmlRendererUtils.writeDataAttributes(facesContext, writer, bar);
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/60-bar/bar.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/60-bar/bar.xhtml?rev=1801131&r1=1801130&r2=1801131&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/60-bar/bar.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/60-bar/bar.xhtml Fri Jul 7 08:45:32 2017
@@ -112,4 +112,35 @@
</tc:link>
</tc:bar>
</tc:section>
+
+ <tc:section label="Styles">
+ <p>You can use bootstrap classes to style the bar.</p>
+ <pre><code class="language-markup"><tc:bar>
+ <tc:style customClass="navbar-light bg-faded" />
+ <f:facet name="brand">
+ <tc:link label="BRAND" outcome="/content/10-intro/intro.xhtml">
+ <tc:style customClass="navbar-brand"/>
+ </tc:link>
+ </f:facet>
+ ...
+</tc:bar></code></pre>
+ <tc:bar>
+ <tc:style customClass="navbar-light bg-faded" />
+ <f:facet name="brand">
+ <tc:link label="BRAND" outcome="/content/10-intro/intro.xhtml">
+ <tc:style customClass="navbar-brand"/>
+ </tc:link>
+ </f:facet>
+ <tc:links>
+ <tc:link label="Link One"/>
+ <tc:link label="Link Two"/>
+ </tc:links>
+ <f:facet name="after">
+ <tc:flexLayout columns="*; auto">
+ <tc:in placeholder="Search" labelLayout="skip"/>
+ <tc:button label="Go"/>
+ </tc:flexLayout>
+ </f:facet>
+ </tc:bar>
+ </tc:section>
</ui:composition>