Author: alexsmirnov
Date: 2010-10-06 12:50:13 -0400 (Wed, 06 Oct 2010)
New Revision: 19482
Added:
branches/RF-8742/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/RichBean.java
branches/RF-8742/core/api/src/main/java/org/richfaces/renderkit/util/ColorUtils.java
branches/RF-8742/core/api/src/main/java/org/richfaces/resource/Java2DAnimatedUserResource.java
branches/RF-8742/core/impl/src/main/java/org/richfaces/resource/Java2DAnimatedUserResourceWrapperImpl.java
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF/
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF/jdoconfig.xml
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF/persistence.xml
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarAnimatedBackgroundImage.java
Removed:
branches/RF-8742/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/
branches/RF-8742/core/impl/src/main/java/org/richfaces/renderkit/html/images/TabHeaderGradient.java
branches/RF-8742/core/impl/src/main/java/org/richfaces/renderkit/html/images/TopTabHeaderGradient.java
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF/
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF/jdoconfig.xml
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF/persistence.xml
branches/RF-8742/examples/richfaces-showcase/src/main/resources/META-INF/jdoconfig.xml
branches/RF-8742/examples/richfaces-showcase/src/main/resources/META-INF/persistence.xml
Modified:
branches/RF-8742/
branches/RF-8742/archetypes/rf-gae-sample/pom.xml
branches/RF-8742/archetypes/rf-gae-sample/readme.txt
branches/RF-8742/archetypes/rf-gae-sample/src/main/resources/META-INF/maven/archetype-metadata.xml
branches/RF-8742/archetypes/rf-gae-sample/src/main/resources/archetype-resources/pom.xml
branches/RF-8742/archetypes/rf-gae-sample/src/main/resources/archetype-resources/readme.txt
branches/RF-8742/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/java/RichBean.java
branches/RF-8742/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml
branches/RF-8742/core/api/src/main/java/org/richfaces/resource/ImageType.java
branches/RF-8742/core/impl/src/main/java/org/richfaces/resource/Java2DUserResourceWrapperImpl.java
branches/RF-8742/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java
branches/RF-8742/dist/readme-ui.txt
branches/RF-8742/examples/iteration-demo/src/main/webapp/dataGrid.xhtml
branches/RF-8742/examples/richfaces-showcase/pom.xml
branches/RF-8742/examples/richfaces-showcase/src/main/java/org/richfaces/demo/progressBar/ProgressBarBean.java
branches/RF-8742/ui/dist/richfaces-components-ui/pom.xml
branches/RF-8742/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataGridRenderer.java
branches/RF-8742/ui/output/ui/pom.xml
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlAccordionItem.java
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTogglePanelTitledItem.java
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
Log:
Merged revisions 19431,19434-19441,19443-19444,19446,19468,19470,19477 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
.......
r19431 | nbelaevski | 2010-10-04 10:04:35 -0700 (Mon, 04 Oct 2010) | 1 line
https://jira.jboss.org/browse/RF-9397
.......
r19434 | nbelaevski | 2010-10-04 10:27:49 -0700 (Mon, 04 Oct 2010) | 1 line
https://jira.jboss.org/browse/RF-9270
.......
r19435 | jbalunas(a)redhat.com | 2010-10-04 12:16:38 -0700 (Mon, 04 Oct 2010) | 1 line
RF-9400, RF-9404 - fixed filtering overrides, and updated version correctly
.......
r19436 | jbalunas(a)redhat.com | 2010-10-04 12:32:49 -0700 (Mon, 04 Oct 2010) | 1 line
RF-9409 fixed simple archetype so that it uses packages
.......
r19437 | nbelaevski | 2010-10-04 12:43:13 -0700 (Mon, 04 Oct 2010) | 2 lines
https://jira.jboss.org/browse/RF-9405
https://jira.jboss.org/browse/RF-8779
.......
r19438 | nbelaevski | 2010-10-04 14:42:02 -0700 (Mon, 04 Oct 2010) | 1 line
https://jira.jboss.org/browse/RF-9406
.......
r19439 | jbalunas(a)redhat.com | 2010-10-04 14:44:13 -0700 (Mon, 04 Oct 2010) | 1 line
RF-9411 Updated archetype, and readme files to describe deploying to GAE SDK developer
server
.......
r19440 | nbelaevski | 2010-10-04 16:52:08 -0700 (Mon, 04 Oct 2010) | 1 line
https://jira.jboss.org/browse/RF-9413
.......
r19441 | nbelaevski | 2010-10-04 17:00:43 -0700 (Mon, 04 Oct 2010) | 1 line
ProgressBarBean.java made Serializable
.......
r19443 | jbalunas(a)redhat.com | 2010-10-04 17:52:14 -0700 (Mon, 04 Oct 2010) | 1 line
Prep for M3 respin
.......
r19444 | jbalunas(a)redhat.com | 2010-10-04 18:08:26 -0700 (Mon, 04 Oct 2010) | 1 line
[maven-release-plugin] prepare release 4.0.0.20101004-M3
.......
r19446 | jbalunas(a)redhat.com | 2010-10-04 18:09:24 -0700 (Mon, 04 Oct 2010) | 1 line
[maven-release-plugin] prepare for next development iteration
.......
r19468 | abelevich | 2010-10-06 04:03:20 -0700 (Wed, 06 Oct 2010) | 1 line
fix sample
.......
r19470 | abelevich | 2010-10-06 04:52:43 -0700 (Wed, 06 Oct 2010) | 1 line
https://jira.jboss.org/browse/RF-9422
.......
r19477 | abelevich | 2010-10-06 06:43:08 -0700 (Wed, 06 Oct 2010) | 1 line
.......
Property changes on: branches/RF-8742
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-19430
+ /trunk:1-19481
Modified: branches/RF-8742/archetypes/rf-gae-sample/pom.xml
===================================================================
--- branches/RF-8742/archetypes/rf-gae-sample/pom.xml 2010-10-06 15:19:12 UTC (rev 19481)
+++ branches/RF-8742/archetypes/rf-gae-sample/pom.xml 2010-10-06 16:50:13 UTC (rev 19482)
@@ -17,10 +17,6 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <!-- Setting this property for resource filtering so that generated project
- uses correct version of richfaces.
- -->
-
<archetype.project.version>${project.version}</archetype.project.version>
</properties>
<build>
@@ -39,9 +35,17 @@
</plugin>
</plugins>
<resources>
+ <!-- Selectively trigger filtering on resource directory
+ The second element turns on filtering only for META-INF directory
+ -->
<resource>
- <directory>src/main/resources</directory>
+ <directory>src/main/resources/</directory>
+ <filtering>false</filtering>
+ </resource>
+ <resource>
+ <directory>src/main/resources/META-INF/maven</directory>
<filtering>true</filtering>
+ <targetPath>META-INF/maven</targetPath>
</resource>
</resources>
</build>
Modified: branches/RF-8742/archetypes/rf-gae-sample/readme.txt
===================================================================
--- branches/RF-8742/archetypes/rf-gae-sample/readme.txt 2010-10-06 15:19:12 UTC (rev
19481)
+++ branches/RF-8742/archetypes/rf-gae-sample/readme.txt 2010-10-06 16:50:13 UTC (rev
19482)
@@ -1,51 +1,46 @@
RichFaces 4 Archetype
-BUILDING THE ARCHETYPE
+GENERATING THE PROJECT
-just execute mvn clean install in the root folder
+This archetype creates a simple RichFaces 4 application with all the settings and custom
artifacts you need to perform deploy to GAE cloud.
-APPLICATION CREATION
-
-This archetype creates a simple RichFaces 4 application with all the settings and custom
artifacts you need to perform deply to GAE cloud.
-
1) To generate a project from the archetype, run
mvn archetype:generate -DarchetypeGroupId=org.richfaces.archetypes
-DarchetypeArtifactId=richfaces-archetype-gae -DarchetypeVersion=<richfaces-version>
-DgroupId=<yourGroupId> -DartifactId=<yourArtifactId>
-Dversion=1.0-SNAPSHOT
-2) To build the project for deploy to GAE cloud, run
+2) Navigate into the new project directory and build by running:
mvn clean install
-*BEFORE NEXT STEP - you should setup your GAE account at
http://appspot.com and register
new application there.
-(read more at
http://code.google.com/intl/ru/appengine/docs/python/gettingstarted/uploa...)
+*BEFORE NEXT STEP:
+ -- You should setup your GAE account at
http://appspot.com
+ -- Register your new application there. By default the applications name is
"rf-${artifactId}"
+ -- Download and install the GAE SDK for deployment and local server tools
-3) Then just execute appcfg from GAE SDK(link) to publish to your account:
+3) Execute appcfg from GAE SDK to publish to your account:
appcfg update <PATH: "generated-application-target-folder/output application
folder">
-NOTE:Do not forget to register your own application name and make sure that the demo uses
the same name accordingly.
-
-
-4) now visit your application using http://<application-name>.appspot.com
+4) Once uploaded, visit your application using
http://<application-name>.appspot.com
4.1) check all the information about deployed application at
https://appengine.google.com/dashboard?&app_id=<your-application-i...
+NOTE:
+During build the "org.richfaces.cdk:maven-resource-plugin" executed and
generated static resources(web-app\static-resources\) for all skins in order to
+solve the compatibility problem with GAE and java2D API.
-PAY ATTENTION:
-during build with GAE profile - our org.richfaces.cdk:maven-resource-plugin executed and
generates static resources(web-app\static-resources\) for all the skins in order to
-solve the compatibility problem with GAE which restricts java2D usage(our dynamic
resources works using that dependency)
-
-NOTES about additional artifacts in webapp folder:
+NOTE: about additional artifacts in webapp folder:
1) java-gae-jsf-ri - contains modified WebConfiguration.java class which will be put to
Web-inf\classes when building with GAE profile. It solves compatibilities
issues exist in GAE for JSF applications.
-2) Webapp-gae folder contains GAE descriptor(appengine-web.xml) and modified application
web.xml. Them will be placed to WEb-inf folder after build with GAE profile. web.xml
-should be different in order to use static resources generated by plugin instead of
dynamic resources. And also restricts threading with
+2) Webapp-gae folder contains GAE descriptor(appengine-web.xml) and modified application
web.xml. They will be placed in the WEB-INF folder. The web.xml
+is different in order to use static resources generated by plugin instead of dynamic
resources. And also restricts threading with
com.sun.faces.enableThreading context parameter as GAE not allows threads.
============================================================================================================
-LOCAL DEPLOYMENT
-you still could deploy your application as usually using
-1) mvn clean install
-2) put to tomcat6\webapps
-3) run server
-4) enjoy going to http:\\localhost:8080\<app-name>
\ No newline at end of file
+LOCAL DEPLOYMENTS
+To test your application on your local machine you can use GAE SDK development server.
+1) Build archetype as above
+2) Navigate GAE SDK /bin
+3) Execute"
+ ./dev_appserver.sh <PATH: "generated-application-target-folder/output
application folder">
+4) Once loaded, access your application at http:\\localhost:8080\
\ No newline at end of file
Modified:
branches/RF-8742/archetypes/rf-gae-sample/src/main/resources/META-INF/maven/archetype-metadata.xml
===================================================================
---
branches/RF-8742/archetypes/rf-gae-sample/src/main/resources/META-INF/maven/archetype-metadata.xml 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/archetypes/rf-gae-sample/src/main/resources/META-INF/maven/archetype-metadata.xml 2010-10-06
16:50:13 UTC (rev 19482)
@@ -2,6 +2,11 @@
<archetype-descriptor
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-...
http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
name="gae-sample"
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archet...
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <requiredProperties>
+ <requiredProperty key="richfaces-version">
+ <defaultValue>${project.version}</defaultValue>
+ </requiredProperty>
+ </requiredProperties>
<fileSets>
<fileSet filtered="true" packaged="true"
encoding="UTF-8">
<directory>src/main/java</directory>
Modified:
branches/RF-8742/archetypes/rf-gae-sample/src/main/resources/archetype-resources/pom.xml
===================================================================
---
branches/RF-8742/archetypes/rf-gae-sample/src/main/resources/archetype-resources/pom.xml 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/archetypes/rf-gae-sample/src/main/resources/archetype-resources/pom.xml 2010-10-06
16:50:13 UTC (rev 19482)
@@ -26,10 +26,10 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <!-- Setting this property for resource filtering so that generated project
- uses correct version of richfaces.
+ <!-- Setting this property using archetype-metadata.xml requiredPorperty
+ so that generated project uses correct version of richfaces.
-->
-
<org.richfaces.bom.version>${archetype.project.version}</org.richfaces.bom.version>
+
<org.richfaces.bom.version>${richfaces-version}</org.richfaces.bom.version>
</properties>
<build>
@@ -127,78 +127,9 @@
</execution>
</executions>
</plugin>
-
</plugins>
</build>
- <profiles>
- <profile>
- <id>jee6</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
-
<webappDirectory>${project.build.directory}/${project.build.finalName}-jee6</webappDirectory>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>release</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <executions>
- <execution>
- <id>jee6</id>
- <phase>package</phase>
- <goals>
- <goal>war</goal>
- </goals>
- <configuration>
-
<webappDirectory>${project.build.directory}/${project.build.finalName}-jee6</webappDirectory>
- <classifier>jee6</classifier>
-
<packagingExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/slf4j-*</packagingExcludes>
-
<warSourceExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/slf4j-*</warSourceExcludes>
- </configuration>
- </execution>
- </executions>
- <configuration>
- <webResources>
- <resource>
-
<directory>${basedir}/src/main/java</directory>
- <targetPath>/WEB-INF/src</targetPath>
- </resource>
- </webResources>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
<dependencyManagement>
<dependencies>
<dependency>
@@ -239,33 +170,12 @@
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
+
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
-
- <dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
-
- <!--
- simple logger binding: only messages of level INFO and
- higher are printed
- -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.5.8</version>
- </dependency>
-
- <!-- Log4J dependency used in examples -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
-
+
<!-- Tests -->
<dependency>
<groupId>org.testng</groupId>
@@ -274,8 +184,8 @@
<classifier>jdk15</classifier>
<scope>test</scope>
</dependency>
+
<!-- GAE PROFILE DEPENDENCIES -->
-
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>el-impl</artifactId>
@@ -310,6 +220,5 @@
<version>2.9.1</version>
<scope>runtime</scope>
</dependency>
-
</dependencies>
</project>
Modified:
branches/RF-8742/archetypes/rf-gae-sample/src/main/resources/archetype-resources/readme.txt
===================================================================
---
branches/RF-8742/archetypes/rf-gae-sample/src/main/resources/archetype-resources/readme.txt 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/archetypes/rf-gae-sample/src/main/resources/archetype-resources/readme.txt 2010-10-06
16:50:13 UTC (rev 19482)
@@ -1,38 +1,37 @@
-Project generated with richfaces-archetype-gae
+RichFaces 4 Archetype
-1) To build the project for deploy to GAE cloud, run
+1) Build by running:
mvn clean install
-*BEFORE NEXT STEP - you should setup your GAE account at
http://appspot.com and register
new application there.
-(read more at
http://code.google.com/intl/ru/appengine/docs/python/gettingstarted/uploa...)
+*BEFORE NEXT STEP:
+ -- You should setup your GAE account at
http://appspot.com
+ -- Register your new application there. By default the applications name is
"rf-${artifactId}"
+ -- Download and install the GAE SDK for deployment and local server tools
-2) Then just execute appcfg from GAE SDK(link) to publish to your account:
- appcfg update <PATH: "generated-application-target-folder/output application
folder">
+3) Execute appcfg from GAE SDK to publish to your account:
+ appcfg update <PATH: "generated-application-target-folder/output application
folder">
-NOTE:Do not forget to register your own application name and make sure that the demo uses
the same name accordingly.
+4) Once uploaded, visit your application using
http://<application-name>.appspot.com
+4.1) check all the information about deployed application at
https://appengine.google.com/dashboard?&app_id=<your-application-i...
+NOTE:
+During build the "org.richfaces.cdk:maven-resource-plugin" executed and
generated static resources(web-app\static-resources\) for all skins in order to
+solve the compatibility problem with GAE and java2D API.
-3) now visit your application using http://<application-name>.appspot.com
-3.1) check all the information about deployed application at
https://appengine.google.com/dashboard?&app_id=<your-application-i...
-
-
-PAY ATTENTION:
-during build with GAE profile(default one) - our org.richfaces.cdk:maven-resource-plugin
executed and generates static resources(web-app\static-resources\) for all the skins in
order to
-solve the compatibility problem with GAE which restricts java2D usage(our dynamic
resources works using that dependency)
-
-NOTES about additional artifacts in webapp folder:
+NOTE: about additional artifacts in webapp folder:
1) java-gae-jsf-ri - contains modified WebConfiguration.java class which will be put to
Web-inf\classes when building with GAE profile. It solves compatibilities
issues exist in GAE for JSF applications.
-2) Webapp-gae folder contains GAE descriptor(appengine-web.xml) and modified application
web.xml. Them will be placed to WEb-inf folder after build with GAE profile. web.xml
-should be different in order to use static resources generated by plugin instead of
dynamic resources. And also restricts threading with
+2) Webapp-gae folder contains GAE descriptor(appengine-web.xml) and modified application
web.xml. They will be placed in the WEB-INF folder. The web.xml
+is different in order to use static resources generated by plugin instead of dynamic
resources. And also restricts threading with
com.sun.faces.enableThreading context parameter as GAE not allows threads.
============================================================================================================
-LOCAL DEPLOYMENT
-you still could deploy your application as usually using
-1) mvn clean install -Prelease
-2) put to tomcat6 or jboss (war's for both application servers will be created)
-3) run choosen server
-4) enjoy going to http:\\localhost:8080\<app-name>
\ No newline at end of file
+LOCAL DEPLOYMENTS
+To test your application on your local machine you can use GAE SDK development server.
+1) Build archetype as above
+2) Navigate GAE SDK /bin
+3) Execute"
+ ./dev_appserver.sh <PATH: "generated-application-target-folder/output
application folder">
+4) Once loaded, access your application at http:\\localhost:8080\
\ No newline at end of file
Modified:
branches/RF-8742/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/java/RichBean.java
===================================================================
---
branches/RF-8742/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/java/RichBean.java 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/java/RichBean.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -3,20 +3,15 @@
#set( $symbol_escape = '\' )
package ${package};
-import org.slf4j.LoggerFactory;
-import org.slf4j.Logger;
-
import java.io.Serializable;
public class RichBean implements Serializable {
private static final long serialVersionUID = -2403138958014741653L;
- private Logger logger;
private String name;
public RichBean() {
- logger = LoggerFactory.getLogger(RichBean.class);
- logger.info("post construct: initialize");
+ System.out.println("post construct: initialize");
name = "John";
}
Copied:
branches/RF-8742/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/RichBean.java
(from rev 19477,
trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/RichBean.java)
===================================================================
---
branches/RF-8742/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/RichBean.java
(rev 0)
+++
branches/RF-8742/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/RichBean.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -0,0 +1,25 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package};
+
+import java.io.Serializable;
+
+public class RichBean implements Serializable {
+
+ private static final long serialVersionUID = -2403138958014741653L;
+ private String name;
+
+ public RichBean() {
+ System.out.println("post construct: initialize");
+ name = "John";
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Modified:
branches/RF-8742/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
branches/RF-8742/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml 2010-10-06
16:50:13 UTC (rev 19482)
@@ -1,3 +1,6 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
<?xml version="1.0"?>
<faces-config version="2.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
@@ -4,7 +7,7 @@
<managed-bean>
<managed-bean-name>richBean</managed-bean-name>
- <managed-bean-class>org.richfaces.RichBean</managed-bean-class>
+ <managed-bean-class>${package}.RichBean</managed-bean-class>
<managed-bean-scope>view</managed-bean-scope>
</managed-bean>
</faces-config>
Copied:
branches/RF-8742/core/api/src/main/java/org/richfaces/renderkit/util/ColorUtils.java (from
rev 19477, trunk/core/api/src/main/java/org/richfaces/renderkit/util/ColorUtils.java)
===================================================================
--- branches/RF-8742/core/api/src/main/java/org/richfaces/renderkit/util/ColorUtils.java
(rev 0)
+++
branches/RF-8742/core/api/src/main/java/org/richfaces/renderkit/util/ColorUtils.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -0,0 +1,235 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.renderkit.util;
+
+import java.awt.Color;
+
+/**
+ * Utility methods that are useful for color processing.
+ *
+ * @author carcasser
+ */
+public final class ColorUtils {
+
+ private ColorUtils() {
+ }
+
+ /**
+ * Converts the components of a color, as specified by the default RGB
+ * model, to an equivalent set of values for hue, saturation, and lightness
+ * that are the three components of the HSL model.
+ *
+ * @param r
+ * the red component of the color
+ * @param g
+ * the green component of the color
+ * @param b
+ * the blue component of the color
+ * @return an array of three elements containing the hue, saturation, and
+ * lightness (in that order), of the color with the indicated red,
+ * green, and blue components.
+ */
+ public static float[] convertRGBtoHSL(int r, int g, int b) {
+ float varR = (r / 255f);
+ float varG = (g / 255f);
+ float varB = (b / 255f);
+
+ float varMin = Math.min(varR, Math.min(varG, varB)); // Min value of RGB
+ float varMax = Math.max(varR, Math.max(varG, varB)); // Max value of RGB
+ float delMax = varMax - varMin; // Delta RGB value
+
+ float h = 0;
+ float s = 0;
+ float l = (varMax + varMin) / 2;
+
+ if (delMax == 0 || l == 0) {
+ s = 0;
+ } else if (l == 1) {
+ s = 1;
+ } else if (l <= 0.5) {
+ s = delMax / (2 * (1 - l));
+ } else if (l > 0.5) {
+ s = delMax / (2 * l);
+ }
+
+ if (delMax == 0) {
+ h = 0;
+ } else if (varMax == varR && g >= b) {
+ h = 60 * (varG - varB) / delMax + 0;
+ } else if (varMax == varR && varG < b) {
+ h = 60 * (varG - varB) / delMax + 360;
+ } else if (varMax == varG) {
+ h = 60 * (varB - varR) / delMax + 120;
+ } else if (varMax == varB) {
+ h = 60 * (varR - varG) / delMax + 240;
+ }
+
+ return new float[] { h, s, l };
+ }
+
+ /**
+ * Converts the components of a color, as specified by the HSL model, to an
+ * equivalent set of values for the default RGB model.
+ * <p>
+ * The <code>saturation</code> and <code>lightness</code>
components
+ * should be floating-point values between zero and one (numbers in the
+ * range 0.0-1.0). The <code>hue</code> component can be any
+ * floating-point number. The floor of this number is subtracted from it to
+ * create a fraction between 0 and 1. This fractional number is then
+ * multiplied by 360 to produce the hue angle in the HSB color model.
+ *
+ * @param h
+ * the hue component of the color
+ * @param s
+ * the saturation of the color
+ * @param l
+ * the lightness of the color
+ * @return the RGB value of the color with the indicated hue, saturation,
+ * and lightness
+ */
+ public static Color convertHSLtoRGB(float h, float s, float l) {
+ float q;
+ if (l < 0.5) {
+ q = l * (1 + s);
+ } else {
+ q = l + s - (l * s);
+ }
+
+ float p = 2 * l - q;
+ float hNorm = h / 360;
+
+ float tR = hNorm + 1f / 3f;
+ float tG = hNorm;
+ float tB = hNorm - 1f / 3f;
+
+ float r = tC2C(tR, p, q);
+ float g = tC2C(tG, p, q);
+ float b = tC2C(tB, p, q);
+
+ return new Color(r, g, b);
+ }
+
+ private static float tC2C(float tC, float p, float q) {
+ float retVal;
+
+ if (tC < 0) {
+ tC += 1;
+ }
+
+ if (tC > 1) {
+ tC -= 1;
+ }
+
+ if ((6 * tC) < 1) {
+ retVal = (p + (q - p) * 6 * tC);
+ } else if ((2 * tC) < 1) {
+ retVal = q;
+ } else if ((3 * tC) < 2) {
+ retVal = (p + (q - p) * 6 * (2f / 3f - tC));
+ } else {
+ retVal = p;
+ }
+
+ return retVal;
+ }
+
+ /**
+ * Increases/decreases brightness of the given color by the specified
+ * <code>difference</code>.
+ * <p>
+ * The <code>difference</code> values in the range (-1.0, 1.0): 1.0 -
the
+ * brightest value; -1.0 - the dimmest value.
+ *
+ * @param c
+ * color to adjust
+ * @param difference
+ * value to be added to the current brightness
+ *
+ * @return a new <code>Color</code> instance with increased/decreased
+ * brightness by specified <code>difference</code>
+ * @throws IllegalArgumentException
+ * if difference is outside of the range -1.0 to 1.0, inclusive
+ */
+ public static Color adjustBrightness(Color c, float difference) {
+ if (difference < -1.0 || difference > 1.0) {
+ throw new IllegalArgumentException("Difference parameter outside of
expected range: "
+ + "Difference parameter should be floating-point values between
-1 and 1");
+ }
+
+ Color retVal = null;
+ if (c != null) {
+ float[] hsb = Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), null);
+ float brightness = Math.min(1.0f, Math.max(0.0f, hsb[2] + difference));
+ retVal = new Color(Color.HSBtoRGB(hsb[0], hsb[1], brightness));
+ }
+
+ return retVal;
+ }
+
+ /**
+ * Increases/decreases lightness of the given color by the specified
+ * <code>difference</code>.
+ * <p>
+ * The <code>difference</code> values in the range (-1.0, 1.0): 1.0 -
the
+ * lightest value; -1.0 - on the contrary.
+ *
+ * @param c
+ * color to adjust
+ * @param difference
+ * value to be added to the current lightness
+ *
+ * @return a new <code>Color</code> instance with increased/decreased
+ * lightness by specified <code>difference</code>
+ * @throws IllegalArgumentException
+ * if difference is outside of the range -1.0 to 1.0, inclusive
+ */
+ public static Color adjustLightness(Color c, float difference) {
+ if (difference < -1.0 || difference > 1.0) {
+ throw new IllegalArgumentException("Difference parameter outside of
expected range: "
+ + "Difference parameter should be floating-point values between
-1 and 1");
+ }
+
+ Color retVal = null;
+ if (c != null) {
+ float[] hsl = convertRGBtoHSL(c.getRed(), c.getGreen(), c.getBlue());
+ float lightness = Math.min(1.0f, Math.max(0.0f, hsl[2] + difference));
+ retVal = convertHSLtoRGB(hsl[0], hsl[1], lightness);
+ }
+
+ return retVal;
+ }
+
+ /**
+ * Overwrites alpha value for given color.
+ *
+ * @param c color to overwrite
+ * @param alpha a new value of alpha
+ * @return a new <code>Color</code> object with a new specified alpha
value
+ */
+ public static Color overwriteAlpha(Color c, float alpha) {
+ Color retVal = c;
+ if (c != null) {
+ retVal = new Color(c.getRed(), c.getGreen(), c.getBlue(), (int) (alpha * 255
+ 0.5));
+ }
+ return retVal;
+ }
+
+}
Modified: branches/RF-8742/core/api/src/main/java/org/richfaces/resource/ImageType.java
===================================================================
---
branches/RF-8742/core/api/src/main/java/org/richfaces/resource/ImageType.java 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/core/api/src/main/java/org/richfaces/resource/ImageType.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -21,6 +21,7 @@
*/
package org.richfaces.resource;
+import java.awt.Dimension;
import java.awt.Transparency;
import java.awt.color.ColorSpace;
import java.awt.image.BufferedImage;
@@ -115,6 +116,10 @@
public abstract BufferedImage createImage(int width, int height);
+ public BufferedImage createImage(Dimension dimension) {
+ return createImage(dimension.width, dimension.height);
+ }
+
public String getFormatName() {
return formatName;
}
Copied:
branches/RF-8742/core/api/src/main/java/org/richfaces/resource/Java2DAnimatedUserResource.java
(from rev 19477,
trunk/core/api/src/main/java/org/richfaces/resource/Java2DAnimatedUserResource.java)
===================================================================
---
branches/RF-8742/core/api/src/main/java/org/richfaces/resource/Java2DAnimatedUserResource.java
(rev 0)
+++
branches/RF-8742/core/api/src/main/java/org/richfaces/resource/Java2DAnimatedUserResource.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.richfaces.resource;
+
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface Java2DAnimatedUserResource extends Java2DUserResource {
+
+ public boolean isLooped();
+
+ public int getFrameDelay();
+
+ public void startFramesSequence();
+
+ public boolean hasNextFrame();
+
+ public void paint(Graphics2D graphics2d, Dimension dimension);
+
+}
Deleted:
branches/RF-8742/core/impl/src/main/java/org/richfaces/renderkit/html/images/TabHeaderGradient.java
===================================================================
---
branches/RF-8742/core/impl/src/main/java/org/richfaces/renderkit/html/images/TabHeaderGradient.java 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/core/impl/src/main/java/org/richfaces/renderkit/html/images/TabHeaderGradient.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -1,41 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.images;
-
-import org.richfaces.renderkit.html.BaseGradient;
-import org.richfaces.skin.Skin;
-
-import javax.faces.context.FacesContext;
-
-/**
- * @author akolonitsky
- * @since Sep 30, 2010
- */
-public class TabHeaderGradient extends BaseGradient {
-
- @Override
- protected void initializeProperties(FacesContext context, Skin skin) {
- super.initializeProperties(context, skin);
- setBaseColorParam(Skin.GENERAL_BACKGROUND_COLOR);
- setGradientColorParam(Skin.TAB_BACKGROUND_COLOR);
- }
-}
Deleted:
branches/RF-8742/core/impl/src/main/java/org/richfaces/renderkit/html/images/TopTabHeaderGradient.java
===================================================================
---
branches/RF-8742/core/impl/src/main/java/org/richfaces/renderkit/html/images/TopTabHeaderGradient.java 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/core/impl/src/main/java/org/richfaces/renderkit/html/images/TopTabHeaderGradient.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -1,41 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.images;
-
-import org.richfaces.renderkit.html.BaseGradient;
-import org.richfaces.skin.Skin;
-
-import javax.faces.context.FacesContext;
-
-/**
- * @author akolonitsky
- * @since Sep 30, 2010
- */
-public class TopTabHeaderGradient extends BaseGradient {
-
- @Override
- protected void initializeProperties(FacesContext context, Skin skin) {
- super.initializeProperties(context, skin);
- setBaseColorParam(Skin.TAB_BACKGROUND_COLOR);
- setGradientColorParam(Skin.GENERAL_BACKGROUND_COLOR);
- }
-}
Copied:
branches/RF-8742/core/impl/src/main/java/org/richfaces/resource/Java2DAnimatedUserResourceWrapperImpl.java
(from rev 19477,
trunk/core/impl/src/main/java/org/richfaces/resource/Java2DAnimatedUserResourceWrapperImpl.java)
===================================================================
---
branches/RF-8742/core/impl/src/main/java/org/richfaces/resource/Java2DAnimatedUserResourceWrapperImpl.java
(rev 0)
+++
branches/RF-8742/core/impl/src/main/java/org/richfaces/resource/Java2DAnimatedUserResourceWrapperImpl.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -0,0 +1,161 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.richfaces.resource;
+
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.text.MessageFormat;
+import java.util.Iterator;
+
+import javax.imageio.IIOImage;
+import javax.imageio.ImageIO;
+import javax.imageio.ImageTypeSpecifier;
+import javax.imageio.ImageWriteParam;
+import javax.imageio.ImageWriter;
+import javax.imageio.metadata.IIOMetadata;
+import javax.imageio.metadata.IIOMetadataNode;
+import javax.imageio.stream.ImageOutputStream;
+
+import org.w3c.dom.Node;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class Java2DAnimatedUserResourceWrapperImpl extends Java2DUserResourceWrapperImpl
{
+
+ public Java2DAnimatedUserResourceWrapperImpl(Java2DAnimatedUserResource
resourceObject) {
+ super(resourceObject);
+ }
+
+ private static ImageWriter getSequenceCapableImageWriter(ImageType imageType) {
+ Iterator<ImageWriter> imageWriters =
ImageIO.getImageWritersByFormatName(imageType.getFormatName());
+
+ while (imageWriters.hasNext()) {
+ ImageWriter imageWriter = imageWriters.next();
+
+ if (imageWriter.canWriteSequence()) {
+ return imageWriter;
+ }
+ }
+
+ throw new IllegalArgumentException(MessageFormat.format("Cannot find
sequence-capable image writer for {0} format",
+ imageType.getFormatName()));
+ }
+
+ private static Node getOrCreateChild(Node root, String name) {
+ Node result = null;
+
+ for (Node node = root.getFirstChild(); (node != null) && (result ==
null); node = node.getNextSibling()) {
+ if (name.equals(node.getNodeName())) {
+ result = node;
+ }
+ }
+
+ if (result == null) {
+ result = new IIOMetadataNode(name);
+ root.appendChild(result);
+ }
+
+ return result;
+ }
+
+ private static void checkSupportedFormat(ImageType imageType) {
+ if (imageType != ImageType.GIF) {
+ throw new IllegalArgumentException(MessageFormat.format("Image format
{0} is not supported", imageType.getFormatName()));
+ }
+ }
+
+ @Override
+ public String getRequestPath() {
+ //detect unsupported types early
+ checkSupportedFormat(getWrapped().getImageType());
+ return super.getRequestPath();
+ }
+
+ @Override
+ protected void paintAndWrite(ImageOutputStream outputStream) throws IOException {
+ Java2DAnimatedUserResource userResource = (Java2DAnimatedUserResource)
getWrapped();
+
+ ImageType imageType = userResource.getImageType();
+ checkSupportedFormat(imageType);
+ ImageWriter imageWriter = getSequenceCapableImageWriter(imageType);
+ Dimension dimension = userResource.getDimension();
+ BufferedImage image = imageType.createImage(dimension);
+
+ try {
+ imageWriter.setOutput(outputStream);
+
+ ImageWriteParam defaultImageWriteParam = imageWriter.getDefaultWriteParam();
+ IIOMetadata imageMetaData =
imageWriter.getDefaultImageMetadata(ImageTypeSpecifier.createFromBufferedImageType(
+ BufferedImage.TYPE_INT_RGB),
+ defaultImageWriteParam);
+ String metaFormatName = imageMetaData.getNativeMetadataFormatName();
+ Node root = imageMetaData.getAsTree(metaFormatName);
+ IIOMetadataNode graphicsControlExtensionNode = (IIOMetadataNode)
getOrCreateChild(root, "GraphicControlExtension");
+
+ //
http://java.sun.com/javase/6/docs/api/javax/imageio/metadata/doc-files/gi...
+ graphicsControlExtensionNode.setAttribute("disposalMethod",
"none");
+ graphicsControlExtensionNode.setAttribute("userInputFlag",
"FALSE");
+ graphicsControlExtensionNode.setAttribute("transparentColorFlag",
"FALSE");
+ graphicsControlExtensionNode.setAttribute("delayTime",
Integer.toString(userResource.getFrameDelay() / 100));
+ graphicsControlExtensionNode.setAttribute("transparentColorIndex",
"0");
+
+ Node applicationExtensionsNode = getOrCreateChild(root,
"ApplicationExtensions");
+ IIOMetadataNode netscapeExtension = new
IIOMetadataNode("ApplicationExtension");
+
+ netscapeExtension.setAttribute("applicationID",
"NETSCAPE");
+ netscapeExtension.setAttribute("authenticationCode",
"2.0");
+
+ byte numLoops = (byte) (userResource.isLooped() ? 0x0 : 0x1);
+
+ netscapeExtension.setUserObject(new byte[]{0x1, numLoops, 0x0});
+ applicationExtensionsNode.appendChild(netscapeExtension);
+ imageMetaData.setFromTree(metaFormatName, root);
+
+ imageWriter.prepareWriteSequence(null);
+
+ userResource.startFramesSequence();
+
+ while (userResource.hasNextFrame()) {
+ Graphics2D g2d = null;
+ try {
+ g2d = createGraphics(image);
+ userResource.paint(g2d, dimension);
+ imageWriter.writeToSequence(new IIOImage(image, null,
imageMetaData),
+ defaultImageWriteParam);
+ } finally {
+ if (g2d != null) {
+ g2d.dispose();
+ }
+ }
+ }
+
+ imageWriter.endWriteSequence();
+ } finally {
+ imageWriter.dispose();
+ }
+ }
+
+}
Modified:
branches/RF-8742/core/impl/src/main/java/org/richfaces/resource/Java2DUserResourceWrapperImpl.java
===================================================================
---
branches/RF-8742/core/impl/src/main/java/org/richfaces/resource/Java2DUserResourceWrapperImpl.java 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/core/impl/src/main/java/org/richfaces/resource/Java2DUserResourceWrapperImpl.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -34,6 +34,7 @@
import javax.faces.context.FacesContext;
import javax.imageio.ImageIO;
+import javax.imageio.stream.ImageOutputStream;
import org.ajax4jsf.util.HtmlColor;
import org.richfaces.renderkit.util.HtmlDimensions;
@@ -52,54 +53,33 @@
}
public InputStream getInputStream() throws IOException {
- Java2DUserResource j2DUserResource = getWrapped();
- Dimension dimension = j2DUserResource.getDimension();
- int width = dimension.width;
- int height = dimension.height;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
- ImageType imageType = j2DUserResource.getImageType();
-
- if ((width > 0) && (height > 0)) {
- BufferedImage image = imageType.createImage(width, height);
- Graphics2D g2d = image.createGraphics();
-
- try {
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_ENABLE);
-
- g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
- RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
-
- j2DUserResource.paint(g2d, dimension);
- } finally {
- g2d.dispose();
- }
-
- try {
- ImageIO.write(image, imageType.getFormatName(), baos);
- } finally {
+ ImageOutputStream imageOutputStream = ImageIO.createImageOutputStream(baos);
+ try {
+ paintAndWrite(imageOutputStream);
+ } finally {
+ if (imageOutputStream != null) {
try {
- baos.close();
+ imageOutputStream.close();
} catch (IOException e) {
-
- // TODO Auto-generated catch block
+ // TODO: handle exception
e.printStackTrace();
}
}
}
-
return new ByteArrayInputStream(baos.toByteArray());
}
+ protected void write(BufferedImage image, String formatName, ImageOutputStream
imageOutputStream) throws IOException {
+ ImageIO.write(image, formatName, imageOutputStream);
+ }
+
public String getContentType() {
return getWrapped().getImageType().getMimeType();
}
protected String getValueParameter(FacesContext context, String name) {
- SkinFactory skinFactory = SkinFactory.getInstance();
+ SkinFactory skinFactory = SkinFactory.getInstance(context);
Skin skin = skinFactory.getSkin(context);
String value = (String) skin.getParameter(context, name);
@@ -115,16 +95,16 @@
protected Integer getColorValueParameter(FacesContext context, String name, boolean
useDefault) {
Skin skin;
if (useDefault) {
- skin = SkinFactory.getInstance().getDefaultSkin(context);
+ skin = SkinFactory.getInstance(context).getDefaultSkin(context);
} else {
- skin = SkinFactory.getInstance().getSkin(context);
+ skin = SkinFactory.getInstance(context).getSkin(context);
}
return decodeColor((String) skin.getParameter(context, name));
}
protected Integer getHeight(FacesContext context, String heightParamName) {
- SkinFactory skinFactory = SkinFactory.getInstance();
+ SkinFactory skinFactory = SkinFactory.getInstance(context);
Skin skin = skinFactory.getSkin(context);
String height = (String) skin.getParameter(context, heightParamName);
@@ -157,4 +137,33 @@
protected Date getLastModified(FacesContext context) {
return getWrapped().getLastModified();
}
+
+ protected void paintAndWrite(ImageOutputStream outputStream) throws IOException {
+ Java2DUserResource resource = getWrapped();
+ ImageType imageType = resource.getImageType();
+
+ BufferedImage image = imageType.createImage(resource.getDimension());
+ Graphics2D g2d = null;
+ try {
+ g2d = createGraphics(image);
+ resource.paint(g2d, new Dimension(image.getWidth(), image.getHeight()));
+ ImageIO.write(image, imageType.getFormatName(), outputStream);
+ } finally {
+ if (g2d != null) {
+ g2d.dispose();
+ }
+ }
+ }
+
+ protected Graphics2D createGraphics(BufferedImage image) {
+ Graphics2D g2d = image.createGraphics();
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
+ g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_ENABLE);
+
+ g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
+ RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
+ return g2d;
+ }
}
Modified:
branches/RF-8742/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java
===================================================================
---
branches/RF-8742/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -260,7 +260,11 @@
if (legitimateResource) {
Object wrappedResource;
- if (Java2DUserResource.class.isAssignableFrom(loadedClass)) {
+ if (Java2DAnimatedUserResource.class.isAssignableFrom(loadedClass))
{
+ Java2DAnimatedUserResource java2DAnimatedUserResource =
(Java2DAnimatedUserResource) loadedClass.newInstance();
+ wrappedResource = java2DAnimatedUserResource;
+ resource = new
Java2DAnimatedUserResourceWrapperImpl(java2DAnimatedUserResource);
+ } else if (Java2DUserResource.class.isAssignableFrom(loadedClass)) {
Java2DUserResource java2DUserResource = (Java2DUserResource)
loadedClass.newInstance();
wrappedResource = java2DUserResource;
resource = new
Java2DUserResourceWrapperImpl(java2DUserResource);
Modified: branches/RF-8742/dist/readme-ui.txt
===================================================================
--- branches/RF-8742/dist/readme-ui.txt 2010-10-06 15:19:12 UTC (rev 19481)
+++ branches/RF-8742/dist/readme-ui.txt 2010-10-06 16:50:13 UTC (rev 19482)
@@ -8,10 +8,10 @@
-------------------------------
1) Put RichFaces libraries and its dependencies in your application libraries folder:
- 1.1) richfaces-core-api-4.0.0.20101001-M3.jar
- 1.2) richfaces-core-impl-4.0.0.20101001-M3.jar
- 1.3) richfaces-components-api-4.0.0.20101001-M3.jar
- 1.4) richfaces-components-ui-4.0.0.20101001-M3.jar
+ 1.1) richfaces-core-api-4.0.0.20101004-M3.jar
+ 1.2) richfaces-core-impl-4.0.0.20101004-M3.jar
+ 1.3) richfaces-components-api-4.0.0.20101004-M3.jar
+ 1.4) richfaces-components-ui-4.0.0.20101004-M3.jar
1.5) sac-1.3, cssparser-0.9.5 - required for components CSS work
1.6) google-guava-r06 - core runtime dependency.
1.7) annotations.jar from org.richfaces.cdk
Modified: branches/RF-8742/examples/iteration-demo/src/main/webapp/dataGrid.xhtml
===================================================================
--- branches/RF-8742/examples/iteration-demo/src/main/webapp/dataGrid.xhtml 2010-10-06
15:19:12 UTC (rev 19481)
+++ branches/RF-8742/examples/iteration-demo/src/main/webapp/dataGrid.xhtml 2010-10-06
16:50:13 UTC (rev 19482)
@@ -39,15 +39,11 @@
<h:body>
<h:form id="form1">
- <it:dataGrid columns="3" var="record" elements="8"
value="#{dataBean.employeeList}">
+ <it:dataGrid id="dataGrid" columns="3" var="record"
elements="8" value="#{dataBean.employeeList}">
<f:facet name="header">
<h:outputText value="header"/>
</f:facet>
- <f:facet name="footer">
- <h:outputText value="footer"/>
- </f:facet>
-
<f:facet name="caption">
<h:outputText value="caption"/>
</f:facet>
Modified: branches/RF-8742/examples/richfaces-showcase/pom.xml
===================================================================
--- branches/RF-8742/examples/richfaces-showcase/pom.xml 2010-10-06 15:19:12 UTC (rev
19481)
+++ branches/RF-8742/examples/richfaces-showcase/pom.xml 2010-10-06 16:50:13 UTC (rev
19482)
@@ -145,6 +145,14 @@
</dependency>
</dependencies>
<build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>src/main/resources-gae</directory>
+ </resource>
+ </resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Modified:
branches/RF-8742/examples/richfaces-showcase/src/main/java/org/richfaces/demo/progressBar/ProgressBarBean.java
===================================================================
---
branches/RF-8742/examples/richfaces-showcase/src/main/java/org/richfaces/demo/progressBar/ProgressBarBean.java 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/examples/richfaces-showcase/src/main/java/org/richfaces/demo/progressBar/ProgressBarBean.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -3,6 +3,7 @@
*/
package org.richfaces.demo.progressBar;
+import java.io.Serializable;
import java.util.Date;
import javax.faces.bean.ManagedBean;
@@ -14,8 +15,10 @@
*/
@ManagedBean
@ViewScoped
-public class ProgressBarBean {
+public class ProgressBarBean implements Serializable {
+ private static final long serialVersionUID = -314414475508376585L;
+
private boolean buttonRendered = true;
private boolean enabled=false;
private Long startTime;
Deleted:
branches/RF-8742/examples/richfaces-showcase/src/main/resources/META-INF/jdoconfig.xml
===================================================================
---
branches/RF-8742/examples/richfaces-showcase/src/main/resources/META-INF/jdoconfig.xml 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/examples/richfaces-showcase/src/main/resources/META-INF/jdoconfig.xml 2010-10-06
16:50:13 UTC (rev 19482)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<jdoconfig
xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdocon...
-
- <persistence-manager-factory name="transactions-optional">
- <property name="javax.jdo.PersistenceManagerFactoryClass"
-
value="org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory"/>
- <property name="javax.jdo.option.ConnectionURL"
value="appengine"/>
- <property name="javax.jdo.option.NontransactionalRead"
value="true"/>
- <property name="javax.jdo.option.NontransactionalWrite"
value="true"/>
- <property name="javax.jdo.option.RetainValues"
value="true"/>
- <property name="datanucleus.appengine.autoCreateDatastoreTxns"
value="true"/>
- </persistence-manager-factory>
-</jdoconfig>
Deleted:
branches/RF-8742/examples/richfaces-showcase/src/main/resources/META-INF/persistence.xml
===================================================================
---
branches/RF-8742/examples/richfaces-showcase/src/main/resources/META-INF/persistence.xml 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/examples/richfaces-showcase/src/main/resources/META-INF/persistence.xml 2010-10-06
16:50:13 UTC (rev 19482)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
- version="1.0">
- <persistence-unit name="transactions-optional">
-
<provider>org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider</provider>
- <properties>
- <property name="datanucleus.NontransactionalRead"
value="true"/>
- <property name="datanucleus.NontransactionalWrite"
value="true"/>
- <property name="datanucleus.ConnectionURL"
value="appengine"/>
- </properties>
- </persistence-unit>
-
-</persistence>
\ No newline at end of file
Copied: branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae (from rev
19477, trunk/examples/richfaces-showcase/src/main/resources-gae)
Copied: branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF (from
rev 19477, trunk/examples/richfaces-showcase/src/main/resources-gae/META-INF)
Deleted:
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF/jdoconfig.xml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/resources-gae/META-INF/jdoconfig.xml 2010-10-06
13:43:08 UTC (rev 19477)
+++
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF/jdoconfig.xml 2010-10-06
16:50:13 UTC (rev 19482)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<jdoconfig
xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdocon...
-
- <persistence-manager-factory name="transactions-optional">
- <property name="javax.jdo.PersistenceManagerFactoryClass"
-
value="org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory"/>
- <property name="javax.jdo.option.ConnectionURL"
value="appengine"/>
- <property name="javax.jdo.option.NontransactionalRead"
value="true"/>
- <property name="javax.jdo.option.NontransactionalWrite"
value="true"/>
- <property name="javax.jdo.option.RetainValues"
value="true"/>
- <property name="datanucleus.appengine.autoCreateDatastoreTxns"
value="true"/>
- </persistence-manager-factory>
-</jdoconfig>
Copied:
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF/jdoconfig.xml
(from rev 19477,
trunk/examples/richfaces-showcase/src/main/resources-gae/META-INF/jdoconfig.xml)
===================================================================
---
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF/jdoconfig.xml
(rev 0)
+++
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF/jdoconfig.xml 2010-10-06
16:50:13 UTC (rev 19482)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jdoconfig
xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdocon...
+
+ <persistence-manager-factory name="transactions-optional">
+ <property name="javax.jdo.PersistenceManagerFactoryClass"
+
value="org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory"/>
+ <property name="javax.jdo.option.ConnectionURL"
value="appengine"/>
+ <property name="javax.jdo.option.NontransactionalRead"
value="true"/>
+ <property name="javax.jdo.option.NontransactionalWrite"
value="true"/>
+ <property name="javax.jdo.option.RetainValues"
value="true"/>
+ <property name="datanucleus.appengine.autoCreateDatastoreTxns"
value="true"/>
+ </persistence-manager-factory>
+</jdoconfig>
Deleted:
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF/persistence.xml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/resources-gae/META-INF/persistence.xml 2010-10-06
13:43:08 UTC (rev 19477)
+++
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF/persistence.xml 2010-10-06
16:50:13 UTC (rev 19482)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
- version="1.0">
- <persistence-unit name="transactions-optional">
-
<provider>org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider</provider>
- <properties>
- <property name="datanucleus.NontransactionalRead"
value="true"/>
- <property name="datanucleus.NontransactionalWrite"
value="true"/>
- <property name="datanucleus.ConnectionURL"
value="appengine"/>
- </properties>
- </persistence-unit>
-
-</persistence>
\ No newline at end of file
Copied:
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF/persistence.xml
(from rev 19477,
trunk/examples/richfaces-showcase/src/main/resources-gae/META-INF/persistence.xml)
===================================================================
---
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF/persistence.xml
(rev 0)
+++
branches/RF-8742/examples/richfaces-showcase/src/main/resources-gae/META-INF/persistence.xml 2010-10-06
16:50:13 UTC (rev 19482)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+ version="1.0">
+ <persistence-unit name="transactions-optional">
+
<provider>org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider</provider>
+ <properties>
+ <property name="datanucleus.NontransactionalRead"
value="true"/>
+ <property name="datanucleus.NontransactionalWrite"
value="true"/>
+ <property name="datanucleus.ConnectionURL"
value="appengine"/>
+ </properties>
+ </persistence-unit>
+
+</persistence>
\ No newline at end of file
Modified: branches/RF-8742/ui/dist/richfaces-components-ui/pom.xml
===================================================================
--- branches/RF-8742/ui/dist/richfaces-components-ui/pom.xml 2010-10-06 15:19:12 UTC (rev
19481)
+++ branches/RF-8742/ui/dist/richfaces-components-ui/pom.xml 2010-10-06 16:50:13 UTC (rev
19482)
@@ -137,6 +137,9 @@
</taglibs>
</transformer>
<transformer
implementation="org.richfaces.build.shade.resource.FacesConfigXmlResourceTransformer"
/>
+ <transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
+
<resource>META-INF/richfaces/resource-mappings.properties</resource>
+ </transformer>
</transformers>
</configuration>
</execution>
Copied:
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
(from rev 19477,
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js)
===================================================================
---
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
(rev 0)
+++
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-10-06
16:50:13 UTC (rev 19482)
@@ -0,0 +1,90 @@
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ var INTERFACE = {
+ SelectListener : {
+ processItem: function(event, element){}
+ }
+ };
+
+ rf.ui.Select = function(id, listener, options) {
+ this.id = id;
+ this.select = $(document.getElementById(id));
+ this.itemsCord = $(document.getElementById(options.itemsCord));
+ this.selectItemCss = options.selectItemCss;
+ this.itemCss = options.itemCss;
+ this.selectListener = listener;
+
+ this.select.bind("blur", $.proxy(this.__blurHandler, this));
+ this.itemsCord.bind("mouseover", $.proxy(this.__mouseHandler, this));
+ this.itemsCord.bind("click", $.proxy(this.__mouseHandler, this));
+ };
+
+ rf.BaseComponent.extend(rf.ui.Select);
+ var $super = rf.ui.Select.$super;
+
+ $.extend(rf.ui.Select.prototype, ( function () {
+
+ var processed = null;
+
+ var isSelectListener = function(obj) {
+ for (var method in INTERFACE.SelectListener) {
+ if ( (typeof obj[method] != typeof INTERFACE.SelectListener[method]) ) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+ return{
+ name : "select",
+
+ show: function() {
+ this.select.css("display", "");
+ },
+
+ hide: function() {
+ this.select.css("display", "none");
+ },
+
+ processItem: function(event, element) {
+ if(isSelectListener(this.selectListener)) {
+ this.selectListener.processItem(event, element);
+ }
+ },
+
+ __getCurrentElement: function() {
+ return processed;
+ },
+
+ __blurHandler: function(e) {
+ processItem(e, processed);
+ return false;
+ },
+
+ __mouseHandler: function(event) {
+ var element = $(event.target).closest("."+this.itemCss,
event.currentTarget);
+ if (event&& element) {
+ if(event.type == 'mouseover') {
+ if(processed) {
+ processed.removeClass(this.selectItemCss);
+ }
+ element.addClass(this.selectItemCss);
+ processed = element;
+ }
+
+ if(event.type == 'click') {
+ this.processItem(event, element);
+ }
+ }
+ return false;
+ },
+
+ __getId: function() {
+ return this.id;
+ }
+ }
+ })());
+
+})(jQuery, window.RichFaces);
Modified:
branches/RF-8742/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataGridRenderer.java
===================================================================
---
branches/RF-8742/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataGridRenderer.java 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataGridRenderer.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -54,16 +54,13 @@
public void begin(ResponseWriter writer, FacesContext context, UIComponent
component, Object[] params)
throws IOException {
- AbstractDataGrid dataGrid = (AbstractDataGrid)component;
- String clientId = dataGrid.getClientId(context) + ":h";
+ String clientId = component.getClientId(context) + ":h";
boolean partial = (Boolean)(Boolean)params[0];
if(partial) {
context.getPartialViewContext().getPartialResponseWriter().startUpdate(clientId);
}
- int columns = dataGrid.getColumns();
-
writer.startElement(HtmlConstants.THEAD_ELEMENT, component);
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, clientId , null);
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-thead",
null);
@@ -71,7 +68,11 @@
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-h",
null);
writer.startElement(HtmlConstants.TH_ELEM, component);
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-h-c",
null);
- writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
+
+ int columns = (Integer)component.getAttributes().get("columns");
+ if(columns != Integer.MIN_VALUE) {
+ writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
+ }
}
public void end(ResponseWriter writer, FacesContext context, UIComponent
component, Object[] params)
@@ -92,10 +93,8 @@
public void begin(ResponseWriter writer, FacesContext context, UIComponent
component, Object[] params)
throws IOException {
- AbstractDataGrid dataGrid = (AbstractDataGrid)component;
- String clientId = dataGrid.getClientId(context) + ":f";
-
- int columns = dataGrid.getColumns();
+ String clientId = component.getClientId(context) + ":f";
+
boolean partial = (Boolean)(Boolean)params[0];
if(partial) {
context.getPartialViewContext().getPartialResponseWriter().startUpdate(clientId);
@@ -108,7 +107,11 @@
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-f",
null);
writer.startElement(HtmlConstants.TD_ELEM, component);
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-f-c",
null);
- writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
+
+ int columns = (Integer)component.getAttributes().get("columns");
+ if(columns != Integer.MIN_VALUE) {
+ writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
+ }
}
public void end(ResponseWriter writer, FacesContext context, UIComponent
component, Object[] params)
@@ -144,6 +147,11 @@
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-nd",
null);
writer.startElement(HtmlConstants.TD_ELEM, component);
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-nd-c",
null);
+
+ int columns = (Integer)component.getAttributes().get("columns");
+ if(columns != Integer.MIN_VALUE) {
+ writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
+ }
}
public void end(ResponseWriter writer, FacesContext context, UIComponent
component, Object[] params)
@@ -165,10 +173,10 @@
if (processCell != 0) {
writer.endElement(HtmlConstants.TR_ELEMENT);
rowHolder.resetProcessCell();
- rowHolder.nextRow();
}
writer.startElement(HtmlConstants.TR_ELEMENT, dataGrid);
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-r",
null);
+ rowHolder.nextRow();
}
writer.startElement(HtmlConstants.TD_ELEM, dataGrid);
@@ -283,10 +291,8 @@
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dg-c",
null);
writer.endElement(HtmlConstants.TD_ELEM);
}
+ writer.endElement(HtmlConstants.TR_ELEMENT);
}
-
- writer.endElement(HtmlConstants.TR_ELEMENT);
-
}
public DataVisitResult process(FacesContext facesContext, Object rowKey, Object
argument) {
Modified: branches/RF-8742/ui/output/ui/pom.xml
===================================================================
--- branches/RF-8742/ui/output/ui/pom.xml 2010-10-06 15:19:12 UTC (rev 19481)
+++ branches/RF-8742/ui/output/ui/pom.xml 2010-10-06 16:50:13 UTC (rev 19482)
@@ -55,10 +55,6 @@
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-api</artifactId>
</dependency>
- <dependency>
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-impl</artifactId>
- </dependency>
<dependency>
<groupId>org.richfaces.ui.common</groupId>
<artifactId>richfaces-ui-common-ui</artifactId>
Modified:
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlAccordionItem.java
===================================================================
---
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlAccordionItem.java 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlAccordionItem.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -22,22 +22,22 @@
package org.richfaces.component.html;
-import org.richfaces.component.UITogglePanelTitledItem;
-import org.richfaces.component.behavior.ToggleControl;
-
-import javax.faces.component.behavior.ClientBehaviorHolder;
-
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
+import org.richfaces.component.UITogglePanelTitledItem;
+import org.richfaces.component.behavior.ToggleControl;
+
/**
* @author akolonitsky
* @since 2010-08-13
*/
public class HtmlAccordionItem extends UITogglePanelTitledItem implements
ClientBehaviorHolder {
- public static final String COMPONENT_TYPE =
"org.richfaces.TogglePanelTitledItem";
+ public static final String COMPONENT_TYPE = "org.richfaces.AccordionItem";
public static final String COMPONENT_FAMILY =
"org.richfaces.TogglePanelTitledItem";
Modified:
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java
===================================================================
---
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -22,20 +22,21 @@
package org.richfaces.component.html;
-import org.richfaces.component.UITogglePanelTitledItem;
-
-import javax.faces.component.behavior.ClientBehaviorHolder;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
+import org.richfaces.component.UITogglePanelTitledItem;
+
/**
* @author akolonitsky
* @since 2010-08-27
*/
public class HtmlTab extends UITogglePanelTitledItem implements ClientBehaviorHolder {
- public static final String COMPONENT_TYPE =
"org.richfaces.TogglePanelTitledItem";
+ public static final String COMPONENT_TYPE = "org.richfaces.TabPanelItem";
public static final String COMPONENT_FAMILY =
"org.richfaces.TogglePanelTitledItem";
Modified:
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTogglePanelTitledItem.java
===================================================================
---
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTogglePanelTitledItem.java 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTogglePanelTitledItem.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -22,17 +22,19 @@
package org.richfaces.component.html;
-import org.richfaces.component.UITogglePanelTitledItem;
-import javax.faces.component.behavior.ClientBehaviorHolder;
-
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
+import org.richfaces.component.UITogglePanelTitledItem;
+
/**
* @author akolonitsky
* @since 2010-08-13
*/
+//TODO alex - what's the purpose of this class?
public class HtmlTogglePanelTitledItem extends UITogglePanelTitledItem implements
ClientBehaviorHolder {
public static final String COMPONENT_TYPE =
"org.richfaces.TogglePanelTitledItem";
Copied:
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarAnimatedBackgroundImage.java
(from rev 19477,
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarAnimatedBackgroundImage.java)
===================================================================
---
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarAnimatedBackgroundImage.java
(rev 0)
+++
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarAnimatedBackgroundImage.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -0,0 +1,168 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.richfaces.renderkit.html;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GradientPaint;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.richfaces.renderkit.util.ColorUtils;
+import org.richfaces.resource.CacheableResource;
+import org.richfaces.resource.DynamicResource;
+import org.richfaces.resource.ImageType;
+import org.richfaces.resource.Java2DAnimatedUserResource;
+import org.richfaces.resource.StateHolderResource;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+//TODO - add version
+@DynamicResource
+public class ProgressBarAnimatedBackgroundImage implements Java2DAnimatedUserResource,
StateHolderResource, CacheableResource {
+
+ private static final int NUMBER_OF_FRAMES = 12;
+
+ private static final Dimension DIMENSION = new Dimension(24, 48);
+
+ private int frameNumber = 0;
+
+ private Color basicColor;
+
+ public Map<String, String> getResponseHeaders() {
+ return null;
+ }
+
+ public Date getLastModified() {
+ return null;
+ }
+
+ public ImageType getImageType() {
+ return ImageType.GIF;
+ }
+
+ public Dimension getDimension() {
+ return DIMENSION;
+ }
+
+ public boolean isLooped() {
+ return true;
+ }
+
+ public int getFrameDelay() {
+ return 1000;
+ }
+
+ public void startFramesSequence() {
+ frameNumber = 0;
+ }
+
+ public boolean hasNextFrame() {
+ return frameNumber < NUMBER_OF_FRAMES;
+ }
+
+ /**
+ * Creates a main stage for progress bar background.
+ *
+ * @param context
+ * resource context
+ * @return a <code>BufferedImage</code> object
+ */
+ private BufferedImage createMainStage() {
+ Color progressbarBackgroundColor = basicColor;
+ Color progressbarSpiralColor = ColorUtils.adjustLightness(basicColor, 0.2f);
+
+ Dimension dimension = getDimension();
+ BufferedImage retVal = getImageType().createImage(dimension.width,
dimension.height * 2);
+ Graphics g = retVal.getGraphics();
+ try {
+ g.setColor(progressbarBackgroundColor);
+ g.fillRect(0, 0, dimension.width, dimension.height * 2);
+ g.setColor(progressbarSpiralColor);
+ for (int k : new int[] { -24, 0, 24, 48, 72 }) {
+ g.fillPolygon(new int[] { 0, 24, 24, 0 }, new int[] { 24 + k, k, 12 + k,
36 + k }, 4);
+ }
+ } finally {
+ if (g != null) {
+ g.dispose();
+ }
+ }
+
+ return retVal;
+ }
+
+ public void paint(Graphics2D g2d, Dimension dimension) {
+ frameNumber++;
+
+ BufferedImage mainStage = createMainStage();
+ BufferedImage frame = mainStage.getSubimage(0, 48 - frameNumber * 2,
dimension.width, dimension.height);
+ g2d.drawImage(frame, null, null);
+ Color progressbarShadowStartColor =
ColorUtils.overwriteAlpha(ColorUtils.adjustLightness(basicColor, 0.7f), 0.6f);
+ Color progressbarShadowEndColor =
ColorUtils.overwriteAlpha(ColorUtils.adjustLightness(basicColor, 0.3f), 0.6f);
+ // paint a shadow in the form of semi-transparent gradient
+ g2d.setPaint(new GradientPaint(0, 0, progressbarShadowStartColor, 0, 7,
progressbarShadowEndColor));
+ g2d.fillRect(0, 0, dimension.width, 7);
+ }
+
+ public boolean isTransient() {
+ return false;
+ }
+
+ public void writeState(FacesContext context, DataOutput dataOutput) throws
IOException {
+ // TODO Auto-generated method stub
+ Skin skin = SkinFactory.getInstance(context).getSkin(context);
+ Integer color = skin.getColorParameter(context, Skin.SELECT_CONTROL_COLOR);
+ dataOutput.writeInt(color.intValue());
+ }
+
+ public void readState(FacesContext context, DataInput dataInput) throws IOException
{
+ basicColor = new Color(dataInput.readInt());
+ }
+
+ public boolean isCacheable(FacesContext context) {
+ return true;
+ }
+
+ public Date getExpires(FacesContext context) {
+ return null;
+ }
+
+ public int getTimeToLive(FacesContext context) {
+ return 0;
+ }
+
+ public String getEntityTag(FacesContext context) {
+ return null;
+ }
+}
Modified:
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java
===================================================================
---
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java 2010-10-06
16:50:13 UTC (rev 19482)
@@ -22,23 +22,18 @@
package org.richfaces.renderkit.html;
-import org.richfaces.component.behavior.ToggleControl;
-
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.behavior.ClientBehavior;
import javax.faces.component.behavior.ClientBehaviorContext;
import javax.faces.render.ClientBehaviorRenderer;
-import javax.faces.render.FacesBehaviorRenderer;
-import javax.faces.render.RenderKitFactory;
+import org.richfaces.component.behavior.ToggleControl;
+
/**
* @author akolonitsky
*
*/
-@FacesBehaviorRenderer(
- rendererType = "org.richfaces.component.behavior.ToggleControl",
- renderKitId = RenderKitFactory.HTML_BASIC_RENDER_KIT)
@ResourceDependencies({
@ResourceDependency(name = "jquery.js"),
@ResourceDependency(name = "richfaces.js") })
Modified: branches/RF-8742/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
===================================================================
---
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-10-06
16:50:13 UTC (rev 19482)
@@ -491,7 +491,7 @@
</component>
<component>
- <component-type>org.richfaces.TogglePanelTitledItem</component-type>
+ <component-type>org.richfaces.AccordionItem</component-type>
<component-class>org.richfaces.component.html.HtmlAccordionItem</component-class>
<property>
<description></description>
@@ -659,7 +659,7 @@
<component-class>org.richfaces.component.html.HtmlTabPanel</component-class>
</component>
<component>
- <component-type>org.richfaces.TogglePanelTitledItem</component-type>
+ <component-type>org.richfaces.TabPanelItem</component-type>
<component-class>org.richfaces.component.html.HtmlTab</component-class>
</component>
@@ -726,6 +726,11 @@
<cdk:renders-children>false</cdk:renders-children>
</renderer-extension>
</renderer>
+
+ <client-behavior-renderer>
+
<client-behavior-renderer-type>org.richfaces.component.behavior.ToggleControl</client-behavior-renderer-type>
+
<client-behavior-renderer-class>org.richfaces.renderkit.html.ToggleControlRenderer</client-behavior-renderer-class>
+ </client-behavior-renderer>
</render-kit>
<faces-config-extension>
Modified: branches/RF-8742/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
===================================================================
--- branches/RF-8742/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-10-06
15:19:12 UTC (rev 19481)
+++ branches/RF-8742/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-10-06
16:50:13 UTC (rev 19482)
@@ -45,7 +45,7 @@
<tag>
<tag-name>tab</tag-name>
<component>
-
<component-type>org.richfaces.TogglePanelTitledItem</component-type>
+ <component-type>org.richfaces.TabPanelItem</component-type>
<renderer-type>org.richfaces.Tab</renderer-type>
</component>
</tag>
@@ -741,9 +741,8 @@
<tag>
<tag-name>accordionItem</tag-name>
<component>
-
<component-type>org.richfaces.TogglePanelTitledItem</component-type>
+ <component-type>org.richfaces.AccordionItem</component-type>
<renderer-type>org.richfaces.AccordionItem</renderer-type>
-
</component>
<attribute>
<description></description>
Modified:
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss
===================================================================
---
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss 2010-10-06
16:50:13 UTC (rev 19482)
@@ -5,7 +5,7 @@
}
.rf-pb-upl{
background-repeat : repeat-x;
-background-image :
"url(#{resource['org.richfaces.renderkit.html.images.ProgressBarAnimatedBg']})";
+background-image :
"url(#{resource['org.richfaces.images:pbAniBg.gif']})";
background-color : '#{richSkin.selectControlColor}';
height : 13px;
}
@@ -40,5 +40,5 @@
height : 13px;
width : 200px;
padding: 0px;
-background-image :
"url(#{resource['org.richfaces.renderkit.html.images.ProgressBarAnimatedBg']})";
+background-image :
"url(#{resource['org.richfaces.images:pbAniBg.gif']})";
}
Modified:
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss
===================================================================
---
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss 2010-10-06
16:50:13 UTC (rev 19482)
@@ -4,7 +4,7 @@
cursor : pointer;
padding : 0px 5px 3px 5px;
vertical-align : top;
- background-image:
"url(#{resource['org.richfaces.renderkit.html.images.TabHeaderGradient']})";
+ background-image:
"url(#{resource['org.richfaces.images:tabBg.png']})";
background-position: top;
background-repeat: repeat-x;
background-color: "#{richSkin.tabBackgroundColor}";
@@ -16,7 +16,7 @@
border-bottom: 0px;
font-weight: bold;
vertical-align: top;
- background-image:
"url(#{resource['org.richfaces.renderkit.html.images.TopTabHeaderGradient']})";
+ background-image:
"url(#{resource['org.richfaces.images:actTabBg.png']})";
background-position: top;
background-repeat: repeat-x;
background-color: "#{richSkin.additionalBackgroundColor}";
@@ -32,10 +32,15 @@
}
.rf-tb-hdr-tabline-vis {
- background:url("tabline_bg.gif") repeat-x scroll center top #EEF4FB;
- border-color:#A6A6A6 #A6A6A6 -moz-use-text-color;
- border-style:solid solid none;
- border-width:1px 1px 0;
+ background:url("tabline_bg.gif") repeat-x scroll center top;
+ background-color: "#{richSkin.additionalBackgroundColor}";
+
+ border-color: "#{richSkin.panelBorderColor}";
+ border-style: solid;
+ border-width: 1px;
+
+ border-bottom-width: 0px;
+
padding-top: 2px;
overflow: hidden;
height: 25px;
@@ -68,7 +73,7 @@
}
.rf-tb-hdr-scrl_l {
- background:
"url(#{resource['org.richfaces.renderkit.html.images.TopTabHeaderGradient']})
top repeat-x #{richSkin.additionalBackgroundColor}";
+ background: "url(#{resource['org.richfaces.images:actTabBg.png']}) top
repeat-x #{richSkin.additionalBackgroundColor}";
position: absolute;
top: 1px;
left: 1px;
@@ -83,7 +88,7 @@
}
.rf-tb-hdr-scrl_r {
- background:
"url(#{resource['org.richfaces.renderkit.html.images.TopTabHeaderGradient']})
top repeat-x #{richSkin.additionalBackgroundColor}";
+ background: "url(#{resource['org.richfaces.images:actTabBg.png']}) top
repeat-x #{richSkin.additionalBackgroundColor}";
position: absolute;
top: 1px;
right: 17px;
@@ -98,7 +103,7 @@
}
.rf-tb-hdr-tablst {
- background:
"url(#{resource['org.richfaces.renderkit.html.images.TopTabHeaderGradient']})
top repeat-x #{richSkin.additionalBackgroundColor}";
+ background: "url(#{resource['org.richfaces.images:actTabBg.png']}) top
repeat-x #{richSkin.additionalBackgroundColor}";
position: absolute;
top: 1px;
right: 1px;
Modified:
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
===================================================================
---
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties 2010-10-06
15:19:12 UTC (rev 19481)
+++
branches/RF-8742/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties 2010-10-06
16:50:13 UTC (rev 19482)
@@ -12,3 +12,5 @@
org.richfaces.images\:actRightTabBg.png=org.richfaces.renderkit.html.BaseGradient\
{width=26, height=5, baseColorParam=generalBackgroundColor,
gradientColorParam=tabBackgroundColor, horizontal=true}
+
+org.richfaces.images\:pbAniBg.gif=org.richfaces.renderkit.html.ProgressBarAnimatedBackgroundImage
\ No newline at end of file