JBoss Rich Faces SVN: r20933 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-10 09:45:29 -0500 (Mon, 10 Jan 2011)
New Revision: 20933
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/templates/template.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
Log:
* fixed tests for rich:tabPanel
* executeChecker moved into a form
Modified: modules/tests/metamer/trunk/application/src/main/webapp/templates/template.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/templates/template.xhtml 2011-01-10 14:34:39 UTC (rev 20932)
+++ modules/tests/metamer/trunk/application/src/main/webapp/templates/template.xhtml 2011-01-10 14:45:29 UTC (rev 20933)
@@ -38,18 +38,20 @@
</h:head>
<h:body>
- <h:selectBooleanCheckbox id="executeChecker" value="#{richBean.executeChecker}" style="display: none" />
-
+ <h:form id="executeCheckerForm">
+ <h:selectBooleanCheckbox id="executeChecker" value="#{richBean.executeChecker}" style="display: none" />
+ </h:form>
+
<div class="header"><ui:decorate template="/templates/header.xhtml" /></div>
<div class="content">
<div class="messages"><h:messages /></div>
<h:panelGroup id="commonGrid" layout="block" rendered="#{richBean.reComponent}">
-
- <c:set var="nestedPrefix" value="#{templateBean.componentPrefix}" />
- <c:set var="nestedComponentId" value="#{templateBean.componentPrefix}#{componentId}" />
-
+
+ <c:set var="nestedPrefix" value="#{templateBean.componentPrefix}" />
+ <c:set var="nestedComponentId" value="#{templateBean.componentPrefix}#{componentId}" />
+
<c:choose>
<c:when test="#{dontRenderForm}">
<div style="margin-bottom: 20px;"><ui:insert name="outOfTemplateBefore" /></div>
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2011-01-10 14:34:39 UTC (rev 20932)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2011-01-10 14:45:29 UTC (rev 20933)
@@ -313,6 +313,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10165")
public void testItemchangeEvents() {
selenium.type(pjq("input[type=text][id$=onbeforeitemchangeInput]"), "metamerEvents += \"beforeitemchange \"");
selenium.waitForPageToLoad();
@@ -327,8 +328,9 @@
String[] events = selenium.getEval(new JavaScript("window.metamerEvents")).split(" ");
+ assertEquals(events.length, 2, "Two events should be fired - beforeitemchange and itemchange.");
assertEquals(events[0], "beforeitemchange", "Attribute onbeforeitemchange doesn't work");
- assertEquals(events[1], "itemchange", "Attribute onbeforeitemchange doesn't work");
+ assertEquals(events[1], "itemchange", "Attribute onitemchange doesn't work");
}
@Test
@@ -408,6 +410,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-9309")
public void testTabHeaderClass() {
selenium.type(pjq("input[id$=tabHeaderClassInput]"), "metamer-ftest-class");
selenium.waitForPageToLoad();
@@ -426,6 +429,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-9309")
public void testTabHeaderClassActive() {
selenium.type(pjq("input[id$=tabHeaderClassActiveInput]"), "metamer-ftest-class");
selenium.waitForPageToLoad();
@@ -444,6 +448,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-9309")
public void testTabHeaderClassDisabled() {
selenium.type(pjq("input[id$=tabHeaderClassDisabledInput]"), "metamer-ftest-class");
selenium.waitForPageToLoad();
@@ -462,6 +467,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-9309")
public void testTabHeaderClassInactive() {
selenium.type(pjq("input[id$=tabHeaderClassInactiveInput]"), "metamer-ftest-class");
selenium.waitForPageToLoad();
13 years, 11 months
JBoss Rich Faces SVN: r20932 - in trunk: ui/output/ui/src/main/java/org/richfaces/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2011-01-10 09:34:39 -0500 (Mon, 10 Jan 2011)
New Revision: 20932
Modified:
trunk/examples/output-demo/src/main/webapp/examples/togglePanel-mixed.xhtml
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java
Log:
RF-9894: Toggle panel item: no item displayed when rendered is false
Modified: trunk/examples/output-demo/src/main/webapp/examples/togglePanel-mixed.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/togglePanel-mixed.xhtml 2011-01-10 14:19:14 UTC (rev 20931)
+++ trunk/examples/output-demo/src/main/webapp/examples/togglePanel-mixed.xhtml 2011-01-10 14:34:39 UTC (rev 20932)
@@ -15,9 +15,10 @@
<ui:define name="body">
<h:form id="f">
<pn:togglePanel id="panel" activeItem="name1" switchType="client" lang="en" cycledSwitching="true" >
- <pn:togglePanelItem name="name1" >hello name1 client</pn:togglePanelItem>
+ <pn:togglePanelItem name="name1" rendered="false" >hello name1 client</pn:togglePanelItem>
<pn:togglePanelItem name="name2" onenter="alert('onenter ajax');" switchType="ajax">hello name2 ajax</pn:togglePanelItem>
<pn:togglePanelItem name="name3" switchType="server">hello name3 server</pn:togglePanelItem>
+ <pn:togglePanelItem name="name4" >hello name4</pn:togglePanelItem>
</pn:togglePanel>
<h:outputLink>
@@ -34,6 +35,11 @@
<ou:toggleControl targetPanel="panel" targetItem="name3" event="click" />
name3 server
</h:outputLink>
+ |
+ <h:outputLink>
+ <ou:toggleControl targetPanel="panel" targetItem="name4" event="click" />
+ name4 client disabled
+ </h:outputLink>
<br />
<h:outputLink>
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2011-01-10 14:19:14 UTC (rev 20931)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2011-01-10 14:34:39 UTC (rev 20932)
@@ -22,6 +22,7 @@
package org.richfaces.component;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -138,6 +139,20 @@
// ----------------------------------------------------- UIComponent Methods
+
+ @Override
+ public void encodeBegin(FacesContext context) throws IOException {
+ AbstractTogglePanelItem item = this.getItem(getActiveItem());
+ if (item == null || !item.isRendered()) {
+ List<AbstractTogglePanelItem> renderedItems = this.getRenderedItems();
+ if (!renderedItems.isEmpty()) {
+ setActiveItem(renderedItems.get(0).getName());
+ }
+ }
+
+ super.encodeBegin(context);
+ }
+
/**
* <p>Specialized decode behavior on top of that provided by the
* superclass. In addition to the standard
@@ -212,6 +227,7 @@
Application app = context.getApplication();
app.publishEvent(context, PreValidateEvent.class, this);
+
// Process all the facets and children of this component
Iterator<UIComponent> kids = getFacetsAndChildren();
String activeItem = getActiveItemValue();
@@ -456,20 +472,24 @@
public AbstractTogglePanelItem getItemByIndex(final int index) {
List<AbstractTogglePanelItem> children = getRenderedItems();
- if (isCycledSwitching()) {
+ if (index < 0 || index >= children.size()) {
+ return null;
+ } else if (isCycledSwitching()) {
int size = getRenderedItems().size();
return children.get((size + index) % size);
- } else if (index < 0 || index >= children.size()) {
- return null;
} else {
return children.get(index);
}
}
public List<AbstractTogglePanelItem> getRenderedItems() {
+ return getItems(false);
+ }
+
+ public List<AbstractTogglePanelItem> getItems(boolean isRendered) {
List<AbstractTogglePanelItem> res = new ArrayList<AbstractTogglePanelItem>(getChildCount());
for (UIComponent child : getChildren()) {
- if (child.isRendered() && child instanceof AbstractTogglePanelItem) {
+ if ((isRendered || child.isRendered()) && child instanceof AbstractTogglePanelItem) {
res.add((AbstractTogglePanelItem) child);
}
}
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java 2011-01-10 14:19:14 UTC (rev 20931)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java 2011-01-10 14:34:39 UTC (rev 20932)
@@ -46,7 +46,6 @@
/**
* @author akolonitsky
- * @since -4712-01-01
*/
@ResourceDependencies({
@ResourceDependency(library = "javax.faces", name = "jsf.js"),
13 years, 11 months
JBoss Rich Faces SVN: r20931 - in trunk: examples/input-demo/src/main/webapp/templates and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2011-01-10 09:19:14 -0500 (Mon, 10 Jan 2011)
New Revision: 20931
Modified:
trunk/examples/input-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/examples/input-demo/src/main/webapp/templates/template.xhtml
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java
Log:
RF-10132 Provide default event name for UISelect component
Modified: trunk/examples/input-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/WEB-INF/faces-config.xml 2011-01-10 14:13:39 UTC (rev 20930)
+++ trunk/examples/input-demo/src/main/webapp/WEB-INF/faces-config.xml 2011-01-10 14:19:14 UTC (rev 20931)
@@ -34,7 +34,11 @@
<navigation-case>
<from-outcome>fileUpload</from-outcome>
<to-view-id>/examples/fileupload.xhtml</to-view-id>
- </navigation-case>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>select</from-outcome>
+ <to-view-id>/examples/select.xhtml</to-view-id>
+ </navigation-case>
<!-- QUnit -->
Modified: trunk/examples/input-demo/src/main/webapp/templates/template.xhtml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/templates/template.xhtml 2011-01-10 14:13:39 UTC (rev 20930)
+++ trunk/examples/input-demo/src/main/webapp/templates/template.xhtml 2011-01-10 14:19:14 UTC (rev 20931)
@@ -38,6 +38,7 @@
<li><h:commandLink value="rich:inputNumberSpinner" action="inputNumberSpinner" /></li>
<li><h:commandLink value="rich:autocomplete" action="autocomplete" /></li>
<li><h:commandLink value="rich:fileUpload" action="fileUpload" /></li>
+ <li><h:commandLink value="rich:select" action="select" /></li>
</ul>
<h:panelGrid columns="3">
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java 2011-01-10 14:13:39 UTC (rev 20930)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java 2011-01-10 14:19:14 UTC (rev 20931)
@@ -70,7 +70,7 @@
@Attribute(events=@EventName("click"))
public abstract String getOnclick();
- @Attribute(events=@EventName("change"))
+ @Attribute(events=@EventName(value="change", defaultEvent=true))
public abstract String getOnchange();
@Attribute(events=@EventName("dblclick"))
13 years, 11 months
JBoss Rich Faces SVN: r20930 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-10 09:13:39 -0500 (Mon, 10 Jan 2011)
New Revision: 20930
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestFacets.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java
Log:
* fixed tests for rich:collapsiblePanel
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestFacets.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestFacets.java 2011-01-10 13:38:07 UTC (rev 20929)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestFacets.java 2011-01-10 14:13:39 UTC (rev 20930)
@@ -45,8 +45,8 @@
private JQueryLocator panel = pjq("div[id$=collapsiblePanel]");
private JQueryLocator header = pjq("div[id$=collapsiblePanel:header]");
- private JQueryLocator headerExp = pjq("div[id$=collapsiblePanel:header] div.rf-cp-hdr-exp");
- private JQueryLocator headerColps = pjq("div[id$=collapsiblePanel:header] div.rf-cp-hdr-colps");
+ private JQueryLocator headerExp = pjq("div[id$=collapsiblePanel:header] div.rf-cp-lbl-exp");
+ private JQueryLocator headerColps = pjq("div[id$=collapsiblePanel:header] div.rf-cp-lbl-colps");
private JQueryLocator content = pjq("div[id$=collapsiblePanel:content]");
@Override
@@ -131,7 +131,7 @@
displayed = selenium.isDisplayed(content);
assertTrue(displayed, "Panel's content should be visible.");
- String text = selenium.getText(header);
+ String text = selenium.getText(headerExp);
assertEquals(text, "header expanded", "Header of the panel.");
text = selenium.getText(content);
@@ -153,7 +153,7 @@
assertFalse(displayed, "Panel's content should not be visible.");
}
- String text = selenium.getText(header);
+ String text = selenium.getText(headerColps);
assertEquals(text, "header collapsed", "Header of the panel.");
}
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java 2011-01-10 13:38:07 UTC (rev 20929)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java 2011-01-10 14:13:39 UTC (rev 20930)
@@ -47,9 +47,9 @@
public class TestRichCollapsiblePanel extends AbstractMetamerTest {
private JQueryLocator panel = pjq("div[id$=collapsiblePanel]");
- private JQueryLocator header = pjq("div[id$=collapsiblePanel:header]");
- private JQueryLocator headerExp = pjq("div[id$=collapsiblePanel:header] div.rf-cp-hdr-exp");
- private JQueryLocator headerColps = pjq("div[id$=collapsiblePanel:header] div.rf-cp-hdr-colps");
+ private JQueryLocator header = pjq("div[id$=collapsiblePanel:header] div.rf-cp-lbl-exp");
+ private JQueryLocator headerExp = pjq("div[id$=collapsiblePanel:header] div.rf-cp-lbl-exp");
+ private JQueryLocator headerColps = pjq("div[id$=collapsiblePanel:header] div.rf-cp-lbl-colps");
private JQueryLocator content = pjq("div[id$=collapsiblePanel:content]");
@Override
@@ -119,7 +119,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-9421")
+ @IssueTracking("https://issues.jboss.org/browse/RF-10054")
public void testBypassUpdates() {
selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
selenium.waitForPageToLoad();
@@ -146,7 +146,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-9421")
+ @IssueTracking("https://issues.jboss.org/browse/RF-10054")
public void testImmediate() {
selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
13 years, 11 months
JBoss Rich Faces SVN: r20929 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richAccordion and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-10 08:38:07 -0500 (Mon, 10 Jan 2011)
New Revision: 20929
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordionItem/TestRichAccordionItem.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java
Log:
* fixed tests for accordion and accordion item
* removed unnecessary import from TestRichCollapsiblePanel
* testLang rewritten
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-01-10 11:53:42 UTC (rev 20928)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-01-10 13:38:07 UTC (rev 20929)
@@ -37,6 +37,8 @@
import org.apache.commons.lang.LocaleUtils;
import org.jboss.test.selenium.AbstractTestCase;
+import org.jboss.test.selenium.SystemProperties;
+import org.jboss.test.selenium.browser.BrowserType;
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.encapsulated.JavaScript;
import org.jboss.test.selenium.locator.Attribute;
@@ -265,18 +267,23 @@
*/
protected void testLang(ElementLocator<?> element) {
JQueryLocator langInput = pjq("input[type=text][id$=langInput]");
+ JavaScript getAttributeLang = null;
+ if (SystemProperties.getBrowser().getType() == BrowserType.FIREFOX) {
+ getAttributeLang = new JavaScript("window.jQuery('" + element.getRawLocator() + "').attr('lang')");
+ } else {
+ getAttributeLang = new JavaScript("window.jQuery('" + element.getRawLocator() + "').attr('xml:lang')");
+ }
+
// lang = null
- AttributeLocator<?> langAttr = element.getAttribute(new Attribute("lang"));
- assertFalse(selenium.isAttributePresent(langAttr), "Attribute xml:lang should not be present.");
+ String langAttr = selenium.getEval(getAttributeLang);
+ assertTrue("null".equals(langAttr) || "".equals(langAttr), "Attribute xml:lang should not be present.");
selenium.type(langInput, "sk");
selenium.waitForPageToLoad();
// lang = sk
- langAttr = element.getAttribute(new Attribute("lang"));
- assertTrue(selenium.isAttributePresent(langAttr), "Attribute xml:lang should be present.");
- assertEquals(selenium.getAttribute(langAttr), "sk", "Attribute xml:lang should be present.");
+ assertEquals(selenium.getEval(getAttributeLang), "sk", "Attribute xml:lang should be present.");
}
/**
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java 2011-01-10 11:53:42 UTC (rev 20928)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java 2011-01-10 13:38:07 UTC (rev 20929)
@@ -59,13 +59,15 @@
pjq("div[id$=item3:header]"), pjq("div[id$=item4:header]"), pjq("div[id$=item5:header]")};
private JQueryLocator[] itemContents = {pjq("div[id$=item1:content]"), pjq("div[id$=item2:content]"),
pjq("div[id$=item3:content]"), pjq("div[id$=item4:content]"), pjq("div[id$=item5:content]")};
- private JQueryLocator[] activeHeaders = {pjq("div.rf-ac-itm-hdr-act:eq(0)"), pjq("div.rf-ac-itm-hdr-act:eq(1)"),
- pjq("div.rf-ac-itm-hdr-act:eq(2)"), pjq("div.rf-ac-itm-hdr-act:eq(3)"), pjq("div.rf-ac-itm-hdr-act:eq(4)")};
- private JQueryLocator[] inactiveHeaders = {pjq("div.rf-ac-itm-hdr-inact:eq(0)"),
- pjq("div.rf-ac-itm-hdr-inact:eq(1)"), pjq("div.rf-ac-itm-hdr-inact:eq(2)"),
- pjq("div.rf-ac-itm-hdr-inact:eq(3)"), pjq("div.rf-ac-itm-hdr-inact:eq(4)")};
- private JQueryLocator[] disabledHeaders = {pjq("div.rf-ac-itm-hdr-dis:eq(0)"), pjq("div.rf-ac-itm-hdr-dis:eq(1)"),
- pjq("div.rf-ac-itm-hdr-dis:eq(2)"), pjq("div.rf-ac-itm-hdr-dis:eq(3)"), pjq("div.rf-ac-itm-hdr-dis:eq(4)")};
+ private JQueryLocator[] activeHeaders = {pjq("div[id$=item1:header] div.rf-ac-itm-lbl-act"),
+ pjq("div[id$=item2:header] div.rf-ac-itm-lbl-act"), pjq("div[id$=item3:header] div.rf-ac-itm-lbl-act"),
+ pjq("div[id$=item4:header] div.rf-ac-itm-lbl-act"), pjq("div[id$=item5:header] div.rf-ac-itm-lbl-act")};
+ private JQueryLocator[] inactiveHeaders = {pjq("div[id$=item1:header] div.rf-ac-itm-lbl-inact"),
+ pjq("div[id$=item2:header] div.rf-ac-itm-lbl-inact"), pjq("div[id$=item3:header] div.rf-ac-itm-lbl-inact"),
+ pjq("div[id$=item4:header] div.rf-ac-itm-lbl-inact"), pjq("div[id$=item5:header] div.rf-ac-itm-lbl-inact")};
+ private JQueryLocator[] disabledHeaders = {pjq("div[id$=item1:header] div.rf-ac-itm-lbl-dis"),
+ pjq("div[id$=item2:header] div.rf-ac-itm-lbl-dis"), pjq("div[id$=item3:header] div.rf-ac-itm-lbl-dis"),
+ pjq("div[id$=item4:header] div.rf-ac-itm-lbl-dis"), pjq("div[id$=item5:header] div.rf-ac-itm-lbl-dis")};
@Override
public URL getTestUrl() {
@@ -102,7 +104,7 @@
@Test
public void testSwitchTypeAjax() {
- selenium.click(pjq("input[type=radio][id$=switchTypeInput:0]"));
+ selenium.click(pjq("input[type=radio][name$=switchTypeInput][value=ajax]"));
selenium.waitForPageToLoad();
testSwitchTypeNull();
@@ -110,7 +112,7 @@
@Test
public void testSwitchTypeClient() {
- selenium.click(pjq("input[type=radio][id$=switchTypeInput:1]"));
+ selenium.click(pjq("input[type=radio][name$=switchTypeInput][value=client]"));
selenium.waitForPageToLoad();
for (int i = 2; i >= 0; i--) {
@@ -123,7 +125,7 @@
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-10040")
public void testSwitchTypeServer() {
- selenium.click(pjq("input[type=radio][id$=switchTypeInput:3]"));
+ selenium.click(pjq("input[type=radio][name$=switchTypeInput][value=server]"));
selenium.waitForPageToLoad();
for (int i = 2; i >= 0; i--) {
@@ -297,56 +299,17 @@
@Test
public void testItemHeaderClassActive() {
- selenium.type(pjq("input[id$=itemHeaderClassActiveInput]"), "metamer-ftest-class");
- selenium.waitForPageToLoad();
-
- for (JQueryLocator loc : activeHeaders) {
- assertTrue(selenium.belongsClass(loc, "metamer-ftest-class"), "itemHeaderClassActive does not work");
- }
-
- for (JQueryLocator loc : inactiveHeaders) {
- assertFalse(selenium.belongsClass(loc, "metamer-ftest-class"), "itemHeaderClassActive does not work");
- }
-
- for (JQueryLocator loc : disabledHeaders) {
- assertFalse(selenium.belongsClass(loc, "metamer-ftest-class"), "itemHeaderClassActive does not work");
- }
+ testStyleClass(activeHeaders[0], "itemHeaderClassActive");
}
@Test
public void testItemHeaderClassDisabled() {
- selenium.type(pjq("input[id$=itemHeaderClassDisabledInput]"), "metamer-ftest-class");
- selenium.waitForPageToLoad();
-
- for (JQueryLocator loc : activeHeaders) {
- assertFalse(selenium.belongsClass(loc, "metamer-ftest-class"), "itemHeaderClassDisabled does not work");
- }
-
- for (JQueryLocator loc : inactiveHeaders) {
- assertFalse(selenium.belongsClass(loc, "metamer-ftest-class"), "itemHeaderClassDisabled does not work");
- }
-
- for (JQueryLocator loc : disabledHeaders) {
- assertTrue(selenium.belongsClass(loc, "metamer-ftest-class"), "itemHeaderClassDisabled does not work");
- }
+ testStyleClass(disabledHeaders[3], "itemHeaderClassDisabled");
}
@Test
public void testItemHeaderClassInactive() {
- selenium.type(pjq("input[id$=itemHeaderClassInactiveInput]"), "metamer-ftest-class");
- selenium.waitForPageToLoad();
-
- for (JQueryLocator loc : activeHeaders) {
- assertFalse(selenium.belongsClass(loc, "metamer-ftest-class"), "itemHeaderClassInactive does not work");
- }
-
- for (JQueryLocator loc : inactiveHeaders) {
- assertTrue(selenium.belongsClass(loc, "metamer-ftest-class"), "itemHeaderClassInactive does not work");
- }
-
- for (JQueryLocator loc : disabledHeaders) {
- assertFalse(selenium.belongsClass(loc, "metamer-ftest-class"), "itemHeaderClassInactive does not work");
- }
+ testStyleClass(inactiveHeaders[1], "itemHeaderClassInactive");
}
@Test
@@ -381,7 +344,7 @@
String timeValue = selenium.getText(time);
- guardXhr(selenium).click(inactiveHeaders[1]);
+ guardXhr(selenium).click(itemHeaders[1]);
waitGui.failWith("Item 2 is not displayed.").until(isDisplayed.locator(itemContents[1]));
String newTime = selenium.getText(time);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordionItem/TestRichAccordionItem.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordionItem/TestRichAccordionItem.java 2011-01-10 11:53:42 UTC (rev 20928)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordionItem/TestRichAccordionItem.java 2011-01-10 13:38:07 UTC (rev 20929)
@@ -53,13 +53,15 @@
pjq("div[id$=item3:header]"), pjq("div[id$=item4:header]"), pjq("div[id$=item5:header]")};
private JQueryLocator[] itemContents = {pjq("div[id$=item1:content]"), pjq("div[id$=item2:content]"),
pjq("div[id$=item3:content]"), pjq("div[id$=item4:content]"), pjq("div[id$=item5:content]")};
- private JQueryLocator[] activeHeaders = {pjq("div.rf-ac-itm-hdr-act:eq(0)"), pjq("div.rf-ac-itm-hdr-act:eq(1)"),
- pjq("div.rf-ac-itm-hdr-act:eq(2)"), pjq("div.rf-ac-itm-hdr-act:eq(3)"), pjq("div.rf-ac-itm-hdr-act:eq(4)")};
- private JQueryLocator[] inactiveHeaders = {pjq("div.rf-ac-itm-hdr-inact:eq(0)"),
- pjq("div.rf-ac-itm-hdr-inact:eq(1)"), pjq("div.rf-ac-itm-hdr-inact:eq(2)"),
- pjq("div.rf-ac-itm-hdr-inact:eq(3)"), pjq("div.rf-ac-itm-hdr-inact:eq(4)")};
- private JQueryLocator[] disabledHeaders = {pjq("div.rf-ac-itm-hdr-dis:eq(0)"), pjq("div.rf-ac-itm-hdr-dis:eq(1)"),
- pjq("div.rf-ac-itm-hdr-dis:eq(2)"), pjq("div.rf-ac-itm-hdr-dis:eq(3)"), pjq("div.rf-ac-itm-hdr-dis:eq(4)")};
+ private JQueryLocator[] activeHeaders = {pjq("div[id$=item1:header] div.rf-ac-itm-lbl-act"),
+ pjq("div[id$=item2:header] div.rf-ac-itm-lbl-act"), pjq("div[id$=item3:header] div.rf-ac-itm-lbl-act"),
+ pjq("div[id$=item4:header] div.rf-ac-itm-lbl-act"), pjq("div[id$=item5:header] div.rf-ac-itm-lbl-act")};
+ private JQueryLocator[] inactiveHeaders = {pjq("div[id$=item1:header] div.rf-ac-itm-lbl-inact"),
+ pjq("div[id$=item2:header] div.rf-ac-itm-lbl-inact"), pjq("div[id$=item3:header] div.rf-ac-itm-lbl-inact"),
+ pjq("div[id$=item4:header] div.rf-ac-itm-lbl-inact"), pjq("div[id$=item5:header] div.rf-ac-itm-lbl-inact")};
+ private JQueryLocator[] disabledHeaders = {pjq("div[id$=item1:header] div.rf-ac-itm-lbl-dis"),
+ pjq("div[id$=item2:header] div.rf-ac-itm-lbl-dis"), pjq("div[id$=item3:header] div.rf-ac-itm-lbl-dis"),
+ pjq("div[id$=item4:header] div.rf-ac-itm-lbl-dis"), pjq("div[id$=item5:header] div.rf-ac-itm-lbl-dis")};
@Override
public URL getTestUrl() {
@@ -107,7 +109,7 @@
selenium.type(pjq("input[id$=headerInput]"), "new header");
selenium.waitForPageToLoad();
- String header = selenium.getText(itemHeaders[0]);
+ String header = selenium.getText(activeHeaders[0]);
assertEquals(header, "new header", "Header of item1 did not change.");
}
@@ -129,10 +131,10 @@
@Test
public void testHeaderClassDisabled() {
+ selenium.click(pjq("input[type=radio][name$=disabledInput][value=true]"));
+ selenium.waitForPageToLoad();
+
testStyleClass(disabledHeaders[0], "headerClassDisabled");
- assertFalse(selenium.belongsClass(disabledHeaders[1], "metamer-ftest-class"), "headerClassDisabled should be set only on first item");
- assertFalse(selenium.belongsClass(disabledHeaders[2], "metamer-ftest-class"), "headerClassDisabled should be set only on first item");
- assertFalse(selenium.belongsClass(disabledHeaders[3], "metamer-ftest-class"), "headerClassDisabled should be set only on first item");
}
@Test
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java 2011-01-10 11:53:42 UTC (rev 20928)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java 2011-01-10 13:38:07 UTC (rev 20929)
@@ -24,7 +24,6 @@
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardNoRequest;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
-import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
13 years, 11 months
JBoss Rich Faces SVN: r20928 - trunk/ui/iteration/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2011-01-10 06:53:42 -0500 (Mon, 10 Jan 2011)
New Revision: 20928
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractList.java
Log:
RF-10126 rich:list: provide default value for type attribute.
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractList.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractList.java 2011-01-10 10:29:55 UTC (rev 20927)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractList.java 2011-01-10 11:53:42 UTC (rev 20928)
@@ -72,7 +72,7 @@
return getFacetsIterator(NON_TERM_PREDICATE);
}
- @Attribute(required = true)
+ @Attribute(defaultValue = "ListType.unordered")
public abstract ListType getType();
public UIComponent getTerm() {
13 years, 11 months
JBoss Rich Faces SVN: r20927 - in trunk: cdk/generator/src/main/java/org/richfaces/cdk/apt and 14 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2011-01-10 05:29:55 -0500 (Mon, 10 Jan 2011)
New Revision: 20927
Added:
trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/JsfSubComponent.java
Modified:
trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/Event.java
trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehavior.java
trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java
trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java
trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfRenderer.java
trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfValidator.java
trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/RendererSpecificComponent.java
trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/TagType.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/ReflectionUtils.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/SourceUtils.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/BehaviorProcessor.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/ConverterProcessor.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/DescriptionProcessor.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/DescriptionProcessorImpl.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/EventProcessor.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/FunctionProcessor.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/ValidatorProcessor.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/freemarker/FreeMarkerWriter.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/freemarker/LibraryModelWrapper.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/freemarker/ModelElementBaseTemplateModel.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroup.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroupBase.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/EventModel.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/DescriptionGroupBean.java
trunk/cdk/generator/src/test/java/org/richfaces/cdk/apt/AptSourceUtilsAnnotationsTest.java
trunk/cdk/generator/src/test/java/org/richfaces/cdk/apt/processors/BehaviorProcessorTest.java
trunk/cdk/generator/src/test/java/org/richfaces/cdk/apt/processors/ComponentProcessorTest.java
trunk/cdk/generator/src/test/java/org/richfaces/cdk/apt/processors/DescriptionProcessorTest.java
trunk/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
trunk/cdk/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java
trunk/cdk/generator/src/test/java/org/richfaces/cdk/xmlconfig/FragmentParserTest.java
trunk/cdk/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
trunk/ui/core/ui/src/main/java/org/richfaces/component/UIRepeat.java
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/DrowDownMenuRendererTest.java
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/MenuItemRendererTest.java
Log:
Revert: RESOLVED - issue RF-10093: https://issues.jboss.org/browse/RF-10093
Modified: trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/Event.java
===================================================================
--- trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/Event.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/Event.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -23,8 +23,6 @@
package org.richfaces.cdk.annotations;
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
@@ -52,18 +50,13 @@
public static final String NAME = "org.richfaces.cdk.annotations.Event";
/**
- * <p class="changed_added_4_0">Used in the {@link JsfComponent} only, to define event type.</p>
- * @return
- */
- public Class<? extends FacesEvent> value() default DEFAULT.class;
- /**
* <p class="changed_added_4_0">
- * The listener interface class that process annotated event.
+ * The listener interface class that process annotated event. This is mandatory parameter.
* </p>
*
* @return name of listener interface
*/
- public Class<? extends FacesListener> listener() default DEFAULT_LISTENER.class;
+ public Class<? extends FacesListener> listener();
/**
* <p class="changed_added_4_0">Name for the listener interface method that process annotated event type.</p>
@@ -89,24 +82,4 @@
*/
public Tag[] tag() default {};
- @SuppressWarnings("serial")
- static final class DEFAULT extends FacesEvent {
-
- public DEFAULT(UIComponent component) {
- super(component);
- }
-
- @Override
- public boolean isAppropriateListener(FacesListener listener) {
- return false;
- }
-
- @Override
- public void processListener(FacesListener listener) {
- }
- }
-
- static final class DEFAULT_LISTENER implements FacesListener {
-
- }
}
Modified: trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehavior.java
===================================================================
--- trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehavior.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehavior.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -52,7 +52,7 @@
public String generate() default "";
- public Tag[] tag() default {};
+ public Tag tag() default @Tag;
public JsfBehaviorRenderer renderer() default @JsfBehaviorRenderer();
/**
@@ -77,13 +77,4 @@
* @return
*/
public String[] attributes() default {};
-
- /**
- * <p class="changed_added_4_0">
- * Interfaces that should be implemented in the generated class. CDK processes all {@link Attribute} annotations in these interfaces
- * </p>
- *
- * @return
- */
- public Class<?>[] interfaces() default {};
}
Modified: trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java
===================================================================
--- trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -134,7 +134,7 @@
*
* @return
*/
- public Event[] fires() default {};
+ public Class<? extends FacesEvent>[] fires() default {};
/**
* <p class="changed_added_4_0">
Modified: trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java
===================================================================
--- trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -56,7 +56,7 @@
*/
public Description description() default @Description();
- public Tag[] tag() default {};
+ public Tag tag() default @Tag;
public static final class NONE {}
@@ -72,13 +72,5 @@
* @return
*/
public String[] attributes() default {};
- /**
- * <p class="changed_added_4_0">
- * Interfaces that should be implemented in the generated class. CDK processes all {@link Attribute} annotations in these interfaces
- * </p>
- *
- * @return
- */
- public Class<?>[] interfaces() default {};
}
Modified: trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfRenderer.java
===================================================================
--- trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfRenderer.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfRenderer.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -58,13 +58,6 @@
* @return
*/
public String family() default "";
-
-
- /**
- * <p class="changed_added_4_0">Name of generated renderer class.</p>
- * @return
- */
- public String generate() default "";
/**
* <p class="changed_added_4_0">RenderKit for which this renderer is belong to</p>
Modified: trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfValidator.java
===================================================================
--- trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfValidator.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/JsfValidator.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -19,7 +19,7 @@
public String generate() default "";
- public Tag[] tag() default {};
+ public Tag tag() default @Tag;
/**
* <p class="changed_added_4_0">
* Description used by IDE.
@@ -41,13 +41,4 @@
* @return
*/
public String[] attributes() default {};
- /**
- * <p class="changed_added_4_0">
- * Interfaces that should be implemented in the generated class. CDK processes all {@link Attribute} annotations in these interfaces
- * </p>
- *
- * @return
- */
- public Class<?>[] interfaces() default {};
-
}
Modified: trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/RendererSpecificComponent.java
===================================================================
--- trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/RendererSpecificComponent.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/RendererSpecificComponent.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -129,13 +129,5 @@
* @return
*/
public Class<?>[] interfaces() default {};
- /**
- * <p class="changed_added_4_0">
- * Events fired by the component.
- * </p>
- *
- * @return
- */
- public Event[] fires() default {};
}
Modified: trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/TagType.java
===================================================================
--- trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/TagType.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/annotations/src/main/java/org/richfaces/cdk/annotations/TagType.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -28,19 +28,16 @@
*/
public enum TagType {
/**
- * <p class="changed_added_4_0">
- * Defines JSP tag.
- * </p>
- */
+ * <p class="changed_added_4_0">Do not generate any tags, this is default value for {@link Tag#type()} annotation.</p>
+ */
+ None, /**
+ * <p class="changed_added_4_0">Defines JSP tag.</p>
+ */
Jsp, /**
- * <p class="changed_added_4_0">
- * Defines Facelets tag.
- * </p>
- */
+ * <p class="changed_added_4_0">Defines Facelets tag.</p>
+ */
Facelets, /**
- * <p class="changed_added_4_0">
- * Enforces tag annotation to generate all known tag types
- * </p>
- */
+ * <p class="changed_added_4_0">Enforces tag annotation to generate all known tag types</p>
+ */
All
}
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -25,7 +25,6 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.Logger;
import org.richfaces.cdk.model.ClassName;
-import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.util.PropertyUtils;
import com.google.common.base.Predicate;
@@ -161,7 +160,7 @@
AptBeanProperty beanProperty = result.get(propertyName);
checkPropertyType(type, propertyName, propertyType, beanProperty);
if (null != (setter?beanProperty.setter:beanProperty.getter)) {
- log.debug("Two " + (setter ? "setter" : "getter") + " methods for the same bean property "
+ log.warn("Two " + (setter ? "setter" : "getter") + " methods for the same bean property "
+ propertyName + " in the class " + type.getQualifiedName());
if(!method.getModifiers().contains(Modifier.ABSTRACT)){
beanProperty.setAccessMethod(method, setter);
@@ -279,11 +278,8 @@
VariableElement variable = (VariableElement) annotationValue.getValue();
return (T) Enum.valueOf((Class<? extends Enum>) expectedType, variable.getSimpleName().toString());
} else if (ClassName.class.equals(expectedType)) {
- Object value = annotationValue.getValue();
+ TypeMirror value = (TypeMirror) annotationValue.getValue();
return (T) ClassName.get(value.toString());
- } else if (FacesId.class.equals(expectedType)) {
- String value = (String) annotationValue.getValue();
- return (T) FacesId.parseId(value);
} else if (AnnotationMirror.class.isAssignableFrom(expectedType)) {
AnnotationMirror value = (AnnotationMirror) annotationValue.getValue();
return (T) value;
@@ -294,7 +290,7 @@
@SuppressWarnings("unchecked")
@Override
- public <T> Iterable<T> getAnnotationValues(AnnotationMirror annotation, String propertyName, Class<T> expectedType) {
+ public <T> List<T> getAnnotationValues(AnnotationMirror annotation, String propertyName, Class<T> expectedType) {
Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> attributeEntry =
findAnnotationProperty(annotation, propertyName);
List<? extends AnnotationValue> annotationValues =
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/ReflectionUtils.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/ReflectionUtils.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/ReflectionUtils.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -24,6 +24,7 @@
package org.richfaces.cdk.apt;
import java.lang.annotation.Annotation;
+import java.util.List;
import java.util.Set;
import javax.lang.model.element.AnnotationMirror;
@@ -112,7 +113,7 @@
}
@Override
- public <T> Iterable<T> getAnnotationValues(AnnotationMirror annotation, String propertyName, Class<T> expectedType) {
+ public <T> List<T> getAnnotationValues(AnnotationMirror annotation, String propertyName, Class<T> expectedType) {
// TODO Auto-generated method stub
return null;
}
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/SourceUtils.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/SourceUtils.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/SourceUtils.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -24,6 +24,7 @@
package org.richfaces.cdk.apt;
import java.lang.annotation.Annotation;
+import java.util.List;
import java.util.Set;
import javax.lang.model.element.AnnotationMirror;
@@ -199,7 +200,7 @@
* @param propertyName
* @return
*/
- <T> Iterable<T> getAnnotationValues(AnnotationMirror annotation, String propertyName, Class<T> expectedType);
+ <T> List<T> getAnnotationValues(AnnotationMirror annotation, String propertyName, Class<T> expectedType);
/**
* <p class="changed_added_4_0"></p>
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -23,7 +23,6 @@
import org.richfaces.cdk.xmlconfig.CdkEntityResolver;
import org.richfaces.cdk.xmlconfig.FragmentParser;
-import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -84,20 +83,19 @@
}
} else {
SourceUtils utils = utilsProvider.get();
- utils.setModelProperty(attribute, attributeAnnotarion, "hidden");
- utils.setModelProperty(attribute, attributeAnnotarion, "literal");
- utils.setModelProperty(attribute, attributeAnnotarion, "passThrough");
- utils.setModelProperty(attribute, attributeAnnotarion, "required");
- utils.setModelProperty(attribute, attributeAnnotarion, "readOnly");
+ utils.setModelProperty(attribute, attributeAnnotarion, "hidden");
+ utils.setModelProperty(attribute, attributeAnnotarion, "literal");
+ utils.setModelProperty(attribute, attributeAnnotarion, "passThrough");
+ utils.setModelProperty(attribute, attributeAnnotarion, "required");
+ utils.setModelProperty(attribute, attributeAnnotarion, "readOnly");
if (!utils.isDefaultValue(attributeAnnotarion, "generate")) {
attribute.setGenerate(utils.getAnnotationValue(attributeAnnotarion, "generate", boolean.class));
} else {
attribute.setGenerate(!beanProperty.isExists());
}
- descriptionProcessor.processDescription(attribute,
- utils.getAnnotationValue(attributeAnnotarion, "description", AnnotationMirror.class),
- beanProperty.getDocComment());
+ descriptionProcessor.processDescription(attribute, beanProperty.getAnnotation(Attribute.class).description(), beanProperty
+ .getDocComment());
setDefaultValue(attribute, attributeAnnotarion);
@@ -106,13 +104,13 @@
// MethodExpression call signature.
attribute.setSignature(getSignature(attributeAnnotarion));
- for (AnnotationMirror event : utils.getAnnotationValues(attributeAnnotarion, "events",
- AnnotationMirror.class)) {
+ for (AnnotationMirror event : utils.getAnnotationValues(attributeAnnotarion, "events", AnnotationMirror.class)){
setBehaviorEvent(attribute, event);
}
}
}
+
private void setDefaultValue(PropertyBase attribute, AnnotationMirror attributeAnnotarion) {
SourceUtils utils = utilsProvider.get();
String defaultValue;
@@ -167,8 +165,8 @@
if (!SIGNATURE_NONE_CLASS_NAME.equals(returnType)) {
MethodSignature methodSignature = new MethodSignature();
- methodSignature.setParameters(Lists.newArrayList(utils.getAnnotationValues(signatureAnnotation, "parameters",
- ClassName.class)));
+ methodSignature.setParameters(utils.getAnnotationValues(signatureAnnotation, "parameters",
+ ClassName.class));
methodSignature.setReturnType(returnType);
return methodSignature;
}
@@ -176,6 +174,7 @@
return null;
}
+
private void setBehaviorEvent(PropertyBase attribute, AnnotationMirror eventMirror) {
if (null != eventMirror) {
SourceUtils utils = utilsProvider.get();
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/BehaviorProcessor.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/BehaviorProcessor.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/BehaviorProcessor.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -26,15 +26,14 @@
import java.lang.annotation.Annotation;
import javax.annotation.processing.SupportedAnnotationTypes;
-import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import org.richfaces.cdk.CdkProcessingException;
import org.richfaces.cdk.annotations.JsfBehavior;
-import org.richfaces.cdk.apt.SourceUtils;
import org.richfaces.cdk.model.BehaviorModel;
import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.FacesId;
/**
* <p class="changed_added_4_0"></p>
@@ -46,17 +45,17 @@
@Override
public void process(Element element, ComponentLibrary library) throws CdkProcessingException {
- SourceUtils sourceUtils = getSourceUtils();
- AnnotationMirror behavior = sourceUtils.getAnnotationMirror(element, JsfBehavior.class);
+ JsfBehavior behavior = element.getAnnotation(JsfBehavior.class);
- BehaviorModel behaviorModel = new BehaviorModel();
-
- sourceUtils.setModelProperty(behaviorModel, behavior, "id");
- setClassNames((TypeElement) element, behaviorModel, behavior);
+ BehaviorModel behaviorModel = new BehaviorModel(new FacesId(behavior.id()));
+ setClassNames((TypeElement) element, behaviorModel, behavior.generate());
- setTagInfo(behavior, behaviorModel);
- processAttributes((TypeElement) element, behaviorModel, behavior);
- setDescription(behaviorModel, behavior, getDocComment(element));
+ setTagInfo(behavior.tag(), behaviorModel);
+ AttributesProcessor attributesProcessor = getAttributeProcessor();
+ attributesProcessor.processXmlFragment(behaviorModel, behavior.attributes());
+ attributesProcessor.processType(behaviorModel, (TypeElement) element);
+ setDescription(behaviorModel, behavior.description(), getDocComment(element));
+
library.getBehaviors().add(behaviorModel);
}
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -24,24 +24,36 @@
package org.richfaces.cdk.apt.processors;
import java.lang.annotation.Annotation;
+import java.util.Collection;
+import java.util.List;
import java.util.Set;
-import javax.lang.model.element.AnnotationMirror;
+import javax.faces.event.FacesEvent;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
+import javax.lang.model.type.MirroredTypeException;
+import javax.lang.model.type.MirroredTypesException;
+import javax.lang.model.type.TypeKind;
+import javax.lang.model.type.TypeMirror;
import org.richfaces.cdk.CdkException;
+import org.richfaces.cdk.Logger;
import org.richfaces.cdk.annotations.Facet;
import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.RendererSpecificComponent;
+import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.apt.SourceUtils;
import org.richfaces.cdk.apt.SourceUtils.BeanProperty;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ComponentModel;
-import org.richfaces.cdk.model.EventModel;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.FacetModel;
+import org.richfaces.cdk.util.Strings;
+import com.google.inject.Inject;
+
/**
* <p class="changed_added_4_0">
* That class process component-related annotations such as {@link org.richfaces.cdk.annotations.JsfComponent} or
@@ -57,32 +69,32 @@
public static final String COMPONENT_TYPE = "COMPONENT_TYPE";
+ @Inject
+ private Logger log;
+
public void process(Element componentElement, ComponentLibrary library) {
- SourceUtils sourceUtils = getSourceUtils();
- if (sourceUtils.isAnnotationPresent(componentElement, JsfComponent.class)) {
- AnnotationMirror annotation = sourceUtils.getAnnotationMirror(componentElement, JsfComponent.class);
- // Process class-level annotations.
- ComponentModel component = new ComponentModel();
+ final JsfComponent annotation = componentElement.getAnnotation(JsfComponent.class);
+ if (annotation == null) {
+ return;
+ }
- // Should that component be generated ?
- setClassNames((TypeElement) componentElement, component, annotation);
- setComponentProperties((TypeElement) componentElement, component, annotation);
+ // Process class-level annotations.
+ ComponentModel component = new ComponentModel();
- library.getComponents().add(component);
+ // Should that component be generated ?
+ setClassNames((TypeElement) componentElement, component, annotation.generate());
+ setComponentProperties((TypeElement) componentElement, component, annotation);
+ library.getComponents().add(component);
- // Process the second level annotations.
- for (AnnotationMirror subcomponent : sourceUtils.getAnnotationValues(annotation, "components",
- AnnotationMirror.class)) {
- ComponentModel subcomponentModel = new ComponentModel();
- subcomponentModel.setBaseClass(component.getTargetClass());
- if (!sourceUtils.isDefaultValue(subcomponent, "generate")) {
- subcomponentModel.setTargetClass(sourceUtils.getAnnotationValue(subcomponent, "generate",
- ClassName.class));
- subcomponentModel.setGenerate(true);
- }
- setComponentProperties(null, subcomponentModel, subcomponent);
- library.getComponents().add(subcomponentModel);
- }
+ // Process the second level annotations.
+ for (final RendererSpecificComponent subcomponent : annotation.components()) {
+ JsfComponent subAnnotation = new JsfSubComponent(subcomponent, annotation);
+ ComponentModel subcomponentModel = new ComponentModel();
+ subcomponentModel.setBaseClass(component.getTargetClass());
+ subcomponentModel.setTargetClass(ClassName.parseName(subcomponent.generate()));
+ subcomponentModel.setGenerate(!Strings.isEmpty(subcomponent.generate()));
+ setComponentProperties(null, subcomponentModel, subAnnotation);
+ library.getComponents().add(subcomponentModel);
}
}
@@ -96,48 +108,91 @@
* @param annotation
* @throws CdkException
*/
- void setComponentProperties(TypeElement componentElement, ComponentModel component, AnnotationMirror annotation)
+ void setComponentProperties(TypeElement componentElement, ComponentModel component, JsfComponent annotation)
throws CdkException {
- SourceUtils sourceUtils = getSourceUtils();
- setComponentType(componentElement, component, annotation);
- setComponeneFamily(componentElement, component, annotation);
- setDescription(component, annotation, getDocComment(componentElement));
- if (!sourceUtils.isDefaultValue(annotation, "renderer")) {
- setRendererType(component, sourceUtils.getAnnotationValue(annotation, "renderer", AnnotationMirror.class));
- }
+ setComponentType(componentElement, component, annotation.type());
+ setComponeneFamily(componentElement, component, annotation.family());
+ setDescription(component, annotation.description(), getDocComment(componentElement));
+ setRendererType(component, annotation.renderer());
+
processFacets(componentElement, component, annotation);
processAttributes(componentElement, component, annotation);
processEvents(componentElement, component, annotation);
- setTagInfo(annotation, component);
+ for (Tag tag : annotation.tag()) {
+ setTagInfo(tag, component);
+ }
// TODO - process @Test annotations.
}
- private void setRendererType(ComponentModel component, AnnotationMirror annotation) {
- SourceUtils sourceUtils = getSourceUtils();
- if (!sourceUtils.isDefaultValue(annotation, "type")) {
- component.setRendererType(sourceUtils.getAnnotationValue(annotation, "type", FacesId.class));
+ private void setRendererType(ComponentModel component, JsfRenderer jsfRenderer) {
+ if(!Strings.isEmpty(jsfRenderer.type())){
+ component.setRendererType(FacesId.parseId(jsfRenderer.type()));
}
- if (!sourceUtils.isDefaultValue(annotation, "template")) {
- component.setRendererTemplate(sourceUtils.getAnnotationValue(annotation, "template", String.class));
+ if(!Strings.isEmpty(jsfRenderer.template())){
+ component.setRendererTemplate(jsfRenderer.template());
}
}
- void setComponentType(TypeElement componentElement, ComponentModel component, AnnotationMirror annotation) {
- component.setId(FacesId.parseId(getAnnotationPropertyOrConstant(componentElement, annotation,"type",COMPONENT_TYPE)));
+ private void processAttributes(TypeElement componentElement, ComponentModel component, JsfComponent annotation) {
+ AttributesProcessor attributesProcessor = getAttributeProcessor();
+ attributesProcessor.processXmlFragment(component, annotation.attributes());
+
+ if (componentElement != null) {
+ attributesProcessor.processType(component, componentElement);
+ }
+
+ Collection<ClassName> interfaceNames = component.getInterfaces();
+ try {
+ Class<?>[] interfaces = annotation.interfaces();
+ for (Class<?> clazz : interfaces) {
+ interfaceNames.add(new ClassName(clazz));
+ }
+ } catch (MirroredTypesException e) {
+ List<? extends TypeMirror> typeMirrors = e.getTypeMirrors();
+ for (TypeMirror mirror : typeMirrors) {
+ processInterface(component, attributesProcessor, mirror);
+ }
+ } catch (MirroredTypeException e) {
+ processInterface(component, attributesProcessor, e.getTypeMirror());
+ }
}
- final void processFacets(TypeElement componentElement, ComponentModel component, AnnotationMirror annotation) {
- SourceUtils sourceUtils = getSourceUtils();
+ private void processInterface(ComponentModel component, AttributesProcessor attributesProcessor, TypeMirror mirror) {
+ component.getInterfaces().add(ClassName.parseName(mirror.toString()));
+ if (TypeKind.DECLARED.equals(mirror.getKind())) {
+ attributesProcessor.processType(component, getSourceUtils().asTypeElement(mirror));
+ } else {
+ // TODO - record warning.
+ }
+ }
+
+ void setComponentType(TypeElement componentElement, ComponentModel component, String type) {
+ if (!Strings.isEmpty(type)) {
+ component.setId(FacesId.parseId(type));
+ } else if (null != componentElement) {
+
+ // static final String COMPONENT_FAMILY = "...";
+ Object value = getSourceUtils().getConstant(componentElement, COMPONENT_TYPE);
+ if (value != null) {
+ component.setId(FacesId.parseId(value.toString()));
+ }
+ }
+ }
+
+ final void processFacets(TypeElement componentElement, ComponentModel component, JsfComponent annotation) {
if (null != componentElement) {
+ SourceUtils sourceUtils = getSourceUtils();
Set<BeanProperty> properties = sourceUtils.getBeanPropertiesAnnotatedWith(Facet.class, componentElement);
// TODO - encapsulate attribute builder into utility class.
for (BeanProperty beanProperty : properties) {
- AnnotationMirror facet = beanProperty.getAnnotationMirror(Facet.class);
+ Facet facet = beanProperty.getAnnotation(Facet.class);
FacetModel facetModel = component.getOrCreateFacet(beanProperty.getName());
+
facetModel.setDescription(beanProperty.getDocComment());
+
processFacet(facet, facetModel, beanProperty.getDocComment());
if (!beanProperty.isExists()) {
facetModel.setGenerate(true);
@@ -145,42 +200,57 @@
}
}
- for (AnnotationMirror facet : sourceUtils.getAnnotationValues(annotation, "facets", AnnotationMirror.class)) {
- if (!sourceUtils.isDefaultValue(facet, "name")) {
- String name = sourceUtils.getAnnotationValue(facet, "name", String.class);
+ for (Facet facet : annotation.facets()) {
+ String name = facet.name();
+ if (!Strings.isEmpty(name)) {
FacetModel facetModel = component.getOrCreateFacet(name);
processFacet(facet, facetModel, null);
} else {
+ // TODO - record error.
throw new CdkException("Facet name should be set");
}
}
}
- final void processFacet(AnnotationMirror facet, FacetModel facetModel, String docComment) {
- SourceUtils sourceUtils = getSourceUtils();
- if (!sourceUtils.isDefaultValue(facet, "description")) {
- setDescription(facetModel, facet, docComment);
- }
- if (!sourceUtils.isDefaultValue(facet, "generate")) {
- facetModel.setGenerate(sourceUtils.getAnnotationValue(facet, "generate", Boolean.class));
- }
+ final void processFacet(Facet facet, FacetModel facetModel, String docComment) {
+ setDescription(facetModel, facet.description(), docComment);
+ facetModel.setGenerate(facet.generate());
}
- final void setComponeneFamily(TypeElement componentElement, ComponentModel component, AnnotationMirror annotation) {
- if(null != componentElement){
- component.setFamily(FacesId.parseId(getAnnotationPropertyOrConstant(componentElement, annotation,"family",COMPONENT_FAMILY)));
+ final void setComponeneFamily(TypeElement componentElement, ComponentModel component, String family) {
+ if (!Strings.isEmpty(family)) {
+ component.setFamily(FacesId.parseId(family));
+ } else if (null != componentElement) {
+ // static final String COMPONENT_FAMILY = "...";
+ Object value = getSourceUtils().getConstant(componentElement, COMPONENT_FAMILY);
+ if (null != value) {
+ component.setFamily(FacesId.parseId(value.toString()));
+ }
}
}
- final void processEvents(TypeElement componentElement, ComponentModel component, AnnotationMirror annotation) {
- SourceUtils sourceUtils = getSourceUtils();
- for (AnnotationMirror event : sourceUtils.getAnnotationValues(annotation, "fires", AnnotationMirror.class)) {
- EventModel model = new EventModel();
- sourceUtils.setModelProperty(model, event, "type", "value");
- sourceUtils.setModelProperty(model, event, "listenerInterface", "listener");
- sourceUtils.setModelProperty(model, event, "listenerMethod");
- sourceUtils.setModelProperty(model, event, "sourceInterface", "source");
- component.getEvents().add(model);
+ final void processEvents(TypeElement componentElement, ComponentModel component, JsfComponent annotation) {
+ try {
+ Class<? extends FacesEvent>[] fires = annotation.fires();
+
+ for (Class<? extends FacesEvent> event : fires) {
+ try {
+ component.addEvent(event.getName());
+ } catch (MirroredTypesException mirror) {
+ for (TypeMirror eventType : mirror.getTypeMirrors()) {
+ component.addEvent(eventType.toString());
+ }
+ } catch (MirroredTypeException mirror) {
+ component.addEvent(mirror.getTypeMirror().toString());
+ }
+
+ }
+ } catch (MirroredTypesException mirror) {
+ for (TypeMirror eventType : mirror.getTypeMirrors()) {
+ component.addEvent(eventType.toString());
+ }
+ } catch (MirroredTypeException mirror) {
+ component.addEvent(mirror.getTypeMirror().toString());
}
}
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/ConverterProcessor.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/ConverterProcessor.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/ConverterProcessor.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -24,14 +24,16 @@
import java.lang.annotation.Annotation;
import javax.annotation.processing.SupportedAnnotationTypes;
-import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.type.MirroredTypeException;
import org.richfaces.cdk.CdkProcessingException;
import org.richfaces.cdk.annotations.JsfConverter;
-import org.richfaces.cdk.apt.SourceUtils;
+import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConverterModel;
+import org.richfaces.cdk.model.FacesId;
/**
* @author akolonitsky
@@ -42,16 +44,32 @@
@Override
public void process(Element element, ComponentLibrary library) throws CdkProcessingException {
- SourceUtils sourceUtils = getSourceUtils();
- AnnotationMirror converter = sourceUtils.getAnnotationMirror(element, JsfConverter.class);
+ JsfConverter converter = element.getAnnotation(JsfConverter.class);
ConverterModel converterModel = new ConverterModel();
- sourceUtils.setModelProperty(converterModel, converter, "id");
- sourceUtils.setModelProperty(converterModel, converter, "converterForClass","forClass");
+ converterModel.setId(FacesId.parseId(converter.id()));
- setDescription(converterModel, converter, getDocComment(element));
- processAttributes(element, converterModel, converter);
- setTagInfo(converter, converterModel);
+ try {
+ Class<?> forClass = converter.forClass();
+ if (!JsfConverter.NONE.class.equals(forClass)) {
+ converterModel.setConverterForClass(new ClassName(forClass.getName()));
+ }
+ } catch (MirroredTypeException e) {
+ String name = e.getTypeMirror().toString();
+ if (!JsfConverter.NONE.class.getName().equals(name)) {
+ converterModel.setConverterForClass(new ClassName(name));
+ }
+ }
+
+ setDescription(converterModel, converter.description(), getDocComment(element));
+
+ AttributesProcessor attributesProcessor = getAttributeProcessor();
+ attributesProcessor.processXmlFragment(converterModel, converter.attributes());
+ attributesProcessor.processType(converterModel, (TypeElement) element);
+ setClassNames((TypeElement) element, converterModel, converter.generate());
+
+ setTagInfo(converter.tag(), converterModel);
+
library.getConverters().add(converterModel);
}
@@ -59,4 +77,11 @@
public Class<? extends Annotation> getProcessedAnnotation() {
return JsfConverter.class;
}
+
+
+ protected String[] getAnnotationAttributes(TypeElement element) {
+ JsfConverter converter = element.getAnnotation(JsfConverter.class);
+
+ return converter.attributes();
+ }
}
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/DescriptionProcessor.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/DescriptionProcessor.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/DescriptionProcessor.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -23,8 +23,7 @@
package org.richfaces.cdk.apt.processors;
-import javax.lang.model.element.AnnotationMirror;
-
+import org.richfaces.cdk.annotations.Description;
import org.richfaces.cdk.model.DescriptionGroup;
/**
@@ -37,15 +36,15 @@
/**
* <p class="changed_added_4_0">process {@link Description} annotation and set information from it into model. Optional string from the JavaDoc comment has precedence over {@link Desription#value()} attribute.</p>
* @param model
- * @param annotation
+ * @param description
* @param docComment JavaDoc comment associated with described element.
*/
- public void processDescription(DescriptionGroup model, AnnotationMirror annotation, String docComment);
+ public void processDescription(DescriptionGroup model, Description description, String docComment);
/**
* <p class="changed_added_4_0">process {@link Description} annotation and set information from it into model.</p>
* @param model
* @param description
*/
- public void processDescription(DescriptionGroup model, AnnotationMirror description);
+ public void processDescription(DescriptionGroup model, Description description);
}
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/DescriptionProcessorImpl.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/DescriptionProcessorImpl.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/DescriptionProcessorImpl.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -23,56 +23,51 @@
package org.richfaces.cdk.apt.processors;
-import javax.lang.model.element.AnnotationMirror;
-
-import org.richfaces.cdk.apt.SourceUtils;
+import org.richfaces.cdk.annotations.Description;
import org.richfaces.cdk.model.DescriptionGroup;
import org.richfaces.cdk.util.Strings;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
/**
- * <p class="changed_added_4_0">
- * </p>
- *
+ * <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
*/
public class DescriptionProcessorImpl implements DescriptionProcessor {
- private final Provider<SourceUtils> utilsProvider;
-
- @Inject
- public DescriptionProcessorImpl(Provider<SourceUtils> utilsProvider) {
- this.utilsProvider = utilsProvider;
- }
-
@Override
- public void processDescription(DescriptionGroup model, AnnotationMirror description, String docComment) {
+ public void processDescription(DescriptionGroup model, Description description, String docComment) {
if (!Strings.isEmpty(docComment)) {
model.setDescription(docComment);
}
if (description != null) {
- SourceUtils utils = utilsProvider.get();
setIcon(model, description);
- utils.setModelProperty(model, description, "displayName");
- utils.setModelProperty(model, description, "description","value");
+ if (!Strings.isEmpty(description.displayName())) {
+ model.setDisplayname(description.displayName());
+ }
+ if (!Strings.isEmpty(description.value())) {
+ model.setDescription(description.value());
+ }
}
}
@Override
- public void processDescription(DescriptionGroup model, AnnotationMirror description) {
+ public void processDescription(DescriptionGroup model, Description description) {
processDescription(model, description, null);
}
- protected void setIcon(DescriptionGroup component, AnnotationMirror description) {
- SourceUtils utils = utilsProvider.get();
- if (null != description
- && (!utils.isDefaultValue(description, "smallIcon") || !utils.isDefaultValue(description, "largeIcon"))) {
+ protected void setIcon(DescriptionGroup component, Description icon) {
+ if (null != icon && (!Strings.isEmpty(icon.smallIcon()) || !Strings.isEmpty(icon.largeIcon()))) {
DescriptionGroup.Icon iconValue = new DescriptionGroup.Icon();
- utils.setModelProperty(iconValue, description, "smallIcon");
- utils.setModelProperty(iconValue, description, "largeIcon");
+
+ if (!Strings.isEmpty(icon.smallIcon())) {
+ iconValue.setSmallIcon(icon.smallIcon());
+ }
+
+ if (!Strings.isEmpty(icon.largeIcon())) {
+ iconValue.setLargeIcon(icon.largeIcon());
+ }
+
component.setIcon(iconValue);
}
}
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/EventProcessor.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/EventProcessor.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/EventProcessor.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -25,31 +25,28 @@
import java.lang.annotation.Annotation;
-import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.TypeElement;
+import javax.lang.model.type.MirroredTypeException;
import org.richfaces.cdk.CdkProcessingException;
import org.richfaces.cdk.annotations.Event;
-import org.richfaces.cdk.apt.SourceUtils;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.TagType;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.EventModel;
+import org.richfaces.cdk.util.Strings;
/**
- * <p class="changed_added_4_0">
- * This class processes annotations for FacesEvents.
- * </p>
- *
+ * <p class="changed_added_4_0">This class processes annotations for FacesEvents.</p>
* @author asmirnov(a)exadel.com
- *
+ *
*/
public class EventProcessor extends ProcessorBase implements CdkAnnotationProcessor {
- /*
- * (non-Javadoc)
- *
+ /* (non-Javadoc)
* @see org.richfaces.cdk.apt.processors.CdkAnnotationProcessor#getProcessedAnnotation()
*/
@Override
@@ -57,24 +54,31 @@
return Event.class;
}
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.cdk.apt.processors.CdkAnnotationProcessor#process(javax.lang.model.element.Element,
- * org.richfaces.cdk.model.ComponentLibrary)
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.apt.processors.CdkAnnotationProcessor#process(javax.lang.model.element.Element, org.richfaces.cdk.model.ComponentLibrary)
*/
@Override
public void process(Element element, ComponentLibrary library) throws CdkProcessingException {
if (ElementKind.CLASS.equals(element.getKind())) {
- SourceUtils sourceUtils = getSourceUtils();
TypeElement eventType = (TypeElement) element;
- AnnotationMirror event = sourceUtils.getAnnotationMirror(element, Event.class);
+ Event event = eventType.getAnnotation(Event.class);
EventModel model = new EventModel();
model.setType(ClassName.parseName(eventType.getQualifiedName().toString()));
- sourceUtils.setModelProperty(model, event, "listenerInterface", "listener");
- sourceUtils.setModelProperty(model, event, "listenerMethod");
- sourceUtils.setModelProperty(model, event, "sourceInterface", "source");
- setTagInfo(event, model);
+ try {
+ model.setListenerInterface(ClassName.parseName(event.listener().toString()));
+ } catch (MirroredTypeException mirror) {
+ model.setListenerInterface(ClassName.parseName(mirror.getTypeMirror().toString()));
+ }
+ String listenerMethod = event.listenerMethod();
+ if(!Strings.isEmpty(listenerMethod)){
+ model.setListenerMethod(listenerMethod);
+ }
+ model.setSourceInterface(ClassName.parseName(event.source()));
+ for (Tag tag : event.tag()) {
+ if(!TagType.None.equals(tag.type())){
+ model.getTags().add(processTag(tag));
+ }
+ }
library.getEvents().add(model);
}
}
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/FunctionProcessor.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/FunctionProcessor.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/FunctionProcessor.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -26,7 +26,6 @@
import java.lang.annotation.Annotation;
import java.util.Set;
-import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ExecutableElement;
@@ -36,14 +35,11 @@
import org.richfaces.cdk.CdkProcessingException;
import org.richfaces.cdk.annotations.Function;
-import org.richfaces.cdk.apt.SourceUtils;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.FunctionModel;
+import org.richfaces.cdk.util.Strings;
-import com.google.common.base.Joiner;
-import com.google.common.collect.Iterables;
-
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
@@ -51,14 +47,6 @@
*/
public class FunctionProcessor extends ProcessorBase implements CdkAnnotationProcessor {
- private static final Joiner PARAMETERS_JOINER = Joiner.on(',').skipNulls();
- private static final com.google.common.base.Function<VariableElement,String> PARAMETER_CONVERTER = new com.google.common.base.Function<VariableElement,String>(){
-
- @Override
- public String apply(VariableElement var) {
- return var.asType().toString();
- }
- };
/* (non-Javadoc)
* @see org.richfaces.cdk.apt.processors.CdkAnnotationProcessor#getProcessedAnnotation()
*/
@@ -72,7 +60,6 @@
*/
@Override
public void process(Element element, ComponentLibrary library) throws CdkProcessingException {
- SourceUtils utils = getSourceUtils();
switch (element.getKind()) {
case METHOD:
ExecutableElement methodElement = (ExecutableElement) element;
@@ -85,20 +72,27 @@
if(!modifiers.contains(Modifier.STATIC)){
throw new CdkProcessingException("Only static method can be registered as EL function "+methodElement.getSimpleName());
}
- AnnotationMirror function = utils.getAnnotationMirror(methodElement, Function.class);
+ Function function = methodElement.getAnnotation(Function.class);
FunctionModel model = new FunctionModel();
- if(!utils.isDefaultValue(function, "name")){
- utils.setModelProperty(model, function, "name");
+ if(!Strings.isEmpty(function.name())){
+ model.setName(function.name());
} else {
model.setName(methodElement.getSimpleName().toString());
}
- utils.setModelProperty(model, function, "type");
- setDescription(model, function, getDocComment(methodElement));
+ model.setType(function.type());
+ setDescription(model, function.description(), getDocComment(methodElement));
// Calculate method signature
StringBuilder signature = new StringBuilder();
signature.append(methodElement.getReturnType()).append(" ");
signature.append(methodElement.getSimpleName()).append("(");
- PARAMETERS_JOINER.appendTo(signature, Iterables.transform(methodElement.getParameters(), PARAMETER_CONVERTER));
+ boolean first = true;
+ for(VariableElement parameter :methodElement.getParameters()){
+ if(!first){
+ signature.append(",");
+ }
+ signature.append(parameter.asType());
+ first = false;
+ }
signature.append(")");
model.setSignature(signature.toString());
Element declaringClass = methodElement.getEnclosingElement();
Added: trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/JsfSubComponent.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/JsfSubComponent.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/JsfSubComponent.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.cdk.apt.processors;
+
+import java.lang.annotation.Annotation;
+
+import javax.faces.event.FacesEvent;
+
+import org.richfaces.cdk.annotations.Description;
+import org.richfaces.cdk.annotations.Facet;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.RendererSpecificComponent;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.Test;
+
+/**
+ * This calss wraps {@link RendererSpecificComponent} annotation so it would be used by {@link ComponentProcessor} methods, so they
+ * can be reused for different types of the component annotations.
+ *
+ * @author akolonitsky
+ * @since Mar 31, 2010
+ */
+public class JsfSubComponent implements JsfComponent {
+
+ private final RendererSpecificComponent subcomponent;
+
+ private final JsfComponent parent;
+
+ public JsfSubComponent(RendererSpecificComponent subcomponent, JsfComponent parent) {
+ this.subcomponent = subcomponent;
+ this.parent = parent;
+ }
+
+ @Override
+ public Class<? extends Annotation> annotationType() {
+ return JsfComponent.class;
+ }
+
+ @Override
+ public String type() {
+ return this.subcomponent.type();
+ }
+
+ @Override
+ public Test test() {
+ return this.subcomponent.test();
+ }
+
+ @Override
+ public Tag[] tag() {
+ return this.subcomponent.tag();
+ }
+
+ @Override
+ public JsfRenderer renderer() {
+ return this.subcomponent.renderer();
+ }
+
+ @Override
+ public Class<?>[] interfaces() {
+ return this.subcomponent.interfaces();
+ }
+
+ @Override
+ public String generate() {
+ return this.subcomponent.generate();
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Class<? extends FacesEvent>[] fires() {
+ return new Class[0];
+ }
+
+ @Override
+ public String family() {
+ return this.parent.family();
+ }
+
+ @Override
+ public Facet[] facets() {
+ return this.subcomponent.facets();
+ }
+
+ @Override
+ public Description description() {
+ return this.subcomponent.description();
+ }
+
+ @Override
+ public RendererSpecificComponent[] components() {
+ return new RendererSpecificComponent[0];
+ }
+
+ @Override
+ public String[] attributes() {
+ return this.subcomponent.attributes();
+ }
+}
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -1,33 +1,27 @@
package org.richfaces.cdk.apt.processors;
-import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
-import javax.lang.model.element.ElementKind;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
-import javax.lang.model.type.TypeKind;
-import javax.lang.model.type.TypeMirror;
-import org.richfaces.cdk.Logger;
import org.richfaces.cdk.NamingConventions;
+import org.richfaces.cdk.annotations.Description;
+import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
import org.richfaces.cdk.apt.SourceUtils;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.DescriptionGroup;
-import org.richfaces.cdk.model.ModelCollection;
import org.richfaces.cdk.model.ModelElementBase;
import org.richfaces.cdk.model.TagModel;
-import org.richfaces.cdk.model.ViewElement;
+import org.richfaces.cdk.util.Strings;
import com.google.inject.Inject;
import com.google.inject.Provider;
-public abstract class ProcessorBase {
+public abstract class ProcessorBase {
+
@Inject
- protected Logger log;
-
- @Inject
private Provider<SourceUtils> sourceUtils;
@Inject
@@ -35,7 +29,7 @@
@Inject
private NamingConventions namingConventions;
-
+
@Inject
private DescriptionProcessor descriptionProcessor;
@@ -43,47 +37,46 @@
return this.sourceUtils.get();
}
- protected void setTagInfo(AnnotationMirror annotation, ViewElement model) {
- SourceUtils sourceUtils = getSourceUtils();
- ModelCollection<TagModel> tags = model.getTags();
- for (AnnotationMirror tag : sourceUtils.getAnnotationValues(annotation, "tag", AnnotationMirror.class)) {
+ protected void setTagInfo(Tag tag, ModelElementBase model) {
+
+ if (!TagType.None.equals(tag.type())) {
TagModel tagModel = processTag(tag);
- tags.add(tagModel);
+
+ model.getTags().add(tagModel);
+
}
}
- protected TagModel processTag(AnnotationMirror tag) {
+ protected TagModel processTag(Tag tag) {
TagModel tagModel = new TagModel();
- SourceUtils sourceUtils = getSourceUtils();
- sourceUtils.setModelProperty(tagModel, tag, "name");
- tagModel.setType(sourceUtils.getAnnotationValue(tag, "type", TagType.class));
- sourceUtils.setModelProperty(tagModel, tag, "targetClass", "handler");
- sourceUtils.setModelProperty(tagModel, tag, "baseClass");
- sourceUtils.setModelProperty(tagModel, tag, "generate");
+ String name = tag.name();
+ tagModel.setName(name);
+ tagModel.setType(tag.type());
+ tagModel.setTargetClass(ClassName.parseName(tag.handler()));
+ tagModel.setBaseClass(ClassName.parseName(tag.baseClass()));
+ tagModel.setGenerate(tag.generate());
return tagModel;
}
- protected void setClassNames(TypeElement componentElement, ModelElementBase modelElement, AnnotationMirror behavior) {
- SourceUtils sourceUtils = getSourceUtils();
- if (componentElement.getModifiers().contains(Modifier.ABSTRACT)
- || !sourceUtils.isDefaultValue(behavior, "generate")) {
+ protected void setClassNames(TypeElement componentElement, ModelElementBase modelElement,
+ String generatedClass) {
+
+ if (componentElement.getModifiers().contains(Modifier.ABSTRACT) || !Strings.isEmpty(generatedClass)) {
modelElement.setGenerate(true);
- sourceUtils.setModelProperty(modelElement, behavior, "targetClass", "generate");
+ modelElement.setTargetClass(ClassName.parseName(generatedClass));
} else {
modelElement.setGenerate(false);
- modelElement.setTargetClass(ClassName.parseName(componentElement.getQualifiedName().toString()));
}
modelElement.setBaseClass(ClassName.parseName(componentElement.getQualifiedName().toString()));
}
+
protected String getDocComment(Element element) {
return null != element ? getSourceUtils().getDocComment(element) : null;
}
/**
- * <p class="changed_added_4_0">
- * </p>
- *
+ * <p class="changed_added_4_0"></p>
* @return the attributeProcessor
*/
protected AttributesProcessor getAttributeProcessor() {
@@ -98,44 +91,7 @@
this.namingConventions = namingConventions;
}
- protected void setDescription(DescriptionGroup model, AnnotationMirror annotation, String docComment) {
- descriptionProcessor.processDescription(model,
- getSourceUtils().getAnnotationValue(annotation, "description", AnnotationMirror.class), docComment);
+ protected void setDescription(DescriptionGroup model, Description description, String docComment) {
+ descriptionProcessor.processDescription(model, description, docComment);
}
-
- protected void processAttributes(Element element, ModelElementBase component, AnnotationMirror annotation) {
- AttributesProcessor attributesProcessor = getAttributeProcessor();
- SourceUtils sourceUtils = getSourceUtils();
- for (String atributesFragment : sourceUtils.getAnnotationValues(annotation, "attributes", String.class)) {
- attributesProcessor.processXmlFragment(component, atributesFragment);
- }
- if (element != null && ElementKind.CLASS.equals(element.getKind())) {
- attributesProcessor.processType(component, (TypeElement) element);
- }
- for (TypeMirror atributesInterface : sourceUtils
- .getAnnotationValues(annotation, "interfaces", TypeMirror.class)) {
- processInterface(component, attributesProcessor, atributesInterface);
- }
- }
-
- private void processInterface(ModelElementBase component, AttributesProcessor attributesProcessor, TypeMirror mirror) {
- component.getInterfaces().add(ClassName.parseName(mirror.toString()));
- if (TypeKind.DECLARED.equals(mirror.getKind())) {
- attributesProcessor.processType(component, getSourceUtils().asTypeElement(mirror));
- } else {
- // TODO - record warning.
- }
- }
-
- protected String getAnnotationPropertyOrConstant(TypeElement element, AnnotationMirror annotation, String annotationAttribute, String fieldName) {
- SourceUtils utils = getSourceUtils();
- if (!utils.isDefaultValue(annotation, annotationAttribute)) {
- return utils.getAnnotationValue(annotation, annotationAttribute,String.class);
- }
- Object value = utils.getConstant((TypeElement) element, fieldName);
- if (value != null) {
- return value.toString();
- }
- return null;
- }
}
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -24,18 +24,23 @@
import java.lang.annotation.Annotation;
import javax.annotation.processing.SupportedAnnotationTypes;
-import javax.lang.model.element.AnnotationMirror;
+import javax.faces.render.RenderKitFactory;
import javax.lang.model.element.Element;
+import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
+import javax.lang.model.type.TypeKind;
+import javax.lang.model.type.TypeMirror;
+import org.richfaces.cdk.Logger;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
-import org.richfaces.cdk.apt.SourceUtils;
+import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.RendererModel;
import org.richfaces.cdk.util.Strings;
+import com.google.inject.Inject;
/**
* @author akolonitsky
@@ -48,29 +53,61 @@
private static final String RENDERER_TYPE = "RENDERER_TYPE";
+ @Inject
+ private Logger log;
+
+
public void process(Element rendererElement, ComponentLibrary library) {
- SourceUtils sourceUtils = getSourceUtils();
- AnnotationMirror annotation = sourceUtils.getAnnotationMirror(rendererElement, JsfRenderer.class);
+ JsfRenderer annotation = rendererElement.getAnnotation(JsfRenderer.class);
+ RendererModel rendererModel = process((TypeElement) rendererElement, annotation, library);
+
+ addToRenderKit(annotation, library, rendererModel);
+
+ }
+
+ public RendererModel process(TypeElement rendererElement, JsfRenderer annotation, ComponentLibrary library) {
RendererModel rendererModel = new RendererModel();
- TypeElement rendererTypeElement = (TypeElement) rendererElement;
- setClassNames(rendererTypeElement, rendererModel, annotation);
+ setClassNames(rendererElement, rendererModel, null);
- setRendererType(rendererTypeElement, rendererModel, annotation);
-
- setComponentFamily(rendererTypeElement, rendererModel, annotation);
- setDescription(rendererModel, annotation, getDocComment(rendererElement));
+ setRendererType(rendererElement, rendererModel, annotation);
+ setComponentFamily(rendererElement, rendererModel, annotation);
+ setDescription(rendererModel, annotation.description(), getDocComment(rendererElement));
- sourceUtils.setModelProperty(rendererModel, annotation, "templatePath","template");
+ setTemplate(rendererModel, annotation);
- String renderKitId = sourceUtils.getAnnotationValue(annotation, "renderKitId", String.class);
- library.addRenderer(renderKitId, rendererModel);
+ // TODO - process @Test annotations.
+ return rendererModel;
+ }
+ protected void setClassNames(TypeElement componentElement, RendererModel modelElement, String generatedClass) {
+
+ if (componentElement.getModifiers().contains(Modifier.ABSTRACT) || !Strings.isEmpty(generatedClass)) {
+ modelElement.setGenerate(true);
+ modelElement.setRendererClass(ClassName.parseName(generatedClass));
+ modelElement.setBaseClass(ClassName.parseName(componentElement.getQualifiedName().toString()));
+ } else {
+ modelElement.setGenerate(false);
+ modelElement.setRendererClass(ClassName.parseName(componentElement.getQualifiedName().toString()));
+
+ TypeMirror superclass = componentElement.getSuperclass();
+ if (superclass.getKind() == TypeKind.DECLARED) {
+ TypeElement typeElement = getSourceUtils().asTypeElement(superclass);
+ modelElement.setBaseClass(ClassName.parseName(typeElement.getQualifiedName().toString()));
+ }
+ }
+
}
+ private void addToRenderKit(JsfRenderer annotation, ComponentLibrary library, RendererModel rendererModel) {
+ String renderKitId = annotation.renderKitId();
+ if (Strings.isEmpty(renderKitId)) {
+ renderKitId = RenderKitFactory.HTML_BASIC_RENDER_KIT; // TODO ???
+ }
+ library.addRenderer(renderKitId, rendererModel);
+ }
-
private void setTemplate(RendererModel rendererModel, JsfRenderer annotation) {
String template = annotation.template();
if (!Strings.isEmpty(template)) {
@@ -79,14 +116,39 @@
}
- private void setComponentFamily(TypeElement rendererElement, RendererModel rendererModel, AnnotationMirror annotation) {
- rendererModel.setFamily(FacesId.parseId(getAnnotationPropertyOrConstant(rendererElement, annotation,"family",COMPONENT_FAMILY)));
+ private void setComponentFamily(TypeElement rendererElement, RendererModel rendererModel, JsfRenderer annotation) {
+ String family = annotation.family();
+ if (!Strings.isEmpty(family)) {
+ rendererModel.setFamily(FacesId.parseId(family));
+ return;
+ } else {
+
+ Object value = getSourceUtils().getConstant(rendererElement, COMPONENT_FAMILY);
+ if (value != null) {
+ rendererModel.setFamily(FacesId.parseId(value.toString()));
+ return;
+ }
+ }
}
- private void setRendererType(TypeElement rendererElement, RendererModel rendererModel, AnnotationMirror annotation) {
- rendererModel.setId(FacesId.parseId(getAnnotationPropertyOrConstant(rendererElement, annotation,"type",RENDERER_TYPE)));
+ private String getRendererType(TypeElement rendererElement, JsfRenderer annotation) {
+ String type = annotation.type();
+ if (!Strings.isEmpty(type)) {
+ return type;
+ }
+
+ Object value = getSourceUtils().getConstant(rendererElement, RENDERER_TYPE);
+ if (value != null) {
+ return value.toString();
+ }
+
+ return null;
}
+ private void setRendererType(TypeElement rendererElement, RendererModel rendererModel, JsfRenderer annotation) {
+ rendererModel.setId(FacesId.parseId(getRendererType(rendererElement, annotation)));
+ }
+
protected String getComponentType(TypeElement componentElement) {
JsfComponent annotation = componentElement.getAnnotation(JsfComponent.class);
if (annotation != null) {
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/ValidatorProcessor.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/ValidatorProcessor.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/apt/processors/ValidatorProcessor.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -24,14 +24,13 @@
import java.lang.annotation.Annotation;
import javax.annotation.processing.SupportedAnnotationTypes;
-import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import org.richfaces.cdk.CdkProcessingException;
import org.richfaces.cdk.annotations.JsfValidator;
-import org.richfaces.cdk.apt.SourceUtils;
import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.ValidatorModel;
/**
@@ -43,15 +42,13 @@
@Override
public void process(Element element, ComponentLibrary library) throws CdkProcessingException {
- SourceUtils utils = getSourceUtils();
- AnnotationMirror validator = utils.getAnnotationMirror(element,JsfValidator.class);
+ JsfValidator validator = element.getAnnotation(JsfValidator.class);
- ValidatorModel validatorModel = new ValidatorModel();
- utils.setModelProperty(validatorModel, validator, "id");
- setClassNames((TypeElement) element, validatorModel, validator);
- setDescription(validatorModel, validator, getDocComment(element));
+ ValidatorModel validatorModel = new ValidatorModel(FacesId.parseId(validator.id()));
+ setClassNames((TypeElement) element, validatorModel, validator.generate());
+ setDescription(validatorModel, validator.description(), getDocComment(element));
- setTagInfo(validator, validatorModel);
+ setTagInfo(validator.tag(), validatorModel);
library.getValidators().add(validatorModel);
}
@@ -60,4 +57,10 @@
public Class<? extends Annotation> getProcessedAnnotation() {
return JsfValidator.class;
}
+
+
+ protected String[] getAnnotationAttributes(TypeElement element) {
+ JsfValidator validator = element.getAnnotation(JsfValidator.class);
+ return validator.attributes();
+ }
}
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/freemarker/FreeMarkerWriter.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/freemarker/FreeMarkerWriter.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/freemarker/FreeMarkerWriter.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -36,7 +36,6 @@
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ModelElementBase;
import org.richfaces.cdk.model.Trackable;
-import org.richfaces.cdk.model.ViewElement;
import freemarker.template.TemplateException;
@@ -87,7 +86,7 @@
}
protected String getOutputFileName(C c) throws CdkException {
- if (c instanceof ViewElement) {
+ if (c instanceof ModelElementBase) {
ModelElementBase modelElement = (ModelElementBase) c;
return modelElement.getTargetClass().getName().replace('.', File.separatorChar) + ".java";
} else {
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/freemarker/LibraryModelWrapper.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/freemarker/LibraryModelWrapper.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/freemarker/LibraryModelWrapper.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -26,9 +26,9 @@
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.EventModel;
import org.richfaces.cdk.model.FacesId;
+import org.richfaces.cdk.model.ModelElementBase;
import org.richfaces.cdk.model.PropertyBase;
import org.richfaces.cdk.model.TagModel;
-import org.richfaces.cdk.model.ViewElement;
import freemarker.ext.beans.BeansWrapper;
import freemarker.ext.beans.StringModel;
@@ -72,7 +72,7 @@
return create(obj, EventTemplateModel.FACTORY);
} else if (obj instanceof TagModel) {
return create(obj, TagTemplateModel.FACTORY);
- } else if (obj instanceof ViewElement) {
+ } else if (obj instanceof ModelElementBase) {
return create(obj, ModelElementBaseTemplateModel.FACTORY);
} else {
return super.wrap(obj);
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/freemarker/ModelElementBaseTemplateModel.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/freemarker/ModelElementBaseTemplateModel.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/freemarker/ModelElementBaseTemplateModel.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -122,46 +122,39 @@
public TemplateModel getImportClasses() throws TemplateModelException {
Set<ClassName> result = Sets.newTreeSet();
- String targetPackage = model.getTargetClass().getPackage();
+
for (PropertyBase entry : model.getAttributes()) {
- if (entry.getGenerate()) {
- addIfNecessary(targetPackage, result, entry.getType());
+ if (entry.getGenerate() && !isPredefined(entry)) {
+ result.add(entry.getType());
}
}
// Import all interfaces implemented by the generated class.
result.addAll(model.getInterfaces());
if (model instanceof ComponentModel) {
ComponentModel component = (ComponentModel) model;
- for (EventModel event : component.getEvents()) {
- addIfNecessary(targetPackage, result, event.getSourceInterface());
- addIfNecessary(targetPackage, result, event.getListenerInterface());
+ for(EventModel event :component.getEvents()){
+ result.add(event.getSourceInterface());
+ result.add(event.getListenerInterface());
}
}
// Collection<String> list = new ArrayList<String>(result);
return this.wrapper.wrap(result);
}
-
- private void addIfNecessary(String pkg, Set<ClassName> classNames, ClassName toadd) {
- if (null != toadd && !isPredefined(toadd) && !pkg.equals(toadd.getPackage())) {
- classNames.add(toadd);
- }
- }
-
public TemplateModel getTagImports() throws TemplateModelException {
Set<ClassName> result = Sets.newTreeSet();
for (PropertyBase entry : model.getAttributes()) {
- if (!(entry.isHidden() || entry.isReadOnly() || null == entry.getSignature())) {
+ if (!(entry.isHidden()||entry.isReadOnly()||null == entry.getSignature())) {
MethodSignature methodSignature = entry.getSignature();
- if (!isPredefined(methodSignature.getReturnType())) {
+ if(!isPredefined(methodSignature.getReturnType())){
result.add(methodSignature.getReturnType());
}
for (ClassName className : methodSignature.getParameters()) {
- if (!isPredefined(className)) {
+ if(!isPredefined(className)){
result.add(className);
}
-
+
}
}
}
@@ -180,18 +173,15 @@
public TemplateModel getImplementedInterfaces() throws TemplateModelException {
Set<ClassName> result = Sets.newTreeSet();
- if (getEventNames().size() > 0) {
+ if(getEventNames().size()>0){
result.add(ClassName.parseName("javax.faces.component.behavior.ClientBehaviorHolder"));
}
// Import all interfaces implemented by the generated class.
result.addAll(model.getInterfaces());
if (model instanceof ComponentModel) {
ComponentModel component = (ComponentModel) model;
- for (EventModel event : component.getEvents()) {
- ClassName sourceInterface = event.getSourceInterface();
- if (null != sourceInterface) {
- result.add(sourceInterface);
- }
+ for(EventModel event :component.getEvents()){
+ result.add(event.getSourceInterface());
}
}
// Collection<String> list = new ArrayList<String>(result);
@@ -203,7 +193,7 @@
}
public boolean isPredefined(ClassName type) {
- return type.isPrimitive() || "java.lang".equals(type.getPackage());
+ return type.isPrimitive() ||"java.lang".equals(type.getPackage());
}
private TemplateModel eventNames() throws TemplateModelException {
@@ -264,7 +254,7 @@
@Override
public boolean apply(PropertyBase input) {
- return !(input.isHidden() || input.isReadOnly());
+ return !(input.isHidden()||input.isReadOnly());
}
}));
}
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -288,8 +288,8 @@
if (!Strings.isEmpty(model.getDescription())) {
parent.addElement("description").addText(model.getDescription());
}
- if (!Strings.isEmpty(model.getDisplayName())) {
- parent.addElement("display-name").addText(model.getDisplayName());
+ if (!Strings.isEmpty(model.getDisplayname())) {
+ parent.addElement("display-name").addText(model.getDisplayname());
}
if (null != model.getIcon()) {
Element iconElement = parent.addElement("icon");
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -159,18 +159,15 @@
return events;
}
- public EventModel addEvent(ClassName className) {
+ public EventModel addEvent(String className) {
+ // TODO - use a single events collection from library.
EventModel event = new EventModel();
- event.setType(className);
+ event.setType(new ClassName(className));
events.add(event);
return event;
}
- public EventModel addEvent(String className) {
- return addEvent(ClassName.get(className));
- }
-
@Override
public String toString() {
return "Component {type: " + getId() + ", family: " + getFamily() + "}";
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroup.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroup.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroup.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -36,7 +36,7 @@
*/
@XmlElement(name = "display-name")
@Merge
- public String getDisplayName();
+ public String getDisplayname();
/**
* <p class="changed_added_4_0">
@@ -44,7 +44,7 @@
*
* @param displayname the displayname to set
*/
- public void setDisplayName(String displayname);
+ public void setDisplayname(String displayname);
/**
* <p class="changed_added_4_0">
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroupBase.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroupBase.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroupBase.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -65,11 +65,11 @@
}
@Merge
- public final String getDisplayName() {
+ public final String getDisplayname() {
return displayname;
}
- public final void setDisplayName(String displayname) {
+ public final void setDisplayname(String displayname) {
this.displayname = displayname;
}
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/EventModel.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/EventModel.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/EventModel.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -41,7 +41,7 @@
@SuppressWarnings("serial")
@XmlType(name = "event-configType", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
-public class EventModel implements ModelElement<EventModel>, ViewElement {
+public class EventModel implements ModelElement<EventModel> {
private String description;
private ClassName listenerInterface;
private String listenerMethod;
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -10,7 +10,7 @@
* @author asmirnov(a)exadel.com
*
*/
-public class ModelElementBase extends BeanModelBase implements FacesComponent, ViewElement {
+public class ModelElementBase extends BeanModelBase implements FacesComponent {
private FacesId id;
@@ -23,10 +23,10 @@
private final Collection<ClassName> interfaces = Lists.newArrayList();
- /* (non-Javadoc)
- * @see org.richfaces.cdk.model.ViewElement#getTags()
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the tags
*/
- @Override
public ModelCollection<TagModel> getTags() {
return this.tags;
}
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -319,19 +319,22 @@
protected void verifyEvents(ComponentLibrary library) {
for (EventModel event : library.getEvents()) {
ClassName listenerInterface = event.getListenerInterface();
+ if (null == listenerInterface) {
+ // TODO - infer listener interface name.
+ }
SourceUtils sourceUtils = sourceUtilsProvider.get();
- if (null != listenerInterface) {
- event.setGenerateListener(!sourceUtils.isClassExists(listenerInterface));
- }
+ event.setGenerateListener(!sourceUtils.isClassExists(listenerInterface));
String methodName = event.getListenerMethod();
if (null == methodName) {
+ // TODO infer listener method name.
methodName = "process";
event.setListenerMethod(methodName);
}
ClassName sourceInterface = event.getSourceInterface();
- if (null != sourceInterface) {
- event.setGenerateSource(!sourceUtils.isClassExists(sourceInterface));
+ if (null == sourceInterface) {
+ // TODO - infer source interface.
}
+ event.setGenerateSource(!sourceUtils.isClassExists(sourceInterface));
// Propagate event to corresponding components.
for (ComponentModel component : library.getComponents()) {
for (EventModel componentEvent : component.getEvents()) {
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -246,7 +246,7 @@
// TODO is it the right one?
rendererProperty.setDescription(templateAttribute.getShortDescription());
- rendererProperty.setDisplayName(templateAttribute.getDisplayName());
+ rendererProperty.setDisplayname(templateAttribute.getDisplayName());
Set<EventName> eventNamesSet = convert(templateAttribute.getClientBehaviors());
if (eventNamesSet != null) {
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/DescriptionGroupBean.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/DescriptionGroupBean.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/DescriptionGroupBean.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -7,7 +7,7 @@
import org.richfaces.cdk.model.DescriptionGroup;
@XmlType(name = "descriptionType", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,
- propOrder = {"description", "displayName", "icon"})
+ propOrder = {"description", "displayname", "icon"})
public class DescriptionGroupBean implements DescriptionGroup {
private String description;
private String displayname;
@@ -61,7 +61,7 @@
* @return the displayname
*/
@XmlElement(name = "display-name", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
- public final String getDisplayName() {
+ public final String getDisplayname() {
return displayname;
}
@@ -70,7 +70,7 @@
*
* @param displayname the displayname to set
*/
- public final void setDisplayName(String displayname) {
+ public final void setDisplayname(String displayname) {
this.displayname = displayname;
}
}
Modified: trunk/cdk/generator/src/test/java/org/richfaces/cdk/apt/AptSourceUtilsAnnotationsTest.java
===================================================================
--- trunk/cdk/generator/src/test/java/org/richfaces/cdk/apt/AptSourceUtilsAnnotationsTest.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/test/java/org/richfaces/cdk/apt/AptSourceUtilsAnnotationsTest.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -13,7 +13,6 @@
import org.richfaces.cdk.model.ClassName;
import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
public class AptSourceUtilsAnnotationsTest extends SourceUtilsTestBase {
@@ -137,11 +136,11 @@
public void process(SourceUtils utils, RoundEnvironment roundEnv) {
Element element = findElement(roundEnv, ANNOTATIONS_TEST_CLASS);
AnnotationMirror annotationMirror = utils.getAnnotationMirror(element, TestAnnotation.class);
- Iterable<T> annotationValues = utils.getAnnotationValues(annotationMirror, propertyName, type);
- assertEquals("Annotation values size is different from expected",expected.length, Iterables.size(annotationValues));
+ List<T> annotationValues = utils.getAnnotationValues(annotationMirror, propertyName, type);
+ assertEquals("Annotation values size is different from expected",expected.length, annotationValues.size());
for (int i = 0; i < expected.length; i++) {
Object expectedValue = expected[i];
- assertEquals("Annotation value at position "+i+" is different from expected",expectedValue, Iterables.get(annotationValues, i));
+ assertEquals("Annotation value at position "+i+" is different from expected",expectedValue, annotationValues.get(i));
}
}
});
Modified: trunk/cdk/generator/src/test/java/org/richfaces/cdk/apt/processors/BehaviorProcessorTest.java
===================================================================
--- trunk/cdk/generator/src/test/java/org/richfaces/cdk/apt/processors/BehaviorProcessorTest.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/test/java/org/richfaces/cdk/apt/processors/BehaviorProcessorTest.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -104,7 +104,7 @@
expect(componentElement.getModifiers()).andReturn(Collections.singleton(Modifier.ABSTRACT));
expect(componentElement.getQualifiedName()).andReturn(name).atLeastOnce();
expect(behaviorAnnotation.generate()).andReturn("foo.Bar");
- expect(behaviorAnnotation.tag()).andReturn(new Tag[]{tag});
+ expect(behaviorAnnotation.tag()).andReturn(tag);
expect(behaviorAnnotation.attributes()).andReturn(new String[] {});
expect(behaviorAnnotation.description()).andReturn(this.description);
expect(tag.handler()).andStubReturn("");
Modified: trunk/cdk/generator/src/test/java/org/richfaces/cdk/apt/processors/ComponentProcessorTest.java
===================================================================
--- trunk/cdk/generator/src/test/java/org/richfaces/cdk/apt/processors/ComponentProcessorTest.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/test/java/org/richfaces/cdk/apt/processors/ComponentProcessorTest.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -28,7 +28,6 @@
import java.util.Collections;
-import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
@@ -72,7 +71,7 @@
private static final String FOO_HTML_BAR = "foo.HtmlBar";
@Mock
- private AnnotationMirror annotation;
+ private JsfComponent annotation;
@Mock
private AttributesProcessor attributesProcessor;
@@ -113,19 +112,13 @@
@Test
public void testProcessFacetsFromAnnotation() throws Exception {
- AnnotationMirror facet = createMock(AnnotationMirror.class);
+ Facet facet = createMock(Facet.class);
expect(utils.getBeanPropertiesAnnotatedWith(eq(Facet.class), same(componentElement))).andReturn(
Collections.<BeanProperty> emptySet());
-// expect(annotation.facets()).andReturn(new Facet[] { facet });
- expect(utils.getAnnotationValues(annotation, "facets",AnnotationMirror.class)).andReturn(Collections.singleton(facet));
- expect(utils.isDefaultValue(same(facet), eq("name"))).andReturn(false);
- expect(utils.getAnnotationValue(facet, "name",String.class)).andReturn("foo");
- expect(utils.isDefaultValue(same(facet), eq("description"))).andReturn(true);
- expect(utils.isDefaultValue(same(facet), eq("generate"))).andReturn(false);
- expect(utils.getAnnotationValue(facet, "generate",Boolean.class)).andReturn(true);
-// expect(facet.name()).andReturn("foo");
-// expect(facet.description()).andReturn(this.description);
-// expect(facet.generate()).andReturn(true);
+ expect(annotation.facets()).andReturn(new Facet[] { facet });
+ expect(facet.name()).andReturn("foo");
+ expect(facet.description()).andReturn(this.description);
+ expect(facet.generate()).andReturn(true);
// expect(this.description.smallIcon()).andReturn("");
// expect(this.description.largeIcon()).andReturn("");
// expect(this.description.displayName()).andReturn("fooFacet").times(2);
@@ -146,17 +139,20 @@
@Test
public void testProcessFacetsFromProperty() throws Exception {
- AnnotationMirror facet = createMock(AnnotationMirror.class);
+ Facet facet = createMock(Facet.class);
expect(utils.getBeanPropertiesAnnotatedWith(eq(Facet.class), same(componentElement))).andReturn(
Collections.singleton(property));
- expect(property.getAnnotationMirror(Facet.class)).andReturn(facet);
+ expect(annotation.facets()).andReturn(new Facet[0]);
+ expect(property.getAnnotation(Facet.class)).andReturn(facet);
expect(property.getName()).andReturn("foo");
expect(property.getDocComment()).andReturn("my comment").times(2);
expect(property.isExists()).andReturn(true);
- expect(utils.isDefaultValue(same(facet), eq("description"))).andReturn(true);
- expect(utils.isDefaultValue(same(facet), eq("generate"))).andReturn(false);
- expect(utils.getAnnotationValue(facet, "generate",Boolean.class)).andReturn(true);
- expect(utils.getAnnotationValues(annotation, "facets",AnnotationMirror.class)).andReturn(Collections.<AnnotationMirror>emptySet());
+ expect(facet.description()).andReturn(description);
+ expect(facet.generate()).andReturn(true);
+ // expect(this.description.smallIcon()).andReturn("");
+ // expect(this.description.largeIcon()).andReturn("");
+ // expect(this.description.displayName()).andReturn("fooFacet").times(2);
+ // expect(this.description.value()).andReturn("");
replay(utils, componentElement, jaxb, annotation, property, facet, description);
processor.processFacets(componentElement, model, annotation);
@@ -166,6 +162,9 @@
FacetModel facetModel = Iterables.getOnlyElement(model.getFacets());
assertTrue(facetModel.getGenerate());
assertEquals("foo", facetModel.getName());
+ // assertEquals("my comment", facetModel.getDescription());
+ // assertEquals("fooFacet", facetModel.getDisplayname());
+ // assertNull(facetModel.getIcon());
}
/**
@@ -178,14 +177,12 @@
public void testSetClassNames() throws Exception {
expect(componentElement.getModifiers()).andReturn(Collections.<Modifier> emptySet());
expect(componentElement.getQualifiedName()).andReturn(new TestName(FOO_BAR));
- expect(utils.isDefaultValue(annotation, "generate")).andReturn(true);
- expect(componentElement.getQualifiedName()).andReturn(new TestName(FOO_BAR));
replay(utils, componentElement, jaxb, annotation);
- processor.setClassNames(componentElement, model, annotation);
+ processor.setClassNames(componentElement, model, "");
verify(utils, componentElement, jaxb, annotation);
assertFalse(model.getGenerate());
assertEquals(FOO_BAR, model.getBaseClass().toString());
- assertEquals(FOO_BAR, model.getTargetClass().toString());
+ assertNull(model.getTargetClass());
}
/**
@@ -197,11 +194,10 @@
@Test
public void testSetClassNames1() throws Exception {
expect(componentElement.getModifiers()).andReturn(Collections.<Modifier> singleton(Modifier.ABSTRACT));
- utils.setModelProperty(model, annotation, "targetClass","generate");expectLastCall();
expect(componentElement.getQualifiedName()).andReturn(new TestName(FOO_BAR));
replay(utils, componentElement, jaxb, annotation);
- processor.setClassNames(componentElement, model, annotation);
+ processor.setClassNames(componentElement, model, "");
verify(utils, componentElement, jaxb, annotation);
assertTrue(model.getGenerate());
@@ -218,18 +214,50 @@
@Test
public void testSetClassNames2() throws Exception {
expect(componentElement.getModifiers()).andReturn(Collections.<Modifier> emptySet());
- expect(utils.isDefaultValue(annotation, "generate")).andReturn(false);
- utils.setModelProperty(model, annotation, "targetClass","generate");expectLastCall();
expect(componentElement.getQualifiedName()).andReturn(new TestName(FOO_BAR));
replay(utils, componentElement, jaxb, annotation);
- processor.setClassNames(componentElement, model, annotation);
+ processor.setClassNames(componentElement, model, FOO_HTML_BAR);
verify(utils, componentElement, jaxb, annotation);
assertTrue(model.getGenerate());
assertEquals(FOO_BAR, model.getBaseClass().toString());
+ assertEquals(FOO_HTML_BAR, model.getTargetClass().toString());
}
+ @Test
+ public void testSetFamily() throws Exception {
+ replay(utils, componentElement, jaxb, annotation);
+
+ processor.setComponeneFamily(componentElement, model, FOO_HTML_BAR);
+
+ verify(utils, componentElement, jaxb, annotation);
+ assertEquals(FacesId.parseId(FOO_HTML_BAR), model.getFamily());
+ }
+
+ @Test
+ public void testSetFamily1() throws Exception {
+ expect(utils.getConstant(same(componentElement), eq(ComponentProcessor.COMPONENT_FAMILY))).andReturn(
+ FOO_HTML_BAR);
+ replay(utils, componentElement, jaxb, annotation);
+
+ processor.setComponeneFamily(componentElement, model, "");
+
+ verify(utils, componentElement, jaxb, annotation);
+ assertEquals(FacesId.parseId(FOO_HTML_BAR), model.getFamily());
+ }
+
+ @Test
+ public void testSetFamily2() throws Exception {
+ expect(utils.getConstant(same(componentElement), eq(ComponentProcessor.COMPONENT_FAMILY))).andReturn(null);
+ replay(utils, componentElement, jaxb, annotation);
+
+ processor.setComponeneFamily(componentElement, model, "");
+
+ verify(utils, componentElement, jaxb, annotation);
+ assertNull(model.getFamily());
+ }
+
@Override
protected Iterable<String> sources() {
return Collections.singleton(COMPONENT_CLASS_JAVA);
Modified: trunk/cdk/generator/src/test/java/org/richfaces/cdk/apt/processors/DescriptionProcessorTest.java
===================================================================
--- trunk/cdk/generator/src/test/java/org/richfaces/cdk/apt/processors/DescriptionProcessorTest.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/test/java/org/richfaces/cdk/apt/processors/DescriptionProcessorTest.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -27,15 +27,12 @@
import java.util.Collections;
-import javax.lang.model.element.AnnotationMirror;
-
import org.junit.Test;
import org.junit.runner.RunWith;
import org.richfaces.cdk.CdkTestRunner;
import org.richfaces.cdk.Mock;
import org.richfaces.cdk.annotations.Description;
import org.richfaces.cdk.apt.AnnotationProcessorTestBase;
-import org.richfaces.cdk.apt.SourceUtils;
import org.richfaces.cdk.model.DescriptionGroup;
import com.google.inject.Inject;
@@ -58,14 +55,12 @@
private DescriptionGroup bean;
@Mock
- private AnnotationMirror description;
+ private Description description;
@Inject
private DescriptionProcessorImpl descriptionProcessor;
- @Mock
- private SourceUtils utils;
- /**
+ /**
* Test method for
* {@link org.richfaces.cdk.apt.processors.DescriptionProcessorImpl#processDescription(org.richfaces.cdk.model.DescriptionGroup, org.richfaces.cdk.annotations.Description, java.lang.String)}
* .
@@ -74,14 +69,12 @@
public void testProcessDescription() {
bean.setDescription(FOO_BAR_ELEMENT);
expectLastCall();
- expect(utils.isDefaultValue(description, "smallIcon")).andStubReturn(true);
- expect(utils.isDefaultValue(description, "largeIcon")).andStubReturn(true);
- utils.setModelProperty(bean, description, "displayName");expectLastCall();
- utils.setModelProperty(bean, description, "description","value");expectLastCall();
-// expect(this.description.smallIcon()).andReturn("");
-// expect(this.description.largeIcon()).andReturn("");
-// expect(this.description.displayName()).andReturn(FOO_FACET).times(2);
-// expect(this.description.value()).andReturn("");
+ bean.setDisplayname(FOO_FACET);
+ expectLastCall();
+ expect(this.description.smallIcon()).andReturn("");
+ expect(this.description.largeIcon()).andReturn("");
+ expect(this.description.displayName()).andReturn(FOO_FACET).times(2);
+ expect(this.description.value()).andReturn("");
mockController.replay();
descriptionProcessor.processDescription(bean, description, FOO_BAR_ELEMENT);
mockController.verify();
Modified: trunk/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
===================================================================
--- trunk/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -252,7 +252,7 @@
assertTrue(requiredAttribute.isRequired());
assertEquals("That's a required attribute", requiredAttribute.getDescription());
- assertEquals("Required Attribute", requiredAttribute.getDisplayName());
+ assertEquals("Required Attribute", requiredAttribute.getDisplayname());
}
@Test
Modified: trunk/cdk/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java
===================================================================
--- trunk/cdk/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -103,7 +103,7 @@
assertEquals("panel.gif", component.getIcon().getSmallIcon());
assertEquals("panel-large.gif", component.getIcon().getLargeIcon());
assertEquals("Panel component", component.getDescription());
- assertEquals("Panel", component.getDisplayName());
+ assertEquals("Panel", component.getDisplayname());
assertTrue(component.getGenerate());
FacetModel facet = Iterables.getOnlyElement(component.getFacets());
Modified: trunk/cdk/generator/src/test/java/org/richfaces/cdk/xmlconfig/FragmentParserTest.java
===================================================================
--- trunk/cdk/generator/src/test/java/org/richfaces/cdk/xmlconfig/FragmentParserTest.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/generator/src/test/java/org/richfaces/cdk/xmlconfig/FragmentParserTest.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -113,7 +113,7 @@
assertEquals("int", property.getType().getName());
assertEquals("test2 property", property.getDescription());
assertEquals("ontest2.png", property.getIcon().getSmallIcon());
- assertEquals("test2 event property", property.getDisplayName());
+ assertEquals("test2 event property", property.getDisplayname());
assertEquals("3", property.getDefaultValue());
assertEquals("15", property.getSuggestedValue());
Modified: trunk/cdk/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/cdk/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -31,12 +31,9 @@
import javax.faces.component.ValueHolder;
import javax.faces.el.MethodBinding;
import javax.faces.el.ValueBinding;
-import javax.faces.event.ValueChangeEvent;
-import javax.faces.event.ValueChangeListener;
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.Description;
-import org.richfaces.cdk.annotations.Event;
import org.richfaces.cdk.annotations.Facet;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
@@ -59,7 +56,7 @@
description=@Description(displayName="Test Component",largeIcon="large.gif",smallIcon="spall.png"),
generate="org.richfaces.cdk.test.component.UITestComponent",
facets=@Facet(name="caption",generate=true,description=@Description("Caption Facet")),
- fires={@Event(TestEvent.class),(a)Event(value=ValueChangeEvent.class,listener=ValueChangeListener.class)},
+ fires=TestEvent.class,
interfaces=ValueHolder.class,
components={
@RendererSpecificComponent(type = "org.richfaces.cdk.test.TestHtmlAbbr",
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/component/UIRepeat.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/component/UIRepeat.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/component/UIRepeat.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -30,7 +30,7 @@
* @author Nick Belaevski
*
*/
-@JsfComponent(tag = @Tag(name = "repeat", type = TagType.Facelets), renderer = @JsfRenderer(type = "org.richfaces.RepeatRenderer"))
+@JsfComponent(generate = "", tag = @Tag(name = "repeat", type = TagType.Facelets), renderer = @JsfRenderer(type = "org.richfaces.RepeatRenderer"))
public class UIRepeat extends UISequence {
public static final String COMPONENT_TYPE = "org.richfaces.Repeat";
Modified: trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/DrowDownMenuRendererTest.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/DrowDownMenuRendererTest.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/DrowDownMenuRendererTest.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -29,6 +29,7 @@
import java.net.URISyntaxException;
import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
+import org.junit.Ignore;
import org.junit.Test;
import org.richfaces.component.DropDownMenuBean;
import org.xml.sax.SAXException;
@@ -36,6 +37,7 @@
import com.gargoylesoftware.htmlunit.html.HtmlDivision;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
+@Ignore
public class DrowDownMenuRendererTest extends RendererTestBase {
@Override
Modified: trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/MenuItemRendererTest.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/MenuItemRendererTest.java 2011-01-10 10:14:36 UTC (rev 20926)
+++ trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/MenuItemRendererTest.java 2011-01-10 10:29:55 UTC (rev 20927)
@@ -29,6 +29,7 @@
import java.net.URISyntaxException;
import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
+import org.junit.Ignore;
import org.junit.Test;
import org.richfaces.component.DropDownMenuBean;
import org.xml.sax.SAXException;
@@ -36,6 +37,7 @@
import com.gargoylesoftware.htmlunit.html.HtmlDivision;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
+@Ignore
public class MenuItemRendererTest extends RendererTestBase {
@Override
13 years, 11 months
JBoss Rich Faces SVN: r20926 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-10 05:14:36 -0500 (Mon, 10 Jan 2011)
New Revision: 20926
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java
Log:
* fixed testRendered
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java 2011-01-10 08:09:52 UTC (rev 20925)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java 2011-01-10 10:14:36 UTC (rev 20926)
@@ -21,6 +21,7 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.a4jOutputPanel;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
@@ -166,8 +167,12 @@
selenium.waitForPageToLoad(TIMEOUT);
assertFalse(selenium.isElementPresent(outputDiv), "Panel should not be rendered.");
- selenium.click(increaseCounterButton);
- selenium.click(increaseCounterButton);
+ String timeValue = selenium.getText(time);
+ guardXhr(selenium).click(increaseCounterButton);
+ waitGui.failWith("Page was not updated").waitForChange(timeValue, retrieveText.locator(time));
+ timeValue = selenium.getText(time);
+ guardXhr(selenium).click(increaseCounterButton);
+ waitGui.failWith("Page was not updated").waitForChange(timeValue, retrieveText.locator(time));
selenium.click(renderedInputTrue);
selenium.waitForPageToLoad(TIMEOUT);
13 years, 11 months
JBoss Rich Faces SVN: r20925 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richCollapsibleSubTable and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-10 03:09:52 -0500 (Mon, 10 Jan 2011)
New Revision: 20925
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/scroller.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-column.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-component-control.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerlBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml
Log:
rich:collapsibleSubTable preparation (RFPL-731)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java 2011-01-10 06:13:31 UTC (rev 20924)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java 2011-01-10 08:09:52 UTC (rev 20925)
@@ -23,7 +23,9 @@
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
@@ -56,6 +58,9 @@
// true = model, false = empty table
private boolean state;
+ // facets
+ private Map<String, String> facets = new HashMap<String, String>();
+
/**
* Initializes the managed bean.
*/
@@ -64,7 +69,7 @@
logger = LoggerFactory.getLogger(getClass());
logger.debug("initializing bean " + getClass().getName());
- attributes = Attributes.getComponentAttributesFromClass(UICollapsibleSubTable.class, getClass());
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UICollapsibleSubTable.class, getClass());
attributes.setAttribute("expandMode", "client");
attributes.setAttribute("expanded", true);
@@ -72,6 +77,9 @@
attributes.setAttribute("rows", 5);
// TODO these attributes have to be tested in another way
+ attributes.remove("filterVar");
+ attributes.remove("keepSaved");
+ attributes.remove("iterationStatusVar");
attributes.remove("componentState");
attributes.remove("rowKeyVar");
attributes.remove("stateVar");
@@ -128,4 +136,8 @@
this.state = state;
}
+ public Map<String, String> getFacets() {
+ return facets;
+ }
+
}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerlBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerlBean.java 2011-01-10 06:13:31 UTC (rev 20924)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerlBean.java 2011-01-10 08:09:52 UTC (rev 20925)
@@ -64,7 +64,7 @@
logger = LoggerFactory.getLogger(getClass());
logger.debug("initializing bean " + getClass().getName());
- attributes = Attributes.getComponentAttributesFromClass(UICollapsibleSubTableToggleControl.class, getClass());
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UICollapsibleSubTableToggleControl.class, getClass());
attributes.setAttribute("event", "click");
attributes.setAttribute("rendered", true);
// TODO these attributes have to be tested in another way
Copied: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml (from rev 20922, modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml 2011-01-10 08:09:52 UTC (rev 20925)
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox id="noDataCheckbox" value="#{richSubTableBean.state}">
+ <a4j:ajax render="richDataTable"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list">
+ <f:facet name="header">
+ <rich:columnGroup id="columnGroup">
+ <rich:column id="columnHeaderEmployees" colspan="3">
+ <h:outputText id="columnHeaderEmployeesText" value="Employees" />
+ </rich:column>
+ <rich:column id="columnHeaderName" breakRowBefore="true">
+ <h:outputText id="columnHeaderNameText" value="Name" />
+ </rich:column>
+ <rich:column id="columnHeaderTitle">
+ <h:outputText id="columnHeaderTitleText" value="Title" />
+ </rich:column>
+ <rich:column id="columnHeaderBirthdate">
+ <h:outputText id="columnHeaderBirthdateText" value="Birthdate" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ <rich:column id="columnSubTable" colspan="3">
+ <rich:collapsibleSubTableToggler id="subTableTC" for="richSubTable"/>
+ <h:outputText value="#{list[0].sex == 'MALE' ? 'Men' : 'Women'}" />
+ </rich:column>
+
+ <rich:collapsibleSubTable id="richSubTable"
+ breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
+ expandMode="#{richSubTableBean.attributes['expandMode'].value}"
+ expanded="#{richSubTableBean.attributes['expanded'].value}"
+ filterVar="#{richSubTableBean.attributes['filterVar'].value}"
+ filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
+ first="#{richSubTableBean.attributes['first'].value}"
+ footer="#{richSubTableBean.attributes['footer'].value}"
+ header="#{richSubTableBean.attributes['header'].value}"
+ iterationState="#{richSubTableBean.attributes['iterationState'].value}"
+ iterationStatusVar="#{richSubTableBean.attributes['iterationStatusVar'].value}"
+ keepSaved="#{richSubTableBean.attributes['keepSaved'].value}"
+ noData="#{richSubTableBean.attributes['noData'].value}"
+ noDataLabel="#{richSubTableBean.attributes['noDataLabel'].value}"
+ relativeRowIndex="#{richSubTableBean.attributes['relativeRowIndex'].value}"
+ rendered="#{richSubTableBean.attributes['rendered'].value}"
+ rowAvailable="#{richSubTableBean.attributes['rowAvailable'].value}"
+ rowCount="#{richSubTableBean.attributes['rowCount'].value}"
+ rowData="#{richSubTableBean.attributes['rowData'].value}"
+ rowIndex="#{richSubTableBean.attributes['rowIndex'].value}"
+ rowKey="#{richSubTableBean.attributes['rowKey'].value}"
+ rowKeyConverter="#{richSubTableBean.attributes['rowKeyConverter'].value}"
+ rows="#{richSubTableBean.attributes['rows'].value}"
+ selection="#{richSubTableBean.attributes['selection'].value}"
+ sortExpression="#{richSubTableBean.attributes['sortExpression'].value}"
+ sortMode="#{richSubTableBean.attributes['sortMode'].value}"
+ sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
+ sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
+ toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+ value="#{richSubTableBean.state ? list : null}"
+ var="item">
+
+ <f:facet name="noData">
+ <h:outputText id="noData" value="#{richSubTableBean.facets['noData']}" style="color: red;"
+ rendered="#{not empty richSubTableBean.facets['noData']}"/>
+ </f:facet>
+
+ <f:facet name="header">
+ <h:outputText id="header" value="#{richSubTableBean.facets['header']}"
+ rendered="#{not empty richSubTableBean.facets['header']}" />
+ </f:facet>
+
+ <f:facet name="footer">
+ <h:outputText id="footer" value="#{richSubTableBean.facets['footer']}"
+ rendered="#{not empty richSubTableBean.facets['footer']}" />
+ </f:facet>
+
+ <rich:column id="columnName">
+ <h:outputText id="name" value="#{item.name}" />
+ </rich:column>
+ <rich:column id="columnTitle">
+ <h:outputText id="title" value="#{item.title}" />
+ </rich:column>
+ <rich:column id="columnBirthdate">
+ <h:outputText id="birthdate" value="#{item.birthdate}">
+ <f:convertDateTime pattern="d MMM yyyy"/>
+ </h:outputText>
+ </rich:column>
+
+ </rich:collapsibleSubTable>
+ </rich:dataTable>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <a4j:ajax render="#{nestedComponentId}">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="No Data Facet: " />
+ <h:inputText id="noDataInput" value="#{richSubTableBean.facets['noData']}" />
+
+ <h:outputLabel value="Header Facet:" />
+ <h:inputText id="headerInput" value="#{richSubTableBean.facets['header']}" />
+
+ <h:outputLabel value="Footer Facet:" />
+ <h:inputText id="footerInput" value="#{richSubTableBean.facets['footer']}" />
+ </h:panelGrid>
+ </a4j:ajax>
+
+ <metamer:attributes value="#{richSubTableBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Copied: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml (from rev 20922, modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml 2011-01-10 08:09:52 UTC (rev 20925)
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox id="noDataCheckbox" value="#{richSubTableBean.state}">
+ <a4j:ajax render="richDataTable"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list">
+ <f:facet name="header">
+ <rich:columnGroup id="columnGroup">
+ <rich:column id="columnHeaderEmployees" colspan="3">
+ <h:outputText id="columnHeaderEmployeesText" value="Employees" />
+ </rich:column>
+ <rich:column id="columnHeaderName" breakRowBefore="true">
+ <h:outputText id="columnHeaderNameText" value="Name" />
+ </rich:column>
+ <rich:column id="columnHeaderTitle">
+ <h:outputText id="columnHeaderTitleText" value="Title" />
+ </rich:column>
+ <rich:column id="columnHeaderBirthdate">
+ <h:outputText id="columnHeaderBirthdateText" value="Birthdate" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ <rich:column id="columnSubTable" colspan="3">
+ <rich:collapsibleSubTableToggler id="subTableTC" for="richSubTable"/>
+ <h:outputText value="#{list[0].sex == 'MALE' ? 'Men' : 'Women'}" />
+ </rich:column>
+
+ <rich:collapsibleSubTable id="richSubTable"
+ breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
+ expandMode="#{richSubTableBean.attributes['expandMode'].value}"
+ expanded="#{richSubTableBean.attributes['expanded'].value}"
+ filterVar="#{richSubTableBean.attributes['filterVar'].value}"
+ filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
+ first="#{richSubTableBean.attributes['first'].value}"
+ footer="#{richSubTableBean.attributes['footer'].value}"
+ header="#{richSubTableBean.attributes['header'].value}"
+ iterationState="#{richSubTableBean.attributes['iterationState'].value}"
+ iterationStatusVar="#{richSubTableBean.attributes['iterationStatusVar'].value}"
+ keepSaved="#{richSubTableBean.attributes['keepSaved'].value}"
+ noData="#{richSubTableBean.attributes['noData'].value}"
+ noDataLabel="#{richSubTableBean.attributes['noDataLabel'].value}"
+ relativeRowIndex="#{richSubTableBean.attributes['relativeRowIndex'].value}"
+ rendered="#{richSubTableBean.attributes['rendered'].value}"
+ rowAvailable="#{richSubTableBean.attributes['rowAvailable'].value}"
+ rowCount="#{richSubTableBean.attributes['rowCount'].value}"
+ rowData="#{richSubTableBean.attributes['rowData'].value}"
+ rowIndex="#{richSubTableBean.attributes['rowIndex'].value}"
+ rowKey="#{richSubTableBean.attributes['rowKey'].value}"
+ rowKeyConverter="#{richSubTableBean.attributes['rowKeyConverter'].value}"
+ rows="#{richSubTableBean.attributes['rows'].value}"
+ selection="#{richSubTableBean.attributes['selection'].value}"
+ sortExpression="#{richSubTableBean.attributes['sortExpression'].value}"
+ sortMode="#{richSubTableBean.attributes['sortMode'].value}"
+ sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
+ sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
+ toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+ value="#{richSubTableBean.state ? list : null}"
+ var="item">
+
+ <f:facet name="header">
+ header facet
+ </f:facet>
+
+ <f:facet name="noData">
+ no data facet
+ </f:facet>
+
+ <rich:column id="columnName">
+ <h:outputText id="name" value="#{item.name}" />
+ </rich:column>
+ <rich:column id="columnTitle">
+ <h:outputText id="title" value="#{item.title}" />
+ </rich:column>
+ <rich:column id="columnBirthdate">
+ <h:outputText id="birthdate" value="#{item.birthdate}">
+ <f:convertDateTime pattern="d MMM yyyy"/>
+ </h:outputText>
+ </rich:column>
+
+ <f:facet name="footer">
+ footer facet
+ </f:facet>
+
+ </rich:collapsibleSubTable>
+ </rich:dataTable>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richSubTableBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/list.xhtml 2011-01-10 06:13:31 UTC (rev 20924)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/list.xhtml 2011-01-10 08:09:52 UTC (rev 20925)
@@ -34,7 +34,15 @@
<metamer:testPageLink id="simple" outcome="simple" value="Simple">
Page that contains a table with two <b>rich:collapsibleSubTable</b>s with defined facets (header, footer, noData) and input boxes for all its attributes.
</metamer:testPageLink>
+
+ <metamer:testPageLink id="facets" outcome="facets" value="Facets">
+ Simple page that contains <b>rich:collapsibleSubTable</b> (with model containing employees) and all facets for this table updateable by Ajax.
+ </metamer:testPageLink>
+ <metamer:testPageLink id="scroller" outcome="scroller" value="Data Scroller">
+ Page that contains <b>rich:collapsibleSubTable</b> (with model containing employees), data scroller and input boxes for all its attributes.
+ </metamer:testPageLink>
+
<metamer:testPageLink id="components1" outcome="components1" value="Various Components 1">
Page that contains a table with two <b>rich:collapsibleSubTable</b>s (with model containing employees) and input boxes for all its attributes.
<span style="color: red">TODO will be used with various types of input and command components as soon as available</span>
@@ -45,6 +53,18 @@
<span style="color: red">TODO will be used with various types of input and command components as soon as available</span>
</metamer:testPageLink>
+ <metamer:testPageLink id="sorting-using-component-control" outcome="sorting-using-component-control" value="Table Sorting - Component Control">
+ <b>rich:collapsibleSubTable</b> (with model containing employees) sortable by <b>rich:componentControl</b>.
+ </metamer:testPageLink>
+
+ <metamer:testPageLink id="sorting-using-column" outcome="sorting-using-column" value="Table Sorting - Column based">
+ <b>rich:collapsibleSubTable</b> (with model containing employees) with custom sorting by <b>rich:column</b>'s attribute @sortBy, @sortOrder.
+ </metamer:testPageLink>
+
+ <metamer:testPageLink id="filtering" outcome="filtering" value="Table Filtering">
+ Page that contains filterable <b>rich:collapsibleSubTable</b> (with model containing employees) and input boxes for all its attributes filterable by its columns.
+ </metamer:testPageLink>
+
</ui:define>
</ui:composition>
Copied: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/scroller.xhtml (from rev 20922, modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/scroller.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/scroller.xhtml 2011-01-10 08:09:52 UTC (rev 20925)
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox id="noDataCheckbox" value="#{richSubTableBean.state}">
+ <a4j:ajax render="richDataTable"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list">
+ <f:facet name="header">
+ <rich:columnGroup id="columnGroup">
+ <rich:column id="columnHeaderEmployees" colspan="3">
+ <h:outputText id="columnHeaderEmployeesText" value="Employees" />
+ </rich:column>
+ <rich:column id="columnHeaderName" breakRowBefore="true">
+ <h:outputText id="columnHeaderNameText" value="Name" />
+ </rich:column>
+ <rich:column id="columnHeaderTitle">
+ <h:outputText id="columnHeaderTitleText" value="Title" />
+ </rich:column>
+ <rich:column id="columnHeaderBirthdate">
+ <h:outputText id="columnHeaderBirthdateText" value="Birthdate" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ <rich:column id="columnSubTable" colspan="3">
+ <rich:collapsibleSubTableToggler id="subTableTC" for="richSubTable"/>
+ <h:outputText value="#{list[0].sex == 'MALE' ? 'Men' : 'Women'}" />
+ </rich:column>
+
+ <rich:collapsibleSubTable id="richSubTable"
+ breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
+ expandMode="#{richSubTableBean.attributes['expandMode'].value}"
+ expanded="#{richSubTableBean.attributes['expanded'].value}"
+ filterVar="#{richSubTableBean.attributes['filterVar'].value}"
+ filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
+ first="#{richSubTableBean.attributes['first'].value}"
+ footer="#{richSubTableBean.attributes['footer'].value}"
+ header="#{richSubTableBean.attributes['header'].value}"
+ iterationState="#{richSubTableBean.attributes['iterationState'].value}"
+ iterationStatusVar="#{richSubTableBean.attributes['iterationStatusVar'].value}"
+ keepSaved="#{richSubTableBean.attributes['keepSaved'].value}"
+ noData="#{richSubTableBean.attributes['noData'].value}"
+ noDataLabel="#{richSubTableBean.attributes['noDataLabel'].value}"
+ relativeRowIndex="#{richSubTableBean.attributes['relativeRowIndex'].value}"
+ rendered="#{richSubTableBean.attributes['rendered'].value}"
+ rowAvailable="#{richSubTableBean.attributes['rowAvailable'].value}"
+ rowCount="#{richSubTableBean.attributes['rowCount'].value}"
+ rowData="#{richSubTableBean.attributes['rowData'].value}"
+ rowIndex="#{richSubTableBean.attributes['rowIndex'].value}"
+ rowKey="#{richSubTableBean.attributes['rowKey'].value}"
+ rowKeyConverter="#{richSubTableBean.attributes['rowKeyConverter'].value}"
+ rows="#{richSubTableBean.attributes['rows'].value}"
+ selection="#{richSubTableBean.attributes['selection'].value}"
+ sortExpression="#{richSubTableBean.attributes['sortExpression'].value}"
+ sortMode="#{richSubTableBean.attributes['sortMode'].value}"
+ sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
+ sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
+ toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+ value="#{richSubTableBean.state ? list : null}"
+ var="item">
+
+ <f:facet name="footer">
+ <rich:dataScroller id="scroller1" for="richSubTable" maxPages="7" render="richDataTable" />
+ </f:facet>
+
+ <rich:column id="columnName">
+ <h:outputText id="name" value="#{item.name}" />
+ </rich:column>
+ <rich:column id="columnTitle">
+ <h:outputText id="title" value="#{item.title}" />
+ </rich:column>
+ <rich:column id="columnBirthdate">
+ <h:outputText id="birthdate" value="#{item.birthdate}">
+ <f:convertDateTime pattern="d MMM yyyy"/>
+ </h:outputText>
+ </rich:column>
+
+ </rich:collapsibleSubTable>
+ </rich:dataTable>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richSubTableBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml 2011-01-10 06:13:31 UTC (rev 20924)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml 2011-01-10 08:09:52 UTC (rev 20925)
@@ -102,14 +102,6 @@
value="#{richSubTableBean.state ? list : null}"
var="item">
- <f:facet name="header">
- header facet
- </f:facet>
-
- <f:facet name="noData">
- no data facet
- </f:facet>
-
<rich:column id="columnName">
<h:outputText id="name" value="#{item.name}" />
</rich:column>
@@ -122,10 +114,6 @@
</h:outputText>
</rich:column>
- <f:facet name="footer">
- footer facet
- </f:facet>
-
</rich:collapsibleSubTable>
</rich:dataTable>
Copied: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-column.xhtml (from rev 20922, modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-column.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-column.xhtml 2011-01-10 08:09:52 UTC (rev 20925)
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox id="noDataCheckbox" value="#{richSubTableBean.state}">
+ <a4j:ajax render="richDataTable"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list">
+ <f:facet name="header">
+ <rich:columnGroup id="columnGroup">
+ <rich:column id="columnHeaderEmployees" colspan="3">
+ <h:outputText id="columnHeaderEmployeesText" value="Employees" />
+ </rich:column>
+ <rich:column id="columnHeaderName" breakRowBefore="true">
+ <h:outputText id="columnHeaderNameText" value="Name" />
+ </rich:column>
+ <rich:column id="columnHeaderTitle">
+ <h:outputText id="columnHeaderTitleText" value="Title" />
+ </rich:column>
+ <rich:column id="columnHeaderBirthdate">
+ <h:outputText id="columnHeaderBirthdateText" value="Birthdate" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ <rich:column id="columnSubTable" colspan="3">
+ <rich:collapsibleSubTableToggler id="subTableTC" for="richSubTable"/>
+ <h:outputText value="#{list[0].sex == 'MALE' ? 'Men' : 'Women'}" />
+ </rich:column>
+
+ <rich:collapsibleSubTable id="richSubTable"
+ breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
+ expandMode="#{richSubTableBean.attributes['expandMode'].value}"
+ expanded="#{richSubTableBean.attributes['expanded'].value}"
+ filterVar="#{richSubTableBean.attributes['filterVar'].value}"
+ filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
+ first="#{richSubTableBean.attributes['first'].value}"
+ footer="#{richSubTableBean.attributes['footer'].value}"
+ header="#{richSubTableBean.attributes['header'].value}"
+ iterationState="#{richSubTableBean.attributes['iterationState'].value}"
+ iterationStatusVar="#{richSubTableBean.attributes['iterationStatusVar'].value}"
+ keepSaved="#{richSubTableBean.attributes['keepSaved'].value}"
+ noData="#{richSubTableBean.attributes['noData'].value}"
+ noDataLabel="#{richSubTableBean.attributes['noDataLabel'].value}"
+ relativeRowIndex="#{richSubTableBean.attributes['relativeRowIndex'].value}"
+ rendered="#{richSubTableBean.attributes['rendered'].value}"
+ rowAvailable="#{richSubTableBean.attributes['rowAvailable'].value}"
+ rowCount="#{richSubTableBean.attributes['rowCount'].value}"
+ rowData="#{richSubTableBean.attributes['rowData'].value}"
+ rowIndex="#{richSubTableBean.attributes['rowIndex'].value}"
+ rowKey="#{richSubTableBean.attributes['rowKey'].value}"
+ rowKeyConverter="#{richSubTableBean.attributes['rowKeyConverter'].value}"
+ rows="#{richSubTableBean.attributes['rows'].value}"
+ selection="#{richSubTableBean.attributes['selection'].value}"
+ sortExpression="#{richSubTableBean.attributes['sortExpression'].value}"
+ sortMode="#{richSubTableBean.attributes['sortMode'].value}"
+ sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
+ sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
+ toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+ value="#{richSubTableBean.state ? list : null}"
+ var="item">
+
+ <f:facet name="header">
+ header facet
+ </f:facet>
+
+ <f:facet name="noData">
+ no data facet
+ </f:facet>
+
+ <rich:column id="columnName">
+ <h:outputText id="name" value="#{item.name}" />
+ </rich:column>
+ <rich:column id="columnTitle">
+ <h:outputText id="title" value="#{item.title}" />
+ </rich:column>
+ <rich:column id="columnBirthdate">
+ <h:outputText id="birthdate" value="#{item.birthdate}">
+ <f:convertDateTime pattern="d MMM yyyy"/>
+ </h:outputText>
+ </rich:column>
+
+ <f:facet name="footer">
+ footer facet
+ </f:facet>
+
+ </rich:collapsibleSubTable>
+ </rich:dataTable>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richSubTableBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Copied: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-component-control.xhtml (from rev 20922, modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-component-control.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-component-control.xhtml 2011-01-10 08:09:52 UTC (rev 20925)
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox id="noDataCheckbox" value="#{richSubTableBean.state}">
+ <a4j:ajax render="richDataTable"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list">
+ <f:facet name="header">
+ <rich:columnGroup id="columnGroup">
+ <rich:column id="columnHeaderEmployees" colspan="3">
+ <h:outputText id="columnHeaderEmployeesText" value="Employees" />
+ </rich:column>
+ <rich:column id="columnHeaderName" breakRowBefore="true">
+ <h:commandLink id="sortNames" value="Name">
+ <rich:componentControl event="click" target="richSubTable" operation="sort">
+ <f:param value="columnName" />
+ </rich:componentControl>
+ </h:commandLink>
+ </rich:column>
+ <rich:column id="columnHeaderTitle">
+ <h:outputText id="columnHeaderTitleText" value="Title" />
+ </rich:column>
+ <rich:column id="columnHeaderBirthdate">
+ <h:outputText id="columnHeaderBirthdateText" value="Birthdate" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ <rich:column id="columnSubTable" colspan="3">
+ <rich:collapsibleSubTableToggler id="subTableTC" for="richSubTable"/>
+ <h:outputText value="#{list[0].sex == 'MALE' ? 'Men' : 'Women'}" />
+ </rich:column>
+
+ <rich:collapsibleSubTable id="richSubTable"
+ breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
+ expandMode="#{richSubTableBean.attributes['expandMode'].value}"
+ expanded="#{richSubTableBean.attributes['expanded'].value}"
+ filterVar="#{richSubTableBean.attributes['filterVar'].value}"
+ filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
+ first="#{richSubTableBean.attributes['first'].value}"
+ footer="#{richSubTableBean.attributes['footer'].value}"
+ header="#{richSubTableBean.attributes['header'].value}"
+ iterationState="#{richSubTableBean.attributes['iterationState'].value}"
+ iterationStatusVar="#{richSubTableBean.attributes['iterationStatusVar'].value}"
+ keepSaved="#{richSubTableBean.attributes['keepSaved'].value}"
+ noData="#{richSubTableBean.attributes['noData'].value}"
+ noDataLabel="#{richSubTableBean.attributes['noDataLabel'].value}"
+ relativeRowIndex="#{richSubTableBean.attributes['relativeRowIndex'].value}"
+ rendered="#{richSubTableBean.attributes['rendered'].value}"
+ rowAvailable="#{richSubTableBean.attributes['rowAvailable'].value}"
+ rowCount="#{richSubTableBean.attributes['rowCount'].value}"
+ rowData="#{richSubTableBean.attributes['rowData'].value}"
+ rowIndex="#{richSubTableBean.attributes['rowIndex'].value}"
+ rowKey="#{richSubTableBean.attributes['rowKey'].value}"
+ rowKeyConverter="#{richSubTableBean.attributes['rowKeyConverter'].value}"
+ rows="#{richSubTableBean.attributes['rows'].value}"
+ selection="#{richSubTableBean.attributes['selection'].value}"
+ sortExpression="#{richSubTableBean.attributes['sortExpression'].value}"
+ sortMode="#{richSubTableBean.attributes['sortMode'].value}"
+ sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
+ sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
+ toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+ value="#{richSubTableBean.state ? list : null}"
+ var="item">
+
+ <f:facet name="header">
+ header facet
+ </f:facet>
+
+ <f:facet name="noData">
+ no data facet
+ </f:facet>
+
+ <rich:column id="columnName">
+ <h:outputText id="name" value="#{item.name}" />
+ </rich:column>
+ <rich:column id="columnTitle">
+ <h:outputText id="title" value="#{item.title}" />
+ </rich:column>
+ <rich:column id="columnBirthdate">
+ <h:outputText id="birthdate" value="#{item.birthdate}">
+ <f:convertDateTime pattern="d MMM yyyy"/>
+ </h:outputText>
+ </rich:column>
+
+ <f:facet name="footer">
+ footer facet
+ </f:facet>
+
+ </rich:collapsibleSubTable>
+ </rich:dataTable>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richSubTableBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
13 years, 11 months
JBoss Rich Faces SVN: r20924 - in modules/docs/trunk: Component_Reference/src/main/docbook/en-US/skinning and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2011-01-10 01:13:31 -0500 (Mon, 10 Jan 2011)
New Revision: 20924
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/tabl-richdataTable.xml
modules/docs/trunk/Developer_Guide/src/main/docbook/en-US/appe-Developer_Guide-Style_classes_and_skin_parameters.xml
Log:
Tables and grids skinning references
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2011-01-10 05:02:39 UTC (rev 20923)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2011-01-10 06:13:31 UTC (rev 20924)
@@ -990,6 +990,11 @@
</listitem>
</itemizedlist>
</section>
+
+ <section id="sect-Component_Reference-richextendedDataTable-Style_classes_and_skin_parameters">
+ <title>Style classes and skin parameters</title>
+ <xi:include href="skinning/tabl-richextendedDataTable.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ </section>
</section>
<!-- TODO
@@ -1243,6 +1248,11 @@
</listitem>
</itemizedlist>
</section>
+
+ <section id="sect-Component_Reference-richlist-Style_classes_and_skin_parameters">
+ <title>Style classes and skin parameters</title>
+ <xi:include href="skinning/tabl-richlist.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ </section>
</section>
<section id="sect-Component_Reference-Tables_and_grids-Table_filtering">
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/tabl-richdataTable.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/tabl-richdataTable.xml 2011-01-10 05:02:39 UTC (rev 20923)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/tabl-richdataTable.xml 2011-01-10 06:13:31 UTC (rev 20924)
@@ -133,7 +133,7 @@
<term><classname>.rich-table-subheader</classname></term>
<listitem>
<para>
- This class defines the styles for a column header.
+ This class defines the styles for a column sub-header.
</para>
</listitem>
</varlistentry>
@@ -167,7 +167,7 @@
<term><classname>.rich-table-subheadercell</classname></term>
<listitem>
<para>
- This class defines the styles for a column header cell.
+ This class defines the styles for a column sub-header cell.
</para>
</listitem>
</varlistentry>
Modified: modules/docs/trunk/Developer_Guide/src/main/docbook/en-US/appe-Developer_Guide-Style_classes_and_skin_parameters.xml
===================================================================
--- modules/docs/trunk/Developer_Guide/src/main/docbook/en-US/appe-Developer_Guide-Style_classes_and_skin_parameters.xml 2011-01-10 05:02:39 UTC (rev 20923)
+++ modules/docs/trunk/Developer_Guide/src/main/docbook/en-US/appe-Developer_Guide-Style_classes_and_skin_parameters.xml 2011-01-10 06:13:31 UTC (rev 20924)
@@ -7,13 +7,29 @@
Each of the <productname>RichFaces</productname> components are listed below, along with their style classes and skin parameters. For further details on each component, refer to the relevant section in the <citetitle>RichFaces Component Reference</citetitle>.
</para>
<!-- This appendix pulls in the skinning reference tables from the Component Reference -->
+ <section id="sect-Component_Reference-richlist-Style_classes_and_skin_parameters">
+ <title><sgmltag><rich:list></sgmltag></title>
+ <xi:include href="skinning/tabl-richlist.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include href="http://anonsvn.jboss.org/repos/richfaces/modules/docs/trunk/Component_Ref..." xmlns:xi="http://www.w3.org/2001/XInclude" />
+ </xi:fallback>
+ </xi:include>
+ </section>
<section id="sect-Component_Reference-richdataTable-Style_classes_and_skin_parameters">
- <title><sgmltag><rich:dataTable></sgmltag></title>
+ <title><sgmltag><rich:dataTable></sgmltag>, <sgmltag><rich:column></sgmltag>, <sgmltag><rich:columnGroup></sgmltag>, <sgmltag><rich:dataGrid></sgmltag></title>
<xi:include href="skinning/tabl-richdataTable.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="http://anonsvn.jboss.org/repos/richfaces/modules/docs/trunk/Component_Ref..." xmlns:xi="http://www.w3.org/2001/XInclude" />
</xi:fallback>
</xi:include>
</section>
+ <section id="sect-Component_Reference-richdataTable-Style_classes_and_skin_parameters">
+ <title><sgmltag><rich:extendedDataTable></sgmltag></title>
+ <xi:include href="skinning/tabl-richextendedDataTable.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include href="http://anonsvn.jboss.org/repos/richfaces/modules/docs/trunk/Component_Ref..." xmlns:xi="http://www.w3.org/2001/XInclude" />
+ </xi:fallback>
+ </xi:include>
+ </section>
</appendix>
13 years, 11 months