Author: lfryc(a)redhat.com
Date: 2010-07-10 14:43:30 -0400 (Sat, 10 Jul 2010)
New Revision: 17828
Added:
root/tests/metamer/trunk/src/main/webapp/templates/a4jRepeat1.xhtml
root/tests/metamer/trunk/src/main/webapp/templates/a4jRepeat2.xhtml
root/tests/metamer/trunk/src/main/webapp/templates/hDataTable1.xhtml
root/tests/metamer/trunk/src/main/webapp/templates/hDataTable2.xhtml
root/tests/metamer/trunk/src/main/webapp/templates/uiRepeat1.xhtml
root/tests/metamer/trunk/src/main/webapp/templates/uiRepeat2.xhtml
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/Template.java
root/tests/metamer/trunk/src/main/webapp/templates/richDataTable1.xhtml
root/tests/metamer/trunk/src/main/webapp/templates/richDataTable2.xhtml
Log:
https://jira.jboss.org/browse/RFPL-466
* class Template refactored, added JavaDocs
* added templates for h:dataTable, a4j:repeat and ui:repeat
* template with rich:dataTable refactored
Modified: root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/Template.java
===================================================================
--- root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/Template.java 2010-07-10
18:42:25 UTC (rev 17827)
+++ root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/Template.java 2010-07-10
18:43:30 UTC (rev 17828)
@@ -23,21 +23,33 @@
package org.richfaces.testapp;
/**
- * Kids of templates that can be put in harness.
- * @author carcasser
+ * Representation of a template. The name of the template can be used as
+ * a view parameter.
*
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
*/
public enum Template {
- PLAIN ("plain", "", "Plain"),
- REDDIV ("redDiv", "", "Red div"),
- BLUEDIV ("blueDiv", "", "Blue div"),
- RICHDATATABLE1 ("richDataTable1", "", "Rich Data Table Row
1"),
- RICHDATATABLE2 ("richDataTable2", "", "Rich Data Table Row
2");
+ PLAIN ("plain", "Plain"),
+ REDDIV ("redDiv", "Red div"),
+ BLUEDIV ("blueDiv", "Blue div"),
+ RICHDATATABLE1 ("richDataTable1", "Rich Data Table Row 1"),
+ RICHDATATABLE2 ("richDataTable2", "Rich Data Table Row 2"),
+ HDATATABLE1 ("hDataTable1", "JSF Data Table Row 1"),
+ HDATATABLE2 ("hDataTable2", "JSF Data Table Row 2"),
+ UIREPEAT1 ("uiRepeat1", "UI Repeat Row 1"),
+ UIREPEAT2 ("uiRepeat2", "UI Repeat Row 2"),
+ A4JREPEAT1 ("a4jRepeat1", "A4J Repeat Row 1"),
+ A4JREPEAT2 ("a4jRepeat2", "A4J Repeat Row 2");
+ /**
+ * identifier of a template
+ */
private String name;
- private String prefix;
-
+ /**
+ * human-readable name of the template
+ */
private String desc;
/**
@@ -46,9 +58,8 @@
* @param name
* @param prefix
*/
- private Template(String name, String prefix, String desc) {
+ private Template(String name, String desc) {
this.name = name;
- this.prefix = prefix;
this.desc = desc;
}
@@ -61,14 +72,6 @@
}
/**
- * Gets value of prefix field.
- * @return value of prefix field
- */
- public String getPrefix() {
- return prefix;
- }
-
- /**
* Gets value of desc field.
* @return value of desc field
*/
Added: root/tests/metamer/trunk/src/main/webapp/templates/a4jRepeat1.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/a4jRepeat1.xhtml
(rev 0)
+++ root/tests/metamer/trunk/src/main/webapp/templates/a4jRepeat1.xhtml 2010-07-10
18:43:30 UTC (rev 17828)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
+
+ <ui:composition>
+
+ <ul>
+ <a4j:repeat value="#{templateBean.dataTableModel}"
var="item" id="containerA4JRepeat1">
+ <li><h:panelGroup columns="1" rendered="#{item ==
'row 1'}">
+ <ui:include src="#{templateBean.nextTemplate}.xhtml"
/>
+ </h:panelGroup>
+ <h:outputText value="#{item}" rendered="#{item !=
'row 1'}" /></li>
+ </a4j:repeat>
+ </ul>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added: root/tests/metamer/trunk/src/main/webapp/templates/a4jRepeat2.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/a4jRepeat2.xhtml
(rev 0)
+++ root/tests/metamer/trunk/src/main/webapp/templates/a4jRepeat2.xhtml 2010-07-10
18:43:30 UTC (rev 17828)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
+
+ <ui:composition>
+
+ <ul>
+ <a4j:repeat value="#{templateBean.dataTableModel}"
var="item" id="containerA4JRepeat2">
+ <li><h:panelGroup columns="1" rendered="#{item ==
'row 2'}">
+ <ui:include src="#{templateBean.nextTemplate}.xhtml"
/>
+ </h:panelGroup>
+ <h:outputText value="#{item}" rendered="#{item !=
'row 2'}" /></li>
+ </a4j:repeat>
+ </ul>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Copied: root/tests/metamer/trunk/src/main/webapp/templates/hDataTable1.xhtml (from rev
17827, root/tests/metamer/trunk/src/main/webapp/templates/richDataTable1.xhtml)
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/hDataTable1.xhtml
(rev 0)
+++ root/tests/metamer/trunk/src/main/webapp/templates/hDataTable1.xhtml 2010-07-10
18:43:30 UTC (rev 17828)
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich">
+
+ <ui:composition>
+
+ <h:dataTable value="#{templateBean.dataTableModel}"
var="item" id="containerHDataTable1">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="JSF Data Table" />
+ </f:facet>
+ <h:panelGroup columns="1" rendered="#{item == 'row
1'}">
+ <ui:include src="#{templateBean.nextTemplate}.xhtml"
/>
+ </h:panelGroup>
+ <h:outputText value="#{item}" rendered="#{item !=
'row 1'}" />
+ </h:column>
+ </h:dataTable>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Copied: root/tests/metamer/trunk/src/main/webapp/templates/hDataTable2.xhtml (from rev
17827, root/tests/metamer/trunk/src/main/webapp/templates/richDataTable1.xhtml)
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/hDataTable2.xhtml
(rev 0)
+++ root/tests/metamer/trunk/src/main/webapp/templates/hDataTable2.xhtml 2010-07-10
18:43:30 UTC (rev 17828)
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich">
+
+ <ui:composition>
+
+ <h:dataTable value="#{templateBean.dataTableModel}"
var="item" id="containerHDataTable1">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="JSF Data Table" />
+ </f:facet>
+ <h:panelGroup columns="1" rendered="#{item == 'row
2'}">
+ <ui:include src="#{templateBean.nextTemplate}.xhtml"
/>
+ </h:panelGroup>
+ <h:outputText value="#{item}" rendered="#{item !=
'row 2'}" />
+ </h:column>
+ </h:dataTable>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: root/tests/metamer/trunk/src/main/webapp/templates/richDataTable1.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/richDataTable1.xhtml 2010-07-10
18:42:25 UTC (rev 17827)
+++ root/tests/metamer/trunk/src/main/webapp/templates/richDataTable1.xhtml 2010-07-10
18:43:30 UTC (rev 17828)
@@ -4,15 +4,15 @@
<ui:composition>
- <rich:dataTable value="#{templateBean.dataTableModel}"
var="item" id="containerDataTable1" rowKeyVar="row">
+ <rich:dataTable value="#{templateBean.dataTableModel}"
var="item" id="containerRichDataTable1" rowKeyVar="row">
<rich:column>
<f:facet name="header">
- <h:outputText value="Data Table" />
+ <h:outputText value="Rich Data Table" />
</f:facet>
- <h:panelGroup columns="1" rendered="#{row
==0}">
+ <h:panelGroup columns="1" rendered="#{item == 'row
1'}">
<ui:include src="#{templateBean.nextTemplate}.xhtml"
/>
</h:panelGroup>
- <h:outputText value="#{item}" rendered="#{row !=
0}" />
+ <h:outputText value="#{item}" rendered="#{item !=
'row 1'}" />
</rich:column>
</rich:dataTable>
Modified: root/tests/metamer/trunk/src/main/webapp/templates/richDataTable2.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/richDataTable2.xhtml 2010-07-10
18:42:25 UTC (rev 17827)
+++ root/tests/metamer/trunk/src/main/webapp/templates/richDataTable2.xhtml 2010-07-10
18:43:30 UTC (rev 17828)
@@ -4,15 +4,15 @@
<ui:composition>
- <rich:dataTable value="#{templateBean.dataTableModel}"
var="item" id="containerDataTable2" rowKeyVar="row">
+ <rich:dataTable value="#{templateBean.dataTableModel}"
var="item" id="containerRichDataTable2" rowKeyVar="row">
<rich:column>
<f:facet name="header">
- <h:outputText value="Data Table" />
+ <h:outputText value="Rich Data Table" />
</f:facet>
- <h:panelGroup columns="1" rendered="#{row ==
1}">
+ <h:panelGroup columns="1" rendered="#{item == 'row
2'}">
<ui:include src="#{templateBean.nextTemplate}.xhtml"
/>
</h:panelGroup>
- <h:outputText value="#{item}" rendered="#{row !=
1}" />
+ <h:outputText value="#{item}" rendered="#{item !=
'row 2'}" />
</rich:column>
</rich:dataTable>
Added: root/tests/metamer/trunk/src/main/webapp/templates/uiRepeat1.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/uiRepeat1.xhtml
(rev 0)
+++ root/tests/metamer/trunk/src/main/webapp/templates/uiRepeat1.xhtml 2010-07-10 18:43:30
UTC (rev 17828)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
+
+ <ui:composition>
+
+ <ol>
+ <ui:repeat value="#{templateBean.dataTableModel}"
var="item" id="containerUiRepeat1">
+ <li><h:panelGroup columns="1" rendered="#{item ==
'row 1'}">
+ <ui:include src="#{templateBean.nextTemplate}.xhtml"
/>
+ </h:panelGroup>
+ <h:outputText value="#{item}" rendered="#{item !=
'row 1'}" /></li>
+ </ui:repeat>
+ </ol>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added: root/tests/metamer/trunk/src/main/webapp/templates/uiRepeat2.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/uiRepeat2.xhtml
(rev 0)
+++ root/tests/metamer/trunk/src/main/webapp/templates/uiRepeat2.xhtml 2010-07-10 18:43:30
UTC (rev 17828)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
+
+ <ui:composition>
+
+ <ol>
+ <ui:repeat value="#{templateBean.dataTableModel}"
var="item" id="containerUiRepeat2">
+ <li><h:panelGroup columns="1" rendered="#{item ==
'row 2'}">
+ <ui:include src="#{templateBean.nextTemplate}.xhtml"
/>
+ </h:panelGroup>
+ <h:outputText value="#{item}" rendered="#{item !=
'row 2'}" /></li>
+ </ui:repeat>
+ </ol>
+
+ </ui:composition>
+</html>
\ No newline at end of file