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 2016/06/08 13:25:58 UTC
svn commit: r1747394 - in /myfaces/tobago/trunk:
tobago-core/src/main/java/org/apache/myfaces/tobago/context/
tobago-core/src/test/java/org/apache/myfaces/tobago/context/
tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/exampl...
Author: lofwyr
Date: Wed Jun 8 13:25:57 2016
New Revision: 1747394
URL: http://svn.apache.org/viewvc?rev=1747394&view=rev
Log:
TOBAGO-1502: Advanced tc:sheet support for Bootstrap
* new Markups: inverse, striped, bordered, hover, small
Added:
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/35-markup/
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/35-markup/sheet-markup.xhtml
Modified:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/context/MarkupUnitTest.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/00-content/sheet-column-content.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/sheet-sorting.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/20-selector/sheet-column-selector.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-column-event.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/40-dropdown/sheet-dropdown.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/55-staticheader/sheet-static-header.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/80-editable/sheet-editable.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/sheet.xhtml
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/css/BootstrapClass.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java?rev=1747394&r1=1747393&r2=1747394&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java Wed Jun 8 13:25:57 2016
@@ -60,6 +60,7 @@ public final class Markup implements Ser
public static final Markup ASCENDING = valueOf("ascending");
public static final Markup BIG = valueOf("big");
+ public static final Markup BORDERED = valueOf("bordered");
public static final Markup CENTER = valueOf("center");
public static final Markup CLICKABLE = valueOf("clickable");
public static final Markup DEFAULT = valueOf("default");
@@ -77,9 +78,11 @@ public final class Markup implements Ser
@Deprecated
public static final Markup FIRST = valueOf("first");
public static final Markup FOLDER = valueOf("folder");
+ public static final Markup HOVER = valueOf("hover");
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 INVERSE = valueOf("inverse");
public static final Markup LEFT = valueOf("left");
public static final Markup MARKED = valueOf("marked");
public static final Markup MODAL = valueOf("modal");
@@ -96,7 +99,9 @@ public final class Markup implements Ser
public static final Markup SHEET_SELECT_ALL = valueOf("sheetSelectAll");
public static final Markup SHEET_DESELECT_ALL = valueOf("sheetDeselectAll");
public static final Markup SHEET_TOGGLE_ALL = valueOf("sheetToggleAll");
+ public static final Markup SMALL = valueOf("small");
public static final Markup SORTABLE = valueOf("sortable");
+ public static final Markup STRIPED = valueOf("striped");
public static final Markup STRONG = valueOf("strong");
public static final Markup TOP = valueOf("top");
public static final Markup VERTICALLY = valueOf("vertically");
@@ -302,7 +307,7 @@ public final class Markup implements Ser
public boolean contains(final String markup) {
if (markup == null) {
- return false;
+ return true;
}
if (this == NULL) {
return this == Markup.valueOf(markup);
@@ -318,6 +323,38 @@ public final class Markup implements Ser
return false;
}
+ public boolean contains(final Markup markup) {
+ if (markup == null || markup == NULL) {
+ return true;
+ }
+ if (this == NULL) {
+ return this == markup;
+ }
+ if (markup.value != null) {
+ if (value != null) {
+ return value.equals(markup.value);
+ } else {
+ for (final String value : values) {
+ if (value.equals(markup.value)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ } else {
+ if (value != null) {
+ return false;
+ } else {
+ for (final String markupString : markup.values) {
+ if (!contains(markupString)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ }
+
@Override
public String toString() {
if (value != null) {
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/context/MarkupUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/context/MarkupUnitTest.java?rev=1747394&r1=1747393&r2=1747394&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/context/MarkupUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/context/MarkupUnitTest.java Wed Jun 8 13:25:57 2016
@@ -116,14 +116,33 @@ public class MarkupUnitTest {
}
@Test
- public void testContains() {
+ public void testContainsString() {
final Markup a = Markup.valueOf("a");
final Markup ab = Markup.valueOf("a,b");
Assert.assertFalse(Markup.NULL.contains("a"));
Assert.assertTrue(a.contains("a"));
+ Assert.assertTrue(a.contains((String)null));
Assert.assertFalse(a.contains("b"));
Assert.assertTrue(ab.contains("a"));
Assert.assertTrue(ab.contains("b"));
Assert.assertFalse(ab.contains("c"));
}
+
+ @Test
+ public void testContainsMarkup() {
+ final Markup a = Markup.valueOf("a");
+ final Markup ab = Markup.valueOf("a,b");
+ Assert.assertFalse(Markup.NULL.contains(Markup.valueOf("a")));
+ Assert.assertTrue(a.contains(Markup.NULL));
+ Assert.assertTrue(a.contains((Markup)null));
+ Assert.assertTrue(a.contains(Markup.valueOf("a")));
+ Assert.assertFalse(a.contains(Markup.valueOf("b")));
+ Assert.assertTrue(ab.contains(Markup.valueOf("a")));
+ Assert.assertTrue(ab.contains(Markup.valueOf("b")));
+ Assert.assertFalse(ab.contains(Markup.valueOf("c")));
+ Assert.assertTrue(ab.contains(Markup.valueOf("a,b")));
+ Assert.assertTrue(ab.contains(Markup.valueOf("a,a")));
+ Assert.assertFalse(ab.contains(Markup.valueOf("a,c")));
+ Assert.assertFalse(ab.contains(Markup.valueOf("a,c,d,e,c,f,e,f")));
+ }
}
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java?rev=1747394&r1=1747393&r2=1747394&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java Wed Jun 8 13:25:57 2016
@@ -19,6 +19,7 @@
package org.apache.myfaces.tobago.example.demo;
+import org.apache.myfaces.tobago.context.Markup;
import org.apache.myfaces.tobago.example.data.SolarObject;
import org.apache.myfaces.tobago.model.SheetState;
import org.apache.myfaces.tobago.util.ComponentUtils;
@@ -41,6 +42,8 @@ public class SheetController implements
private List<SolarObject> solarList;
private SheetState sheetState;
private SolarObject selectedSolarObject;
+ private boolean automaticLayout;
+ private List<Markup> markup;
public SheetController() {
solarList = SolarObject.getList();
@@ -85,4 +88,20 @@ public class SheetController implements
return sheetState.getSelectedRows().get(0);
}
}
+
+ public boolean isAutomaticLayout() {
+ return automaticLayout;
+ }
+
+ public void setAutomaticLayout(boolean automaticLayout) {
+ this.automaticLayout = automaticLayout;
+ }
+
+ public List<Markup> getMarkup() {
+ return markup;
+ }
+
+ public void setMarkup(List<Markup> markup) {
+ this.markup = markup;
+ }
}
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/00-content/sheet-column-content.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/00-content/sheet-column-content.xhtml?rev=1747394&r1=1747393&r2=1747394&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/00-content/sheet-column-content.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/00-content/sheet-column-content.xhtml Wed Jun 8 13:25:57 2016
@@ -45,23 +45,23 @@
</tc:tabGroup>
</tc:column>
...</code></pre>
- <tc:sheet id="s2" value="#{sheetController.solarList}" var="solarobject" rows="4" showHeader="false">
+ <tc:sheet id="s2" value="#{sheetController.solarList}" var="object" rows="4" showHeader="false">
<tc:style maxHeight="500px"/>
<tc:column label="Name">
- <tc:out value="#{solarobject.name}"/>
+ <tc:out value="#{object.name}"/>
</tc:column>
<tc:column label="Orbit & Period">
<tc:tabGroup>
<tc:tab label="Orbiting">
- <tc:out value="#{solarobject.orbit}"/>
+ <tc:out value="#{object.orbit}"/>
</tc:tab>
<tc:tab label="Period (Days)">
- <tc:out value="#{solarobject.period}"/>
+ <tc:out value="#{object.period}"/>
</tc:tab>
</tc:tabGroup>
</tc:column>
<tc:column label="Discovery">
- <tc:out value="Discovered by #{solarobject.discoverer} in the year #{solarobject.discoverYear}."/>
+ <tc:out value="Discovered by #{object.discoverer} in the year #{object.discoverYear}."/>
</tc:column>
</tc:sheet>
</tc:section>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/sheet-sorting.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/sheet-sorting.xhtml?rev=1747394&r1=1747393&r2=1747394&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/sheet-sorting.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/sheet-sorting.xhtml Wed Jun 8 13:25:57 2016
@@ -37,15 +37,15 @@
<p>In this example, the <code>sortable</code> attribute is 'true' for all columns.
Notice, that there are negative periods.</p>
<pre><code class="language-markup"><tc:column label="Name" sortable="true"></code></pre>
- <tc:sheet id="s1" value="#{sheetSortingController.solarList}" var="solarobject" rows="4">
+ <tc:sheet id="s1" value="#{sheetSortingController.solarList}" var="object" rows="4">
<tc:column label="Name" sortable="true">
- <tc:out value="#{solarobject.name}"/>
+ <tc:out value="#{object.name}"/>
</tc:column>
<tc:column label="Period (Days)" sortable="true">
- <tc:out value="#{solarobject.period}"/>
+ <tc:out value="#{object.period}"/>
</tc:column>
<tc:column label="Discovery Year" sortable="true">
- <tc:out value="#{solarobject.discoverYear}"/>
+ <tc:out value="#{object.discoverYear}"/>
</tc:column>
</tc:sheet>
</tc:section>
@@ -64,13 +64,13 @@
<tc:sheet id="s2" value="#{sheetSortingController.solarList}" var="solarobject" rows="4"
sortActionListener="#{sheetSortingController.sheetSorter}">
<tc:column id="namecol" label="Name" sortable="true">
- <tc:out value="#{solarobject.name}"/>
+ <tc:out value="#{object.name}"/>
</tc:column>
<tc:column id="periodcol" label="Period (Days)" sortable="true">
- <tc:out value="#{solarobject.period}"/>
+ <tc:out value="#{object.period}"/>
</tc:column>
<tc:column id="yearcol" label="Discovery Year" sortable="true">
- <tc:out value="#{solarobject.discoverYear}"/>
+ <tc:out value="#{object.discoverYear}"/>
</tc:column>
</tc:sheet>
</tc:section>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/20-selector/sheet-column-selector.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/20-selector/sheet-column-selector.xhtml?rev=1747394&r1=1747393&r2=1747394&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/20-selector/sheet-column-selector.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/20-selector/sheet-column-selector.xhtml Wed Jun 8 13:25:57 2016
@@ -43,23 +43,23 @@
<tc:out value="\#{solarobject.name}"/>
</tc:column>
...</code></pre>
- <tc:sheet id="s4" value="#{sheetController.solarList}" var="solarobject" rows="2"
+ <tc:sheet id="s4" value="#{sheetController.solarList}" var="object" rows="2"
selectable="singleOrNone" state="#{sheetController.sheetState}">
<tc:columnSelector/>
<tc:column label="Name">
- <tc:out value="#{solarobject.name}"/>
+ <tc:out value="#{object.name}"/>
</tc:column>
<tc:column label="Orbit">
- <tc:out value="#{solarobject.orbit}"/>
+ <tc:out value="#{object.orbit}"/>
</tc:column>
<tc:column label="Period (Days)">
- <tc:out value="#{solarobject.period}"/>
+ <tc:out value="#{object.period}"/>
</tc:column>
<tc:column label="Discoverer">
- <tc:out value="#{solarobject.discoverer}"/>
+ <tc:out value="#{object.discoverer}"/>
</tc:column>
<tc:column label="Year">
- <tc:out value="#{solarobject.discoverYear}"/>
+ <tc:out value="#{object.discoverYear}"/>
</tc:column>
</tc:sheet>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-column-event.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-column-event.xhtml?rev=1747394&r1=1747393&r2=1747394&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-column-event.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-column-event.xhtml Wed Jun 8 13:25:57 2016
@@ -32,10 +32,10 @@
<p>Select an object from the SolarObjects list.</p>
<tc:segmentLayout medium="5;7">
<tc:box label="Solar Objects">
- <tc:sheet id="s1" value="#{sheetController.solarList}" var="solarobject" columns="1*">
+ <tc:sheet id="s1" value="#{sheetController.solarList}" var="object" columns="1*">
<tc:style maxHeight="486px"/>
<tc:column label="#{overviewBundle.solarArrayName}" id="name">
- <tc:out value="#{solarobject.name}" id="t_name"/>
+ <tc:out value="#{object.name}" id="t_name"/>
</tc:column>
<tc:columnEvent event="click">
<tc:command actionListener="#{sheetController.selectSolarObject}" immediate="true">
Added: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/35-markup/sheet-markup.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/35-markup/sheet-markup.xhtml?rev=1747394&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/35-markup/sheet-markup.xhtml (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/35-markup/sheet-markup.xhtml Wed Jun 8 13:25:57 2016
@@ -0,0 +1,69 @@
+<?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.
+-->
+
+<ui:composition template="/main.xhtml"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core">
+ <ui:param name="title" value="#{overviewBundle.sheet} markups"/>
+ <p>This example, demonstrate the different markups defined for sheet.
+ These markups reflecting the styles from bootstrap.
+ <tc:selectOneRadio value="#{sheetController.automaticLayout}">
+ <f:facet name="change">
+ <tc:command/>
+ </f:facet>
+ <tc:selectItem itemLabel="Automatic table layout" itemValue="true"/>
+ <tc:selectItem itemLabel="Managed table layout" itemValue="false"/>
+ </tc:selectOneRadio>
+
+ <tc:selectManyShuttle value="#{sheetController.markup}">
+ <f:facet name="change">
+ <tc:command/>
+ </f:facet>
+ <tc:selectItem itemLabel="Inverse" itemValue="inverse"/>
+ <tc:selectItem itemLabel="Striped" itemValue="striped"/>
+ <tc:selectItem itemLabel="Bordered" itemValue="bordered"/>
+ <tc:selectItem itemLabel="Hover" itemValue="hover"/>
+ <tc:selectItem itemLabel="Small" itemValue="small"/>
+ </tc:selectManyShuttle>
+ </p>
+
+ <tc:section label="Markup: inverse">
+ <pre><code class="language-markup"><tc:sheet markup="inverse" ...></code></pre>
+ <tc:sheet markup="#{sheetController.markup}" value="#{sheetController.solarList}" var="object" rows="4"
+ columns="#{sheetController.automaticLayout ? '*;*;*;*;*' : null}">
+ <tc:column label="Name">
+ <tc:out value="#{object.name}"/>
+ </tc:column>
+ <tc:column label="Orbit">
+ <tc:out value="#{object.orbit}"/>
+ </tc:column>
+ <tc:column label="Period (Days)">
+ <tc:out value="#{object.period}"/>
+ </tc:column>
+ <tc:column label="Discoverer">
+ <tc:out value="#{object.discoverer}"/>
+ </tc:column>
+ <tc:column label="Year">
+ <tc:out value="#{object.discoverYear}"/>
+ </tc:column>
+ </tc:sheet>
+ </tc:section>
+
+</ui:composition>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/40-dropdown/sheet-dropdown.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/40-dropdown/sheet-dropdown.xhtml?rev=1747394&r1=1747393&r2=1747394&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/40-dropdown/sheet-dropdown.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/40-dropdown/sheet-dropdown.xhtml Wed Jun 8 13:25:57 2016
@@ -34,9 +34,9 @@
link="#{overviewBundle.tagDocUrl}/column.html"/></p>
<tc:section label="dropDownMenu">
- <tc:sheet id="s5" value="#{sheetController.solarList}" var="solarobject" rows="4">
+ <tc:sheet id="s5" value="#{sheetController.solarList}" var="object" rows="4">
<tc:column label="Name">
- <tc:out value="#{solarobject.name}"/>
+ <tc:out value="#{object.name}"/>
</tc:column>
<tc:column label="Orbit">
<f:facet name="dropDownMenu">
@@ -48,13 +48,13 @@
</f:facet>
</tc:column>
<tc:column label="Period (Days)">
- <tc:out value="#{solarobject.period}"/>
+ <tc:out value="#{object.period}"/>
</tc:column>
<tc:column label="Discoverer">
- <tc:out value="#{solarobject.discoverer}"/>
+ <tc:out value="#{object.discoverer}"/>
</tc:column>
<tc:column label="Year">
- <tc:out value="#{solarobject.discoverYear}"/>
+ <tc:out value="#{object.discoverYear}"/>
</tc:column>
</tc:sheet>
</tc:section>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/55-staticheader/sheet-static-header.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/55-staticheader/sheet-static-header.xhtml?rev=1747394&r1=1747393&r2=1747394&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/55-staticheader/sheet-static-header.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/55-staticheader/sheet-static-header.xhtml Wed Jun 8 13:25:57 2016
@@ -37,23 +37,23 @@
</tc:section>
<tc:section label="Simple Header">
- <tc:sheet id="s1" value="#{sheetController.solarList}" var="solarobject" rows="7"
+ <tc:sheet id="s1" value="#{sheetController.solarList}" var="object" rows="7"
columns="1;1;2;2;1">
<tc:style maxHeight="500px"/>
<tc:column label="Name">
- <tc:out value="#{solarobject.name}"/>
+ <tc:out value="#{object.name}"/>
</tc:column>
<tc:column label="Orbit">
- <tc:out value="#{solarobject.orbit}"/>
+ <tc:out value="#{object.orbit}"/>
</tc:column>
<tc:column label="Period (Days)">
- <tc:out value="#{solarobject.period}"/>
+ <tc:out value="#{object.period}"/>
</tc:column>
<tc:column label="Discoverer">
- <tc:out value="#{solarobject.discoverer}"/>
+ <tc:out value="#{object.discoverer}"/>
</tc:column>
<tc:column label="Year">
- <tc:out value="#{solarobject.discoverYear}"/>
+ <tc:out value="#{object.discoverYear}"/>
</tc:column>
</tc:sheet>
</tc:section>
@@ -62,19 +62,19 @@
<tc:sheet id="s11" value="#{sheetController.solarList}" var="solarobject" rows="4">
<tc:style maxHeight="500px"/>
<tc:column label="Name">
- <tc:out value="#{solarobject.name}"/>
+ <tc:out value="#{object.name}"/>
</tc:column>
<tc:column label="Orbit">
- <tc:out value="#{solarobject.orbit}"/>
+ <tc:out value="#{object.orbit}"/>
</tc:column>
<tc:column label="Period (Days)">
- <tc:out value="#{solarobject.period}"/>
+ <tc:out value="#{object.period}"/>
</tc:column>
<tc:column label="Discoverer">
- <tc:out value="#{solarobject.discoverer}"/>
+ <tc:out value="#{object.discoverer}"/>
</tc:column>
<tc:column label="Year">
- <tc:out value="#{solarobject.discoverYear}"/>
+ <tc:out value="#{object.discoverYear}"/>
</tc:column>
</tc:sheet>
@@ -85,19 +85,19 @@
columns="3*;2*;3*;*;*">
<tc:style maxHeight="500px"/>
<tc:column label="Name">
- <tc:out value="#{solarobject.name}"/>
+ <tc:out value="#{object.name}"/>
</tc:column>
<tc:column label="Orbit">
- <tc:out value="#{solarobject.orbit}"/>
+ <tc:out value="#{object.orbit}"/>
</tc:column>
<tc:column label="Period (Days)">
- <tc:out value="#{solarobject.period}"/>
+ <tc:out value="#{object.period}"/>
</tc:column>
<tc:column label="Discoverer">
- <tc:out value="#{solarobject.discoverer}"/>
+ <tc:out value="#{object.discoverer}"/>
</tc:column>
<tc:column label="Year">
- <tc:out value="#{solarobject.discoverYear}"/>
+ <tc:out value="#{object.discoverYear}"/>
</tc:column>
</tc:sheet>
</tc:section>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/80-editable/sheet-editable.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/80-editable/sheet-editable.xhtml?rev=1747394&r1=1747393&r2=1747394&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/80-editable/sheet-editable.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/80-editable/sheet-editable.xhtml Wed Jun 8 13:25:57 2016
@@ -25,13 +25,13 @@
<ui:param name="title" value="#{overviewBundle.sheet_editable} <tc:sheet>"/>
<tc:section label="Editable Sheet" id="basics">
- <tc:sheet id="s1" value="#{sheetController.solarList}" var="solarobject" rows="5">
+ <tc:sheet id="s1" value="#{sheetController.solarList}" var="object" rows="5">
<tc:style maxHeight="500px"/>
<tc:column label="Name">
- <tc:in value="#{solarobject.name}"/>
+ <tc:in value="#{object.name}"/>
</tc:column>
<tc:column label="Distance">
- <tc:in value="#{solarobject.distance}"/>
+ <tc:in value="#{object.distance}"/>
</tc:column>
<!-- XXX discoverYear year doesn't work, because the java.util.Date conflicts with java.lang.Interger
<tc:column label="discoverYear">
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/sheet.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/sheet.xhtml?rev=1747394&r1=1747393&r2=1747394&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/sheet.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/sheet.xhtml Wed Jun 8 13:25:57 2016
@@ -44,22 +44,22 @@
<tc:column label="Name">
<tc:out value="\#{solarobject.name}"/>
...</code></pre>
- <tc:sheet id="s1" value="#{sheetController.solarList}" var="solarobject" rows="4">
+ <tc:sheet id="s1" value="#{sheetController.solarList}" var="object" rows="4">
<tc:style maxHeight="500px"/>
<tc:column label="Name">
- <tc:out value="#{solarobject.name}"/>
+ <tc:out value="#{object.name}"/>
</tc:column>
<tc:column label="Orbit">
- <tc:out value="#{solarobject.orbit}"/>
+ <tc:out value="#{object.orbit}"/>
</tc:column>
<tc:column label="Period (Days)">
- <tc:out value="#{solarobject.period}"/>
+ <tc:out value="#{object.period}"/>
</tc:column>
<tc:column label="Discoverer">
- <tc:out value="#{solarobject.discoverer}"/>
+ <tc:out value="#{object.discoverer}"/>
</tc:column>
<tc:column label="Year">
- <tc:out value="#{solarobject.discoverYear}"/>
+ <tc:out value="#{object.discoverYear}"/>
</tc:column>
</tc:sheet>
</tc:section>
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/css/BootstrapClass.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/css/BootstrapClass.java?rev=1747394&r1=1747393&r2=1747394&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/css/BootstrapClass.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/css/BootstrapClass.java Wed Jun 8 13:25:57 2016
@@ -151,6 +151,7 @@ public enum BootstrapClass implements Cs
TABLE("table"),
TABLE_BORDERED("table-bordered"),
TABLE_HOVER("table-hover"),
+ TABLE_INVERSE("table-inverse"),
TABLE_SM("table-sm"),
TABLE_STRIPED("table-striped"),
WARNING("warning");
Modified: myfaces/tobago/trunk/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/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java?rev=1747394&r1=1747393&r2=1747394&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java Wed Jun 8 13:25:57 2016
@@ -231,6 +231,7 @@ public class SheetRenderer extends Rende
final List<AbstractUIColumnBase> columns = sheet.getAllColumns();
final boolean showHeader = sheet.isShowHeader();
final boolean autoLayout = sheet.isAutoLayout();
+ Markup sheetMarkup = sheet.getMarkup() != null ? sheet.getMarkup() : Markup.NULL;
if (!autoLayout) {
writer.startElement(HtmlElements.INPUT);
@@ -267,6 +268,30 @@ public class SheetRenderer extends Rende
expandedValue = new StringBuilder(",");
}
+ final List<CssItem> cssItems = new ArrayList<CssItem>();
+ cssItems.add(BootstrapClass.TABLE);
+ if (sheetMarkup.contains(Markup.INVERSE)) {
+ cssItems.add(BootstrapClass.TABLE_INVERSE);
+ }
+ if (sheetMarkup.contains(Markup.STRIPED)) {
+ cssItems.add(BootstrapClass.TABLE_STRIPED);
+ }
+ if (sheetMarkup.contains(Markup.BORDERED)) {
+ cssItems.add(BootstrapClass.TABLE_BORDERED);
+ }
+ if (sheetMarkup.contains(Markup.HOVER)) {
+ cssItems.add(BootstrapClass.TABLE_HOVER);
+ }
+ if (sheetMarkup.contains(Markup.SMALL)) {
+ cssItems.add(BootstrapClass.TABLE_SM);
+ }
+ if (!autoLayout) {
+ cssItems.add(TobagoClass.TABLE_LAYOUT__FIXED);
+ }
+ if (selectable != Selectable.none) {
+ cssItems.add(BootstrapClass.TABLE_HOVER);
+ }
+
// BEGIN RENDER BODY CONTENT
if (showHeader && !autoLayout) {
@@ -278,8 +303,7 @@ public class SheetRenderer extends Rende
writer.writeAttribute(HtmlAttributes.CELLSPACING, "0", false);
writer.writeAttribute(HtmlAttributes.CELLPADDING, "0", false);
writer.writeAttribute(HtmlAttributes.SUMMARY, "", false);
- writer.writeClassAttribute(Classes.create(sheet, "headerTable"),
- BootstrapClass.TABLE, BootstrapClass.TABLE_BORDERED, TobagoClass.TABLE_LAYOUT__FIXED);
+ writer.writeClassAttribute(Classes.create(sheet, "headerTable"), cssItems.toArray(new CssItem[cssItems.size()]));
writeColgroup(writer, columnWidths, columns);
@@ -298,13 +322,7 @@ public class SheetRenderer extends Rende
writer.writeAttribute(HtmlAttributes.CELLSPACING, "0", false);
writer.writeAttribute(HtmlAttributes.CELLPADDING, "0", false);
writer.writeAttribute(HtmlAttributes.SUMMARY, "", false);
- writer.writeClassAttribute(
- Classes.create(sheet, "bodyTable"),
- BootstrapClass.TABLE,
- BootstrapClass.TABLE_BORDERED,
- BootstrapClass.TABLE_SM,
- selectable != Selectable.none ? BootstrapClass.TABLE_HOVER : null,
- autoLayout ? null : TobagoClass.TABLE_LAYOUT__FIXED);
+ writer.writeClassAttribute(Classes.create(sheet, "bodyTable"), cssItems.toArray(new CssItem[cssItems.size()]));
if (autoLayout) {
writer.startElement(HtmlElements.THEAD);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml?rev=1747394&r1=1747393&r2=1747394&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml Wed Jun 8 13:25:57 2016
@@ -129,6 +129,11 @@
<renderer>
<name>Menu</name>
<supported-markup>
+ <markup>inverse</markup>
+ <markup>striped</markup>
+ <markup>bordered</markup>
+ <markup>hover</markup>
+ <markup>small</markup>
<!-- internal: for the root of the menu -->
<markup>top</markup>
<!-- internal: to mark "cursor" position in the menu -->