Author: nbelaevski
Date: 2007-07-19 18:10:40 -0400 (Thu, 19 Jul 2007)
New Revision: 1713
Added:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/MacroDefinitionJSContentHandler.java
trunk/framework/test/src/test/java/org/richfaces/renderkit/TemplateUtilTest.java
Removed:
trunk/framework/impl/src/main/antlr/
trunk/framework/impl/src/main/java/org/richfaces/renderkit/MacroDefinitionJSContentHandler.jav
trunk/framework/test/src/test/java/org/richfaces/renderkit/TemplateUtilTest.jav
Modified:
trunk/framework/impl/pom.xml
trunk/framework/impl/src/main/java/org/richfaces/component/UIRangedNumberInput.java
trunk/framework/impl/src/main/java/org/richfaces/renderkit/TemplateEncoderRendererBase.java
trunk/framework/impl/src/main/resources/META-INF/skins/blueSky.skin.properties
trunk/framework/impl/src/main/resources/META-INF/skins/classic.skin.properties
trunk/framework/impl/src/main/resources/META-INF/skins/deepMarine.skin.properties
trunk/framework/impl/src/main/resources/META-INF/skins/emeraldTown.skin.properties
trunk/framework/impl/src/main/resources/META-INF/skins/japanCherry.skin.properties
trunk/framework/impl/src/main/resources/META-INF/skins/plain.skin.properties
trunk/framework/impl/src/main/resources/META-INF/skins/ruby.skin.properties
trunk/framework/impl/src/main/resources/META-INF/skins/wine.skin.properties
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/json/json-dom.js
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
trunk/framework/test/src/test/java/org/richfaces/component/UIRangedNumberInputTest.java
Log:
merged changes commit
Modified: trunk/framework/impl/pom.xml
===================================================================
--- trunk/framework/impl/pom.xml 2007-07-19 20:20:46 UTC (rev 1712)
+++ trunk/framework/impl/pom.xml 2007-07-19 22:10:40 UTC (rev 1713)
@@ -1,306 +1,302 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>framework</artifactId>
- <groupId>org.richfaces</groupId>
- <version>3.1.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.framework</groupId>
- <artifactId>impl</artifactId>
- <name>Java Server Faces AJAX framework implementation</name>
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <directory>target/javascript</directory>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-source</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <!--
- <execution>
- <id>antlr</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <java classname="org.antlr.Tool"
- classpathref="maven.plugin.classpath"
- fork="true"
- dir="src/main/antlr">
- <arg value="RichMacroDefinition.g"/>
- <arg line="-o
${project.build.directory}/generated-sources/antlr/org/richfaces"/>
- </java>
- </tasks>
- <sourceRoot>${project.build.directory}/generated-sources/antlr</sourceRoot>
- </configuration>
- </execution>
- -->
- <execution>
- <id>javascript</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <ant
- antfile="${basedir}/generatescript.xml"
inheritRefs="true">
- <target name="assembly" />
- <property name="target-dir"
- value="${project.build.directory}/javascript">
- </property>
- </ant>
- </tasks>
- <resourceRoot>
- ${project.build.directory}/javascript
- </resourceRoot>
- </configuration>
- </execution>
- </executions>
- <!--
- <dependencies>
- <dependency>
- <groupId>org.antlr</groupId>
- <artifactId>antlr</artifactId>
- <version>3.0</version>
- </dependency>
- </dependencies>
- -->
- </plugin>
- </plugins>
- </build>
- <profiles>
- <profile>
- <id>jsf1_1</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- <property>
- <name>jsfVersion</name>
- <value>1.1</value>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.4</source>
- <target>1.4</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.1_02</version>
- <exclusions>
- <exclusion>
- <artifactId>jsp-api</artifactId>
- <groupId>javax.servlet.jsp</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jstl</artifactId>
- <groupId>javax.servlet.jsp.jstl</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>1.1_02</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <artifactId>jsp-api</artifactId>
- <groupId>javax.servlet.jsp</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jstl</artifactId>
- <groupId>javax.servlet.jsp.jstl</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <version>1.0</version>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>jsf1_2</id>
- <activation>
- <property>
- <name>jsfVersion</name>
- <value>1.2</value>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0</version>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>
- build-helper-maven-plugin
- </artifactId>
- <executions>
- <execution>
- <id>add-source</id>
- <phase>process-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>src/main/jsf12</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_03</version>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>1.2_03</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>opensymphony</groupId>
- <artifactId>oscache</artifactId>
- <version>2.3</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <version>1.1.11</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>nekohtml</groupId>
- <artifactId>nekohtml</artifactId>
- <version>0.9.5</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.0.4</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.7.0</version>
- </dependency>
- <dependency>
- <groupId>commons-digester</groupId>
- <artifactId>commons-digester</artifactId>
- <version>1.8</version>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.framework</groupId>
- <artifactId>api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <!--
- <dependency>
- <groupId>org.antlr</groupId>
- <artifactId>antlr</artifactId>
- <version>3.0</version>
- </dependency>
- -->
- </dependencies>
- <properties>
- <jsfVersion>1.1</jsfVersion>
- </properties>
-</project>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>framework</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>impl</artifactId>
+ <name>Java Server Faces AJAX framework implementation</name>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>target/javascript</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-source</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>javacc-maven-plugin</artifactId>
+ <version>2.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>javacc</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <packageName>org.richfaces.javacc</packageName>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>javascript</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <ant
+ antfile="${basedir}/generatescript.xml"
inheritRefs="true">
+ <target name="assembly" />
+ <property name="target-dir"
+ value="${project.build.directory}/javascript">
+ </property>
+ </ant>
+ </tasks>
+ <resourceRoot>
+ ${project.build.directory}/javascript
+ </resourceRoot>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>clover</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin</artifactId>
+ <configuration>
+ <excludes combine.children="append">
+ <exclude>
+ **/javacc/**
+ </exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>jsf1_1</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ <property>
+ <name>jsfVersion</name>
+ <value>1.1</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.1_02</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>jsp-api</artifactId>
+ <groupId>javax.servlet.jsp</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jstl</artifactId>
+ <groupId>javax.servlet.jsp.jstl</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>1.1_02</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <artifactId>jsp-api</artifactId>
+ <groupId>javax.servlet.jsp</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jstl</artifactId>
+ <groupId>javax.servlet.jsp.jstl</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>jsf1_2</id>
+ <activation>
+ <property>
+ <name>jsfVersion</name>
+ <value>1.2</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>
+ build-helper-maven-plugin
+ </artifactId>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>src/main/jsf12</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_03</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>1.2_03</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>opensymphony</groupId>
+ <artifactId>oscache</artifactId>
+ <version>2.3</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ <version>1.1.11</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>nekohtml</groupId>
+ <artifactId>nekohtml</artifactId>
+ <version>0.9.5</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.7.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <version>1.8</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <jsfVersion>1.1</jsfVersion>
+ </properties>
+</project>
+
Modified:
trunk/framework/impl/src/main/java/org/richfaces/component/UIRangedNumberInput.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/component/UIRangedNumberInput.java 2007-07-19
20:20:46 UTC (rev 1712)
+++
trunk/framework/impl/src/main/java/org/richfaces/component/UIRangedNumberInput.java 2007-07-19
22:10:40 UTC (rev 1713)
@@ -40,6 +40,15 @@
public abstract String getMinValue();
public abstract void setMinValue(String value);
+ public abstract boolean isDisabled();
+ public abstract void setDisabled(boolean disabled);
+
+ public void decode(FacesContext arg0) {
+ if (this.isDisabled())
+ return;
+ super.decode(arg0);
+ }
+
protected void validateValue(FacesContext context, Object newValue) {
if (isValid() && !isEmpty(newValue)) {
String label = MessageUtil.getLabel(context, this).toString();
Deleted:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/MacroDefinitionJSContentHandler.jav
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/renderkit/MacroDefinitionJSContentHandler.jav 2007-07-19
20:20:46 UTC (rev 1712)
+++
trunk/framework/impl/src/main/java/org/richfaces/renderkit/MacroDefinitionJSContentHandler.jav 2007-07-19
22:10:40 UTC (rev 1713)
@@ -1,168 +0,0 @@
-/**
- *
- */
-package org.richfaces.renderkit;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Iterator;
-import java.util.List;
-
-import org.richfaces.json.JSContentHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-/**
- * @author Nick Belaevski - mailto:nbelaevski@exadel.com created 21.06.2007
- *
- */
-public class MacroDefinitionJSContentHandler extends JSContentHandler {
- private String prolog;
- private String epilog;
-
- public MacroDefinitionJSContentHandler(Writer writer, String prolog,
- String epilog) {
- super(writer);
- this.prolog = prolog;
- this.epilog = epilog;
- }
-
- private List parseExpressiion(String expressionString) throws SAXException {
- ANTLRStringStream stream = new ANTLRStringStream(expressionString);
- RichMacroDefinitionLexer lexer = new RichMacroDefinitionLexer(stream);
- RichMacroDefinitionParser macroParser = new RichMacroDefinitionParser(
- new CommonTokenStream(lexer));
- try {
- expression_return expression = macroParser.expression();
- List result = expression.result;
-
- return result;
- } catch (RecognitionException e) {
- throw new SAXException(e.getMessage(), e);
- }
- }
-
- private void encodeExpressionString(String string) throws IOException,
- SAXException {
- List parsedExpressiion = parseExpressiion(string);
-
- boolean isExpression = false;
- for (Iterator iterator = parsedExpressiion.iterator(); iterator
- .hasNext();) {
- Object next = (Object) iterator.next();
- if (next instanceof Expression) {
- isExpression = true;
- break;
- }
- }
-
- if (isExpression) {
- this.outputWriter.write("function (context) { return ");
- }
-
- boolean first = true;
- for (Iterator iterator = parsedExpressiion.iterator(); iterator
- .hasNext();) {
- Object next = (Object) iterator.next();
-
- if (next == null) {
- continue;
- }
-
- if (!first) {
- this.outputWriter.write('+');
- }
-
- if (next instanceof Expression) {
- Expression macroExpression = (Expression) next;
-
- this.outputWriter.write(prolog);
- this.encode(macroExpression.getExpression().toString());
- this.outputWriter.write(epilog);
- } else {
- this.outputWriter.write('\'');
- this.encode(next.toString());
- this.outputWriter.write('\'');
- }
-
- first = false;
- }
-
- if (isExpression) {
- this.outputWriter.write(";}");
- }
- }
-
- protected void encodeAttributeValue(Attributes attributes, int idx)
- throws SAXException, IOException {
-
- String value = attributes.getValue(idx);
- encodeExpressionString(value);
- }
-
- public void characters(char[] ch, int start, int length)
- throws SAXException {
- if (isProcessingCdata()) {
- super.characters(ch, start, length);
- } else {
- List parsedExpression = parseExpressiion(new String(ch, start, length));
- for (Iterator iterator = parsedExpression.iterator(); iterator
- .hasNext();) {
-
- Object next = iterator.next();
-
- if (next instanceof Expression) {
- Expression expression = (Expression) next;
-
- if (this.isBeforeDocumentStart() || level < 0)
- return;
- try {
- if (level != 0 && !this.closeElement(false) &&
this.isProcessingCdata() == false) {
- this.outputWriter.write(',');
- }
-
- if (this.isProcessingCdata() == false) {
- this.outputWriter.write("new ET(");
- }
-
- this.outputWriter.write("function (context) { return ");
- this.outputWriter.write(prolog);
- this.encode(expression.getExpression().toString());
- this.outputWriter.write(epilog);
- this.outputWriter.write("}");
-
- if (this.isProcessingCdata() == false) {
- this.outputWriter.write(")");
- }
- } catch (IOException e) {
- throw new SAXException("Write error",e);
- }
-
- } else {
- char[] cs = next.toString().toCharArray();
- super.characters(cs, 0, cs.length);
- }
-
- if (iterator.hasNext()) {
- try {
- this.outputWriter.write(',');
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
- }
- }
-
- protected void encodeText(char[] chars, int start, int length)
- throws SAXException, IOException {
- if (!isProcessingCdata()) {
- String str = new String(chars, start, length);
- encodeExpressionString(str);
- } else {
- super.encodeText(chars, start, length);
- }
- }
-
-}
Added:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/MacroDefinitionJSContentHandler.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/renderkit/MacroDefinitionJSContentHandler.java
(rev 0)
+++
trunk/framework/impl/src/main/java/org/richfaces/renderkit/MacroDefinitionJSContentHandler.java 2007-07-19
22:10:40 UTC (rev 1713)
@@ -0,0 +1,165 @@
+/**
+ *
+ */
+package org.richfaces.renderkit;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.Writer;
+import java.util.Iterator;
+import java.util.List;
+
+import org.richfaces.javacc.RichMacroDefinition;
+import org.richfaces.json.JSContentHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * @author Nick Belaevski - mailto:nbelaevski@exadel.com created 21.06.2007
+ *
+ */
+public class MacroDefinitionJSContentHandler extends JSContentHandler {
+ private String prolog;
+ private String epilog;
+
+ public MacroDefinitionJSContentHandler(Writer writer, String prolog,
+ String epilog) {
+ super(writer);
+ this.prolog = prolog;
+ this.epilog = epilog;
+ }
+
+ private List parseExpressiion(String expressionString) throws SAXException {
+ try {
+ List result = new RichMacroDefinition(new
StringReader(expressionString)).expression();
+
+ return result;
+ } catch (Exception e) {
+ throw new SAXException(e.getMessage(), e);
+ }
+ }
+
+ private void encodeExpressionString(String string) throws IOException,
+ SAXException {
+ List parsedExpressiion = parseExpressiion(string);
+
+ boolean isExpression = false;
+ for (Iterator iterator = parsedExpressiion.iterator(); iterator
+ .hasNext();) {
+ Object next = (Object) iterator.next();
+ if (next instanceof Expression) {
+ isExpression = true;
+ break;
+ }
+ }
+
+ if (isExpression) {
+ this.outputWriter.write("function (context) { return ");
+ }
+
+ boolean first = true;
+ for (Iterator iterator = parsedExpressiion.iterator(); iterator
+ .hasNext();) {
+ Object next = (Object) iterator.next();
+
+ if (next == null) {
+ continue;
+ }
+
+ if (!first) {
+ this.outputWriter.write('+');
+ }
+
+ if (next instanceof Expression) {
+ Expression macroExpression = (Expression) next;
+
+ this.outputWriter.write(prolog);
+ this.encode(macroExpression.getExpression().toString());
+ this.outputWriter.write(epilog);
+ } else {
+ this.outputWriter.write('\'');
+ this.encode(next.toString());
+ this.outputWriter.write('\'');
+ }
+
+ first = false;
+ }
+
+ if (isExpression) {
+ this.outputWriter.write(";}");
+ }
+ }
+
+ protected void encodeAttributeValue(Attributes attributes, int idx)
+ throws SAXException, IOException {
+
+ String value = attributes.getValue(idx);
+ encodeExpressionString(value);
+ }
+
+ public void characters(char[] ch, int start, int length)
+ throws SAXException {
+ if (isProcessingCdata()) {
+ super.characters(ch, start, length);
+ } else {
+ List parsedExpression = parseExpressiion(new String(ch, start, length));
+ for (Iterator iterator = parsedExpression.iterator(); iterator
+ .hasNext();) {
+
+ Object next = iterator.next();
+
+ if (next instanceof Expression) {
+ Expression expression = (Expression) next;
+
+ if (this.isBeforeDocumentStart() || level < 0)
+ return;
+ try {
+ if (level != 0 && !this.closeElement(false) &&
this.isProcessingCdata() == false) {
+ this.outputWriter.write(',');
+ }
+
+ if (this.isProcessingCdata() == false) {
+ this.outputWriter.write("new ET(");
+ }
+
+ this.outputWriter.write("function (context) { return ");
+ this.outputWriter.write(prolog);
+ this.encode(expression.getExpression().toString());
+ this.outputWriter.write(epilog);
+ this.outputWriter.write("}");
+
+ if (this.isProcessingCdata() == false) {
+ this.outputWriter.write(")");
+ }
+ } catch (IOException e) {
+ throw new SAXException("Write error",e);
+ }
+
+ } else {
+ char[] cs = next.toString().toCharArray();
+ super.characters(cs, 0, cs.length);
+ }
+
+ if (iterator.hasNext()) {
+ try {
+ this.outputWriter.write(',');
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+ }
+
+ protected void encodeText(char[] chars, int start, int length)
+ throws SAXException, IOException {
+ if (!isProcessingCdata()) {
+ String str = new String(chars, start, length);
+ encodeExpressionString(str);
+ } else {
+ super.encodeText(chars, start, length);
+ }
+ }
+
+}
Modified:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/TemplateEncoderRendererBase.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/renderkit/TemplateEncoderRendererBase.java 2007-07-19
20:20:46 UTC (rev 1712)
+++
trunk/framework/impl/src/main/java/org/richfaces/renderkit/TemplateEncoderRendererBase.java 2007-07-19
22:10:40 UTC (rev 1713)
@@ -20,9 +20,9 @@
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXResult;
-import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
import org.ajax4jsf.webapp.tidy.TidyParser;
import org.ajax4jsf.webapp.tidy.TidyXMLFilter;
+import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
import org.richfaces.json.JSContentHandler;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -67,30 +67,30 @@
writer.write("[");
-// try {
-// Transformer transformer;
-//
-// synchronized (transformerFactory) {
-// transformer = transformerFactory.newTransformer();
-// }
-//
-// transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
-// transformer.setOutputProperty(OutputKeys.METHOD, "xml");
-//
-// JSContentHandler contentHandler = new MacroDefinitionJSContentHandler(writer,
"Richfaces.eval(\"", "\", context)");
-// Result result = new SAXResult(contentHandler);
-//
-// for (int i = 0; i < bodyChildrenLength; i++) {
-// if (i != 0) {
-// writer.write(", ");
-// }
-// transformer.transform(new DOMSource(bodyChildren.item(i)), result);
-// }
-// } catch (TransformerException e) {
-// throw new IOException(e.getMessage());
-// }
+ try {
+ Transformer transformer;
- writer.write("];\n");
+ synchronized (transformerFactory) {
+ transformer = transformerFactory.newTransformer();
+ }
+
+ transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+
+ JSContentHandler contentHandler = new MacroDefinitionJSContentHandler(writer,
"Richfaces.evalMacro(\"", "\", context)");
+ Result result = new SAXResult(contentHandler);
+
+ for (int i = 0; i < bodyChildrenLength; i++) {
+ if (i != 0) {
+ writer.write(", ");
+ }
+ transformer.transform(new DOMSource(bodyChildren.item(i)), result);
+ }
+ } catch (TransformerException e) {
+ throw new IOException(e.getMessage());
+ }
+
+ writer.write("]");
}
protected void writeScriptBody(FacesContext context, UIComponent component, boolean
children)
@@ -119,7 +119,7 @@
writer.startElement("script", component);
writer.write("var evaluator = ");
writeScriptBody(context, component, true);
- writer.write("new Insertion.Top($('" + component.getClientId(context) +
"'), evaluator.invoke('getContent', window).join(''));");
+ writer.write(";\n new Insertion.Top($('" + component.getClientId(context)
+ "'), evaluator.invoke('getContent', window).join(''));");
writer.endElement("script");
}
}
Modified: trunk/framework/impl/src/main/resources/META-INF/skins/blueSky.skin.properties
===================================================================
---
trunk/framework/impl/src/main/resources/META-INF/skins/blueSky.skin.properties 2007-07-19
20:20:46 UTC (rev 1712)
+++
trunk/framework/impl/src/main/resources/META-INF/skins/blueSky.skin.properties 2007-07-19
22:10:40 UTC (rev 1713)
@@ -24,8 +24,8 @@
trimColor=#D6E6FB
-tipBackgroundColor=\#FAE6B0
-tipBorderColor=\#E5973E
+tipBackgroundColor=#FAE6B0
+tipBorderColor=#E5973E
selectControlColor=#E79A00
@@ -48,3 +48,4 @@
tableFooterBackgroundColor=#cccccc
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C0C0C0
+tableBorderWidth=1px
Modified: trunk/framework/impl/src/main/resources/META-INF/skins/classic.skin.properties
===================================================================
---
trunk/framework/impl/src/main/resources/META-INF/skins/classic.skin.properties 2007-07-19
20:20:46 UTC (rev 1712)
+++
trunk/framework/impl/src/main/resources/META-INF/skins/classic.skin.properties 2007-07-19
22:10:40 UTC (rev 1713)
@@ -24,8 +24,8 @@
trimColor=#C6D6EA
-tipBackgroundColor=\#FAE6B0
-tipBorderColor=\#E5973E
+tipBackgroundColor=#FAE6B0
+tipBorderColor=#E5973E
selectControlColor=#E79A00
@@ -48,5 +48,4 @@
tableFooterBackgroundColor=#cccccc
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C0C0C0
-
-
+tableBorderWidth=1px
Modified:
trunk/framework/impl/src/main/resources/META-INF/skins/deepMarine.skin.properties
===================================================================
---
trunk/framework/impl/src/main/resources/META-INF/skins/deepMarine.skin.properties 2007-07-19
20:20:46 UTC (rev 1712)
+++
trunk/framework/impl/src/main/resources/META-INF/skins/deepMarine.skin.properties 2007-07-19
22:10:40 UTC (rev 1713)
@@ -24,8 +24,8 @@
trimColor=#C9EDF0
-tipBackgroundColor=\#FAE6B0
-tipBorderColor=\#E5973E
+tipBackgroundColor=#FAE6B0
+tipBorderColor=#E5973E
selectControlColor=#E79A00
@@ -48,7 +48,4 @@
tableFooterBackgroundColor=#cccccc
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C0C0C0
-
-
-
-
+tableBorderWidth=1px
Modified:
trunk/framework/impl/src/main/resources/META-INF/skins/emeraldTown.skin.properties
===================================================================
---
trunk/framework/impl/src/main/resources/META-INF/skins/emeraldTown.skin.properties 2007-07-19
20:20:46 UTC (rev 1712)
+++
trunk/framework/impl/src/main/resources/META-INF/skins/emeraldTown.skin.properties 2007-07-19
22:10:40 UTC (rev 1713)
@@ -24,8 +24,8 @@
trimColor=#BBECBB
-tipBackgroundColor=\#FAE6B0
-tipBorderColor=\#E5973E
+tipBackgroundColor=#FAE6B0
+tipBorderColor=#E5973E
selectControlColor=#FF9409
@@ -48,7 +48,4 @@
tableFooterBackgroundColor=#cccccc
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C0C0C0
-
-
-
-
+tableBorderWidth=1px
Modified:
trunk/framework/impl/src/main/resources/META-INF/skins/japanCherry.skin.properties
===================================================================
---
trunk/framework/impl/src/main/resources/META-INF/skins/japanCherry.skin.properties 2007-07-19
20:20:46 UTC (rev 1712)
+++
trunk/framework/impl/src/main/resources/META-INF/skins/japanCherry.skin.properties 2007-07-19
22:10:40 UTC (rev 1713)
@@ -24,8 +24,8 @@
trimColor=#F7D5D5
-tipBackgroundColor=\#FAE6B0
-tipBorderColor=\#E5973E
+tipBackgroundColor=#FAE6B0
+tipBorderColor=#E5973E
selectControlColor=#E79A00
@@ -48,6 +48,4 @@
tableFooterBackgroundColor=#cccccc
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#DFA5A5
-
-
-
+tableBorderWidth=1px
Modified: trunk/framework/impl/src/main/resources/META-INF/skins/plain.skin.properties
===================================================================
---
trunk/framework/impl/src/main/resources/META-INF/skins/plain.skin.properties 2007-07-19
20:20:46 UTC (rev 1712)
+++
trunk/framework/impl/src/main/resources/META-INF/skins/plain.skin.properties 2007-07-19
22:10:40 UTC (rev 1713)
@@ -47,4 +47,5 @@
tableBackgroundColor=#{null}
tableFooterBackgroundColor=#{null}
tableSubfooterBackgroundColor=#{null}
-tableBorderColor=#{null}
\ No newline at end of file
+tableBorderColor=#{null}
+tableBorderWidth=0px
Modified: trunk/framework/impl/src/main/resources/META-INF/skins/ruby.skin.properties
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/skins/ruby.skin.properties 2007-07-19
20:20:46 UTC (rev 1712)
+++ trunk/framework/impl/src/main/resources/META-INF/skins/ruby.skin.properties 2007-07-19
22:10:40 UTC (rev 1713)
@@ -24,8 +24,8 @@
trimColor=#F7C4C4
-tipBackgroundColor=\#FAE6B0
-tipBorderColor=\#E5973E
+tipBackgroundColor=#FAE6B0
+tipBorderColor=#E5973E
selectControlColor=#FF9409
@@ -48,7 +48,4 @@
tableFooterBackgroundColor=#cccccc
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C0C0C0
-
-
-
-
+tableBorderWidth=1px
Modified: trunk/framework/impl/src/main/resources/META-INF/skins/wine.skin.properties
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/skins/wine.skin.properties 2007-07-19
20:20:46 UTC (rev 1712)
+++ trunk/framework/impl/src/main/resources/META-INF/skins/wine.skin.properties 2007-07-19
22:10:40 UTC (rev 1713)
@@ -24,8 +24,8 @@
trimColor=#E1D2AF
-tipBackgroundColor=\#FAE6B0
-tipBorderColor=\#E5973E
+tipBackgroundColor=#FAE6B0
+tipBorderColor=#E5973E
selectControlColor=#E79A00
@@ -49,6 +49,4 @@
tableFooterBackgroundColor=#cccccc
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#B6AD84
-
-
-
+tableBorderWidth=1px
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/json/json-dom.js
===================================================================
---
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/json/json-dom.js 2007-07-19
20:20:46 UTC (rev 1712)
+++
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/json/json-dom.js 2007-07-19
22:10:40 UTC (rev 1713)
@@ -37,9 +37,11 @@
// Escape XML symbols - < > & ' ...
xmlEscape : function(value) {
var text = value ? value.toString() : "";
- for(var i in this._symbols )
+ /*for(var i in this._symbols ) {
text = text.replace(i,this._symbols[i]);
- return text;
+
+ */
+ return text.escapeHTML();
}
};
@@ -77,17 +79,20 @@
this.value = text;
};
+
//ET.prototype = new JSNode();
ET.prototype.getContent = function(context) {
var value = this.value;
- if (typeof value == "function")
- value = value(context);
-
+ if (typeof value=="function") value=value(context);
+ if (value && value.getContent) {
+ value = value.getContent(context);
+ }
+
if (value) return value;
return "";
};
-
+
// Text node
T = function(text) {
this.value = text;
@@ -96,8 +101,7 @@
T.prototype = new JSNode();
T.prototype.getContent = function(context) {
var value = this.value;
- if (typeof value == "function")
- value = value(context);
+ if (typeof value=="function") value=value(context);
if (value) return this.xmlEscape(value);
@@ -124,3 +128,4 @@
return "<![CDATA["+this.value+"]]>";
};
+
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
---
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-07-19
20:20:46 UTC (rev 1712)
+++
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-07-19
22:10:40 UTC (rev 1713)
@@ -100,16 +100,59 @@
return null;
};
-Richfaces.eval = function(template, object) {
- var value = '';
-
- try {
- with (object) {
- value = eval(template) ;
- }
- } catch (e) {
- LOG.warn('Exception: ' + e.message + '\n[' + template + ']');
+Richfaces.VARIABLE_NAME_PATTERN = /^\s*[_,A-Z,a-z][\w,_\.]*\s*$/;
+
+Richfaces.getObjectValue = function (str, object) {
+ var a=str.split(".");
+ var value=object[a[0]];
+ var c=1;
+ while (value && c<a.length) value = value[a[c++]];
+ return (value ? value : "");
+}
+
+Richfaces.evalMacro = function(template, object)
+{
+ var value="";
+ // variable evaluation
+ if (Richfaces.VARIABLE_NAME_PATTERN.test(template))
+ {
+ if (template.indexOf('.')==-1) {
+ value = object[template];
+ if (!value) value=window[template];
+ }
+ // object's variable evaluation
+ else {
+ value = Richfaces.getObjectValue(template, object);
+ if (!value) value=Richfaces.getObjectValue(template, window);
+ }
+ if (value && typeof value=='function') value = value(object);
+ if (!value) value="";
}
+ //js string evaluation
+ else {
+ try {
+ value=object.eval(template);
+ if (typeof value == 'function') {
+ value = value(object);
+ }
+ } catch (e) { LOG.warn("Exception: "+e.Message + "\n[" + template +
"]"); }
+ }
+ return value;
+}
+Richfaces.evalSimpleMacro = function(template, object)
+{
+ var value = object[template];
+ if (!value) {value=window[template]; if (!value) value="";}
+ return value;
+}
- return value;
-};
+Richfaces.invokeOnComponent = function(componentType, element, functionName)
+{
+ var attribute="richfacesComponent";
+ while (element.parentNode) {
+ if (element[attribute] && element[attribute]==componentType)
+ return element.component[functionName]();
+ else
+ element = element.parentNode;
+ }
+}
Modified:
trunk/framework/test/src/test/java/org/richfaces/component/UIRangedNumberInputTest.java
===================================================================
---
trunk/framework/test/src/test/java/org/richfaces/component/UIRangedNumberInputTest.java 2007-07-19
20:20:46 UTC (rev 1712)
+++
trunk/framework/test/src/test/java/org/richfaces/component/UIRangedNumberInputTest.java 2007-07-19
22:10:40 UTC (rev 1713)
@@ -37,6 +37,7 @@
input = new UIRangedNumberInput() {
private String minValue;
private String maxValue;
+ private boolean disabled;
public String getMinValue() {
return minValue;
@@ -50,6 +51,12 @@
public void setMaxValue(String maxValue) {
this.maxValue = maxValue;
}
+ public boolean isDisabled() {
+ return disabled;
+ }
+ public void setDisabled(boolean disabled) {
+ this.disabled = disabled;
+ }
};
input.setMaxValue("100");
Deleted: trunk/framework/test/src/test/java/org/richfaces/renderkit/TemplateUtilTest.jav
===================================================================
---
trunk/framework/test/src/test/java/org/richfaces/renderkit/TemplateUtilTest.jav 2007-07-19
20:20:46 UTC (rev 1712)
+++
trunk/framework/test/src/test/java/org/richfaces/renderkit/TemplateUtilTest.jav 2007-07-19
22:10:40 UTC (rev 1713)
@@ -1,70 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - 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;
-
-import java.io.IOException;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.antlr.runtime.ANTLRStringStream;
-import org.antlr.runtime.CommonTokenStream;
-import org.antlr.runtime.tree.Tree;
-import org.richfaces.RichMacroDefinitionLexer;
-import org.richfaces.RichMacroDefinitionParser;
-import org.richfaces.RichMacroDefinitionParser.expression_return;
-
-/**
- * @author Nick Belaevski - mailto:nbelaevski@exadel.com
- * created 17.06.2007
- *
- */
-public class TemplateUtilTest extends TestCase {
-
- private String doWrite(String in) throws IOException {
- return in;
- }
-
- private void printTree(Tree tree, int indent) {
- int childCount = tree.getChildCount();
- for (int i = 0; i < indent; i++) {
- System.out.print('\t');
- System.out.print(tree.getText() + " : " + tree.getType());
- System.out.println();
- }
- for (int j = 1; j < childCount; j++) {
- printTree(tree.getChild(j), ++indent);
- }
- }
-
-
- public void testAntlr() throws Exception {
- ANTLRStringStream stream = new ANTLRStringStream("{aa{b\\}}a}\\\\
a\\}b\\{c");
- RichMacroDefinitionLexer lexer = new RichMacroDefinitionLexer(stream);
- RichMacroDefinitionParser macroParser = new RichMacroDefinitionParser(new
CommonTokenStream(lexer));
- expression_return expression = macroParser.expression();
- List result = expression.result;
- Expression holder = (Expression) result.get(0);
- assertEquals("aa{b}}a", holder.getExpression());
- assertEquals("\\ a}b{c", result.get(1));
- }
-}
Added: trunk/framework/test/src/test/java/org/richfaces/renderkit/TemplateUtilTest.java
===================================================================
--- trunk/framework/test/src/test/java/org/richfaces/renderkit/TemplateUtilTest.java
(rev 0)
+++
trunk/framework/test/src/test/java/org/richfaces/renderkit/TemplateUtilTest.java 2007-07-19
22:10:40 UTC (rev 1713)
@@ -0,0 +1,45 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - 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;
+
+import java.io.StringReader;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.richfaces.javacc.RichMacroDefinition;
+
+/**
+ * @author Nick Belaevski - mailto:nbelaevski@exadel.com
+ * created 17.06.2007
+ *
+ */
+public class TemplateUtilTest extends TestCase {
+
+
+ public void testAntlr() throws Exception {
+ List result = new RichMacroDefinition(new StringReader("{aa{b\\}}a}\\\\
a\\}b\\{c")).expression();
+ Expression holder = (Expression) result.get(0);
+ assertEquals("aa{b}}a", holder.getExpression());
+ assertEquals("\\ a}b{c", result.get(1));
+ }
+}