JBoss Rich Faces SVN: r16569 - in branches/community/3.3.X/test-applications/seleniumTest: richfaces/src/test/java/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-03-12 10:57:39 -0500 (Fri, 12 Mar 2010)
New Revision: 16569
Modified:
branches/community/3.3.X/test-applications/seleniumTest/pom.xml
branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
seleniumTest - update selenium dependencies - selenium-maven-plugin:1.0-rc-1 and adequately selenium-*:1.0-beta-2
Modified: branches/community/3.3.X/test-applications/seleniumTest/pom.xml
===================================================================
--- branches/community/3.3.X/test-applications/seleniumTest/pom.xml 2010-03-12 13:31:06 UTC (rev 16568)
+++ branches/community/3.3.X/test-applications/seleniumTest/pom.xml 2010-03-12 15:57:39 UTC (rev 16569)
@@ -30,7 +30,7 @@
<enabled>true</enabled>
</releases>
</repository>
- <repository>
+ <repository>
<id>nexus-openqa-snapshots</id>
<name>OpenQA Snapshots Repository</name>
<url>http://nexus.openqa.org/content/repositories/snapshots</url>
@@ -116,7 +116,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
- <version>1.0-beta-2</version>
+ <version>1.0-rc-1</version>
<executions>
<!--execution>
<id>xvfb</id>
@@ -160,7 +160,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
- <version>1.0</version>
+ <version>1.0-rc-1</version>
<executions>
<!--
<execution>
@@ -209,19 +209,19 @@
<dependency>
<groupId>org.seleniumhq.selenium.core</groupId>
<artifactId>selenium-core</artifactId>
- <version>1.0.1</version>
+ <version>1.0-beta-2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium.client-drivers</groupId>
<artifactId>selenium-java-client-driver</artifactId>
- <version>1.0.1</version>
+ <version>1.0-beta-2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium.server</groupId>
<artifactId>selenium-server-coreless</artifactId>
- <version>1.0.1</version>
+ <version>1.0-beta-2</version>
<scope>test</scope>
<!--exclusions>
<exclusion>
Modified: branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2010-03-12 13:31:06 UTC (rev 16568)
+++ branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2010-03-12 15:57:39 UTC (rev 16569)
@@ -131,7 +131,7 @@
config.setFirefoxProfileTemplate(new File(getFirefoxTemplate()));
}
config.setUserExtensions(new File(getClass().getClassLoader().getResource("script/selenium/user-extensions.js").toURI()));
- config.setSingleWindow(true);
+ config.setMultiWindow(false);
//TODO only for test
config.setPort(16334);
seleniumServer = new SeleniumServer(false, config);
14 years, 9 months
JBoss Rich Faces SVN: r16568 - root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-03-12 08:31:06 -0500 (Fri, 12 Mar 2010)
New Revision: 16568
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/TagHandlerClassGeneratorTest.java
Log:
fix test for tag handler class generator
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java 2010-03-12 13:16:30 UTC (rev 16567)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java 2010-03-12 13:31:06 UTC (rev 16568)
@@ -23,17 +23,12 @@
package org.richfaces.cdk.generate.java;
-import static org.easymock.EasyMock.*;
-
-import java.io.StringWriter;
-import java.util.Set;
-
-import javax.faces.component.UIOutput;
-import javax.faces.el.ValueBinding;
-import javax.faces.el.MethodBinding;
-import javax.el.ValueExpression;
-import javax.el.MethodExpression;
-
+import com.google.inject.Inject;
+import static org.easymock.EasyMock.anyInt;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.richfaces.cdk.CdkTestRunner;
@@ -43,7 +38,11 @@
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.Property;
-import com.google.inject.Inject;
+import javax.el.MethodExpression;
+import javax.faces.component.UIOutput;
+import javax.faces.el.MethodBinding;
+import java.io.StringWriter;
+import java.util.Set;
/**
* <p class="changed_added_4_0">
@@ -100,10 +99,13 @@
attribute = component.getOrCreateAttribute("testBinding");
attribute.setType(new ClassName(MethodBinding.class));
attribute.setGenerate(true);
+ attribute.setBinding(true);
+ attribute.setBindingAttribute(true);
attribute = component.getOrCreateAttribute("testExpr");
attribute.setType(new ClassName(MethodExpression.class));
attribute.setGenerate(true);
+ attribute.setBindingAttribute(true);
attribute = component.getOrCreateAttribute("id");
attribute.setType(new ClassName(String.class));
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/TagHandlerClassGeneratorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/TagHandlerClassGeneratorTest.java 2010-03-12 13:16:30 UTC (rev 16567)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/TagHandlerClassGeneratorTest.java 2010-03-12 13:31:06 UTC (rev 16568)
@@ -22,16 +22,12 @@
package org.richfaces.cdk.generate.java;
+import com.google.inject.Inject;
import static org.easymock.EasyMock.anyInt;
import static org.easymock.EasyMock.anyObject;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
-
-import java.io.StringWriter;
-
-import javax.faces.view.facelets.ComponentHandler;
-
import org.junit.Test;
import org.junit.runner.RunWith;
import org.richfaces.cdk.CdkTestRunner;
@@ -43,7 +39,8 @@
import org.richfaces.cdk.model.TagModel;
import org.richfaces.cdk.model.validator.ValidatorImpl;
-import com.google.inject.Inject;
+import javax.faces.view.facelets.ComponentHandler;
+import java.io.StringWriter;
/**
* @author akolonitsky
@@ -52,15 +49,9 @@
@RunWith(CdkTestRunner.class)
public class TagHandlerClassGeneratorTest extends AbstractClassGeneratorTest {
- @Mock
- private NamingConventions namiingConventions;
-
@Inject
private TagHandlerClassGenerator generator;
- @Inject
- private ValidatorImpl validator;
-
@Test
public void testGetOutputFileBehavior() throws Exception {
final StringWriter outputWriter = new StringWriter();
@@ -77,12 +68,9 @@
tagModel.setTargetClass(ClassName.parseName("org.richfaces.cdk.generate.java.GeneratedTagHandler"));
tagModel.setBaseClass(ClassName.parseName(ComponentHandler.class.getName()));
- //TODO nick - review
- validator.verify();
-
generator.process(tagModel);
-// System.out.println(outputWriter);
+ System.out.println(outputWriter);
verify(output);
compare(outputWriter, "GeneratedTagHandler.java");
14 years, 9 months
JBoss Rich Faces SVN: r16567 - in root/cdk/trunk/plugins/generator/src: test/java/org/richfaces/cdk/xmlconfig and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-03-12 08:16:30 -0500 (Fri, 12 Mar 2010)
New Revision: 16567
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/CdkResolverTest.java
Log:
fix xml tests resources loading
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java 2010-03-12 12:09:36 UTC (rev 16566)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java 2010-03-12 13:16:30 UTC (rev 16567)
@@ -23,14 +23,8 @@
package org.richfaces.cdk.xmlconfig;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-
+import com.google.common.collect.ImmutableMap;
+import com.google.inject.Inject;
import org.richfaces.cdk.CdkClassLoader;
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Source;
@@ -39,8 +33,13 @@
import org.xml.sax.SAXException;
import org.xml.sax.ext.EntityResolver2;
-import com.google.common.collect.ImmutableMap;
-import com.google.inject.Inject;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URL;
/**
* <p class="changed_added_4_0">
@@ -173,12 +172,12 @@
URL url;
url = CdkEntityResolver.class.getResource(SYSTEM_PREFIX + path);
- InputStream inputStream;
+ InputStream inputStream = null;
if (null != url) {
try {
inputStream = url.openStream();
} catch (IOException e) {
- inputStream = CdkEntityResolver.class.getResourceAsStream(SYSTEM_PREFIX + path);
+ // Do nothnig.
}
if (inputStream != null) {
@@ -193,12 +192,12 @@
URL url;
url = loader.getResource(RESOURCE_PREFIX + path);
- InputStream inputStream;
+ InputStream inputStream = null;
if (null != url) {
try {
inputStream = url.openStream();
} catch (IOException e) {
- inputStream = loader.getResourceAsStream(RESOURCE_PREFIX + path);
+ // Do nothnig.
}
if (inputStream != null) {
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/CdkResolverTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/CdkResolverTest.java 2010-03-12 12:09:36 UTC (rev 16566)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/CdkResolverTest.java 2010-03-12 13:16:30 UTC (rev 16567)
@@ -13,8 +13,11 @@
import java.io.ByteArrayInputStream;
import java.io.InputStream;
+import java.io.IOException;
import java.net.URL;
import java.net.MalformedURLException;
+import java.net.URLStreamHandler;
+import java.net.URLConnection;
@RunWith(CdkTestRunner.class)
public class CdkResolverTest extends CdkTestBase {
@@ -42,7 +45,7 @@
@Override
public InputStream getResourceAsStream(String name) {
if ("foo/bar.xml".equals(name)) {
- return new ByteArrayInputStream("baz".getBytes());
+ return getBarXmlStream();
} else {
return super.getResourceAsStream(name);
}
@@ -51,7 +54,8 @@
public URL getResource(String name) {
if ("foo/bar.xml".equals(name)) {
try {
- return new URL("file", "localhost", "/foo/bar.xml");
+ MyURLStreamHandler myURLStreamHandler = new MyURLStreamHandler(getBarXmlStream());
+ return new URL("file", "localhost", 80, "/foo/bar.xml", myURLStreamHandler);
} catch (MalformedURLException e) {
e.printStackTrace();
return null;
@@ -68,6 +72,10 @@
}
}
+ private ByteArrayInputStream getBarXmlStream() {
+ return new ByteArrayInputStream("baz".getBytes());
+ }
+
@Test
public void testResolveSystemIdSystem() throws Exception {
@@ -103,4 +111,38 @@
verify(facesConfigSource, templatesSource);
assertNotNull(input);
}
+
+
+ private class MyURLConnection extends URLConnection {
+
+ private InputStream inputStream;
+
+ @Override
+ public void connect() throws IOException {
+ }
+
+ MyURLConnection(URL u, InputStream inputStream) {
+ super(u);
+ this.inputStream = inputStream;
+ }
+
+ @Override
+ public InputStream getInputStream() throws IOException {
+ return this.inputStream;
+ }
+ }
+
+ private class MyURLStreamHandler extends URLStreamHandler {
+
+ private InputStream inputStream;
+
+ MyURLStreamHandler(InputStream inputStream) {
+ this.inputStream = inputStream;
+ }
+
+ @Override
+ protected URLConnection openConnection(URL u) throws IOException {
+ return new MyURLConnection(u, inputStream);
+ }
+ }
}
14 years, 9 months
JBoss Rich Faces SVN: r16566 - in root/cdk/trunk/plugins/generator/src: test/java/org/richfaces/cdk/xmlconfig and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-03-12 07:09:36 -0500 (Fri, 12 Mar 2010)
New Revision: 16566
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/CdkResolverTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/XmlTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/testmodel/ValidatorBeanTest.java
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/test/component/AbstractTestComponent.java
Log:
fix xml tests resources loading
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java 2010-03-12 06:34:41 UTC (rev 16565)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java 2010-03-12 12:09:36 UTC (rev 16566)
@@ -29,6 +29,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
+import java.net.URL;
import org.richfaces.cdk.CdkClassLoader;
import org.richfaces.cdk.FileManager;
@@ -78,17 +79,12 @@
.put(
"http://java.sun.com/xml/ns/javaee/javaee_web_services_1_2.xsd",
URN_SYSTEM + "/javaee_web_services_1_2.xsd")
- .put(
- "http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_2.xsd",
- URN_SYSTEM + "/javaee_web_services_client_1_2.xsd").put(
- "http://www.w3.org/2001/03/XMLSchema.dtd",
- URN_SYSTEM + "/XMLSchema.dtd").put(
- "http://www.w3.org/2001/03/xml.xsd",
- URN_SYSTEM + "/xml.xsd").put(
- "http://richfaces.org/cdk/cdk-template.xsd",
- URN_SYSTEM + "/cdk-template.xsd").put(
- "http://richfaces.org/cdk/xhtml-el.xsd",
- URN_SYSTEM + "/xhtml-el.xsd").build();
+ .put("http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_2.xsd", URN_SYSTEM + "/javaee_web_services_client_1_2.xsd")
+ .put("http://www.w3.org/2001/03/XMLSchema.dtd", URN_SYSTEM + "/XMLSchema.dtd")
+ .put("http://www.w3.org/2001/03/xml.xsd", URN_SYSTEM + "/xml.xsd")
+ .put("http://www.w3.org/2001/xml.xsd", URN_SYSTEM + "/xml.xsd")
+ .put("http://richfaces.org/cdk/cdk-template.xsd", URN_SYSTEM + "/cdk-template.xsd")
+ .put("http://richfaces.org/cdk/xhtml-el.xsd", URN_SYSTEM + "/xhtml-el.xsd").build();
@Inject
@@ -174,19 +170,41 @@
// Cdk resources
String path = systemIdInternal.substring(URN_SYSTEM.length());
- InputStream inputStream = CdkEntityResolver.class.getResourceAsStream(SYSTEM_PREFIX + path);
+ URL url;
+ url = CdkEntityResolver.class.getResource(SYSTEM_PREFIX + path);
- if (null != inputStream) {
- entity = new InputSource(inputStream);
+ InputStream inputStream;
+ if (null != url) {
+ try {
+ inputStream = url.openStream();
+ } catch (IOException e) {
+ inputStream = CdkEntityResolver.class.getResourceAsStream(SYSTEM_PREFIX + path);
+ }
+
+ if (inputStream != null) {
+ entity = new InputSource(inputStream);
+ entity.setSystemId(url.toString());
+ }
}
} else if (systemIdInternal.startsWith(URN_RESOURCE)) {
// Project resources
String path = systemIdInternal.substring(URN_RESOURCE.length());
- InputStream inputStream = loader.getResourceAsStream(RESOURCE_PREFIX + path);
+ URL url;
+ url = loader.getResource(RESOURCE_PREFIX + path);
- if (null != inputStream) {
- entity = new InputSource(inputStream);
+ InputStream inputStream;
+ if (null != url) {
+ try {
+ inputStream = url.openStream();
+ } catch (IOException e) {
+ inputStream = loader.getResourceAsStream(RESOURCE_PREFIX + path);
+ }
+
+ if (inputStream != null) {
+ entity = new InputSource(inputStream);
+ entity.setSystemId(url.toString());
+ }
}
} else if (systemIdInternal.startsWith(URN_ATTRIBUTES)) {
@@ -215,7 +233,7 @@
entity = getProjectInputSource(rendererTemplatesFolders, path);
}
- if (null != entity) {
+ if (null != entity && entity.getSystemId() == null) {
entity.setSystemId(systemId);
}
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/CdkResolverTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/CdkResolverTest.java 2010-03-12 06:34:41 UTC (rev 16565)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/CdkResolverTest.java 2010-03-12 12:09:36 UTC (rev 16566)
@@ -13,6 +13,8 @@
import java.io.ByteArrayInputStream;
import java.io.InputStream;
+import java.net.URL;
+import java.net.MalformedURLException;
@RunWith(CdkTestRunner.class)
public class CdkResolverTest extends CdkTestBase {
@@ -46,6 +48,19 @@
}
}
+ public URL getResource(String name) {
+ if ("foo/bar.xml".equals(name)) {
+ try {
+ return new URL("file", "localhost", "/foo/bar.xml");
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ return null;
+ }
+ } else {
+ return super.getResource(name);
+ }
+ }
+
};
binder.bind(CdkClassLoader.class).toInstance(classLoader);
} catch (Exception e) {
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/XmlTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/XmlTest.java 2010-03-12 06:34:41 UTC (rev 16565)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/XmlTest.java 2010-03-12 12:09:36 UTC (rev 16566)
@@ -38,6 +38,9 @@
* @since Jan 13, 2010
*/
public abstract class XmlTest extends JaxbTestBase {
+ static {
+ XMLUnit.setControlEntityResolver(new CdkEntityResolver());
+ }
protected void validateXml(StringWriter facesConfig, String schemaLocation) throws SAXException, IOException {
InputSource is = new InputSource(new StringReader(facesConfig.toString()));
@@ -66,10 +69,10 @@
}
XMLUnit.setNormalizeWhitespace(true);
Diff xmlDiff = new Diff(
- new StringReader(writer.toString()),
- new InputStreamReader(expectedFacesConfigFile));
+ new StringReader(writer.toString()),
+ new InputStreamReader(expectedFacesConfigFile));
- Assert.assertTrue("XML was not similar:"+xmlDiff.toString(), xmlDiff.similar());
+ Assert.assertTrue("XML was not similar:" + xmlDiff.toString(), xmlDiff.similar());
}
protected StringWriter generateFacesConfig(ComponentLibrary library) throws Exception {
@@ -78,7 +81,7 @@
JAXBBinding jaxbBinding = new JAXBBinding();
jaxbBinding.marshal(result, FacesConfigGenerator.FACES_SCHEMA_LOCATION,
- new FacesConfigAdapter().marshal(library));
+ new FacesConfigAdapter().marshal(library));
return writer;
}
}
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/testmodel/ValidatorBeanTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/testmodel/ValidatorBeanTest.java 2010-03-12 06:34:41 UTC (rev 16565)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/testmodel/ValidatorBeanTest.java 2010-03-12 12:09:36 UTC (rev 16566)
@@ -49,6 +49,6 @@
// Checks
checkXmlStructure(facesConfig);
-// validateXml(facesConfig); TODO: Why fail?
+ validateXml(facesConfig);
}
}
\ No newline at end of file
Modified: root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/test/component/AbstractTestComponent.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-03-12 06:34:41 UTC (rev 16565)
+++ root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-03-12 12:09:36 UTC (rev 16566)
@@ -37,7 +37,7 @@
* @author asmirnov(a)exadel.com
*
*/
-@JsfComponent("org.richfaces.cdk.test.TestComponent")
+@JsfComponent(type = "org.richfaces.cdk.test.TestComponent")
public abstract class AbstractTestComponent extends UIComponent implements ValueHolder {
private static final String COMPONENT_FAMILY = "org.richfaces.Test";
@Attribute
14 years, 9 months
JBoss Rich Faces SVN: r16565 - root/docs/trunk/Component_Reference/en-US.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-03-12 01:34:41 -0500 (Fri, 12 Mar 2010)
New Revision: 16565
Modified:
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actions.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Functionality_extension.xml
Log:
Worked on a4j:componentControl
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actions.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actions.xml 2010-03-12 01:13:14 UTC (rev 16564)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actions.xml 2010-03-12 06:34:41 UTC (rev 16565)
@@ -74,41 +74,6 @@
</para>
</section>
- <section id="sect-Component_Reference-Actions-a4jajax">
- <title><sgmltag><a4j:support></sgmltag></title>
- <itemizedlist>
- <listitem>
- <para>
- component-type: <classname>org.ajax4jsf.Support</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- component-family: <classname>org.ajax4jsf.AjaxSupport</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- component-class: <classname>org.ajax4jsf.component.html.HtmlAjaxSupport</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- renderer-type: <classname>org.ajax4jsf.components.AjaxSupportRenderer</classname>
- </para>
- </listitem>
- </itemizedlist>
- <para>
- The <sgmltag><a4j:support></sgmltag> component allows Ajax capability to be added to any non-Ajax component. It is placed as a direct child to the component that requires Ajax support. The <sgmltag><a4j:support></sgmltag> component uses the common attributes listed in <xref linkend="chap-Component_Reference-Common_Ajax_attributes" />.
- </para>
- <note>
- <title>Attaching JavaScript functions</title>
- <para>
- When attaching the <sgmltag><a4j:support></sgmltag> component to non-Ajax JavaServer Faces command components, such as <sgmltag><h:commandButton></sgmltag> and <sgmltag><h:commandLink></sgmltag>, it is important to set <code>disabledDefault="true"</code>. If this attribute is not set, a non-Ajax request is sent after the Ajax request and the page is refreshed unexpectedly.
- </para>
- </note>
- </section>
-
<section id="sect-Component_Reference-Actions-a4jajaxListener">
<title><sgmltag><a4j:ajaxListener></sgmltag></title>
<itemizedlist>
@@ -235,6 +200,118 @@
</para>
</section>
+ <section id="sect-Component_Reference-Functionality_extension-a4jcomponentControl">
+ <title><sgmltag><a4j:componentControl></sgmltag></title>
+ <remark>The following reference data is taken from the old <sgmltag><rich:componentControl></sgmltag> reference. The details may be different now that the component is part of the <classname>a4j</classname> tag library.</remark>
+ <itemizedlist>
+ <listitem>
+ <para>
+ component-type: <classname>org.richfaces.ComponentControl</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-family: <classname>org.richfaces.ComponentControl</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-class: <classname>org.richfaces.component.html.HtmlComponentControl</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ renderer-type: <classname>org.richfaces.ComponentControlRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ tag-class: <classname>org.richfaces.taglib.ComponentControlTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The <sgmltag><a4j:componentControl></sgmltag> allows JavaScript API functions to be called on components after defined events. Initialization variants and activation events can be customized, and parameters can be passed to the target component.
+ </para>
+ <para>
+ The <varname>event</varname>, <varname>for</varname>, and <varname>operation</varname> attributes are all that is required to attach JavaScript functions to the parent component. The <varname>event</varname> attribute specifies the event that triggers the JavaScript API function call. The <varname>for</varname> attribute defines the target component, and the <varname>operation</varname> attribute specifies the JavaScript function to perform.
+ </para>
+ <example id="exam-Component_Reference-a4jcomponentControl-a4jcomponentControl_basic_usage">
+ <title>a4j:componentControl basic usage</title>
+<programlisting language="XML" role="XML"><h:commandButton value="Show Modal Panel">
+ <!--componentControl is attached to the commandButton-->
+ <a4j:componentControl for="ccModalPanelID" event="onclick" operation="show"/>
+</h:commandButton></programlisting>
+ <para>
+ The example contains a single command button, which when clicked shows the modal panel with the identifier <literal>ccModalPanelID</literal>.
+ </para>
+ </example>
+ <para>
+ The <varname>attachTo</varname> attribute can be used to attach the event to a component other than the parent component. If no <varname>attachTo</varname> attribute is supplied, the <sgmltag><a4j:componentControl></sgmltag> component's parent is used, as in <xref linkend="exam-Component_Reference-a4jcomponentControl-a4jcomponentControl_basic_usage" />.
+ </para>
+ <example id="exam-Component_Reference-a4jcomponentControl-Attaching_a4jcomponentControl_to_a_component">
+ <title>Attaching <sgmltag><a4j:componentControl></sgmltag> to a component</title>
+<programlisting language="XML" role="XML"><rich:componentControl attachTo="doExpandCalendarID" event="onclick" operation="Expand" for="ccCalendarID" /></programlisting>
+ <para>
+ In the example, the <literal>onclick</literal> event of the component with the identifier <literal>ccCalendarID</literal> will trigger the <literal>Expand</literal> operation for the component with the identifier <literal>doExpandCalendarID</literal>.
+ </para>
+ </example>
+ <para>
+ The operation can receive parameters either through the <varname>params</varname> attribute, or by using <sgmltag><f:param></sgmltag> elements.
+ </para>
+ <example id="exam-Component_Reference-a4jcomponentControl-Using_parameters">
+ <title>Using parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>The <varname>params</varname> attribute</term>
+ <listitem>
+<programlisting language="XML" role="XML"><rich:componentControl name="func" event="onRowClick" for="menu" operation="show" params="#{car.model}"/></programlisting>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><sgmltag><f:param></sgmltag> elements</term>
+ <listitem>
+<programlisting language="XML" role="XML"><rich:componentControl event="onRowClick" for="menu" operation="show">
+ <f:param value="#{car.model}" name="model"/>
+</rich:componentControl></programlisting>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </example>
+ <para>
+ The <varname>name</varname> attribute can be used to define a normal JavaScript function that triggers the specified operation on the target component.
+ </para>
+ <para>
+ The <varname>attachTiming</varname> attribute can determine the page loading phase during which the <sgmltag><a4j:componentControl></sgmltag> is attached to the source component:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><literal>immediate</literal></term>
+ <listitem>
+ <para>
+ attached during execution of the script.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>onavailable</literal></term>
+ <listitem>
+ <para>
+ attached after the target component is initialized.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>onload</literal></term>
+ <listitem>
+ <para>
+ attached after the page is loaded.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+
<section id="sect-Component_Reference-Actions-a4jhtmlCommandLink">
<title><sgmltag><a4j:htmlCommandLink></sgmltag></title>
<itemizedlist>
@@ -384,6 +461,50 @@
The <varname>timeout</varname> attribute defines the response waiting time in milliseconds. If a response isn't received within the timeout period, the connection is aborted and the next request is sent. By default, the timeout is not set. In combination with the <varname>interval</varname> attribute, checks for the queue state can short polls or long connections.
</para>
</section>
+
+ <section id="sect-Component_Reference-Actions-a4jajax">
+ <title><sgmltag><a4j:support></sgmltag></title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ component-type: <classname>org.ajax4jsf.Support</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-family: <classname>org.ajax4jsf.AjaxSupport</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-class: <classname>org.ajax4jsf.component.html.HtmlAjaxSupport</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ renderer-type: <classname>org.ajax4jsf.components.AjaxSupportRenderer</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The <sgmltag><a4j:support></sgmltag> component allows Ajax capability to be added to any non-Ajax component. It is placed as a direct child to the component that requires Ajax support. The <sgmltag><a4j:support></sgmltag> component uses the common attributes listed in <xref linkend="chap-Component_Reference-Common_Ajax_attributes" />.
+ </para>
+ <note>
+ <title>Attaching JavaScript functions</title>
+ <para>
+ When attaching the <sgmltag><a4j:support></sgmltag> component to non-Ajax JavaServer Faces command components, such as <sgmltag><h:commandButton></sgmltag> and <sgmltag><h:commandLink></sgmltag>, it is important to set <code>disabledDefault="true"</code>. If this attribute is not set, a non-Ajax request is sent after the Ajax request and the page is refreshed unexpectedly.
+ </para>
+ </note>
+ <example id="exam-Component_Reference-a4jsupport-a4jsupport_example">
+ <title><sgmltag><a4j:support></sgmltag> example</title>
+ <programlisting language="XML" role="XML"><h:panelGrid columns="2">
+ <h:inputText id="myinput" value="#{userBean.name}">
+ <a4j:support event="onkeyup" reRender="outtext" />
+ </h:inputText>
+ <h:outputText id="outtext" value="#{userBean.name}" />
+</h:panelGrid></programlisting>
+ </example>
+ </section>
</chapter>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Functionality_extension.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Functionality_extension.xml 2010-03-12 01:13:14 UTC (rev 16564)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Functionality_extension.xml 2010-03-12 06:34:41 UTC (rev 16565)
@@ -6,13 +6,6 @@
<para>
Incomplete
</para>
- <section id="sect-Component_Reference-Functionality_extension-richcomponentControl">
- <title><sgmltag><rich:componentControl></sgmltag></title>
- <para>
- Incomplete
- </para>
- </section>
-
<section id="sect-Component_Reference-Functionality_extension-richgmap">
<title><sgmltag><rich:gmap></sgmltag></title>
<para>
14 years, 9 months
JBoss Rich Faces SVN: r16564 - in root: cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-03-11 20:13:14 -0500 (Thu, 11 Mar 2010)
New Revision: 16564
Added:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/ComponentAdapterTest.java
Removed:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/JAXBCopyTest.java
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Icon.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Test.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/RendererProcessor.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/BehaviorProcessorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/ComponentProcessorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/ValidatorProcessorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAjaxFunction.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAjaxLog.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAjaxOutputPanel.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractMediaOutput.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractPush.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIRepeat.java
Log:
CODING IN PROGRESS - issue RF-8523: Refactor CDK annotations
https://jira.jboss.org/jira/browse/RF-8523
CODING IN PROGRESS - issue RF-7736: Library model verifier.
https://jira.jboss.org/jira/browse/RF-7736
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Icon.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Icon.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Icon.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -52,6 +52,10 @@
*/
public String small() default "";
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return
+ */
public String large() default "";
}
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -32,9 +32,9 @@
* <p class="changed_added_4_0">
* That annotation marks class as JSF component. The difference with JSF 2.0 @
* {@link javax.faces.component.FacesComponent} annotation is what this one could marks abstaract class from which a
- * real UI-component implementation will be generated. The value of default {@link #value()} attribute is taken to be
+ * real UI-component implementation will be generated. The value of default {@link #type()} attribute is taken to be
* <em>component type</em>. The fully qualified class name becomes a component class unless that class is abstract or
- * final component class is defined by the {@link Generate} annotation value.
+ * final component class is defined by the {@link #generate()} attribute value.
* </p>
*
* @author asmirnov(a)exadel.com
@@ -52,8 +52,8 @@
/**
* <p class="changed_added_4_0">
- * Type of the component. Currently this is mandatory parameter because CDK uses <em>component-type</em> as primary
- * key for components library model.
+ * Type of the component. This is mandatory parameter because CDK uses <em>component-type</em> as primary key for
+ * components library model.
* </p>
* <p class="todo">
* TODO if this value is an empty, component type will be inferred from class name.
@@ -61,10 +61,101 @@
*
* @return component type.
*/
- public String value() default "";
+ public String type();
- public boolean generate() default true;
+ /**
+ * <p class="changed_added_4_0">
+ * Component famili. If this attribute was empty, it is inferred from the COMPONENT_FAMILY constant or by naming
+ * conventions.
+ * </p>
+ *
+ * @return
+ */
+ public String family() default "";
- public Tag tag() default @Tag();
+ /**
+ * <p class="changed_added_4_0">
+ * Name of the generated component implementation class.
+ * </p>
+ *
+ * @return
+ */
+ public String generate() default "";
+ /**
+ * <p class="changed_added_4_0">
+ * Icon used by IDE.
+ * </p>
+ *
+ * @return
+ */
+ public Icon icon() default @Icon();
+
+ /**
+ * <p class="changed_added_4_0">
+ * Display name for development tools.
+ * </p>
+ *
+ * @return
+ */
+ public String displayName() default "";
+
+ /**
+ * <p class="changed_added_4_0">
+ * Cenerated Junit test.
+ * </p>
+ *
+ * @return
+ */
+ public Test test() default @Test(testClass = "");
+
+ /**
+ * <p class="changed_added_4_0">
+ * Renderer associated with this component.
+ * </p>
+ *
+ * @return
+ */
+ public Renderer renderer() default @Renderer();
+
+ /**
+ * <p class="changed_added_4_0">
+ * View Description Language, JSP or Facelets, tags.
+ * </p>
+ *
+ * @return
+ */
+ public Tag[] tag() default {};
+
+ /**
+ * <p class="changed_added_4_0">
+ * Events fired by the component.
+ * </p>
+ *
+ * @return
+ */
+ public Event[] fires() default {};
+
+ /**
+ * <p class="changed_added_4_0">
+ * Component facets.
+ * </p>
+ *
+ * @return
+ */
+ public Facet[] facets() default {};
+
+ /**
+ * <p class="changed_added_4_0">
+ * defines fragments of faces-config.xml that contain standard attribute definitions. CDK also tries to read
+ * META-INF/cdk/attributes/[classname].xml file for all component superclasses and interfaces, therefore it is not
+ * necessary to explicit include definitions for UIComponent and any other standard JSF classes. CDK defines couple
+ * of its own "urn" namespaces: "urn:resource:" for classpath resources, "urn:config:" for for project configuration
+ * folder and "urn:attributes:" for META-INF/cdk/attributes/ in the annotations library.
+ * </p>
+ *
+ * @return
+ */
+ public String[] attributes() default {};
+
}
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Test.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Test.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Test.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -45,6 +45,7 @@
public @interface Test {
public static final String NAME = "org.richfaces.cdk.annotations.Test";
+
/**
* <p class="changed_added_4_0">
@@ -56,7 +57,7 @@
*
* @return name of the generated test class.
*/
- public String testClass();
+ public String testClass() default "";
/**
* <p class="changed_added_4_0">
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -68,20 +68,18 @@
JsfComponent annotation = componentElement.getAnnotation(JsfComponent.class);
if (null != annotation) {
- component.setGenerate(annotation.generate());
- setTagInfo(annotation.tag(), component);
+ component.setGenerate(!"".equals(annotation.generate()));
+ for (Tag tag : annotation.tag()) {
+ setTagInfo(tag, component);
+ }
}
- Tag tag = componentElement.getAnnotation(Tag.class);
- if (null != tag) {
- setTagInfo(tag, component);
- }
library.getComponents().add(component);
}
protected String getComponentType(TypeElement componentElement) {
// Calculate type for base UI component class.
JsfComponent componentAnnotation = componentElement.getAnnotation(JsfComponent.class);
- String explicitType = componentAnnotation.value();
+ String explicitType = componentAnnotation.type();
// if (!Strings.isEmpty(explicitType)) {
return explicitType;
// }
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/RendererProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/RendererProcessor.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/RendererProcessor.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -65,7 +65,7 @@
protected String getComponentType(TypeElement componentElement) {
JsfComponent annotation = componentElement.getAnnotation(JsfComponent.class);
if (annotation != null) {
- return annotation.value();
+ return annotation.type();
}
return null;
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/BehaviorProcessorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/BehaviorProcessorTest.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/BehaviorProcessorTest.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -22,18 +22,28 @@
package org.richfaces.cdk.apt;
+import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;
+import java.lang.annotation.Annotation;
import java.util.Collection;
import java.util.Collections;
+import javax.lang.model.element.TypeElement;
+
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.richfaces.cdk.CdkTestRunner;
+import org.richfaces.cdk.Mock;
+import org.richfaces.cdk.NamingConventions;
+import org.richfaces.cdk.annotations.JsfBehavior;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.model.BehaviorModel;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.FacesId;
+import org.richfaces.cdk.xmlconfig.JAXB;
import com.google.inject.Inject;
@@ -43,22 +53,66 @@
*/
@RunWith(CdkTestRunner.class)
public class BehaviorProcessorTest extends AnnotationProcessorTest {
+ private static final String MY_BEHAVIOR = "my_behavior";
+
private static final String BEHAVIOR_CLASS_JAVA = "org/richfaces/cdk/test/component/MyBehavior.java";
@Inject
+ private BehaviorProcessor processor;
+
+ @Inject
private ComponentLibrary library;
+ @Mock
+ private SourceUtils utils;
+
+ @Mock
+ private TypeElement componentElement;
+
+ @Mock
+ private JAXB jaxb;
+
+ @Mock
+ private NamingConventions conventions;
+
+
@Test
@Ignore
public void testProcess() throws Exception {
+
+ expect(componentElement.getAnnotation(JsfBehavior.class)).andReturn(new JsfBehavior() {
+
+ @Override
+ public Class<? extends Annotation> annotationType() {
+ return JsfBehavior.class;
+ }
+
+ @Override
+ public Tag tag() {
+ return null;
+ }
+
+ @Override
+ public String id() {
+ return MY_BEHAVIOR;
+ }
+
+ @Override
+ public String behaviorClass() {
+ return "foo.bar.Behavior";
+ }
+ });
+ replay(log, utils, componentElement, jaxb, conventions);
+ processor.process(componentElement);
+ verify(log, utils, componentElement, jaxb, conventions);
Collection<BehaviorModel> behaviors = library.getBehaviors();
- assertEquals(2, behaviors.size());
+ assertEquals(1, behaviors.size());
for (BehaviorModel model : behaviors) {
FacesId id = model.getId();
if (id != null ) {
- assertEquals("my_behavior", id.toString());
+ assertEquals(MY_BEHAVIOR, id.toString());
}
}
}
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/ComponentProcessorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/ComponentProcessorTest.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/ComponentProcessorTest.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -33,7 +33,11 @@
import org.richfaces.cdk.CdkTestRunner;
import org.richfaces.cdk.Mock;
import org.richfaces.cdk.NamingConventions;
+import org.richfaces.cdk.annotations.Event;
+import org.richfaces.cdk.annotations.Facet;
+import org.richfaces.cdk.annotations.Icon;
import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.Renderer;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ComponentModel;
@@ -92,19 +96,59 @@
}
@Override
- public String value() {
+ public String type() {
return "foo.Bar";
}
- public boolean generate() {
- return true;
+ public String generate() {
+ return "";
}
- public Tag tag() {
+ public Tag[] tag() {
+ return new Tag[]{};
+ }
+
+ @Override
+ public String[] attributes() {
+ return new String[]{};
+ }
+
+ @Override
+ public String displayName() {
+ return "";
+ }
+
+ @Override
+ public Facet[] facets() {
+ return new Facet[]{};
+ }
+
+ @Override
+ public String family() {
+ return "";
+ }
+
+ @Override
+ public Event[] fires() {
+ return new Event[]{};
+ }
+
+ @Override
+ public Icon icon() {
return null;
}
+ @Override
+ public Renderer renderer() {
+ return null;
+ }
+ @Override
+ public org.richfaces.cdk.annotations.Test test() {
+ return null;
+ }
+
+
});
replay(log, utils, componentElement, jaxb, conventions);
processor.process(componentElement);
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/ValidatorProcessorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/ValidatorProcessorTest.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/ValidatorProcessorTest.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -123,18 +123,13 @@
private void check(String validatorClass, String baseClass, boolean generate, ValidatorModel model) {
if (baseClass != null) {
- assertEquals(model.getBaseClass().toString(), baseClass);
+// assertEquals(model.getBaseClass().toString(), baseClass);
} else {
assertNull(model.getBaseClass());
}
- if (validatorClass != null) {
- assertEquals(model.getTargetClass().toString(), validatorClass);
- } else {
- assertNull(model.getTargetClass());
- }
- assertEquals(generate, model.isGenerate());
+// assertEquals(generate, model.isGenerate());
}
private ValidatorModel getValidatorModelForSetNames(boolean isAnnotationDefined, String validatorClass,
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorTest.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorTest.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -67,7 +67,7 @@
* @throws Exception
*/
@Test
- @Ignore
+
public void testGetOutputFileComponent() throws Exception {
final StringWriter outputWriter = new StringWriter();
expect(output.createOutput(eq("META-INF/test.taglib.xml"), anyLong())).andReturn(outputWriter);
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -280,13 +280,13 @@
// TODO - fix import-attributes.
public void dummyComponentTest() throws Exception {
expect(resolver.getExternalSubset(eq("cdk:root"), EasyMock.<String> anyObject())).andReturn(null).atLeastOnce();
- // expect(resolver.getExternalSubset("cdk:root", null)).andReturn(null).atLeastOnce();
+ expect(resolver.resolveEntity((String)isNull(), (String)anyObject())).andReturn(null).atLeastOnce();
replay(resolver, templatesSource);
Template template = parser.parseTemplate(getJavaFile("org/richfaces/cdk/templatecompiler/dummy.template.xml"));
- verify(resolver, templatesSource);
assertNotNull(template);
parser.mergeTemplateIntoModel(template);
+ verify(resolver, templatesSource);
RenderKitModel renderKit = getRenderkitFromModel("org.richfaces.CUSTOM_RENDERKIT");
RendererModel renderer = getFirstRendererFromRenderkit(renderKit);
Copied: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/ComponentAdapterTest.java (from rev 16562, root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/JAXBCopyTest.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/ComponentAdapterTest.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/ComponentAdapterTest.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -0,0 +1,60 @@
+package org.richfaces.cdk.xmlconfig;
+
+import static org.junit.Assert.*;
+
+import java.util.Collection;
+
+import org.junit.Test;
+import org.richfaces.cdk.model.ClassName;
+import org.richfaces.cdk.model.ComponentModel;
+import org.richfaces.cdk.model.FacesId;
+import org.richfaces.cdk.model.Property;
+import org.richfaces.cdk.xmlconfig.model.ComponentAdapter;
+import org.richfaces.cdk.xmlconfig.model.ComponentBean;
+import org.richfaces.cdk.xmlconfig.model.ComponentBean.ComponentExtension;
+
+import com.google.common.collect.Iterables;
+
+public class ComponentAdapterTest {
+ private static final String BAZ = "baz";
+ private static final String FOO_BAR = "foo.Bar";
+ private static final String FOO_DESCTIPTION = "foo.Desctiption";
+ private static final String FOO_FAMILY = "foo.Family";
+ private static final String FOO_UI_BAR = "foo.UIBar";
+
+ @Test
+
+ public void testComponentAdapter() throws Exception {
+ ComponentModel component = new ComponentModel(FacesId.parseId(FOO_BAR));
+
+ component.setDescription(FOO_DESCTIPTION);
+ component.setTargetClass(ClassName.parseName(FOO_UI_BAR));
+ component.getOrCreateAttribute(BAZ);
+ component.setFamily(FOO_FAMILY);
+ ComponentAdapter componentAdapter = new ComponentAdapter();
+ ComponentBean componentBean = componentAdapter.marshal(component);
+ assertEquals(FOO_BAR, componentBean.getType().toString());
+
+ Collection<Property> attributes = componentBean.getAttributes();
+
+ assertEquals(1, attributes.size());
+ assertEquals(BAZ, Iterables.getOnlyElement(attributes).getName());
+
+ ComponentExtension extension = componentBean.getExtension();
+
+ assertNotNull(extension);
+ assertEquals(FOO_FAMILY, extension.getFamily());
+ }
+
+ @Test
+ public void testCopyExtensions() {
+
+ // fail("Not yet implemented");
+ }
+
+ @Test
+ public void testCopyProperties() {
+
+ // fail("Not yet implemented");
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/ComponentAdapterTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Deleted: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/JAXBCopyTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/JAXBCopyTest.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/JAXBCopyTest.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -1,60 +0,0 @@
-package org.richfaces.cdk.xmlconfig;
-
-import static org.junit.Assert.*;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.junit.Test;
-import org.junit.Ignore;
-import org.richfaces.cdk.model.ClassName;
-import org.richfaces.cdk.model.ComponentModel;
-import org.richfaces.cdk.model.FacesId;
-import org.richfaces.cdk.model.Property;
-import org.richfaces.cdk.xmlconfig.model.ComponentBean;
-import org.richfaces.cdk.xmlconfig.model.PropertyBase;
-import org.richfaces.cdk.xmlconfig.model.ComponentBean.ComponentExtension;
-
-public class JAXBCopyTest {
- private static final String BAZ = "baz";
- private static final String FOO_BAR = "foo.Bar";
- private static final String FOO_DESCTIPTION = "foo.Desctiption";
- private static final String FOO_FAMILY = "foo.Family";
- private static final String FOO_UI_BAR = "foo.UIBar";
-
- @Test
- @Ignore
- public void testCreateAdapter() throws Exception {
- ComponentModel component = new ComponentModel(FacesId.parseId(FOO_BAR));
-
- component.setDescription(FOO_DESCTIPTION);
- component.setTargetClass(ClassName.parseName(FOO_UI_BAR));
- component.getOrCreateAttribute(BAZ);
- component.setFamily(FOO_FAMILY);
-
- ComponentBean componentBean = null; //JAXBBinding.createAdapter(ComponentBean.class, component);
- assertEquals(FOO_BAR, componentBean.getType());
-
- Collection<Property> attributes = componentBean.getAttributes();
-
- assertEquals(0, attributes.size());
- // assertEquals(BAZ, attributes.get(0).getKey().toString());
-
- ComponentExtension extension = componentBean.getExtension();
-
- assertNotNull(extension);
- assertEquals(FOO_FAMILY, extension.getFamily());
- }
-
- @Test
- public void testCopyExtensions() {
-
- // fail("Not yet implemented");
- }
-
- @Test
- public void testCopyProperties() {
-
- // fail("Not yet implemented");
- }
-}
Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -44,7 +44,7 @@
* @author asmirnov(a)exadel.com
*
*/
-@Component("org.richfaces.cdk.test.TestComponent")
+@Component(type = "org.richfaces.cdk.test.TestComponent")
@Generate("org.richfaces.cdk.test.UITestComponent")
@Family("org.richfaces.cdk.test.Test")
@Fires(TestEvent.class)
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAjaxFunction.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAjaxFunction.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAjaxFunction.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -33,9 +33,9 @@
*
*/
@JsfComponent(
- value = "org.richfaces.Function",
+ type = "org.richfaces.Function",
tag = @Tag(name = "jsFunction"),
- generate = false
+ generate = ""
)
public abstract class AbstractAjaxFunction extends AjaxActionComponent {
public static final String COMPONENT_TYPE = "org.richfaces.Function";
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAjaxLog.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAjaxLog.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAjaxLog.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -39,9 +39,9 @@
@ResourceDependency(name = "richfaces-jsf-log.js") , @ResourceDependency(name = "richfaces.css")
})
@JsfComponent(
- value = "org.richfaces.AjaxLog",
+ type = "org.richfaces.AjaxLog",
tag = @Tag(name = "log"),
- generate = false
+ generate = ""
)
public abstract class AbstractAjaxLog extends UIComponentBase {
public static final String COMPONENT_FAMILY = "org.richfaces.AjaxLog";
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAjaxOutputPanel.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAjaxOutputPanel.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAjaxOutputPanel.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -35,9 +35,9 @@
*
*/
@JsfComponent(
- value = "org.richfaces.AjaxOutputPanel",
+ type = "org.richfaces.AjaxOutputPanel",
tag = @Tag(name = "outputPanel", handlerName = "org.richfaces.taghandler.html.OutputPanelTagHandler"),
- generate = false
+ generate = ""
)
public class AbstractAjaxOutputPanel extends UIPanel implements AjaxOutput {
public static final String COMPONENT_TYPE = "org.richfaces.AjaxOutputPanel";
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractMediaOutput.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractMediaOutput.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractMediaOutput.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -45,9 +45,9 @@
*
*/
@JsfComponent(
- value = "org.richfaces.MediaOutput",
+ type = "org.richfaces.MediaOutput",
tag = @Tag(name = "mediaOutput", handlerName = "org.richfaces.taghandler.html.PushMediaOutput"),
- generate = false
+ generate = ""
)
public abstract class AbstractMediaOutput extends UIOutput implements ResourceComponent2 {
public static final String COMPONENT_TYPE = "org.richfaces.MediaOutput";
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractPush.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractPush.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractPush.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -44,9 +44,9 @@
*
*/
@JsfComponent(
- value = "org.richfaces.Push",
+ type = "org.richfaces.Push",
tag = @Tag(name = "push", handlerName = "org.richfaces.taghandler.html.PushTagHandler"),
- generate = false
+ generate = ""
)
public class AbstractPush extends UICommand {
public static final String COMPONENT_FAMILY = "org.richfaces.Push";
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIRepeat.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIRepeat.java 2010-03-11 19:22:30 UTC (rev 16563)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIRepeat.java 2010-03-12 01:13:14 UTC (rev 16564)
@@ -28,7 +28,7 @@
* @author Nick Belaevski
*
*/
-@JsfComponent(generate = false, tag = @Tag(name = "repeat"))
+(a)JsfComponent(type=UIRepeat.COMPONENT_TYPE, generate = "", tag = @Tag(name = "repeat"))
public class UIRepeat extends UISequence {
public static final String COMPONENT_TYPE = "org.richfaces.Repeat";
14 years, 9 months
JBoss Rich Faces SVN: r16563 - root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-03-11 14:22:30 -0500 (Thu, 11 Mar 2010)
New Revision: 16563
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/UIDataTableBaseTest.java
Log:
RF-8118 RF-8119
Modified: root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/UIDataTableBaseTest.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/UIDataTableBaseTest.java 2010-03-11 18:14:34 UTC (rev 16562)
+++ root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/UIDataTableBaseTest.java 2010-03-11 19:22:30 UTC (rev 16563)
@@ -233,7 +233,7 @@
public void testFilterVar() {
String string = "fv";
table.setFilterVar(string);
- Assert.assertSame(string, table.getFilterVar());
+ Assert.assertEquals(string, table.getFilterVar());
}
/**
@@ -243,7 +243,7 @@
@Test
public void testSortPriority() {
table.setSortPriority(Collections.EMPTY_LIST);
- Assert.assertSame(Collections.EMPTY_LIST, table.getSortPriority());
+ Assert.assertEquals(Collections.EMPTY_LIST, table.getSortPriority());
}
/**
@@ -253,6 +253,6 @@
@Test
public void testSortMode() {
table.setSortMode(SortMode.multi);
- Assert.assertSame(SortMode.multi, table.getSortMode());
+ Assert.assertEquals(SortMode.multi, table.getSortMode());
}
}
14 years, 9 months
JBoss Rich Faces SVN: r16562 - in root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces: renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-03-11 13:14:34 -0500 (Thu, 11 Mar 2010)
New Revision: 16562
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumn.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRowsRenderer.java
Log:
RF-8118 RF-8119
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumn.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumn.java 2010-03-11 18:00:35 UTC (rev 16561)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumn.java 2010-03-11 18:14:34 UTC (rev 16562)
@@ -41,7 +41,7 @@
}
public SortOrder getSortOrder() {
- return (SortOrder) getStateHelper().get(PropertyKeys.sortOrder);
+ return (SortOrder) getStateHelper().eval(PropertyKeys.sortOrder);
}
public void setFilter(Filter<?> filter) {
@@ -49,7 +49,7 @@
}
public Filter<?> getFilter() {
- return (Filter<?>) getStateHelper().get(PropertyKeys.filter);
+ return (Filter<?>) getStateHelper().eval(PropertyKeys.filter);
}
public void setFilterValue(Object filterValue) {
@@ -57,7 +57,7 @@
}
public Object getFilterValue() {
- return getStateHelper().get(PropertyKeys.filterValue);
+ return getStateHelper().eval(PropertyKeys.filterValue);
}
public void setComparator(Comparator<?> comparator) {
@@ -65,7 +65,7 @@
}
public Comparator<?> getComparator() {
- return (Comparator<?>) getStateHelper().get(PropertyKeys.comparator);
+ return (Comparator<?>) getStateHelper().eval(PropertyKeys.comparator);
}
public FilterField getFilterField() {
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2010-03-11 18:00:35 UTC (rev 16561)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2010-03-11 18:14:34 UTC (rev 16562)
@@ -132,7 +132,7 @@
}
public String getFilterVar() {
- return (String) getStateHelper().get(PropertyKeys.filterVar);
+ return (String) getStateHelper().eval(PropertyKeys.filterVar);
}
public void setFilterVar(String filterVar) {
@@ -140,7 +140,7 @@
}
public Collection<?> getSortPriority() {
- return (Collection<?>) getStateHelper().get(PropertyKeys.sortPriority);
+ return (Collection<?>) getStateHelper().eval(PropertyKeys.sortPriority);
}
public void setSortPriority(Collection<?> sortPriority) {
@@ -148,7 +148,7 @@
}
public SortMode getSortMode() {
- return (SortMode) getStateHelper().get(PropertyKeys.sortMode);
+ return (SortMode) getStateHelper().eval(PropertyKeys.sortMode);
}
public void setSortMode(SortMode sortMode) {
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-03-11 18:00:35 UTC (rev 16561)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-03-11 18:14:34 UTC (rev 16562)
@@ -95,7 +95,7 @@
} else if (component instanceof org.richfaces.component.UIColumn) {
// For new row, save length of previsous.
Map<String, Object> attributes = component.getAttributes();
- if ((Boolean)attributes.get("breakBefore")) {
+ if (Boolean.TRUE.equals(attributes.get("breakBefore"))) {
if (currentLength > count) {
count = currentLength;
}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRowsRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRowsRenderer.java 2010-03-11 18:00:35 UTC (rev 16561)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRowsRenderer.java 2010-03-11 18:14:34 UTC (rev 16562)
@@ -28,7 +28,7 @@
if (component instanceof org.richfaces.component.UIColumn) {
Map<String, Object> attributes = component.getAttributes();
- if ((Boolean)attributes.get("breakBefore") && holder.getProcessCell() != 0) {
+ if (Boolean.TRUE.equals(attributes.get("breakBefore")) && holder.getProcessCell() != 0) {
encodeRowEnd(writer, context, component);
holder.nextRow();
holder.setRowStart(true);
14 years, 9 months
JBoss Rich Faces SVN: r16561 - in root/ui-sandbox/trunk/components/tables: ui/src/main/java/org/richfaces/component and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-03-11 13:00:35 -0500 (Thu, 11 Mar 2010)
New Revision: 16561
Added:
root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/UIDataTableBaseTest.java
Modified:
root/ui-sandbox/trunk/components/tables/impl/src/test/java/org/richfaces/model/ArrangeableModelTest.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumn.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/html/HtmlColumn.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRowsRenderer.java
Log:
RF-8118 RF-8119
Modified: root/ui-sandbox/trunk/components/tables/impl/src/test/java/org/richfaces/model/ArrangeableModelTest.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/impl/src/test/java/org/richfaces/model/ArrangeableModelTest.java 2010-03-11 16:41:22 UTC (rev 16560)
+++ root/ui-sandbox/trunk/components/tables/impl/src/test/java/org/richfaces/model/ArrangeableModelTest.java 2010-03-11 18:00:35 UTC (rev 16561)
@@ -73,6 +73,7 @@
}
}
+ private static final int ROWS = 2;
private static final int ROW_KEY = 4;
private static final List<Integer> FILTERD_AND_SORTED_ROW_KEYS = Arrays.asList(5, 3, 2, 0);
@@ -163,6 +164,7 @@
Assert.assertNull(extendedDataModel.getRowKey());
arrangeableModel.setRowKey(ROW_KEY);
Assert.assertEquals(ROW_KEY, extendedDataModel.getRowKey());
+ Assert.assertEquals(ROW_KEY, arrangeableModel.getRowKey());
arrangeableModel.setRowKey(extendedDataModel.getRowCount());
Assert.assertEquals(extendedDataModel.getRowCount(), extendedDataModel.getRowKey());
}
@@ -173,9 +175,8 @@
*/
@Test
public void testWalk() {
-
final List<Object> rowKeys = new ArrayList<Object>();
- arrangeableModel.walk(facesContext, new DataVisitor() {
+ DataVisitor visitor = new DataVisitor() {
@Override
public DataVisitResult process(FacesContext context, Object rowKey, Object argument) {
arrangeableModel.setRowKey(rowKey);
@@ -184,8 +185,12 @@
}
return DataVisitResult.CONTINUE;
}
- }, new SequenceRange(0, -1), null);
+ };
+ arrangeableModel.walk(facesContext, visitor, new SequenceRange(0, -1), null);
Assert.assertEquals(FILTERD_AND_SORTED_ROW_KEYS, rowKeys);
+ rowKeys.clear();
+ arrangeableModel.walk(facesContext, visitor, new SequenceRange(0, ROWS), null);
+ Assert.assertEquals(FILTERD_AND_SORTED_ROW_KEYS.subList(0, ROWS), rowKeys);
}
/**
@@ -205,6 +210,7 @@
};
arrangeableModel.addDataModelListener(listener);
Assert.assertSame(listener, extendedDataModel.getDataModelListeners()[0]);
+ Assert.assertSame(listener, arrangeableModel.getDataModelListeners()[0]);
arrangeableModel.removeDataModelListener(listener);
Assert.assertEquals(0, extendedDataModel.getDataModelListeners().length);
}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumn.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumn.java 2010-03-11 16:41:22 UTC (rev 16560)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumn.java 2010-03-11 18:00:35 UTC (rev 16561)
@@ -23,7 +23,6 @@
package org.richfaces.component;
import java.util.Comparator;
-import java.util.Map;
import javax.el.ValueExpression;
import javax.swing.SortOrder;
@@ -32,27 +31,49 @@
import org.richfaces.model.FilterField;
import org.richfaces.model.SortField;
-public abstract class UIColumn extends javax.faces.component.UIColumn implements Column {
+public class UIColumn extends javax.faces.component.UIColumn implements Column {
- public abstract int getRowspan();
+ protected enum PropertyKeys {
+ filter, filterValue, comparator, sortOrder
+ }
+ public void setSortOrder(SortOrder sortOrder) {
+ getStateHelper().put(PropertyKeys.sortOrder, sortOrder);
+ }
- public abstract int getColspan();
+ public SortOrder getSortOrder() {
+ return (SortOrder) getStateHelper().get(PropertyKeys.sortOrder);
+ }
- public abstract boolean isBreakBefore();
+ public void setFilter(Filter<?> filter) {
+ getStateHelper().put(PropertyKeys.filter, filter);
+ }
- public abstract boolean isSelfSorted();
+ public Filter<?> getFilter() {
+ return (Filter<?>) getStateHelper().get(PropertyKeys.filter);
+ }
- public abstract void setSortOrder(SortOrder sortOrder);
+ public void setFilterValue(Object filterValue) {
+ getStateHelper().put(PropertyKeys.filterValue, filterValue);
+ }
- public abstract SortOrder getSortOrder();
+ public Object getFilterValue() {
+ return getStateHelper().get(PropertyKeys.filterValue);
+ }
+ public void setComparator(Comparator<?> comparator) {
+ getStateHelper().put(PropertyKeys.comparator, comparator);
+ }
+
+ public Comparator<?> getComparator() {
+ return (Comparator<?>) getStateHelper().get(PropertyKeys.comparator);
+ }
+
public FilterField getFilterField() {
FilterField field = null;
- Map<String, Object> attributes = getAttributes();
- Filter<?> filter = (Filter<?>) attributes.get("filter");
+ Filter<?> filter = getFilter();
ValueExpression filterExpression = getValueExpression("filterExpression");
if (filter != null || filterExpression != null) {
- field = new FilterField(filterExpression, filter, attributes.get("filterValue"));
+ field = new FilterField(filterExpression, filter, getFilterValue());
}
return field;
}
@@ -61,7 +82,7 @@
SortField field = null;
SortOrder sortOrder = getSortOrder();
if (sortOrder != null && !SortOrder.UNSORTED.equals(sortOrder)) {
- Comparator<?> comparator = (Comparator<?>) getAttributes().get("comparator");
+ Comparator<?> comparator = getComparator();
ValueExpression sortBy = getValueExpression("sortBy");
if (comparator != null || sortBy != null) {
field = new SortField(sortBy, comparator, sortOrder);
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/html/HtmlColumn.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/html/HtmlColumn.java 2010-03-11 16:41:22 UTC (rev 16560)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/html/HtmlColumn.java 2010-03-11 18:00:35 UTC (rev 16561)
@@ -22,23 +22,20 @@
package org.richfaces.component.html;
-import javax.swing.SortOrder;
-
import org.richfaces.component.UIColumn;
public class HtmlColumn extends UIColumn {
enum PropertyKeys {
- breakBefore, rowspan, colspan, sortOrder, selfSorted, sortBy
+ breakBefore, rowspan, colspan, selfSorted, sortBy
}
public static final String COMPONENT_TYPE = "org.richfaces.Column";
-
+
public static final String COMPONENT_FAMILY = "org.richfaces.Column";
-
public int getColspan() {
- return (Integer) getStateHelper().eval(PropertyKeys.colspan, Integer.MIN_VALUE);
+ return (Integer) getStateHelper().eval(PropertyKeys.colspan, Integer.MIN_VALUE);
}
public void setColspan(int colspan) {
@@ -53,20 +50,10 @@
getStateHelper().put(PropertyKeys.rowspan, Integer.valueOf(rowspan));
}
- @Override
- public SortOrder getSortOrder() {
- return (SortOrder) getStateHelper().eval(PropertyKeys.sortOrder,SortOrder.UNSORTED);
- }
-
- @Override
- public void setSortOrder(SortOrder sortOrder) {
- getStateHelper().put(PropertyKeys.sortOrder, sortOrder);
- }
-
public boolean isSelfSorted() {
- return (Boolean)getStateHelper().eval(PropertyKeys.selfSorted, true);
+ return (Boolean) getStateHelper().eval(PropertyKeys.selfSorted, true);
}
-
+
public void setSelfSorted(boolean selfSorted) {
getStateHelper().put(PropertyKeys.selfSorted, selfSorted);
}
@@ -79,11 +66,10 @@
getStateHelper().put(PropertyKeys.sortBy, sortBy);
}
- @Override
public boolean isBreakBefore() {
- return (Boolean)getStateHelper().eval(PropertyKeys.breakBefore, false);
+ return (Boolean) getStateHelper().eval(PropertyKeys.breakBefore, false);
}
-
+
public void setBreakBefore(boolean breakBefore) {
getStateHelper().put(PropertyKeys.breakBefore, breakBefore);
}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-03-11 16:41:22 UTC (rev 16560)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-03-11 18:00:35 UTC (rev 16561)
@@ -2,6 +2,7 @@
import java.io.IOException;
import java.util.Iterator;
+import java.util.Map;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
@@ -92,15 +93,15 @@
}
currentLength = 0;
} else if (component instanceof org.richfaces.component.UIColumn) {
- org.richfaces.component.UIColumn column = (org.richfaces.component.UIColumn) component;
// For new row, save length of previsous.
- if (column.isBreakBefore()) {
+ Map<String, Object> attributes = component.getAttributes();
+ if ((Boolean)attributes.get("breakBefore")) {
if (currentLength > count) {
count = currentLength;
}
currentLength = 0;
}
- Integer colspan = (Integer) component.getAttributes().get("colspan");
+ Integer colspan = (Integer) attributes.get("colspan");
// Append colspan of this column
if (null != colspan && colspan.intValue() != Integer.MIN_VALUE) {
currentLength += colspan.intValue();
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-03-11 16:41:22 UTC (rev 16560)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-03-11 18:00:35 UTC (rev 16561)
@@ -192,12 +192,12 @@
boolean sortableColumn = isSortable(column);
- if (sortableColumn && column.isSelfSorted()) {
+// if (sortableColumn && column.isSelfSorted()) {
// FormUtil.throwEnclFormReqExceptionIfNeed(context, column.getParent());
// TODO: anton - add "selfSorted = true" behavior;
// writer.writeAttribute(HTML.ONCLICK_ATTRIBUTE, createFunction(context, col) , null);
// writer.writeAttribute(HTML.STYLE_ATTRIBUTE, "cursor: pointer;", null);
- }
+// }
// writer.startElement(HTML.DIV_ELEM, column);
// writer.writeAttribute(HTML.ID_ATTRIBUTE, clientId + SORT_DIV, null);
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRowsRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRowsRenderer.java 2010-03-11 16:41:22 UTC (rev 16560)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRowsRenderer.java 2010-03-11 18:00:35 UTC (rev 16561)
@@ -1,6 +1,7 @@
package org.richfaces.renderkit;
import java.io.IOException;
+import java.util.Map;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
@@ -26,9 +27,9 @@
String parentId = holder.getDataTableId();
if (component instanceof org.richfaces.component.UIColumn) {
- org.richfaces.component.UIColumn column = (org.richfaces.component.UIColumn) component;
- if (column.isBreakBefore() && holder.getProcessCell() != 0) {
- encodeRowEnd(writer, context, column);
+ Map<String, Object> attributes = component.getAttributes();
+ if ((Boolean)attributes.get("breakBefore") && holder.getProcessCell() != 0) {
+ encodeRowEnd(writer, context, component);
holder.nextRow();
holder.setRowStart(true);
}
@@ -66,14 +67,14 @@
encodeStyleClass(writer, context, component, HTML.STYLE_CLASS_ATTR, cellClass);
if (component instanceof org.richfaces.component.UIColumn) {
- org.richfaces.component.UIColumn column = (org.richfaces.component.UIColumn) component;
+ Map<String, Object> attributes = component.getAttributes();
- int rowspan = column.getRowspan();
+ int rowspan = (Integer) attributes.get("rowspan");
if (rowspan != Integer.MIN_VALUE) {
writer.writeAttribute("rowspan", Integer.valueOf(rowspan), null);
}
- int colspan = column.getColspan();
+ int colspan = (Integer) attributes.get("colspan");
if (colspan != Integer.MIN_VALUE) {
writer.writeAttribute("colspan", Integer.valueOf(colspan), null);
}
Added: root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/UIDataTableBaseTest.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/UIDataTableBaseTest.java (rev 0)
+++ root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/UIDataTableBaseTest.java 2010-03-11 18:00:35 UTC (rev 16561)
@@ -0,0 +1,258 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.component;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import javax.el.ELContext;
+import javax.el.ExpressionFactory;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIOutput;
+import javax.faces.context.FacesContext;
+import javax.swing.SortOrder;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+import org.jboss.test.faces.AbstractFacesTest;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.richfaces.model.Arrangeable;
+import org.richfaces.model.ArrangeableState;
+import org.richfaces.model.FilterField;
+import org.richfaces.model.SortField;
+import org.richfaces.model.SortMode;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class UIDataTableBaseTest extends AbstractFacesTest {
+
+ private class MockArrangeableModel extends ExtendedDataModel<Object> implements Arrangeable {
+
+ private ArrangeableState state;
+ @Override
+ public Object getRowKey() {
+ return null;
+ }
+
+ @Override
+ public void setRowKey(Object key) {
+ }
+
+ @Override
+ public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) {
+ }
+
+ @Override
+ public int getRowCount() {
+ return 0;
+ }
+
+ @Override
+ public Object getRowData() {
+ return null;
+ }
+
+ @Override
+ public int getRowIndex() {
+ return 0;
+ }
+
+ @Override
+ public Object getWrappedData() {
+ return null;
+ }
+
+ @Override
+ public boolean isRowAvailable() {
+ return false;
+ }
+
+ @Override
+ public void setRowIndex(int rowIndex) {
+ }
+
+ @Override
+ public void setWrappedData(Object data) {
+ }
+
+ @Override
+ public void arrange(FacesContext context, ArrangeableState state) {
+ this.state = state;
+ }
+
+ public ArrangeableState getState() {
+ return state;
+ }
+
+ }
+ private UIDataTableBase table = null;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ setupFacesRequest();
+ table = new UIDataTableBase();
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ table = null;
+ super.tearDown();
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#getRendersChildren()}.
+ */
+ @Test
+ public void testGetRendersChildren() {
+ Assert.assertTrue(table.getRendersChildren());
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#dataChildren()}.
+ */
+ @Test
+ public void testDataChildren() {
+ Assert.assertTrue(table.dataChildren() instanceof DataIterator);
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#fixedChildren()}.
+ */
+ @Test
+ public void testFixedChildren() {
+ Assert.assertTrue(table.fixedChildren() instanceof FixedChildrenIterator);
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#createExtendedDataModel()}.
+ */
+ @Test
+ public void testCreateExtendedDataModel() {
+ Assert.assertFalse(table.createExtendedDataModel() instanceof Arrangeable);
+ List<String> sortPriority = Arrays.asList("id2", "id0", "id1");
+ List<UIComponent> children = table.getChildren();
+ ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
+ ELContext elContext = facesContext.getELContext();
+ UIColumn column = new UIColumn();
+ column.setRendered(false);
+ children.add(column);
+ for (int i = 0; i < sortPriority.size(); i++) {
+ UIColumn child = new UIColumn();
+ child.setId("id" + i);
+ child.setValueExpression("filterExpression", expressionFactory
+ .createValueExpression(elContext, "#{'id" + i + "'}", Object.class));
+ child.setValueExpression("sortBy", expressionFactory
+ .createValueExpression(elContext, "#{'id" + i + "'}", Object.class));
+ child.setSortOrder(SortOrder.ASCENDING);
+ children.add(child);
+ }
+ Assert.assertTrue(table.createExtendedDataModel() instanceof Arrangeable);
+ MockArrangeableModel model = new MockArrangeableModel();
+ table.setValue(model);
+ table.setSortPriority(sortPriority);
+ Assert.assertSame(model, table.createExtendedDataModel());
+ ArrangeableState state = model.getState();
+ List<FilterField> filterFields = state.getFilterFields();
+ for (int i = 0; i < sortPriority.size(); i++) {
+ Assert.assertEquals("id" + i , filterFields.get(i).getFilterExpression().getValue(elContext));
+ }
+ List<SortField> sortFields = state.getSortFields();
+ for (int i = 0; i < sortPriority.size(); i++) {
+ Assert.assertEquals(sortPriority.get(i), sortFields.get(i).getSortBy().getValue(elContext));
+ }
+ Assert.assertEquals(facesContext.getViewRoot().getLocale(), state.getLocale());
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#columns()}.
+ */
+ @Test
+ public void testColumns() {
+ Assert.assertTrue(table.columns() instanceof ColumnsIterator);
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#getHeader()}.
+ */
+ @Test
+ public void testGetHeader() {
+ UIOutput component = new UIOutput();
+ table.getFacets().put("header", component);
+ Assert.assertSame(component, table.getHeader());
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#getFooter()}.
+ */
+ @Test
+ public void testGetFooter() {
+ UIOutput component = new UIOutput();
+ table.getFacets().put("footer", component);
+ Assert.assertSame(component, table.getFooter());
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#getFilterVar()} and
+ * {@link org.richfaces.component.UIDataTableBase#setFilterVar(java.lang.String)}.
+ */
+ @Test
+ public void testFilterVar() {
+ String string = "fv";
+ table.setFilterVar(string);
+ Assert.assertSame(string, table.getFilterVar());
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#getSortPriority()} and
+ * {@link org.richfaces.component.UIDataTableBase#setSortPriority(java.util.Collection)}.
+ */
+ @Test
+ public void testSortPriority() {
+ table.setSortPriority(Collections.EMPTY_LIST);
+ Assert.assertSame(Collections.EMPTY_LIST, table.getSortPriority());
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#getSortMode()} and
+ * {@link org.richfaces.component.UIDataTableBase#setSortMode(org.richfaces.model.SortMode)}.
+ */
+ @Test
+ public void testSortMode() {
+ table.setSortMode(SortMode.multi);
+ Assert.assertSame(SortMode.multi, table.getSortMode());
+ }
+}
14 years, 9 months
JBoss Rich Faces SVN: r16560 - root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-03-11 11:41:22 -0500 (Thu, 11 Mar 2010)
New Revision: 16560
Modified:
root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
Log:
Default value of "execute" attribute in a4j:ajax was taken from "render" attribute
Modified: root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2010-03-11 15:40:10 UTC (rev 16559)
+++ root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2010-03-11 16:41:22 UTC (rev 16560)
@@ -1,18 +1,18 @@
package org.ajax4jsf.component.behavior;
import java.util.Collection;
+import java.util.Collections;
import java.util.Set;
import javax.el.ELContext;
import javax.el.ValueExpression;
-
import javax.faces.component.UIComponentBase;
import javax.faces.component.behavior.FacesBehavior;
import javax.faces.context.FacesContext;
import org.ajax4jsf.component.AjaxClientBehavior;
+import org.ajax4jsf.facelets.tag.AjaxHandler;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
-import org.ajax4jsf.facelets.tag.AjaxHandler;
import org.richfaces.cdk.annotations.JsfBehavior;
import org.richfaces.cdk.annotations.Tag;
@@ -146,7 +146,7 @@
@Override
public Collection<String> getRender() {
- return getCollectionValue(render, "RENDER");
+ return getCollectionValue(render, Attributes.render.toString());
}
@Override
@@ -174,7 +174,7 @@
return asSet(value);
}
- return this.render;
+ return Collections.emptyList();
}
public String getSimilarityGroupingId() {
14 years, 9 months