Author: alexsmirnov
Date: 2008-07-23 19:42:07 -0400 (Wed, 23 Jul 2008)
New Revision: 9760
Modified:
trunk/framework/impl/pom.xml
trunk/samples/beanValidatorSample/src/main/java/org/richfaces/MaxBean.java
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/AjaxOutputPanelRenderer.java
Log:
Some JDK-5 code corrections
Modified: trunk/framework/impl/pom.xml
===================================================================
--- trunk/framework/impl/pom.xml 2008-07-23 21:35:42 UTC (rev 9759)
+++ trunk/framework/impl/pom.xml 2008-07-23 23:42:07 UTC (rev 9760)
@@ -1,165 +1,166 @@
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>framework</artifactId>
- <groupId>org.richfaces</groupId>
- <version>3.2.2-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.framework</groupId>
- <artifactId>richfaces-impl</artifactId>
- <name>Java Server Faces AJAX framework implementation</name>
- <version>3.2.2-SNAPSHOT</version>
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <directory>target/javascript</directory>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>javacc-maven-plugin</artifactId>
- <version>2.4</version>
- <executions>
- <execution>
- <goals>
- <goal>javacc</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>javascript</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <ant antfile="${basedir}/generatescript.xml"
inheritRefs="true">
- <target name="assembly" />
- <property name="target-dir"
value="${project.build.directory}/javascript" />
- </ant>
- </tasks>
-
<resourceRoot>${project.build.directory}/javascript</resourceRoot>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-javascript-plugin</artifactId>
- <version>${project.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>compress</goal>
- </goals>
- <configuration>
- <nosuffix>false</nosuffix>
-
<outputDirectory>${project.build.directory}/compressed/</outputDirectory>
- <aggregations>
- <aggregation>
- <insertNewLine>true</insertNewLine>
-
<output>${project.build.outputDirectory}/org/ajax4jsf/framework.pack.js</output>
- <includes>
-
<include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/prototype-min.js</include>
-
<include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/AJAX-min.js</include>
-
<include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/scriptaculous/scriptaculous-min.js</include>
-
<include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/jquery/jquery-min.js</include>
-
<include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/dnd-min.js</include>
- <include>**/*-min.js</include>
- </includes>
- <excludes>
- <exclude>**/*.pack.js</exclude>
- <exclude>**/scriptaculous/*.js</exclude>
- <exclude>**/extend-min.js</exclude>
- <exclude>**/jquery.jcarousel-min.js</exclude>
- <exclude>**/compressed.css</exclude>
- </excludes>
- </aggregation>
- </aggregations>
- <resources>
- <resource>
- <directory>target/javascript</directory>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- </configuration>
- </execution>
- <execution>
- <id>jslint</id>
- <phase>test</phase>
- <goals>
- <goal>jslint</goal>
- </goals>
- <configuration>
- <includes>
- <include>**/framework.pack.js</include>
- </includes>
- <resources>
- <resource>
- <directory>${project.build.outputDirectory}</directory>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <profiles>
- <profile>
- <id>clover</id>
- <build>
- <plugins>
- <plugin>
- <groupId>com.atlassian.maven.plugins</groupId>
- <artifactId>maven-clover-plugin</artifactId>
- <configuration>
- <includesAllSourceRoots>false</includesAllSourceRoots>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
- <dependencies>
- <dependency>
- <groupId>opensymphony</groupId>
- <artifactId>oscache</artifactId>
- <version>2.3</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>nekohtml</groupId>
- <artifactId>nekohtml</artifactId>
- <version>0.9.5</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>commons-digester</groupId>
- <artifactId>commons-digester</artifactId>
- <version>1.8</version>
- <exclusions>
- <exclusion>
- <artifactId>commons-logging</artifactId>
- <groupId>commons-logging</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.richfaces.framework</groupId>
- <artifactId>richfaces-api</artifactId>
- <version>3.2.2-SNAPSHOT</version>
- </dependency>
- </dependencies>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>framework</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.2.2-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <name>Java Server Faces AJAX framework implementation</name>
+ <version>3.2.2-SNAPSHOT</version>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>target/javascript</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>javacc-maven-plugin</artifactId>
+ <version>2.4</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>javacc</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>javascript</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <ant antfile="${basedir}/generatescript.xml"
inheritRefs="true">
+ <target name="assembly" />
+ <property name="target-dir"
value="${project.build.directory}/javascript" />
+ </ant>
+ </tasks>
+ <resourceRoot>${project.build.directory}/javascript</resourceRoot>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-javascript-plugin</artifactId>
+ <version>${project.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compress</goal>
+ </goals>
+ <configuration>
+ <nosuffix>false</nosuffix>
+ <outputDirectory>${project.build.directory}/compressed/</outputDirectory>
+ <aggregations>
+ <aggregation>
+ <insertNewLine>true</insertNewLine>
+ <output>${project.build.outputDirectory}/org/ajax4jsf/framework.pack.js</output>
+ <includes>
+ <include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/prototype-min.js</include>
+ <include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/AJAX-min.js</include>
+ <include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/scriptaculous/scriptaculous-min.js</include>
+ <include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/jquery/jquery-min.js</include>
+ <include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/dnd-min.js</include>
+ <include>**/*-min.js</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.pack.js</exclude>
+ <exclude>**/scriptaculous/*.js</exclude>
+ <exclude>**/extend-min.js</exclude>
+ <exclude>**/jquery.jcarousel-min.js</exclude>
+ <exclude>**/compressed.css</exclude>
+ </excludes>
+ </aggregation>
+ </aggregations>
+ <resources>
+ <resource>
+ <directory>target/javascript</directory>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>jslint</id>
+ <phase>test</phase>
+ <goals>
+ <goal>jslint</goal>
+ </goals>
+ <configuration>
+ <includes>
+ <include>**/framework.pack.js</include>
+ </includes>
+ <resources>
+ <resource>
+ <directory>${project.build.outputDirectory}</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>clover</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.atlassian.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin</artifactId>
+ <configuration>
+ <includesAllSourceRoots>false</includesAllSourceRoots>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+ <dependencies>
+ <dependency>
+ <groupId>opensymphony</groupId>
+ <artifactId>oscache</artifactId>
+ <version>2.3</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>nekohtml</groupId>
+ <artifactId>nekohtml</artifactId>
+ <version>0.9.5</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <version>1.8</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>commons-logging</artifactId>
+ <groupId>commons-logging</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-api</artifactId>
+ <version>3.2.2-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
</project>
\ No newline at end of file
Modified: trunk/samples/beanValidatorSample/src/main/java/org/richfaces/MaxBean.java
===================================================================
--- trunk/samples/beanValidatorSample/src/main/java/org/richfaces/MaxBean.java 2008-07-23
21:35:42 UTC (rev 9759)
+++ trunk/samples/beanValidatorSample/src/main/java/org/richfaces/MaxBean.java 2008-07-23
23:42:07 UTC (rev 9760)
@@ -3,6 +3,7 @@
*/
package org.richfaces;
+import org.hibernate.validator.CreditCardNumber;
import org.hibernate.validator.Length;
import org.hibernate.validator.Max;
import org.hibernate.validator.Min;
@@ -23,6 +24,7 @@
/**
* @return the text
*/
+ @CreditCardNumber
public String getText() {
return text;
}
@@ -49,7 +51,7 @@
}
public String getTextDescription() {
- return "Text value, no restrictions";
+ return "Text value, should be correct credit card number";
}
public String getIntDescription() {
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/AjaxOutputPanelRenderer.java
===================================================================
---
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/AjaxOutputPanelRenderer.java 2008-07-23
21:35:42 UTC (rev 9759)
+++
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/AjaxOutputPanelRenderer.java 2008-07-23
23:42:07 UTC (rev 9760)
@@ -54,9 +54,8 @@
if (component.getChildCount() > 0) {
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
boolean ajaxRequest = ajaxContext.isAjaxRequest();
- Set ajaxRenderedAreas = ajaxContext.getAjaxRenderedAreas();
- for (Iterator it = component.getChildren().iterator(); it.hasNext();) {
- UIComponent child = (UIComponent) it.next();
+ Set<String> ajaxRenderedAreas = ajaxContext.getAjaxRenderedAreas();
+ for (UIComponent child : component.getChildren()) {
String childId = child.getClientId(context);
if (child.isRendered()) {
renderChild(context, child);
@@ -84,15 +83,13 @@
* @see javax.faces.render.Renderer#getRendersChildren()
*/
public boolean getRendersChildren() {
- // TODO Auto-generated method stub
return true;
}
/* (non-Javadoc)
* @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
*/
- protected Class getComponentClass() {
- // TODO Auto-generated method stub
+ protected Class<? extends UIComponent> getComponentClass() {
return UIAjaxOutputPanel.class;
}
@@ -114,7 +111,6 @@
* @return
*/
private String getTag(UIAjaxOutputPanel panel) {
- // TODO Auto-generated method stub
return "block".equals(panel.getLayout())?HTML.DIV_ELEM:HTML.SPAN_ELEM;
}
@@ -136,8 +132,8 @@
* @param component
*/
private void markNoTransient(UIComponent component) {
- for (Iterator iter = component.getFacetsAndChildren(); iter.hasNext();) {
- UIComponent element = (UIComponent) iter.next();
+ for (Iterator<UIComponent> iter = component.getFacetsAndChildren();
iter.hasNext();) {
+ UIComponent element = iter.next();
markNoTransient(element);
element.setTransient(false);
}