JBoss Rich Faces SVN: r3607 - in trunk/ui/jQuery/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-10-29 19:41:09 -0400 (Mon, 29 Oct 2007)
New Revision: 3607
Modified:
trunk/ui/jQuery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java
trunk/ui/jQuery/src/main/templates/jQuery.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1261
Modified: trunk/ui/jQuery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java
===================================================================
--- trunk/ui/jQuery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java 2007-10-29 23:37:50 UTC (rev 3606)
+++ trunk/ui/jQuery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java 2007-10-29 23:41:09 UTC (rev 3607)
@@ -1,13 +1,10 @@
package org.richfaces.renderkit;
-import java.io.IOException;
-import java.util.regex.Pattern;
-
+import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.FacesException;
-import org.richfaces.renderkit.JQueryRendererBase;
-import org.ajax4jsf.renderkit.ComponentVariables;
+
+import org.ajax4jsf.javascript.JSEncoder;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
import org.richfaces.component.UIJQuery;
import org.richfaces.component.util.HtmlUtil;
@@ -52,5 +49,20 @@
return HtmlUtil.expandIdSelector(selector, component, context);
}
-
+ public String escapeJavaScript(Object o) {
+ if (o != null) {
+ JSEncoder encoder = new JSEncoder();
+ StringBuffer result = new StringBuffer();
+ String string = o.toString();
+ int length = string.length();
+
+ for (int i = 0; i < length; i++) {
+ result.append(encoder.encode(string.charAt(i)));
+ }
+
+ return result.toString();
+ } else {
+ return null;
+ }
+ }
}
Modified: trunk/ui/jQuery/src/main/templates/jQuery.jspx
===================================================================
--- trunk/ui/jQuery/src/main/templates/jQuery.jspx 2007-10-29 23:37:50 UTC (rev 3606)
+++ trunk/ui/jQuery/src/main/templates/jQuery.jspx 2007-10-29 23:41:09 UTC (rev 3607)
@@ -34,7 +34,12 @@
<script type="text/javascript">
//<![CDATA[
function #{name}(elm, param) {
- jQuery(elm || '#{selector}').#{query};
+ var selector = '#{selector}';
+ try {
+ selector = eval("#{this:escapeJavaScript(selector)}");
+ } catch (e) {}
+
+ jQuery(elm || selector).#{query};
}
//]]>
</script>
@@ -43,7 +48,13 @@
<jsp:scriptlet><![CDATA[ if ( "immediate".equals(timing) ) { ]]></jsp:scriptlet>
<script type="text/javascript">
//<![CDATA[
- jQuery('#{selector}').#{query};
+ {
+ var selector = '#{selector}';
+ try {
+ selector = eval("#{this:escapeJavaScript(selector)}");
+ } catch (e) {}
+ jQuery(selector).#{query};
+}
//]]>
</script>
<jsp:scriptlet><![CDATA[ } ]]></jsp:scriptlet>
@@ -52,7 +63,11 @@
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function() {
- jQuery('#{selector}').#{query};
+ var selector = '#{selector}';
+ try {
+ selector = eval("#{this:escapeJavaScript(selector)}");
+ } catch (e) {}
+ jQuery(selector).#{query};
});
//]]>
</script>
17 years, 1 month
JBoss Rich Faces SVN: r3606 - trunk/samples/effect-sample/src/main/webapp.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-10-29 19:37:50 -0400 (Mon, 29 Oct 2007)
New Revision: 3606
Modified:
trunk/samples/effect-sample/src/main/webapp/effect.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-1265
Modified: trunk/samples/effect-sample/src/main/webapp/effect.xhtml
===================================================================
--- trunk/samples/effect-sample/src/main/webapp/effect.xhtml 2007-10-29 23:37:45 UTC (rev 3605)
+++ trunk/samples/effect-sample/src/main/webapp/effect.xhtml 2007-10-29 23:37:50 UTC (rev 3606)
@@ -18,6 +18,10 @@
<span onclick="hideIt()">Hide</span>
<span onclick="showIt()">Show</span>
+ <div id="my:text" style="width:100px;height:100px;background-color:lightgreen"> </div>
+
+ <e:effect for="my:text" event="onmouseover" type="Fade" params="duration:ma"/>
+
<div id="my" style="width:100px;height:100px;background-color:lightblue"> </div>
<e:effect for="my" name="hideIt" type="Fade"/>
17 years, 1 month
JBoss Rich Faces SVN: r3605 - in trunk/ui/effect/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-10-29 19:37:45 -0400 (Mon, 29 Oct 2007)
New Revision: 3605
Modified:
trunk/ui/effect/src/main/java/org/richfaces/renderkit/EffectRendererBase.java
trunk/ui/effect/src/main/templates/effect.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1265
Modified: trunk/ui/effect/src/main/java/org/richfaces/renderkit/EffectRendererBase.java
===================================================================
--- trunk/ui/effect/src/main/java/org/richfaces/renderkit/EffectRendererBase.java 2007-10-29 19:18:19 UTC (rev 3604)
+++ trunk/ui/effect/src/main/java/org/richfaces/renderkit/EffectRendererBase.java 2007-10-29 23:37:45 UTC (rev 3605)
@@ -9,6 +9,7 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import org.ajax4jsf.javascript.JSEncoder;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
import org.richfaces.component.UIEffect;
import org.richfaces.json.JSONTokener;
@@ -129,4 +130,21 @@
}
}
}
+
+ public String escapeJavaScript(Object s) {
+ if (s != null) {
+ JSEncoder encoder = new JSEncoder();
+ StringBuffer result = new StringBuffer();
+ String string = s.toString();
+ int length = string.length();
+
+ for (int i = 0; i < length; i++) {
+ result.append(encoder.encode(string.charAt(i)));
+ }
+
+ return result.toString();
+ } else {
+ return null;
+ }
+ }
}
Modified: trunk/ui/effect/src/main/templates/effect.jspx
===================================================================
--- trunk/ui/effect/src/main/templates/effect.jspx 2007-10-29 19:18:19 UTC (rev 3604)
+++ trunk/ui/effect/src/main/templates/effect.jspx 2007-10-29 23:37:45 UTC (rev 3605)
@@ -86,8 +86,21 @@
var pm = Object.extend( Object.extend(#{typePart},#{forPart}), #{targetPart} );
/* pm.id can have a special meaning, let's check */
//pm.id = #{this:convertElementParameter(pmId)};
-if (typeof #{attachObj} == 'object') {pm.attachId= #{attachObj};if (#{targetObj}=='') pm.targetId=#{attachObj}; };
-if (typeof #{targetObj} == 'object') pm.targetId= #{targetObj};
+var attachObj;
+try {
+ attachObj = eval('#{this:escapeJavaScript(attachObj)}');
+} catch (e) {
+}
+
+var targetObj;
+try {
+ targetObj = eval('#{this:escapeJavaScript(targetObj)}');
+} catch (e) {
+}
+
+if (typeof attachObj == 'object') {pm.attachId = attachObj;if (targetObj == '') pm.targetId = attachObj; };
+if (typeof targetObj == 'object') pm.targetId = targetObj;
+
pm = Object.extend(pm, #{params});
var ename = Richfaces.effectEventOnOut('#{event}');
var bindedFunction = function(event){ return Richfaces.processEffect(this); }.bindAsEventListener(pm);
17 years, 1 month
JBoss Rich Faces SVN: r3604 - trunk/samples/richfaces-demo.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2007-10-29 15:18:19 -0400 (Mon, 29 Oct 2007)
New Revision: 3604
Modified:
trunk/samples/richfaces-demo/pom.xml
Log:
Add Xerces dependency
Modified: trunk/samples/richfaces-demo/pom.xml
===================================================================
--- trunk/samples/richfaces-demo/pom.xml 2007-10-29 18:13:05 UTC (rev 3603)
+++ trunk/samples/richfaces-demo/pom.xml 2007-10-29 19:18:19 UTC (rev 3604)
@@ -1,238 +1,201 @@
-<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>samples</artifactId>
- <groupId>org.richfaces</groupId>
- <version>3.2.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.samples</groupId>
- <artifactId>richfaces-demo</artifactId>
- <version>3.2.0-SNAPSHOT</version>
- <packaging>war</packaging>
- <name>richfaces-demo Maven Webapp</name>
- <dependencies>
- <dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-ui</artifactId>
- <version>3.2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>com.uwyn</groupId>
- <artifactId>jhighlight</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>core</artifactId>
- <version>3.2.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- <build>
- <finalName>richfaces-demo</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>
- richfaces-ui
- </artifactId>
- <version>
- ${project.version}
- </version>
- </artifactItem>
- </artifactItems>
- <outputDirectory>
- ${project.build.directory}/richfaces
- </outputDirectory>
- <overWriteReleases>false</overWriteReleases>
- <overWriteSnapshots>
- true
- </overWriteSnapshots>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>taglibrarydoc</groupId>
- <artifactId>tlddoc</artifactId>
- <version>1.3</version>
- </dependency>
- </dependencies>
- <configuration>
- <includeProjectDependencies>
- false
- </includeProjectDependencies>
- <includePluginDependencies>
- true
- </includePluginDependencies>
- <executableDependency>
- <groupId>taglibrarydoc</groupId>
- <artifactId>tlddoc</artifactId>
- </executableDependency>
- <mainClass>com.sun.tlddoc.TLDDoc</mainClass>
- <arguments>
- <argument>-d</argument>
- <argument>
- ${project.build.directory}/${project.build.finalName}/WEB-INF/tlddoc
- </argument>
- <argument>-xslt</argument>
- <argument>
- ${basedir}/src/main/xslt/tlddoc
- </argument>
- <argument>
- ${project.build.directory}/richfaces/META-INF/ajax4jsf.tld
- </argument>
- <argument>
- ${project.build.directory}/richfaces/META-INF/rich.tld
- </argument>
- </arguments>
- </configuration>
-
- <executions>
- <execution>
- <id>tlddoc</id>
- <phase>process-resources</phase>
- <goals>
- <goal>java</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <webResources>
- <resource>
- <!-- this is relative to the pom.xml directory -->
- <directory>
- ${basedir}/src/main/java
- </directory>
- <targetPath>/WEB-INF/src</targetPath>
- </resource>
- </webResources>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>release</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <webResources>
- <resource>
- <!-- this is relative to the pom.xml directory -->
- <directory>
- ${basedir}/src/main/java
- </directory>
- <targetPath>
- /WEB-INF/src
- </targetPath>
- </resource>
- </webResources>
- </configuration>
- <executions>
- <execution>
- <id>jee5</id>
- <goals>
- <goal>war</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <webappDirectory>
- ${project.build.directory}/${project.build.finalName}-jee5
- </webappDirectory>
- <classifier>jee5</classifier>
- <warSourceExcludes>
- WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/el-*
- </warSourceExcludes>
- </configuration>
- </execution>
- <execution>
- <id>tomcat6</id>
- <goals>
- <goal>war</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <webappDirectory>
- ${project.build.directory}/${project.build.finalName}-tomcat6
- </webappDirectory>
- <classifier>tomcat6</classifier>
- <warSourceExcludes>
- WEB-INF/lib/el-*
- </warSourceExcludes>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>el-impl</groupId>
- <artifactId>el-impl</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_04-p02</version>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>1.2_04-p02</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <parent>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.samples</groupId>
+ <artifactId>richfaces-demo</artifactId>
+ <packaging>war</packaging>
+ <name>richfaces-demo Maven Webapp</name>
+ <version>3.2.0-SNAPSHOT</version>
+ <build>
+ <finalName>richfaces-demo</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui</artifactId>
+ <version>${project.version}</version>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>${project.build.directory}/richfaces</outputDirectory>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>tlddoc</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>taglibrarydoc</groupId>
+ <artifactId>tlddoc</artifactId>
+ <version>1.3</version>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <includeProjectDependencies>false</includeProjectDependencies>
+ <includePluginDependencies>true</includePluginDependencies>
+ <executableDependency>
+ <groupId>taglibrarydoc</groupId>
+ <artifactId>tlddoc</artifactId>
+ </executableDependency>
+ <mainClass>com.sun.tlddoc.TLDDoc</mainClass>
+ <arguments>
+ <argument>-d</argument>
+ <argument>${project.build.directory}/${project.build.finalName}/WEB-INF/tlddoc</argument>
+ <argument>-xslt</argument>
+ <argument>${basedir}/src/main/xslt/tlddoc</argument>
+ <argument>${project.build.directory}/richfaces/META-INF/ajax4jsf.tld</argument>
+ <argument>${project.build.directory}/richfaces/META-INF/rich.tld</argument>
+ </arguments>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>${basedir}/src/main/java</directory>
+ <targetPath>/WEB-INF/src</targetPath>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>jee5</id>
+ <phase>package</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+ <webappDirectory>${project.build.directory}/${project.build.finalName}-jee5</webappDirectory>
+ <classifier>jee5</classifier>
+ <warSourceExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/el-*</warSourceExcludes>
+ </configuration>
+ </execution>
+ <execution>
+ <id>tomcat6</id>
+ <phase>package</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+ <webappDirectory>${project.build.directory}/${project.build.finalName}-tomcat6</webappDirectory>
+ <classifier>tomcat6</classifier>
+ <warSourceExcludes>WEB-INF/lib/el-*</warSourceExcludes>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>${basedir}/src/main/java</directory>
+ <targetPath>/WEB-INF/src</targetPath>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>el-impl</groupId>
+ <artifactId>el-impl</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_04-p02</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>1.2_04-p02</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>com.uwyn</groupId>
+ <artifactId>jhighlight</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>core</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.8.1</version>
+ </dependency>
+ </dependencies>
</project>
\ No newline at end of file
17 years, 1 month
JBoss Rich Faces SVN: r3603 - in trunk/cdk/generator/src/main/java/org/ajax4jsf/builder: model and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-10-29 14:13:05 -0400 (Mon, 29 Oct 2007)
New Revision: 3603
Added:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/Argument.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaAnnotation.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaClass.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaComment.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaField.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaLanguageElement.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaMethod.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaModifier.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaPackage.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/MethodBody.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/ComponentModelBuilder.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/JavaClassRenderer.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/JavaLanguageElementRenderer.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/MethodRenderer.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/ObjectPropertyProcessor.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/PropertyProcessor.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/methods/
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/methods/SimpleAccessorMethodBody.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/methods/SimpleMutatorMethodBody.java
Log:
Statred refactoring of CDK generator
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/Argument.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/Argument.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/Argument.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,30 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class Argument {
+ private Class<?> type;
+ private String name;
+
+ public static Argument arg(String name, Class<?> type) {
+ return new Argument(name, type);
+ }
+
+ public Argument(String name, Class<?> type) {
+ super();
+ this.name = name;
+ this.type = type;
+ }
+ public Class<?> getType() {
+ return type;
+ }
+ public String getName() {
+ return name;
+ }
+
+}
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaAnnotation.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaAnnotation.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaAnnotation.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,19 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class JavaAnnotation extends JavaLanguageElement{
+
+ public static JavaAnnotation OVERRIDE = new JavaAnnotation("Override");
+
+ public JavaAnnotation(String name) {
+ super(name);
+ }
+
+
+}
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaClass.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaClass.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaClass.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,111 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class JavaClass extends JavaLanguageElement{
+ private List<JavaField> fields = new ArrayList<JavaField>();
+ private List<JavaMethod> methods = new ArrayList<JavaMethod>();
+ private Set<Class<?>> imports = new TreeSet<Class<?>>();
+
+ private JavaPackage pakg;
+ private Class<?> superClass = Object.class;
+
+ public JavaClass(String shortName, JavaPackage pakg, Class<?> superClass) {
+ this(shortName, pakg);
+ setSuperClass(superClass);
+ }
+
+ public JavaClass(String shortName, JavaPackage pakg) {
+ super(shortName);
+ this.pakg = pakg;
+ }
+
+ public void addImport(Class<?> claz) {
+ if (shouldAddToImports(claz)) {
+ imports.add(claz);
+ }
+ }
+
+ public void addField(JavaField field) {
+ fields.add(field);
+ addImport(field.getType());
+ }
+
+ public void addMethod(JavaMethod method) {
+ methods.add(method);
+ addImport(method.getReturnType());
+
+ List<Class<Throwable>> exceptions = method.getExceptions();
+
+ for (Class<Throwable> exception : exceptions) {
+ addImport(exception);
+ }
+
+ List<Argument> arguments =
+ method.getArguments();
+ if (arguments != null) {
+ for (Argument argument : arguments) {
+ addImport(argument.getType());
+ }
+ }
+ }
+
+ public JavaPackage getPakg() {
+ return pakg;
+ }
+ public Class<?> getSuperClass() {
+ return superClass;
+ }
+
+ public void setSuperClass(Class<?> superClass) {
+ this.superClass = superClass;
+ addImport(superClass);
+ }
+ public void setPackage(JavaPackage s) {
+ pakg = s;
+ }
+ public JavaPackage getPackage() {
+ return pakg;
+ }
+
+ public List<JavaField> getFields() {
+ return fields;
+ }
+ public List<JavaMethod> getMethods() {
+ return methods;
+ }
+ public Set<Class<?>> getImports() {
+ return imports;
+ }
+
+ private boolean shouldAddToImports(Class<?> clas) {
+
+ boolean result = false;
+
+ if (clas != null) {
+ Package p = clas.getPackage();
+
+ if (!(clas.isPrimitive() || p == null)) {
+ String importPackageName = p.getName();
+ if (importPackageName != null && importPackageName.length() != 0) {
+
+ result = !(importPackageName.equals("java.lang") || importPackageName
+ .equals(getPackage().getName()));
+ }
+ }
+ }
+
+ return result;
+ }
+
+}
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaComment.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaComment.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaComment.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,29 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class JavaComment {
+ private String value;
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public JavaComment(String value) {
+ super();
+ this.value = value;
+ }
+
+ public JavaComment() {
+ // TODO Auto-generated constructor stub
+ }
+}
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaField.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaField.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaField.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,44 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class JavaField extends JavaLanguageElement{
+
+ private Class <?> type;
+ private Object value;
+
+ public JavaField(Class<?> type, String name) {
+ this(type, name, null);
+ }
+
+
+
+ public JavaField(Class<?> type, String name, Object value) {
+ super(name);
+ this.type = type;
+ this.value = value;
+ }
+
+
+
+ public Class<?> getType() {
+ return type;
+ }
+
+
+
+ public Object getValue() {
+ return value;
+ }
+
+
+
+ public void setValue(Object value) {
+ this.value = value;
+ }
+}
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaLanguageElement.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaLanguageElement.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaLanguageElement.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,36 @@
+package org.ajax4jsf.builder.model;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class JavaLanguageElement {
+
+ private Set<JavaModifier> modifiers = new HashSet<JavaModifier>();
+ private List<JavaAnnotation> annotations = new ArrayList<JavaAnnotation>();
+ private List<JavaComment> comments = new ArrayList<JavaComment>();
+ private String name;
+
+ public JavaLanguageElement(String name) {
+ super();
+ this.name = name;
+ }
+
+ public Set<JavaModifier> getModifiers() {
+ return modifiers;
+ }
+
+ public List<JavaAnnotation> getAnnotations() {
+ return annotations;
+ }
+
+ public List<JavaComment> getComments() {
+ return comments;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+}
\ No newline at end of file
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaMethod.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaMethod.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaMethod.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,62 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.model;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class JavaMethod extends JavaLanguageElement {
+
+ private Class<?> returnType;
+
+ private MethodBody methodBody;
+
+ private List <Argument> arguments = new ArrayList<Argument>();
+ private List<Class<Throwable>> exceptions = new ArrayList<Class<Throwable>>();
+
+ public List<Class<Throwable>> getExceptions() {
+ return exceptions;
+ }
+
+ public void setExceptions(List<Class<Throwable>> exceptions) {
+ this.exceptions = exceptions;
+ }
+
+ public JavaMethod(String name) {
+ super(name);
+ this.returnType = Void.TYPE;
+ }
+
+ public JavaMethod(String name, Argument ... arguments) {
+ super(name);
+ this.arguments = Arrays.asList(arguments);
+ }
+
+ public JavaMethod(String name, Class<?> returnType, Argument ... arguments) {
+ super(name);
+ this.returnType = returnType;
+ this.arguments = Arrays.asList(arguments);
+ }
+ public List<Argument> getArguments() {
+ return arguments;
+ }
+
+ public MethodBody getMethodBody() {
+ return methodBody;
+ }
+
+
+ public Class<?> getReturnType() {
+ return returnType;
+ }
+
+ public void setMethodBody(MethodBody methodBody) {
+ this.methodBody = methodBody;
+ }
+}
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaModifier.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaModifier.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaModifier.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,26 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public enum JavaModifier {
+ PRIVATE ,
+ DEFAULT {
+ public String toString() {
+ return "";
+ }
+ },
+ PROTECTED,
+ PUBLIC,
+ STATIC,
+ FINAL;
+
+ public String toString() {
+ return super.toString().toLowerCase();
+ }
+
+}
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaPackage.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaPackage.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaPackage.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class JavaPackage {
+ private String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public JavaPackage(String name) {
+ super();
+ this.name = name;
+ }
+
+
+}
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/MethodBody.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/MethodBody.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/MethodBody.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,33 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.model;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class MethodBody {
+
+ private JavaMethod method;
+
+ public MethodBody() {
+ // TODO Auto-generated constructor stub
+ }
+ public MethodBody(JavaMethod method) {
+ super();
+ this.method = method;
+ }
+
+ protected JavaMethod getMethod() {
+ return method;
+ }
+
+ protected void setMethod(JavaMethod method) {
+ this.method = method;
+ }
+
+ public String toCode() {
+ return "";
+ }
+}
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/ComponentModelBuilder.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/ComponentModelBuilder.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/ComponentModelBuilder.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,96 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.render;
+
+import java.util.Collection;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.builder.config.ComponentBean;
+import org.ajax4jsf.builder.config.PropertyBean;
+import org.ajax4jsf.builder.model.JavaAnnotation;
+import org.ajax4jsf.builder.model.JavaClass;
+import org.ajax4jsf.builder.model.JavaMethod;
+import org.ajax4jsf.builder.model.JavaModifier;
+import org.ajax4jsf.builder.model.JavaPackage;
+
+import static org.ajax4jsf.builder.model.Argument.arg;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ComponentModelBuilder {
+
+ private PropertyProcessor[] propertyProcessors = {};
+
+ public JavaClass build(ComponentBean componentBean) {
+
+ String superclassname =
+ componentBean.getSuperclass();
+
+ JavaClass javaClass =
+ new JavaClass(componentBean.getClassname(),
+ new JavaPackage(componentBean.getPackageName()),
+ UIComponent.class);
+
+ try {
+ Class<?> superClass =
+ Class.forName(superclassname);
+
+ javaClass.setSuperClass(superClass);
+
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+
+ Collection<PropertyBean> properties = componentBean.getProperties();
+
+ for (PropertyBean propertyBean : properties) {
+ PropertyProcessor proc = null;
+
+ for (int i = 0; i < propertyProcessors.length && proc == null; i++) {
+
+ PropertyProcessor processor =
+ propertyProcessors[i];
+
+ if (processor.accept(propertyBean)) {
+ proc = processor;
+ }
+ }
+
+ if (proc != null) {
+ proc.process(propertyBean, javaClass);
+ }
+ }
+
+ javaClass.addMethod(getSaveState());
+ javaClass.addMethod(getRestoreState());
+ return javaClass;
+
+ }
+
+ private JavaMethod getRestoreState() {
+ JavaMethod method =
+ new JavaMethod("restoreState",
+ Void.class,
+ arg("context", FacesContext.class),
+ arg("state", Object.class));
+ method.getModifiers().add(JavaModifier.PUBLIC);
+ method.getAnnotations().add(JavaAnnotation.OVERRIDE);
+
+ return method;
+ }
+
+ private JavaMethod getSaveState() {
+ JavaMethod method =
+ new JavaMethod("saveState",
+ Object.class,
+ arg("context", FacesContext.class));
+ method.getModifiers().add(JavaModifier.PUBLIC);
+ method.getAnnotations().add(JavaAnnotation.OVERRIDE);
+ return method;
+ }
+}
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/JavaClassRenderer.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/JavaClassRenderer.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/JavaClassRenderer.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,89 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.render;
+
+import java.io.PrintWriter;
+import java.util.List;
+import java.util.Set;
+
+import org.ajax4jsf.builder.model.Argument;
+import org.ajax4jsf.builder.model.JavaClass;
+import org.ajax4jsf.builder.model.JavaField;
+import org.ajax4jsf.builder.model.JavaLanguageElement;
+import org.ajax4jsf.builder.model.JavaMethod;
+import org.ajax4jsf.builder.model.JavaModifier;
+import org.ajax4jsf.builder.model.JavaPackage;
+import org.ajax4jsf.builder.model.MethodBody;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class JavaClassRenderer extends JavaLanguageElementRenderer {
+
+ private MethodRenderer methodRenderer = new MethodRenderer();
+
+ public void render(JavaLanguageElement element, PrintWriter out){
+ JavaClass javaClass = (JavaClass) element;
+ out.println("package " + javaClass.getPackage().getName() + ";");
+
+ Set<Class<?>> imports = javaClass.getImports();
+
+ for (Class<?> impord : imports) {
+ out.println("import " + impord.getName());
+ }
+
+ renderModifiers(javaClass, out);
+ out.println("class " + javaClass.getName() + " {");
+
+ List<JavaMethod> methods = javaClass.getMethods();
+ for (JavaMethod javaMethod : methods) {
+ methodRenderer.render(javaMethod, out);
+ }
+
+ out.println("}");
+ out.flush();
+ out.close();
+ }
+
+ public static void main(String[] args) {
+ JavaClass javaClass = new JavaClass("MyClass", new JavaPackage("mypackage"));
+
+ JavaField javaField = new JavaField(int.class, "count");
+ javaField.setValue(0);
+ javaField.getModifiers().add(JavaModifier.PRIVATE);
+ javaClass.addField(javaField);
+
+ JavaMethod accessor = new JavaMethod("getCount", int.class);
+ accessor.setMethodBody(
+ new MethodBody(accessor) {
+ @Override
+ public String toCode() {
+ return "return count;";
+ }
+ }
+ );
+ accessor.getModifiers().add(JavaModifier.PUBLIC);
+ accessor.getModifiers().add(JavaModifier.FINAL);
+ javaClass.addMethod(accessor);
+
+ JavaMethod mutator = new JavaMethod("setCount", int.class,
+ new Argument("i", int.class));
+ mutator.setMethodBody(
+ new MethodBody(mutator) {
+ @Override
+ public String toCode() {
+ return "count = i;";
+ }
+ }
+ );
+ mutator.getModifiers().add(JavaModifier.PUBLIC);
+ mutator.getModifiers().add(JavaModifier.FINAL);
+ javaClass.addMethod(mutator);
+
+ PrintWriter printWriter = new PrintWriter(System.out);
+ new JavaClassRenderer().render(javaClass, printWriter);
+ printWriter.flush();
+ }
+}
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/JavaLanguageElementRenderer.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/JavaLanguageElementRenderer.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/JavaLanguageElementRenderer.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,35 @@
+package org.ajax4jsf.builder.render;
+
+import java.io.PrintWriter;
+import java.util.List;
+import java.util.Set;
+
+import org.ajax4jsf.builder.model.JavaAnnotation;
+import org.ajax4jsf.builder.model.JavaLanguageElement;
+import org.ajax4jsf.builder.model.JavaModifier;
+
+public abstract class JavaLanguageElementRenderer {
+
+ public JavaLanguageElementRenderer() {
+ super();
+ }
+
+ public void renderModifiers(JavaLanguageElement element, PrintWriter out) {
+ Set<JavaModifier> modifiers = element.getModifiers();
+ for (JavaModifier javaModifier : modifiers) {
+ out.print(javaModifier);
+ out.print(" ");
+ }
+ }
+
+ public void renderAnnotations(JavaLanguageElement element, PrintWriter out) {
+ List<JavaAnnotation> annotations = element.getAnnotations();
+ if (annotations != null) {
+ for (JavaAnnotation javaAnnotation : annotations) {
+ out.println("@" + javaAnnotation.getName());
+ }
+ }
+ }
+
+ public abstract void render(JavaLanguageElement element, PrintWriter out);
+}
\ No newline at end of file
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/MethodRenderer.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/MethodRenderer.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/MethodRenderer.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,59 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.render;
+
+import java.io.PrintWriter;
+import java.util.Iterator;
+import java.util.List;
+
+import org.ajax4jsf.builder.model.Argument;
+import org.ajax4jsf.builder.model.JavaLanguageElement;
+import org.ajax4jsf.builder.model.JavaMethod;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class MethodRenderer extends JavaLanguageElementRenderer {
+
+ @Override
+ public void render(JavaLanguageElement element, PrintWriter out) {
+ JavaMethod javaMethod = (JavaMethod) element;
+ renderModifiers(javaMethod, out);
+ renderAnnotations(element, out);
+ out.print(javaMethod.getReturnType() + " " + javaMethod.getName());
+ out.print("(");
+ List<Argument> arguments = javaMethod.getArguments();
+ if (arguments != null) {
+ for (Iterator<Argument> iterator = arguments.iterator(); iterator.hasNext();) {
+ Argument argument = iterator.next();
+ out.print(argument.getType().getSimpleName());
+ out.print(" ");
+ out.print(argument.getName());
+ if (iterator.hasNext()) {
+ out.print(", ");
+ }
+ }
+ }
+ out.print(")");
+ List<Class<Throwable>> exceptions = javaMethod.getExceptions();
+
+ if (exceptions != null && !exceptions.isEmpty()) {
+ out.print(" throws ");
+ for (Iterator<Class<Throwable>> iterator = exceptions.iterator(); iterator.hasNext();) {
+ Class<Throwable> class1 = iterator.next();
+ out.print(class1.getSimpleName());
+ if (iterator.hasNext()) {
+ out.print(", ");
+ }
+
+ }
+ }
+
+ out.println("{");
+ out.println(javaMethod.getMethodBody().toCode());
+ out.println("}");
+
+ }
+}
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/ObjectPropertyProcessor.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/ObjectPropertyProcessor.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/ObjectPropertyProcessor.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,70 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.render;
+
+import org.ajax4jsf.builder.config.PropertyBean;
+import org.ajax4jsf.builder.model.Argument;
+import org.ajax4jsf.builder.model.JavaClass;
+import org.ajax4jsf.builder.model.JavaComment;
+import org.ajax4jsf.builder.model.JavaField;
+import org.ajax4jsf.builder.model.JavaMethod;
+import org.ajax4jsf.builder.model.JavaModifier;
+import org.ajax4jsf.builder.render.methods.SimpleAccessorMethodBody;
+import org.ajax4jsf.builder.render.methods.SimpleMutatorMethodBody;
+
+/**
+ * Default property handler - a fallback one.
+ * @author Maksim Kaszynski
+ *
+ */
+public class ObjectPropertyProcessor implements PropertyProcessor {
+
+ public boolean accept(PropertyBean propertyBean) {
+ return !propertyBean.isHidden();
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.builder.render.PropertyProcessor#process(org.ajax4jsf.builder.config.PropertyBean, org.ajax4jsf.builder.model.JavaClass)
+ */
+ public void process(PropertyBean propertyBean, JavaClass javaClass) {
+
+ String classname = propertyBean.getClassname();
+ String name = propertyBean.getName();
+ String defaultvalue = propertyBean.getDefaultvalue();
+
+ try {
+ Class<?> propertyClass = Class.forName(classname);
+
+ JavaField field = new JavaField(propertyClass, "_" + name, defaultvalue);
+ field.getComments().add(new JavaComment(propertyBean.getDescription()));
+ field.getModifiers().add(JavaModifier.PRIVATE);
+ javaClass.addField(field);
+
+ javaClass.addMethod(getAccessor(propertyBean, field));
+ javaClass.addMethod(getMutator(propertyBean, field));
+
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+
+ protected JavaMethod getAccessor(PropertyBean propertyBean, JavaField field) {
+ JavaMethod accessor =
+ new JavaMethod(propertyBean.getGetterName(), field.getType());
+
+ accessor.setMethodBody(new SimpleAccessorMethodBody(accessor, field));
+
+ return accessor;
+ }
+
+ protected JavaMethod getMutator(PropertyBean propertyBean, JavaField field) {
+ JavaMethod mutator =
+ new JavaMethod(propertyBean.getSetterName(),
+ new Argument(field.getName(), field.getType()));
+
+ mutator.setMethodBody(new SimpleMutatorMethodBody(mutator, field));
+
+ return mutator;
+ }
+}
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/PropertyProcessor.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/PropertyProcessor.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/PropertyProcessor.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,16 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.render;
+
+import org.ajax4jsf.builder.config.PropertyBean;
+import org.ajax4jsf.builder.model.JavaClass;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface PropertyProcessor {
+ boolean accept(PropertyBean propertyBean);
+ void process(PropertyBean propertyBean, JavaClass javaClass);
+}
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/methods/SimpleAccessorMethodBody.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/methods/SimpleAccessorMethodBody.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/methods/SimpleAccessorMethodBody.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,34 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.render.methods;
+
+import org.ajax4jsf.builder.model.JavaField;
+import org.ajax4jsf.builder.model.JavaMethod;
+import org.ajax4jsf.builder.model.MethodBody;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class SimpleAccessorMethodBody extends MethodBody {
+ private JavaField field;
+
+ public SimpleAccessorMethodBody(JavaMethod method, JavaField field) {
+ super(method);
+ this.field = field;
+ }
+
+ protected JavaField getField() {
+ return field;
+ }
+
+ protected void setField(JavaField field) {
+ this.field = field;
+ }
+
+ @Override
+ public String toCode() {
+ return "return " + field.getName() + ";";
+ }
+}
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/methods/SimpleMutatorMethodBody.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/methods/SimpleMutatorMethodBody.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/render/methods/SimpleMutatorMethodBody.java 2007-10-29 18:13:05 UTC (rev 3603)
@@ -0,0 +1,37 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.render.methods;
+
+import org.ajax4jsf.builder.model.JavaField;
+import org.ajax4jsf.builder.model.JavaMethod;
+import org.ajax4jsf.builder.model.MethodBody;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class SimpleMutatorMethodBody extends MethodBody {
+
+ private JavaField field;
+
+ protected JavaField getField() {
+ return field;
+ }
+
+ protected void setField(JavaField field) {
+ this.field = field;
+ }
+
+ public SimpleMutatorMethodBody(JavaMethod method, JavaField field) {
+ super(method);
+ this.field = field;
+ }
+
+ @Override
+ public String toCode() {
+ return field.getName() + " = " + getMethod().getArguments().get(0).getName();
+ }
+
+
+}
17 years, 1 month
JBoss Rich Faces SVN: r3602 - trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2007-10-29 13:40:12 -0400 (Mon, 29 Oct 2007)
New Revision: 3602
Modified:
trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js
Log:
RF-1107
Modified: trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js
===================================================================
--- trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-10-29 14:48:59 UTC (rev 3601)
+++ trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-10-29 17:40:12 UTC (rev 3602)
@@ -94,6 +94,7 @@
break;
}
}
+ Event.observe(this.container.getElement(), 'scroll', this.synchronizeHScroll.bindAsEventListener(this));
// create scroll box
this.scrollBox = new ClientUI.common.box.ScrollableBox(this.gridId + ":scb", this.getElement());
@@ -120,6 +121,7 @@
this.contentBox = new ClientUI.common.box.Box(normal);
this.contentBox.makeAbsolute();
+ Event.observe(this.contentBox.getElement(), 'scroll', this.synchronizeVScroll.bindAsEventListener(this));
this.frozenContentBox = new ClientUI.common.box.Box(frozen);
this.frozenContentBox.makeAbsolute();
@@ -808,5 +810,13 @@
this.templFrozen.moveToY(visibleRowPos);
this.templNormal.moveToY(visibleRowPos);
}
+ },
+
+ synchronizeHScroll: function() {
+ this.container.getElement().scrollLeft = 0;
+ },
+
+ synchronizeVScroll: function() {
+ this.contentBox.getElement().scrollTop = 0;
}
});
17 years, 1 month
JBoss Rich Faces SVN: r3601 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-10-29 10:48:59 -0400 (Mon, 29 Oct 2007)
New Revision: 3601
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
Log:
http://jira.jboss.com/jira/browse/RF-1110 - fixwd some errors in description
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2007-10-29 14:40:05 UTC (rev 3600)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2007-10-29 14:48:59 UTC (rev 3601)
@@ -1272,10 +1272,10 @@
<para>Create a file and define in it skin constants which are used by style classes (see
section <link linkend="SkinParametersTablesInRichFaces">"Skin Parameters Tables
in RichFaces"</link>). The name of skin file should correspond to the
- following format: <property>name.skin.properties</property>. As an example of such file
- you can see RichFaces predefined skin parameters (skins): blueSky, classic, deepMarine,
- etc. These files are located in the richfaces-impl-xxxxx.jar inside the /META-INF/skins
- folder.</para>
+ following format: <property><name>.skin.properties</property>. As an
+ example of such file you can see RichFaces predefined skin parameters (skins): blueSky,
+ classic, deepMarine, etc. These files are located in the richfaces-impl-xxxxx.jar inside
+ the /META-INF/skins folder.</para>
</listitem>
<listitem>
@@ -1294,8 +1294,9 @@
</listitem>
<listitem>
- <para>Put your <property>name.skin.properties</property> file in one of the following classpath elements:
- META-INF/skins/ or default package (e.g. WEB-INF/classes).</para>
+ <para>Put your <property><name>.skin.properties</property> file in one of
+ the following classpath elements: META-INF/skins/ or classpath folder (e.g.
+ WEB-INF/classes).</para>
</listitem>
</itemizedlist>
</section>
17 years, 1 month
JBoss Rich Faces SVN: r3600 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-10-29 10:40:05 -0400 (Mon, 29 Oct 2007)
New Revision: 3600
Modified:
trunk/docs/userguide/en/src/main/docbook/included/gmap.xml
trunk/docs/userguide/en/src/main/docbook/included/message.xml
trunk/docs/userguide/en/src/main/docbook/included/messages.xml
trunk/docs/userguide/en/src/main/docbook/included/virtualEarth.xml
Log:
http://jira.jboss.com/jira/browse/RF-920 - fixed some errors in section "Look-..."
Modified: trunk/docs/userguide/en/src/main/docbook/included/gmap.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/gmap.xml 2007-10-29 14:39:10 UTC (rev 3599)
+++ trunk/docs/userguide/en/src/main/docbook/included/gmap.xml 2007-10-29 14:40:05 UTC (rev 3600)
@@ -157,14 +157,17 @@
</section>
<section>
<title>Look-and-Feel Customization</title>
- <para><property>Gmap</property> component isn't tied to skin parameters, as there is no
- additional elements on it, except the ones provided with <emphasis><property>Google
- Map</property>.</emphasis></para>
- </section>
+ <para><emphasis role="bold">
+ <property><rich:gmap></property>
+ </emphasis> component isn't tied to skin parameters, as there is no additional
+ elements on it, except the ones provided with <emphasis><property>Google
+ Map</property>.</emphasis></para>
+ </section>
+
<section>
<title>Definition of Custom Style Classes</title>
<table>
- <title>Classes names that define a map appearance</title>
+ <title>Classes names that define a component appearance</title>
<tgroup cols="2">
<thead>
<row>
@@ -175,30 +178,30 @@
<tbody>
<row>
<entry>rich-gmap</entry>
- <entry>Defines styles for a wrapper <div> element of a gmap</entry>
+ <entry>Defines styles for a wrapper <div> element of a component</entry>
</row>
</tbody>
</tgroup>
</table>
-
+
<para>In order to redefine styles for all <emphasis role="bold">
- <property><rich:gmap></property>
- </emphasis> components on a page using CSS, it's enough to create class with the
- same name and define necessary properties in it.</para>
-
+ <property><rich:gmap></property>
+ </emphasis> components on a page using CSS, it's enough to create class with the same
+ name and define necessary properties in it.</para>
+
<para>To change styles of particular <emphasis role="bold">
- <property><rich:gmap></property>
- </emphasis> components, define your own style class in the corresponding <emphasis
- role="bold">
- <property><rich:gmap></property>
- </emphasis>attribute.</para>
+ <property><rich:gmap></property>
+ </emphasis> components, define your own style class in the corresponding <emphasis role="bold">
+ <property><rich:gmap></property>
+ </emphasis>attribute.</para>
</section>
<section>
<title>Relevant Resources Links</title>
<para>
<ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/gmap.jsf?c=gmap">Here</ulink>
- you can see the example of <emphasis role="bold"><property><rich:gmap></property></emphasis> usage
- and sources for the given example. </para>
+ you can see the example of <emphasis role="bold">
+ <property><rich:gmap></property>
+ </emphasis> usage and sources for the given example. </para>
</section>
</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/message.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/message.xml 2007-10-29 14:39:10 UTC (rev 3599)
+++ trunk/docs/userguide/en/src/main/docbook/included/message.xml 2007-10-29 14:40:05 UTC (rev 3600)
@@ -123,8 +123,8 @@
<section>
<title>Look-and-Feel Customization</title>
- <para>For skinnability implementation, the components use a style class redefinition method.
- Default style classes are mapped on skin parameters.</para>
+ <!--para>For skinnability implementation, the components use a style class redefinition method.
+ Default style classes are mapped on skin parameters.</para-->
<para>To redefine appearance of all <emphasis role="bold">
<property><rich:message></property>
Modified: trunk/docs/userguide/en/src/main/docbook/included/messages.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/messages.xml 2007-10-29 14:39:10 UTC (rev 3599)
+++ trunk/docs/userguide/en/src/main/docbook/included/messages.xml 2007-10-29 14:40:05 UTC (rev 3600)
@@ -118,8 +118,8 @@
<section>
<title>Look-and-Feel Customization</title>
- <para>For skinnability implementation, the components use a style class redefinition method.
- Default style classes are mapped on skin parameters.</para>
+ <!--para>For skinnability implementation, the components use a style class redefinition method.
+ Default style classes are mapped on skin parameters.</para-->
<para>To redefine appearance of all <emphasis role="bold">
<property><rich:messages></property>
Modified: trunk/docs/userguide/en/src/main/docbook/included/virtualEarth.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/virtualEarth.xml 2007-10-29 14:39:10 UTC (rev 3599)
+++ trunk/docs/userguide/en/src/main/docbook/included/virtualEarth.xml 2007-10-29 14:40:05 UTC (rev 3600)
@@ -113,14 +113,15 @@
dashboardSize="Normal" zoom="11" mapStyle="Hybrid" var="map" />
...
]]></programlisting>
-
+
<para>To set all these parameters and perform some activity (Zoom In/Out etc.) is possible with
your JavaScript, i.e. declare a name of an object on a <property>map</property> in the <emphasis>
<property>"var"</property>
- </emphasis> attribute and then call the object directly with API <emphasis><property>Microsoft Virtual Earth map</property>.</emphasis></para>
+ </emphasis> attribute and then call the object directly with API <emphasis><property>Microsoft
+ Virtual Earth map</property>.</emphasis></para>
<para>For example, to approximate a map for <emphasis>
- <property>"var"</property>
- </emphasis>= <property>"map"</property> declared inside the component, call
+ <property>"var"</property>
+ </emphasis>= <property>"map"</property> declared inside the component, call
map.ZoomIn() on an event.</para>
<para>Moreover, to add e.g. some JavaScript effects, events defined on it are used.</para>
<itemizedlist>
@@ -133,13 +134,17 @@
</section>
<section>
<title>Look-and-Feel Customization</title>
- <para><property>Virtual Earth map</property> component isn't tied to skin parameters, as there is no
- additional elements on it, except the ones provided with <emphasis><property>Virtual Earth map</property>.</emphasis></para>
+ <para><emphasis role="bold">
+ <property><rich:virtualEarth></property>
+ </emphasis> component isn't tied to skin parameters, as there is no additional
+ elements on it, except the ones provided with <emphasis><property>Virtual Earth
+ map</property>.</emphasis></para>
</section>
+
<section>
<title>Definition of Custom Style Classes</title>
<table>
- <title>Classes names that define a virtualEarth appearance</title>
+ <title>Classes names that define a component appearance</title>
<tgroup cols="2">
<thead>
<row>
@@ -150,29 +155,29 @@
<tbody>
<row>
<entry>rich-virtualEarth</entry>
- <entry>Defines styles for a wrapper <div> element of a virtualEarth</entry>
+ <entry>Defines styles for a wrapper <div> element of a
+ component</entry>
</row>
</tbody>
</tgroup>
</table>
-
+
<para>In order to redefine styles for all <emphasis role="bold">
- <property><rich:virtualEarth></property>
- </emphasis> components on a page using CSS, it's enough to create class with the
- same name and define necessary properties in it.</para>
-
+ <property><rich:virtualEarth></property>
+ </emphasis> components on a page using CSS, it's enough to create class with the same
+ name and define necessary properties in it.</para>
+
<para>To change styles of particular <emphasis role="bold">
- <property><rich:virtualEarth></property>
- </emphasis> components, define your own style class in the corresponding <emphasis
- role="bold">
- <property><rich:virtualEarth></property>
- </emphasis>attribute.</para>
+ <property><rich:virtualEarth></property>
+ </emphasis> components, define your own style class in the corresponding <emphasis role="bold">
+ <property><rich:virtualEarth></property>
+ </emphasis>attribute.</para>
</section>
<section>
<title>Relevant Resources Links</title>
<para>
- <ulink url="http://msdn2.microsoft.com/en-us/library/bb429619.aspx">Here</ulink> you can found additional
- information about Microsoft <property>Virtual Earth map</property>.</para>
+ <ulink url="http://msdn2.microsoft.com/en-us/library/bb429619.aspx">Here</ulink> you can found
+ additional information about Microsoft <property>Virtual Earth map</property>.</para>
</section>
</section>
17 years, 1 month
JBoss Rich Faces SVN: r3599 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-10-29 10:39:10 -0400 (Mon, 29 Oct 2007)
New Revision: 3599
Modified:
trunk/docs/userguide/en/src/main/docbook/included/changeExpandListener.xml
trunk/docs/userguide/en/src/main/docbook/included/dndParam.xml
trunk/docs/userguide/en/src/main/docbook/included/dragListener.xml
trunk/docs/userguide/en/src/main/docbook/included/dragSupport.xml
trunk/docs/userguide/en/src/main/docbook/included/dropListener.xml
trunk/docs/userguide/en/src/main/docbook/included/dropSupport.xml
trunk/docs/userguide/en/src/main/docbook/included/effect.xml
trunk/docs/userguide/en/src/main/docbook/included/jQuery.xml
trunk/docs/userguide/en/src/main/docbook/included/nodeSelectListener.xml
Log:
http://jira.jboss.com/jira/browse/RF-920 - Added section "Look-and-Feel Customization" for not visual components.
Modified: trunk/docs/userguide/en/src/main/docbook/included/changeExpandListener.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/changeExpandListener.xml 2007-10-29 14:18:48 UTC (rev 3598)
+++ trunk/docs/userguide/en/src/main/docbook/included/changeExpandListener.xml 2007-10-29 14:39:10 UTC (rev 3599)
@@ -108,4 +108,14 @@
]]></programlisting>
</section>
+ <section>
+ <title>Look-and-Feel Customization</title>
+
+ <para><emphasis role="bold">
+ <property><rich:changeExpandListener></property>
+ </emphasis> has no skin parameters and custom <property>style classes</property>, as the
+ component isn't visual.</para>
+ </section>
+
+
</chapter>
\ No newline at end of file
Modified: trunk/docs/userguide/en/src/main/docbook/included/dndParam.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dndParam.xml 2007-10-29 14:18:48 UTC (rev 3598)
+++ trunk/docs/userguide/en/src/main/docbook/included/dndParam.xml 2007-10-29 14:39:10 UTC (rev 3599)
@@ -169,7 +169,17 @@
if dragged content of a comp type is above the given drop zone that
processes it on the next drop event.</para>
</section>
+
<section>
+ <title>Look-and-Feel Customization</title>
+
+ <para><emphasis role="bold">
+ <property><rich:dndParam></property>
+ </emphasis> has no skin parameters and custom <property>style classes</property>, as the
+ component isn't visual.</para>
+ </section>
+
+ <section>
<title>Relevan Resources Links</title>
<para><ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/dragSupport.jsf?c=dnd..."
>Here</ulink> you can see the example of <emphasis role="bold"
Modified: trunk/docs/userguide/en/src/main/docbook/included/dragListener.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dragListener.xml 2007-10-29 14:18:48 UTC (rev 3598)
+++ trunk/docs/userguide/en/src/main/docbook/included/dragListener.xml 2007-10-29 14:39:10 UTC (rev 3599)
@@ -108,4 +108,13 @@
]]></programlisting>
</section>
+ <section>
+ <title>Look-and-Feel Customization</title>
+
+ <para><emphasis role="bold">
+ <property><rich:dragListener></property>
+ </emphasis> has no skin parameters and custom <property>style classes</property>, as the
+ component isn't visual.</para>
+ </section>
+
</chapter>
\ No newline at end of file
Modified: trunk/docs/userguide/en/src/main/docbook/included/dragSupport.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dragSupport.xml 2007-10-29 14:18:48 UTC (rev 3598)
+++ trunk/docs/userguide/en/src/main/docbook/included/dragSupport.xml 2007-10-29 14:39:10 UTC (rev 3599)
@@ -194,15 +194,19 @@
<section>
<title>Look-and-Feel Customization</title>
- <para>The component doesn't have its own representation.</para>
+ <para><emphasis role="bold">
+ <property><rich:dragSupport></property>
+ </emphasis> has no skin parameters and custom <property>style classes</property>, as the
+ component isn't visual.</para>
</section>
+
<section>
<title>Relevant Resources Links</title>
<para>
<ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/dragSupport.jsf?c=dra..."
- >Here</ulink> you can see the example of <emphasis role="bold"
- ><property><rich:dragSupport></property></emphasis> usage and sources for the given example.
- </para>
+ >Here</ulink> you can see the example of <emphasis role="bold">
+ <property><rich:dragSupport></property>
+ </emphasis> usage and sources for the given example. </para>
</section>
</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dropListener.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dropListener.xml 2007-10-29 14:18:48 UTC (rev 3598)
+++ trunk/docs/userguide/en/src/main/docbook/included/dropListener.xml 2007-10-29 14:39:10 UTC (rev 3599)
@@ -108,4 +108,13 @@
]]></programlisting>
</section>
+ <section>
+ <title>Look-and-Feel Customization</title>
+
+ <para><emphasis role="bold">
+ <property><rich:dropListener></property>
+ </emphasis> has no skin parameters and custom <property>style classes</property>, as the
+ component isn't visual.</para>
+ </section>
+
</chapter>
\ No newline at end of file
Modified: trunk/docs/userguide/en/src/main/docbook/included/dropSupport.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dropSupport.xml 2007-10-29 14:18:48 UTC (rev 3598)
+++ trunk/docs/userguide/en/src/main/docbook/included/dropSupport.xml 2007-10-29 14:39:10 UTC (rev 3599)
@@ -241,7 +241,10 @@
<section>
<title>Look-and-Feel Customization</title>
- <para>The component doesn't have its own visual presentation.</para>
+ <para><emphasis role="bold">
+ <property><rich:dropSupport></property>
+ </emphasis> has no skin parameters and custom <property>style classes</property>, as the
+ component isn't visual.</para>
</section>
<section>
<title>Relevant Resources Links</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/effect.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/effect.xml 2007-10-29 14:18:48 UTC (rev 3598)
+++ trunk/docs/userguide/en/src/main/docbook/included/effect.xml 2007-10-29 14:39:10 UTC (rev 3599)
@@ -195,7 +195,17 @@
url="http://jboss.com/index.html?module=bb&op=viewtopic&t=119044">RichFaces
Users Forum</ulink>.</para>
</section>
+
<section>
+ <title>Look-and-Feel Customization</title>
+
+ <para><emphasis role="bold">
+ <property><rich:effect></property>
+ </emphasis> has no skin parameters and custom <property>style classes</property>, as the
+ component isn't visual.</para>
+ </section>
+
+ <section>
<title>Relevant Resources Links</title>
<para>
<ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/effect.jsf?c=effect"
Modified: trunk/docs/userguide/en/src/main/docbook/included/jQuery.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/jQuery.xml 2007-10-29 14:18:48 UTC (rev 3598)
+++ trunk/docs/userguide/en/src/main/docbook/included/jQuery.xml 2007-10-29 14:39:10 UTC (rev 3599)
@@ -333,6 +333,16 @@
right sintax. Remember to use jQuery() function instead of $(), as soon as jQuery works
without conflicts with prototype.js.</para>
</section>
+
+ <section>
+ <title>Look-and-Feel Customization</title>
+
+ <para><emphasis role="bold">
+ <property><rich:jQuery></property>
+ </emphasis> has no skin parameters and custom <property>style classes</property>, as the
+ component isn't visual.</para>
+ </section>
+
<section>
<title>Relevant Resources Links</title>
<para>More information about jQuery framework and its features you can read <ulink
Modified: trunk/docs/userguide/en/src/main/docbook/included/nodeSelectListener.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/nodeSelectListener.xml 2007-10-29 14:18:48 UTC (rev 3598)
+++ trunk/docs/userguide/en/src/main/docbook/included/nodeSelectListener.xml 2007-10-29 14:39:10 UTC (rev 3599)
@@ -108,4 +108,13 @@
]]></programlisting>
</section>
+ <section>
+ <title>Look-and-Feel Customization</title>
+
+ <para><emphasis role="bold">
+ <property><rich:nodeSelectListener></property>
+ </emphasis> has no skin parameters and custom <property>style classes</property>, as the
+ component isn't visual.</para>
+ </section>
+
</chapter>
\ No newline at end of file
17 years, 1 month
JBoss Rich Faces SVN: r3598 - trunk/framework/impl/src/main/javascript/ajaxjsf.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-10-29 10:18:48 -0400 (Mon, 29 Oct 2007)
New Revision: 3598
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
Log:
onComplete is invoking when all scripts are evaluated in updatePagePart
RF-932 fixed
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2007-10-29 14:14:33 UTC (rev 3597)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2007-10-29 14:18:48 UTC (rev 3598)
@@ -73,6 +73,7 @@
requestStatus = 599;
requestStatusText = "Network error";
}
+ var onReadyFlag = true;
if(requestStatus == 200){
try {
LOG.debug("Response with content-type: "+ _this.getResponseHeader('Content-Type'));
@@ -88,8 +89,10 @@
}
}
if(_this.onready){
+ onReadyFlag = false;
_this.onready(_this);
- }
+ }
+
} else {
_this._errorMessage = "Reqest error, status : "+requestStatus +" " + requestStatusText ;
LOG.error(_this._errorMessage);
@@ -97,10 +100,11 @@
_this._onerror(_this,requestStatus,_this._errorMessage);
}
}
- if(_this.onfinish){
+ if (onReadyFlag && _this.onfinish)
+ {
_this.onfinish(_this);
}
- _this = undefined;
+ _this = undefined;
}
}; //this._onReady;
try{
@@ -284,10 +288,11 @@
return data;
},
- evalScripts : function(node){
+ evalScripts : function(node, isLast){
var newscripts = this.getElementsByTagName("script",node);
LOG.debug("Scripts in updated part count : " + newscripts.length);
if( newscripts.length > 0 ){
+ var _this = this;
window.setTimeout(function() {
for (var i = 0; i < newscripts.length; i++){
var newscript = Sarissa.getText( newscripts[i],true ) ; // TODO - Mozilla disable innerHTML in XML page ..."";
@@ -303,14 +308,39 @@
}
}
newscripts = null;
+ if (isLast)
+ {
+ if(_this.onfinish){
+ _this.onfinish(_this);
+ _this=undefined;
+ }
+ }
},50);
+ } else
+ {
+ if (isLast)
+ {
+ if(this.onfinish){
+ this.onfinish(this);
+ }
+ }
}
+
},
+
+ beforeUpdatePagePart: function (id)
+ {
+ var oldnode = window.document.getElementById(id);
+ if ( oldnode ) {
+
+ }
+ },
+
/**
* Update DOM element with given ID by element with same ID in parsed responseXML
*/
- updatePagePart : function(id){
+ updatePagePart : function(id, isLast){
var newnode = this.getElementById(id);
if( ! newnode ) { LOG.error("New node for ID "+id+" is not present in response");return;}
var oldnode = window.document.getElementById(id);
@@ -336,13 +366,20 @@
// re-execute all script fragments in imported subtree...
// TODO - opera 8 run scripts at replace content stage.
if(!A4J.AJAX._scriptEvaluated){
- this.evalScripts(newnode);
+ this.evalScripts(newnode, isLast);
}
LOG.debug("Update part of page for Id: "+id + " successful");
} else {
LOG.warn("Node for replace by response with id "+id+" not found in document");
}
+ if (A4J.AJAX._scriptEvaluated && isLast)
+ {
+ if(this.onfinish){
+ this.onfinish(this);
+ }
+ }
+
},
appendNewHeadElements : function(){
@@ -713,7 +750,7 @@
req.appendNewHeadElements();
for ( var k =0; k < options.affected.length ; k++ ) {
LOG.debug("Update page part from call parameter for ID " + options.affected[k]);
- req.updatePagePart(options.affected[k]);
+ req.updatePagePart(options.affected[k], k==childs.length-1);
};
// if resopnce contains element with ID "ajax:update" get id's from
// child text element . like :
@@ -730,7 +767,7 @@
for ( var k=0 ; k < childs.length ; k++ ) {
var id = childs[k];
LOG.debug("Attempt to update part of page for Id: "+id);
- if ( id ) {req.updatePagePart(id);};
+ if ( id ) {req.updatePagePart(id, k==childs.length-1);};
};
} else {
// if none of above - error ?
17 years, 1 month