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/13 10:11:01 UTC
svn commit: r1679160 - in /myfaces/tobago/branches/tobago-3.0.x:
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/
tobago-example/tobago-examp...
Author: lofwyr
Date: Wed May 13 08:11:00 2015
New Revision: 1679160
URL: http://svn.apache.org/r1679160
Log:
TOBAGO-1465: Support for header and footer HTML elements
Added:
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/IsFixed.java
myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/footer/
myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/footer/footer-fixed.xhtml
myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/footer/footer.xhtml
myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/header/
myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/header/header-fixed.xhtml
myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/header/header.xhtml
Modified:
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FooterTagDeclaration.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/HeaderTagDeclaration.java
myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml
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/FooterRenderer.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/HeaderRenderer.java
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FooterTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FooterTagDeclaration.java?rev=1679160&r1=1679159&r2=1679160&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FooterTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FooterTagDeclaration.java Wed May 13 08:11:00 2015
@@ -26,6 +26,7 @@ import org.apache.myfaces.tobago.interna
import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasTip;
+import org.apache.myfaces.tobago.internal.taglib.declaration.IsFixed;
import javax.faces.component.UIPanel;
@@ -39,5 +40,5 @@ import javax.faces.component.UIPanel;
componentFamily = UIPanel.COMPONENT_FAMILY,
rendererType = RendererTypes.FOOTER,
allowedChildComponenents = "ALL")
-public interface FooterTagDeclaration extends HasIdBindingAndRendered, HasTip, HasMarkup, HasCurrentMarkup {
+public interface FooterTagDeclaration extends HasIdBindingAndRendered, HasTip, HasMarkup, HasCurrentMarkup, IsFixed {
}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/HeaderTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/HeaderTagDeclaration.java?rev=1679160&r1=1679159&r2=1679160&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/HeaderTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/HeaderTagDeclaration.java Wed May 13 08:11:00 2015
@@ -26,6 +26,7 @@ import org.apache.myfaces.tobago.interna
import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasTip;
+import org.apache.myfaces.tobago.internal.taglib.declaration.IsFixed;
import javax.faces.component.UIPanel;
@@ -39,5 +40,5 @@ import javax.faces.component.UIPanel;
componentFamily = UIPanel.COMPONENT_FAMILY,
rendererType = RendererTypes.HEADER,
allowedChildComponenents = "ALL")
-public interface HeaderTagDeclaration extends HasIdBindingAndRendered, HasTip, HasMarkup, HasCurrentMarkup {
+public interface HeaderTagDeclaration extends HasIdBindingAndRendered, HasTip, HasMarkup, HasCurrentMarkup, IsFixed {
}
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/IsFixed.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/IsFixed.java?rev=1679160&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/IsFixed.java (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/IsFixed.java Wed May 13 08:11:00 2015
@@ -0,0 +1,33 @@
+/*
+ * 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.internal.taglib.declaration;
+
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+
+public interface IsFixed {
+ /**
+ * Flag indicating that this element is fixed on its position, e. g. it will not scroll with the
+ * neighbour elements.
+ */
+ @TagAttribute()
+ @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
+ void setFixed(String fixed);
+}
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml?rev=1679160&r1=1679159&r2=1679160&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml Wed May 13 08:11:00 2015
@@ -17,7 +17,7 @@
* limitations under the License.
-->
-<tc:header xmlns:tc="http://myfaces.apache.org/tobago/component">
+<tc:header fixed="true" xmlns:tc="http://myfaces.apache.org/tobago/component">
<tc:nav image="image/feather-leaf.png" label="Tobago Demo">
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/footer/footer-fixed.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/footer/footer-fixed.xhtml?rev=1679160&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/footer/footer-fixed.xhtml (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/footer/footer-fixed.xhtml Wed May 13 08:11:00 2015
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+
+<f:view
+ xmlns:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:tx="http://myfaces.apache.org/tobago/extension"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <tc:page>
+
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+
+ <tc:footer fixed="true">
+ Fixed Footer
+ </tc:footer>
+
+ </tc:page>
+</f:view>
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/footer/footer.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/footer/footer.xhtml?rev=1679160&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/footer/footer.xhtml (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/footer/footer.xhtml Wed May 13 08:11:00 2015
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+
+<f:view
+ xmlns:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:tx="http://myfaces.apache.org/tobago/extension"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <tc:page>
+
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+
+ <tc:footer>
+ Scrolling Footer
+ </tc:footer>
+
+ </tc:page>
+</f:view>
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/header/header-fixed.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/header/header-fixed.xhtml?rev=1679160&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/header/header-fixed.xhtml (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/header/header-fixed.xhtml Wed May 13 08:11:00 2015
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+
+<f:view
+ xmlns:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:tx="http://myfaces.apache.org/tobago/extension"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <tc:page>
+ <tc:header fixed="true" label="Test the header">
+ Fixed Header
+ </tc:header>
+
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+
+ </tc:page>
+</f:view>
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/header/header.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/header/header.xhtml?rev=1679160&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/header/header.xhtml (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/header/header.xhtml Wed May 13 08:11:00 2015
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+
+<f:view
+ xmlns:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:tx="http://myfaces.apache.org/tobago/extension"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <tc:page>
+ <tc:header label="Test the header">
+ Scrolling Header
+ </tc:header>
+
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+ <p>
+ Lore ipsum.
+ </p>
+
+ </tc:page>
+</f:view>
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=1679160&r1=1679159&r2=1679160&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 May 13 08:11:00 2015
@@ -57,6 +57,7 @@ public enum BootstrapClass implements Cs
NAVBAR_BRAND("navbar-brand"),
NAVBAR_COLLAPSE("navbar-collapse"),
NAVBAR_DEFAULT("navbar-default"),
+ NAVBAR_FIXED_BOTTOM("navbar-fixed-bottom"),
NAVBAR_FIXED_TOP("navbar-fixed-top"),
NAVBAR_FORM("navbar-form"),
NAVBAR_HEADER("navbar-header"),
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/FooterRenderer.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/FooterRenderer.java?rev=1679160&r1=1679159&r2=1679160&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/FooterRenderer.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/FooterRenderer.java Wed May 13 08:11:00 2015
@@ -19,7 +19,9 @@
package org.apache.myfaces.tobago.renderkit.html.standard.standard.tag;
+import org.apache.myfaces.tobago.component.UIFooter;
import org.apache.myfaces.tobago.renderkit.RendererBase;
+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;
@@ -33,8 +35,12 @@ public class FooterRenderer extends Rend
@Override
public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
+ final UIFooter footer = (UIFooter)component;
writer.startElement(HtmlElements.FOOTER, component);
writer.writeIdAttribute(component.getClientId(facesContext));
+ if (footer.isFixed()) {
+ writer.writeClassAttribute(BootstrapClass.NAVBAR_FIXED_BOTTOM);
+ }
}
@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/HeaderRenderer.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/HeaderRenderer.java?rev=1679160&r1=1679159&r2=1679160&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/HeaderRenderer.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/HeaderRenderer.java Wed May 13 08:11:00 2015
@@ -19,6 +19,7 @@
package org.apache.myfaces.tobago.renderkit.html.standard.standard.tag;
+import org.apache.myfaces.tobago.component.UIHeader;
import org.apache.myfaces.tobago.renderkit.RendererBase;
import org.apache.myfaces.tobago.renderkit.html.BootstrapClass;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -34,10 +35,22 @@ public class HeaderRenderer extends Rend
@Override
public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
+ final UIHeader header = (UIHeader) component;
writer.startElement(HtmlElements.HEADER, component);
writer.writeIdAttribute(component.getClientId(facesContext));
- writer.writeClassAttribute(BootstrapClass.NAVBAR, BootstrapClass.NAVBAR_INVERSE, BootstrapClass.NAVBAR_FIXED_TOP);
-//XXX writer.writeClassAttribute(BootstrapClass.NAVBAR, BootstrapClass.NAVBAR_DEFAULT, BootstrapClass.NAVBAR_FIXED_TOP);
+ // TBD: BootstrapClass.NAVBAR_DEFAULT ?
+ if (header.isFixed()) {
+ writer.writeClassAttribute(BootstrapClass.NAVBAR, BootstrapClass.NAVBAR_INVERSE, BootstrapClass.NAVBAR_FIXED_TOP);
+ } else {
+ writer.writeClassAttribute(BootstrapClass.NAVBAR, BootstrapClass.NAVBAR_INVERSE);
+ }
+// TBD: should NAVBAR class be in the NavRenderer?
+
+/*
+ if (header.isFixed()) {
+ writer.writeClassAttribute(BootstrapClass.NAVBAR_FIXED_TOP);
+ }
+*/
}
@Override