From tchemit@users.labs.libre-entreprise.org Tue Oct 21 09:31:10 2008
From: tchemit@users.labs.libre-entreprise.org
To: buix-commits@list.nuiton.org
Subject: [Buix-commits] r990 - in lutinjaxx/tags: . 0.5 0.5/jaxx-core
	0.5/jaxx-core/src/main/java/jaxx	0.5/jaxx-core/src/main/java/jaxx/compiler
	0.5/jaxx-core/src/main/java/jaxx/css	0.5/jaxx-core/src/main/java/jaxx/runtime
	0.5/jaxx-core/src/main/java/jaxx/runtime/validator
	0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui
	0.5/jaxx-core/src/main/java/jaxx/tags
	0.5/jaxx-core/src/main/java/jaxx/tags/swing
	0.5/jaxx-core/src/main/java/jaxx/tags/validator
	0.5/jaxx-core/src/main/resources	0.5/jaxx-core/src/test/java/ja
Date: Tue, 21 Oct 2008 09:31:07 +0200
Message-ID: <20081021073107.532F0461B4E@labs.libre-entreprise.org>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============5572478069805335687=="

--===============5572478069805335687==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Author: tchemit
Date: 2008-10-21 07:31:05 +0000 (Tue, 21 Oct 2008)
New Revision: 990

Added:
   lutinjaxx/tags/0.5/
   lutinjaxx/tags/0.5/jaxx-core/changelog
   lutinjaxx/tags/0.5/jaxx-core/pom.xml
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/PrintTagInfo.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/CompiledObject.ja=
va
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/DataBinding.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/DataSource.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/JAXXCompiler.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/JAXXCompilerHelpe=
r.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/JAXXObjectGenerat=
or.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/ScriptManager.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/css/Stylesheet.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXContext.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXObject.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXValidator.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/Util.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/BeanVali=
dator.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/BeanVali=
datorError.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/BeanVali=
datorErrorListModel.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Existing=
DirectoryFieldValidator.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Existing=
FileFieldValidator.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/NotExist=
ingDirectoryFieldValidator.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/NotExist=
ingFileFieldValidator.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Required=
FileFieldValidator.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui/
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui/Abstr=
actBeanValidatorUI.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui/Trans=
lucentValidationUI.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/DefaultComponentHandl=
er.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/DefaultObjectHandler.=
java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/StyleHandler.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/ApplicationHand=
ler.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/JInternalFrameH=
andler.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/JWindowHandler.=
java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/SwingInitialize=
r.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/validator/
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/validator/BeanValidat=
orHandler.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/validator/FieldValida=
torHandler.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/resources/validators.xml
   lutinjaxx/tags/0.5/jaxx-core/src/test/java/jaxx/junit/ValidatorBean.java
   lutinjaxx/tags/0.5/jaxx-core/src/test/java/jaxx/junit/ValidatorTest.java
   lutinjaxx/tags/0.5/jaxx-core/src/test/resources/jaxx/
   lutinjaxx/tags/0.5/jaxx-core/src/test/resources/log4j.properties
   lutinjaxx/tags/0.5/jaxx-example/Calculator/pom.xml
   lutinjaxx/tags/0.5/jaxx-example/Components/pom.xml
   lutinjaxx/tags/0.5/jaxx-example/Counter/pom.xml
   lutinjaxx/tags/0.5/jaxx-example/LabelStyle/pom.xml
   lutinjaxx/tags/0.5/jaxx-example/Validation/pom.xml
   lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Validati=
on/Identity.java
   lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Validati=
on/Validation.css
   lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Validati=
on/Validation.jaxx
   lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/resources/examples/Val=
idation/Identity-validation.xml
   lutinjaxx/tags/0.5/jaxx-example/pom.xml
   lutinjaxx/tags/0.5/jaxx-swing-action/pom.xml
   lutinjaxx/tags/0.5/jaxx-util/pom.xml
   lutinjaxx/tags/0.5/maven-jaxx-plugin/pom.xml
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/main/java/org/codelutin/jaxx/Jaxx=
GeneratorMojo.java
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Buil=
dExamples.java
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Comp=
ilerTest.java
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/Errors.x=
ml
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/Validato=
rErrors.xml
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/Validato=
rOk.xml
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/force/JB=
utton.jaxx
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/i18n/tex=
t/JButton.jaxx
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/i18n/too=
ltiptext/JButton.jaxx
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/validato=
r/
   lutinjaxx/tags/0.5/pom.xml
Removed:
   lutinjaxx/tags/0.5/jaxx-core/changelog
   lutinjaxx/tags/0.5/jaxx-core/pom.xml
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/PrintTagInfo.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/CompiledObject.ja=
va
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/DataBinding.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/DataSource.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/JAXXCompiler.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/ScriptManager.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/css/Stylesheet.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/BeanValidator.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXContext.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXObject.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/Util.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui/Abstr=
actBeanValidatorUI.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui/Trans=
lucentValidationUI.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/DefaultComponentHandl=
er.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/DefaultObjectHandler.=
java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/StyleHandler.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/ApplicationHand=
ler.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/BeanValidatorHa=
ndler.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/FieldValidatorH=
andler.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/JInternalFrameH=
andler.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/JWindowHandler.=
java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/SwingInitialize=
r.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/validator/BeanValidat=
orHandler.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/validator/FieldValida=
torHandler.java
   lutinjaxx/tags/0.5/jaxx-core/src/main/resources/example.jnlp
   lutinjaxx/tags/0.5/jaxx-core/src/main/resources/manifest.mf
   lutinjaxx/tags/0.5/jaxx-core/src/test/resources/log4j.properties
   lutinjaxx/tags/0.5/jaxx-example/Calculator/pom.xml
   lutinjaxx/tags/0.5/jaxx-example/Components/pom.xml
   lutinjaxx/tags/0.5/jaxx-example/Counter/pom.xml
   lutinjaxx/tags/0.5/jaxx-example/LabelStyle/pom.xml
   lutinjaxx/tags/0.5/jaxx-example/Validation/pom.xml
   lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Validati=
on/Identity.java
   lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Validati=
on/Validation.css
   lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Validati=
on/Validation.jaxx
   lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/resources/examples/Val=
idation/Identity-validation.xml
   lutinjaxx/tags/0.5/jaxx-example/pom.xml
   lutinjaxx/tags/0.5/jaxx-swing-action/pom.xml
   lutinjaxx/tags/0.5/jaxx-util/pom.xml
   lutinjaxx/tags/0.5/maven-jaxx-plugin/pom.xml
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/main/java/org/codelutin/jaxx/Jaxx=
GeneratorMojo.java
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Buil=
dExamples.java
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Comp=
ilerTest.java
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/Errors.x=
ml
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/force/JB=
utton.jaxx
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/i18n/tex=
t/JButton.jaxx
   lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/i18n/too=
ltiptext/JButton.jaxx
   lutinjaxx/tags/0.5/pom.xml
Log:
[maven-release-plugin]  copy for tag 0.5

Copied: lutinjaxx/tags/0.5 (from rev 948, lutinjaxx/trunk)

Deleted: lutinjaxx/tags/0.5/jaxx-core/changelog
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/changelog	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/changelog	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,9 +0,0 @@
- ver-0-5 chemit 20081002
- * 20081013 [chemit] can generate logger on jaxx files
- * 20081011 [chemit] improve site
- * 20081011 [chemit] fix bug on JavaFileParser : works again
- * 20081002 [chemit] Using lutinproject 3.0, changing groupId to org.codelut=
in
- * 20081002 [chemit] use a single module jaxx-core (no more core, runtime an=
d jaxx-swing modules)
- * 20081002 [chemit] Introduce JAXXContext
- * 20081002 [chemit] Fix bug on method creation via scripting
- * 20081002 [chemit] Improve i18n integration (works now also for tabs)

Copied: lutinjaxx/tags/0.5/jaxx-core/changelog (from rev 951, lutinjaxx/trunk=
/jaxx-core/changelog)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/changelog	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/changelog	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,10 @@
+ ver-0-5 chemit 20081002
+ * 20081017 [chemit] add validator support
+ * 20081013 [chemit] can generate logger on jaxx files
+ * 20081011 [chemit] improve site
+ * 20081011 [chemit] fix bug on JavaFileParser : works again
+ * 20081002 [chemit] Using lutinproject 3.0, changing groupId to org.codelut=
in
+ * 20081002 [chemit] use a single module jaxx-core (no more core, runtime an=
d jaxx-swing modules)
+ * 20081002 [chemit] Introduce JAXXContext
+ * 20081002 [chemit] Fix bug on method creation via scripting
+ * 20081002 [chemit] Improve i18n integration (works now also for tabs)

Deleted: lutinjaxx/tags/0.5/jaxx-core/pom.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/pom.xml	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/pom.xml	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,70 +0,0 @@
-<?xml version=3D"1.0" encoding=3D"UTF-8"?>
-<project xmlns=3D"http://maven.apache.org/POM/4.0.0" xmlns:xsi=3D"http://www=
.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mave=
n.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <!-- ************************************************************* -->
-    <!-- *** POM Relationships *************************************** -->
-    <!-- ************************************************************* -->
-
-    <parent>
-        <groupId>org.codelutin</groupId>
-        <artifactId>lutinjaxx</artifactId>
-        <version>0.5-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>jaxx-core</artifactId>
-
-    <dependencies>
-
-        <dependency>
-            <groupId>org.codelutin</groupId>
-            <artifactId>jaxx-util</artifactId>
-        </dependency>
-
-        <!-- pour acceder aux BeansInfos swing via Introspector -->
-        <dependency>
-            <groupId>com.sun</groupId>
-            <artifactId>dt</artifactId>
-            <!--scope>system</scope-->
-        </dependency>
-
-        <!-- pour utiliser javaHelp -->
-        <dependency>
-            <groupId>javax.help</groupId>
-            <artifactId>javahelp</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.opensymphony</groupId>
-            <artifactId>xwork</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.swinglabs</groupId>
-            <artifactId>jxlayer</artifactId>
-        </dependency>
-
-    </dependencies>
-
-    <!-- ************************************************************* -->
-    <!-- *** Project Information ************************************* -->
-    <!-- ************************************************************* -->
-    <name>jaxx-core</name>
-    <description>Jaxx lutin library core</description>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Settings ****************************************** -->
-    <!-- ************************************************************* -->
-    <packaging>jar</packaging>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Environment  ************************************** -->
-    <!-- ************************************************************* -->
-    <scm>
-        <connection>${scm.connection.son}</connection>
-        <developerConnection>${scm.developerConnection.son}</developerConnec=
tion>
-        <url>${scm.url.son}</url>
-    </scm>
-</project>

Copied: lutinjaxx/tags/0.5/jaxx-core/pom.xml (from rev 989, lutinjaxx/trunk/j=
axx-core/pom.xml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/pom.xml	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/pom.xml	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,69 @@
+<?xml version=3D"1.0" encoding=3D"UTF-8"?>
+<project xmlns=3D"http://maven.apache.org/POM/4.0.0" xmlns:xsi=3D"http://www=
.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D"http://maven.apache.or=
g/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- ************************************************************* -->
+    <!-- *** POM Relationships *************************************** -->
+    <!-- ************************************************************* -->
+
+    <parent>
+        <groupId>org.codelutin</groupId>
+        <artifactId>lutinjaxx</artifactId>
+        <version>0.5</version>
+    </parent>
+
+    <artifactId>jaxx-core</artifactId>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.codelutin</groupId>
+            <artifactId>jaxx-util</artifactId>
+        </dependency>
+
+        <!-- pour acceder aux BeansInfos swing via Introspector -->
+        <dependency>
+            <groupId>com.sun</groupId>
+            <artifactId>dt</artifactId>
+            <!--scope>system</scope-->
+        </dependency>
+
+        <!-- pour utiliser javaHelp -->
+        <dependency>
+            <groupId>javax.help</groupId>
+            <artifactId>javahelp</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.opensymphony</groupId>
+            <artifactId>xwork</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.swinglabs</groupId>
+            <artifactId>jxlayer</artifactId>
+        </dependency>
+
+    </dependencies>
+
+    <!-- ************************************************************* -->
+    <!-- *** Project Information ************************************* -->
+    <!-- ************************************************************* -->
+    <name>jaxx-core</name>
+    <description>Jaxx lutin library core</description>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Settings ****************************************** -->
+    <!-- ************************************************************* -->
+    <packaging>jar</packaging>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Environment  ************************************** -->
+    <!-- ************************************************************* -->
+    <scm>
+        <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroo=
t/buix/lutinjaxx/tags/0.5/jaxx-core</connection>
+        <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise=
.org/svnroot/buix/lutinjaxx/tags/0.5/jaxx-core</developerConnection>
+        <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/lut=
injaxx/tags/0.5/jaxx-core?root=3Dbuix</url>
+    </scm>
+</project>

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/PrintTagInfo.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/PrintTagInfo.java	2008-10-17=
 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/PrintTagInfo.java	2008-10=
-21 07:31:05 UTC (rev 990)
@@ -1,71 +0,0 @@
-package jaxx;
-
-import jaxx.compiler.JAXXCompiler;
-import jaxx.introspection.JAXXPropertyDescriptor;
-import jaxx.reflect.ClassDescriptor;
-import jaxx.reflect.ClassDescriptorLoader;
-import jaxx.reflect.MethodDescriptor;
-import jaxx.tags.DefaultObjectHandler;
-import jaxx.tags.TagManager;
-
-/** Generates information about a tag for use on the jaxxframework.org web s=
ite. */
-public class PrintTagInfo {
-    /**
-     * Displays information about the class name in arg[0].
-     *
-     * @param arg command-line arguments
-     * @throws Exception if an error occurs
-     */
-    public static void main(String[] arg) throws Exception {
-        JAXXCompiler.init();
-
-        ClassDescriptor beanClass =3D ClassDescriptorLoader.getClassDescript=
or(arg[0]);
-        DefaultObjectHandler handler =3D TagManager.getTagHandler(beanClass);
-
-        DefaultObjectHandler superHandler =3D TagManager.getTagHandler(beanC=
lass.getSuperclass());
-
-        // dump all bean properties
-        System.out.println("Properties in " + beanClass);
-        JAXXPropertyDescriptor[] properties =3D handler.getJAXXBeanInfo().ge=
tJAXXPropertyDescriptors();
-        JAXXPropertyDescriptor[] superProperties =3D superHandler.getJAXXBea=
nInfo().getJAXXPropertyDescriptors();
-        for (JAXXPropertyDescriptor property : properties) {
-            if (property.getWriteMethodDescriptor() =3D=3D null)
-                continue;
-
-            boolean found =3D false;
-            String name =3D property.getName();
-            for (JAXXPropertyDescriptor superProperty : superProperties) {
-                if (superProperty.getName().equals(name)) {
-                    found =3D true;
-                    break;
-                }
-            }
-            if (!found) {
-                if (property.getPropertyType() =3D=3D null)
-                    System.err.println(name + " has null type");
-                else {
-                    System.out.println("{{EquivalentAttribute|" + name + "|"=
 + arg[0].replace('.', '/') +
-                            "|set" + JAXXCompiler.capitalize(name) + "|" +
-                            JAXXCompiler.getCanonicalName(property.getProper=
tyType()) + "}}");
-                    System.out.println("|-");
-                }
-            }
-        }
-
-        System.out.println();
-        System.out.println();
-
-        // dump all bound methods
-        MethodDescriptor[] methods =3D beanClass.getMethodDescriptors();
-        System.out.println("Bound methods in " + beanClass);
-        for (MethodDescriptor method : methods) {
-            try {
-                if (handler.isMemberBound(method.getName()))
-                    System.out.println("* <tt>" + method.getName() + "()</tt=
>");
-            }
-            catch (Throwable e) {
-                // ignore ?
-            }
-        }
-    }
-}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/PrintTagInfo.java (fr=
om rev 978, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/PrintTagInfo.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/PrintTagInfo.java	       =
                 (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/PrintTagInfo.java	2008-10=
-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,117 @@
+package jaxx;
+
+import jaxx.compiler.JAXXCompiler;
+import jaxx.introspection.JAXXPropertyDescriptor;
+import jaxx.reflect.ClassDescriptor;
+import jaxx.reflect.ClassDescriptorLoader;
+import jaxx.reflect.MethodDescriptor;
+import jaxx.tags.DefaultObjectHandler;
+import jaxx.tags.TagManager;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+
+/** Generates information about a tag for use on the jaxxframework.org web s=
ite. */
+public class PrintTagInfo {
+    /**
+     * Displays information about the class name in arg[0].
+     *
+     * @param arg command-line arguments
+     * @throws Exception if an error occurs
+     */
+    public static void main(String[] arg) throws Exception {
+        if (arg.length < 1) {
+            throw new IllegalArgumentException("programm needs at least two =
parameters : the file where to put the result, and at least one fqn class to =
treate");
+        }
+        String firstarg =3D arg[0];
+        boolean toFile =3D false;
+        BufferedWriter w;
+        if (firstarg.startsWith("file:")) {
+            w =3D new BufferedWriter(new FileWriter(firstarg.substring(5)));
+            toFile =3D true;
+        } else {
+            w =3D new BufferedWriter(new OutputStreamWriter(System.out));
+        }
+
+        try {
+            JAXXCompiler.loadLibraries(false);
+            for (int i =3D toFile ? 1 : 0; i < arg.length; i++) {
+                String className =3D arg[i];
+                treateClass(w, className);
+            }
+        } finally {
+            w.flush();
+            w.close();
+        }
+
+    }
+
+    protected static void treateClass(BufferedWriter w, String className) th=
rows ClassNotFoundException, IOException {
+
+        ClassDescriptor beanClass =3D ClassDescriptorLoader.getClassDescript=
or(className);
+        DefaultObjectHandler handler =3D TagManager.getTagHandler(beanClass);
+
+        DefaultObjectHandler superHandler =3D TagManager.getTagHandler(beanC=
lass.getSuperclass());
+
+        // dump all bean properties
+        w.append("Properties in ").append(String.valueOf(beanClass));
+        w.newLine();
+        JAXXPropertyDescriptor[] properties =3D handler.getJAXXBeanInfo().ge=
tJAXXPropertyDescriptors();
+        JAXXPropertyDescriptor[] superProperties =3D superHandler.getJAXXBea=
nInfo().getJAXXPropertyDescriptors();
+        for (JAXXPropertyDescriptor property : properties) {
+            if (property.getWriteMethodDescriptor() =3D=3D null) {
+                continue;
+            }
+
+            boolean found =3D false;
+            String name =3D property.getName();
+            for (JAXXPropertyDescriptor superProperty : superProperties) {
+                if (superProperty.getName().equals(name)) {
+                    found =3D true;
+                    break;
+                }
+            }
+            if (!found) {
+                if (property.getPropertyType() =3D=3D null) {
+                    System.err.println(name + " has null type");
+                } else {
+                    w.append("{{EquivalentAttribute|");
+                    w.append(name);
+                    w.append("|");
+                    w.append(className.replace('.', '/'));
+                    w.append("|set");
+                    w.append(JAXXCompiler.capitalize(name));
+                    w.append("|");
+                    w.append(JAXXCompiler.getCanonicalName(property.getPrope=
rtyType()));
+                    w.append("}}");
+                    w.append("|-");
+                    w.newLine();
+                }
+            }
+        }
+
+        w.newLine();
+        w.newLine();
+
+        // dump all bound methods
+        dumpMethods(w, beanClass, handler);
+    }
+
+    protected static void dumpMethods(BufferedWriter w, ClassDescriptor bean=
Class, DefaultObjectHandler handler) throws IOException {
+        MethodDescriptor[] methods =3D beanClass.getMethodDescriptors();
+        w.append("Bound methods in ").append(String.valueOf(beanClass));
+        w.newLine();
+        for (MethodDescriptor method : methods) {
+            try {
+                if (handler.isMemberBound(method.getName())) {
+                    w.append("* <tt>").append(method.getName()).append("()</=
tt>");
+                    w.newLine();
+                }
+            } catch (Throwable e) {
+                // ignore ?
+            }
+        }
+    }
+}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/CompiledObj=
ect.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/CompiledObject.java=
	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/CompiledObject.j=
ava	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,487 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler;
-
-import jaxx.CompilerException;
-import jaxx.reflect.ClassDescriptor;
-import jaxx.reflect.ClassDescriptorLoader;
-import jaxx.reflect.MethodDescriptor;
-import jaxx.tags.DefaultComponentHandler;
-import jaxx.tags.TagHandler;
-import jaxx.tags.TagManager;
-import jaxx.types.TypeManager;
-
-import java.awt.Container;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-
-/**
- * Represents an object in the <code>.java</code> file being generated durin=
g compilation.  There is
- * a <code>CompiledObject</code> for each class tag encountered, and certain=
 tags may generate
- * additional objects for various reasons.
- */
-public class CompiledObject {
-    /** The object's id. */
-    private String id;
-
-    /** Java code referring to the object. */
-    private String javaCode;
-
-    /** The object's class. */
-    private ClassDescriptor objectClass;
-
-    /** The style class. */
-    private String styleClass;
-
-    /** The container containing this CompiledObject. */
-    private CompiledObject parent;
-
-    /** true if this object overrides an object of the same id in a supercla=
ss of the object being compiled */
-    private boolean override;
-
-    /**
-     * Comma-separated Java code snippets representing the parameters that s=
hould be passed to the object's
-     * constructor.
-     */
-    private String constructorParams;
-
-    /**
-     * Java code snippet which performs basic initialization of the object (=
after it has already been constructed).
-     * Because CompiledObject initialization order cannot be guaranteed, it =
is not safe to refer to other
-     * CompiledObjects from initializationCode -- you must refer to them fro=
m additionCode instead.
-     */
-    private StringBuffer initializationCode =3D new StringBuffer();
-
-    /**
-     * Java code snippet which completes setup by adding any child objects, =
or otherwise manipulates any refererenced
-     * objects.  Because CompiledObject initialization order cannot be guara=
nteed, it is not safe to refer to other
-     * CompiledObjects from initializationCode -- you must refer to them fro=
m additionCode instead.
-     */
-    private StringBuffer additionCode =3D new StringBuffer();
-
-    /** List of all registered event handlers. */
-    private List<EventHandler> eventHandlers =3D new ArrayList<EventHandler>=
();
-
-    /** All properties that have been applied to this CompiledObject. */
-    private Map<String, String> properties =3D new HashMap<String, String>();
-
-
-    /**
-     * Creates a new <code>CompiledObject</code>.  To be useful, the object =
should be registered with a
-     * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledO=
bject registerCompiledObject}.
-     *
-     * @param id          the object's id
-     * @param objectClass the object's class
-     * @param compiler    the current <code>JAXXCompiler</code>
-     * @throws NullPointerException if id or class is null
-     */
-    public CompiledObject(String id, ClassDescriptor objectClass, JAXXCompil=
er compiler) {
-        this(id, objectClass, compiler, false);
-    }
-
-
-    /**
-     * Creates a new <code>CompiledObject</code>.  To be useful, the object =
should be registered with a
-     * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledO=
bject registerCompiledObject}.
-     *
-     * @param id          the object's id
-     * @param objectClass the object's class
-     * @param compiler    the current <code>JAXXCompiler</code>
-     * @param force       <code>true</code> to force acceptance of invalid i=
ds
-     * @throws NullPointerException if id or class is null
-     */
-    public CompiledObject(String id, ClassDescriptor objectClass, JAXXCompil=
er compiler, boolean force) {
-        this(id, id, objectClass, compiler, force);
-    }
-
-
-    /**
-     * Creates a new <code>CompiledObject</code>.  To be useful, the object =
should be registered with a
-     * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledO=
bject registerCompiledObject}.
-     *
-     * @param id          the object's id
-     * @param javaCode    Java code referring to the object
-     * @param objectClass the object's class
-     * @param force       <code>true</code> to force acceptance of invalid i=
ds
-     * @param compiler    the current <code>JAXXCompiler</code>
-     * @throws CompilerException    if the id is not a valid Java identifier
-     * @throws NullPointerException if id or class is null
-     */
-    public CompiledObject(String id, String javaCode, ClassDescriptor object=
Class, JAXXCompiler compiler, boolean force) throws CompilerException {
-        if (!force) {
-            if (!isValidID(id)) {
-                compiler.reportError("the id '" + id + "' is not a valid Jav=
a identifier");
-            }
-        }
-        this.id =3D id;
-        this.javaCode =3D javaCode;
-
-        if (objectClass =3D=3D null) {
-            throw new NullPointerException();
-        }
-        this.objectClass =3D objectClass;
-    }
-
-
-    public static boolean isValidID(String id) {
-        boolean valid =3D true;
-        if (id.length() =3D=3D 0)
-            valid =3D false;
-        if (valid) {
-            if (!Character.isJavaIdentifierStart(id.charAt(0))) {
-                valid =3D false;
-            }
-            if (valid) {
-                for (int i =3D 1; i < id.length(); i++) {
-                    if (!Character.isJavaIdentifierPart(id.charAt(i))) {
-                        valid =3D false;
-                        break;
-                    }
-                }
-            }
-        }
-        return valid;
-    }
-
-
-    /**
-     * True if this object overrides an object in the superclass of the clas=
s being compiled.  For this to be true, the
-     * class currently being compiled must be a subclass of another <code>JA=
XXObject</code> which has an
-     * identically-named object.
-     *
-     * @return <code>true</code> if this object is an override
-     * @see #setOverride
-     */
-    public boolean isOverride() {
-        return override;
-    }
-
-
-    /**
-     * Sets whether this class overrides an identically-named object in the =
parent class.
-     *
-     * @param override <code>true</code> if this object is an override
-     * @see #isOverride
-     */
-    public void setOverride(boolean override) {
-        this.override =3D override;
-    }
-
-
-    /**
-     * Returns this object's CSS style class.
-     *
-     * @return the value of the <code>styleClass</code> attribute
-     */
-    public String getStyleClass() {
-        return styleClass;
-    }
-
-
-    /**
-     * Sets this object's CSS style class.
-     *
-     * @param styleClass the new style class
-     */
-    public void setStyleClass(String styleClass) {
-        this.styleClass =3D styleClass;
-    }
-
-
-    /**
-     * Returns this object's parent container.  Non-visual components (and t=
he root container) return <code>null</code>.
-     *
-     * @return the object's parent container
-     */
-    public CompiledObject getParent() {
-        return parent;
-    }
-
-
-    /**
-     * Sets this object's parent container.
-     *
-     * @param parent the parent container
-     */
-    public void setParent(CompiledObject parent) {
-        if (!ClassDescriptorLoader.getClassDescriptor(Container.class).isAss=
ignableFrom(parent.getObjectClass())) {
-            throw new IllegalArgumentException("parent must descend from jav=
a.awt.Container");
-        }
-        this.parent =3D parent;
-    }
-
-
-    /**
-     * Returns the name of the method that should be generated in the compil=
ed <code>.java</code> file
-     * in order to create this object.  This is just a suggestion and may be=
 ignored.
-     *
-     * @return the suggested name of the method which initializes this object
-     */
-    public String getCreationMethodName() {
-        return "create" + JAXXCompiler.capitalize(getId());
-    }
-
-
-    /**
-     * Returns the name of the method that should be generated in the compil=
ed <code>.java</code> file
-     * in order to add children to this object.  This is just a suggestion a=
nd may be ignored.
-     *
-     * @return the suggested name of the method which completes this object'=
s setup
-     */
-    public String getAdditionMethodName() {
-        return "addChildrenTo" + JAXXCompiler.capitalize(getId());
-    }
-
-
-    /**
-     * Returns the type of this object.
-     *
-     * @return the class this <code>CompiledObject</code> represents
-     */
-    public ClassDescriptor getObjectClass() {
-        return objectClass;
-    }
-
-
-    /**
-     * Returns this object's id.  Generally, a field with this name will be =
created in the compiled <code>.java</code>
-     * file in order to represent this object.
-     *
-     * @return the id used to refer to this object
-     */
-    public String getId() {
-        return id;
-    }
-
-
-    /**
-     * Returns Java code used to refer to this object in the compiled Java f=
ile.  This is usually the same as its
-     * id.
-     *
-     * @return the Java code for this object
-     */
-    public String getJavaCode() {
-        //if (isOverride()) // handle cases where object is overridden to be=
 a different class
-        //    return "((" + JAXXCompiler.getCanonicalName(getObjectClass()) =
+ ") " + javaCode + ")";
-        //else
-        //TODO Check if this is safe
-        return javaCode;
-    }
-
-
-    /**
-     * Returns a list of comma-separated Java code snippets that represent t=
he parameters to pass to this
-     * object's constructor.
-     *
-     * @return the raw constructor params
-     * @see #setConstructorParams
-     */
-    public String getConstructorParams() {
-        return constructorParams;
-    }
-
-
-    /**
-     * Sets the parameters to pass to this object's constructor.
-     *
-     * @param constructorParams comma-separated Java code snippets represent=
ing constructor params
-     * @see #getConstructorParams
-     */
-    public void setConstructorParams(String constructorParams) {
-        this.constructorParams =3D constructorParams;
-    }
-
-
-    /**
-     * Returns the code that performs basic initialization of this object, a=
fter it has already been constructed.
-     * This basic code should not reference any other <code>CompiledObjects<=
/code> as they may not have
-     * been created yet.
-     *
-     * @param compiler compiler to use
-     * @return the code which initializes this object
-     */
-    public String getInitializationCode(JAXXCompiler compiler) {
-        StringBuffer result =3D new StringBuffer(initializationCode.toString=
());
-        for (Object eventHandler : eventHandlers) {
-            EventHandler handler =3D (EventHandler) eventHandler;
-            result.append(getInitializationCode(handler, compiler));
-        }
-        return result.toString();
-    }
-
-
-    protected String getInitializationCode(EventHandler handler, JAXXCompile=
r compiler) {
-        MethodDescriptor addMethod =3D handler.getAddMethod();
-        ClassDescriptor listenerClass =3D addMethod.getParameterTypes()[0];
-        return getJavaCode() + '.' + addMethod.getName() + "((" + JAXXCompil=
er.getCanonicalName(listenerClass) +
-                ") jaxx.runtime.Util.getEventListener(" + JAXXCompiler.getCa=
nonicalName(listenerClass) + ".class, " +
-                TypeManager.getJavaCode(handler.getListenerMethod().getName(=
)) + ", " + compiler.getRootObject().getJavaCode() + ", " +
-                TypeManager.getJavaCode(compiler.getEventHandlerMethodName(h=
andler)) + "));" + JAXXCompiler.getLineSeparator();
-    }
-
-
-    /**
-     * Returns Java code to complete final setup on this object.  This code =
may reference other
-     * <code>CompiledObjects</code>, as they are guaranteed to have all been=
 created by this point.
-     *
-     * @return code which adds children and performs final setup
-     */
-    public String getAdditionCode() {
-        return additionCode.toString();
-    }
-
-
-    /**
-     * Appends code to the initialization code block.  A line separator is a=
utomatically appended to the end.
-     *
-     * @param code the code to add to the initialization block
-     * @see #getInitializationCode
-     */
-    public void appendInitializationCode(String code) {
-        this.initializationCode.append(code);
-        this.initializationCode.append(JAXXCompiler.getLineSeparator());
-    }
-
-
-    /**
-     * Appends code to the addition code block.  A line separator is automat=
ically appended to the end.
-     *
-     * @param code the code to add to the addition block
-     * @see #getAdditionCode
-     */
-    public void appendAdditionCode(String code) {
-        this.additionCode.append(code);
-        this.additionCode.append(JAXXCompiler.getLineSeparator());
-    }
-
-
-    /**
-     * Stores a property for this object.  The only effect of calling this m=
ethod is that the property will
-     * be returned by <code>getProperties()</code>.
-     *
-     * @param property the name of the property
-     * @param value    the property's value
-     * @see #getProperties
-     */
-    public void addProperty(String property, String value) {
-        properties.put(property, value);
-    }
-
-
-    /**
-     * Returns all properties which have been set for this object.
-     *
-     * @return a <code>Map</code> containing all properties defined for this=
 object
-     * @see #addProperty
-     */
-    public Map/*<String, String>*/ getProperties() {
-        return properties;
-    }
-
-
-    // TODO: remove this temporary method and complete switchover to MethodD=
escriptors
-    public void addEventHandler(String eventId, Method addMethod, Method lis=
tenerMethod, String code, JAXXCompiler compiler) {
-        try {
-            ClassDescriptor descriptor =3D ClassDescriptorLoader.getClassDes=
criptor(getObjectClass().getName());
-            String listenerClassName =3D addMethod.getParameterTypes()[0].ge=
tName();
-            ClassDescriptor listenerDescriptor =3D ClassDescriptorLoader.get=
ClassDescriptor(listenerClassName);
-            MethodDescriptor addMethodDescriptor =3D descriptor.getMethodDes=
criptor(addMethod.getName(), new ClassDescriptor[]{listenerDescriptor});
-            MethodDescriptor listenerMethodDescriptor =3D listenerDescriptor=
.getMethodDescriptor(listenerMethod.getName(), new ClassDescriptor[]{ClassDes=
criptorLoader.getClassDescriptor(listenerMethod.getParameterTypes()[0].getNam=
e())});
-            addEventHandler(eventId, addMethodDescriptor, listenerMethodDesc=
riptor, code, compiler);
-        }
-        catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-
-    /**
-     * Adds an event listener to this object.  The generated code will appea=
r in the initialization block.
-     *
-     * @param eventId        unique (per CompiledObject) identifier for the =
event handler
-     * @param addMethod      the method which adds the event listener
-     * @param listenerMethod the method (in the listener class) which is cal=
led when the event is fired
-     * @param code           the Java code for the listenerMethod's body
-     * @param compiler       the current <code>JAXXCompiler</code>
-     * @see #getInitializationCode
-     */
-    public void addEventHandler(String eventId, MethodDescriptor addMethod, =
MethodDescriptor listenerMethod, String code, JAXXCompiler compiler) {
-        EventHandler handler =3D new EventHandler(getId() + "." + eventId, g=
etJavaCode(), addMethod, addMethod.getParameterTypes()[0], listenerMethod, co=
de);
-        compiler.registerEventHandler(handler);
-        eventHandlers.add(handler);
-
-        if (getJavaCode().indexOf(".") !=3D -1) { // object lives in another=
 JAXX file and consequently its initialization code won't be output
-            compiler.initializer.append(getInitializationCode(handler, compi=
ler));
-        }
-    }
-
-
-    /**
-     * Adds a child component to this container.  The child is added without=
 layout constraints.
-     *
-     * @param child    the component to add
-     * @param compiler the current <code>JAXXCompiler</code>
-     * @throws CompilerException if this object is not a container
-     * @see #addChild(CompiledObject, String, JAXXCompiler)
-     */
-    public void addChild(CompiledObject child, JAXXCompiler compiler) throws=
 CompilerException {
-        addChild(child, null, compiler);
-    }
-
-
-    /**
-     * Adds a child component to this container.  This variant allows the Ja=
va code for a layout constraints
-     * object to be specified.
-     *
-     * @param child       the component to add
-     * @param constraints Java code for the layout constraints object
-     * @param compiler    the current <code>JAXXCompiler</code>
-     * @throws CompilerException if this object is not a container
-     * @see #addChild(CompiledObject, JAXXCompiler)
-     */
-    public void addChild(CompiledObject child, String constraints, JAXXCompi=
ler compiler) throws CompilerException {
-        try {
-            if (constraints !=3D null) {
-                constraints =3D compiler.checkJavaCode(constraints);
-            }
-        }
-        catch (CompilerException e) {
-            compiler.reportError("While parsing 'constraints' attribute: " +=
 e.getMessage());
-        }
-
-        if (!child.isOverride()) {
-            TagHandler tagHandler =3D TagManager.getTagHandler(getObjectClas=
s());
-            if (tagHandler instanceof DefaultComponentHandler && !((DefaultC=
omponentHandler) tagHandler).isContainer()) {
-                compiler.reportError("component " + this + " may not have ch=
ildren");
-            }
-
-            String containerDelegate =3D ((DefaultComponentHandler) tagHandl=
er).getContainerDelegate();
-            String delegateCode =3D containerDelegate !=3D null ? "." + cont=
ainerDelegate + "()" : "";
-
-            child.setParent(this);
-
-            if (constraints !=3D null) {
-                appendAdditionCode(getJavaCode() + delegateCode + ".add(" + =
child.getJavaCode() + ", " + constraints + ");");
-            }
-            else {
-                appendAdditionCode(getJavaCode() + delegateCode + ".add(" + =
child.getJavaCode() + ");");
-            }
-        }
-    }
-
-
-    public String toString() {
-        return getObjectClass().getName() + "[id=3D'" + id + "']";
-    }
-
-
-    public void registerDataBinding(String src, String property, String assi=
gnment, JAXXCompiler compiler) throws CompilerException {
-        compiler.registerDataBinding(src, getId() + "." + property, assignme=
nt);
-    }
-}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/CompiledObje=
ct.java (from rev 977, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/=
CompiledObject.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/CompiledObject.j=
ava	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/CompiledObject.j=
ava	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,519 @@
+/*
+ * Copyright 2006 Ethan Nicholas. All rights reserved.
+ * Use is subject to license terms.
+ */
+package jaxx.compiler;
+
+import jaxx.CompilerException;
+import jaxx.reflect.ClassDescriptor;
+import jaxx.reflect.ClassDescriptorLoader;
+import jaxx.reflect.MethodDescriptor;
+import jaxx.tags.DefaultComponentHandler;
+import jaxx.tags.TagHandler;
+import jaxx.tags.TagManager;
+import jaxx.types.TypeManager;
+
+import java.awt.Container;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * Represents an object in the <code>.java</code> file being generated durin=
g compilation.  There is
+ * a <code>CompiledObject</code> for each class tag encountered, and certain=
 tags may generate
+ * additional objects for various reasons.
+ */
+public class CompiledObject {
+    /** The object's id. */
+    private String id;
+
+    /** Java code referring to the object. */
+    private String javaCode;
+
+    /** The object's class. */
+    private ClassDescriptor objectClass;
+
+    /** The style class. */
+    private String styleClass;
+
+    /** The container containing this CompiledObject. */
+    private CompiledObject parent;
+
+    /** true if this object overrides an object of the same id in a supercla=
ss of the object being compiled */
+    private boolean override;
+
+    /**
+     * Comma-separated Java code snippets representing the parameters that s=
hould be passed to the object's
+     * constructor.
+     */
+    private String constructorParams;
+
+    /**
+     * Java code snippet which performs basic initialization of the object (=
after it has already been constructed).
+     * Because CompiledObject initialization order cannot be guaranteed, it =
is not safe to refer to other
+     * CompiledObjects from initializationCode -- you must refer to them fro=
m additionCode instead.
+     */
+    private StringBuffer initializationCode =3D new StringBuffer();
+
+    /**
+     * Java code snippet which completes setup by adding any child objects, =
or otherwise manipulates any refererenced
+     * objects.  Because CompiledObject initialization order cannot be guara=
nteed, it is not safe to refer to other
+     * CompiledObjects from initializationCode -- you must refer to them fro=
m additionCode instead.
+     */
+    private StringBuffer additionCode =3D new StringBuffer();
+
+    /** List of all registered event handlers. */
+    private List<EventHandler> eventHandlers =3D new ArrayList<EventHandler>=
();
+
+    /** All properties that have been applied to this CompiledObject. */
+    private Map<String, String> properties =3D new HashMap<String, String>();
+
+    /** generic types of the compiled object */
+    private String[] genericTypes;
+
+    /**
+     * Creates a new <code>CompiledObject</code>.  To be useful, the object =
should be registered with a
+     * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledO=
bject registerCompiledObject}.
+     *
+     * @param id          the object's id
+     * @param objectClass the object's class
+     * @param compiler    the current <code>JAXXCompiler</code>
+     * @throws NullPointerException if id or class is null
+     */
+    public CompiledObject(String id, ClassDescriptor objectClass, JAXXCompil=
er compiler) {
+        this(id, objectClass, compiler, false);
+    }
+
+
+    /**
+     * Creates a new <code>CompiledObject</code>.  To be useful, the object =
should be registered with a
+     * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledO=
bject registerCompiledObject}.
+     *
+     * @param id          the object's id
+     * @param objectClass the object's class
+     * @param compiler    the current <code>JAXXCompiler</code>
+     * @param force       <code>true</code> to force acceptance of invalid i=
ds
+     * @throws NullPointerException if id or class is null
+     */
+    public CompiledObject(String id, ClassDescriptor objectClass, JAXXCompil=
er compiler, boolean force) {
+        this(id, id, objectClass, compiler, force);
+    }
+
+
+    /**
+     * Creates a new <code>CompiledObject</code>.  To be useful, the object =
should be registered with a
+     * <code>JAXXCompiler</code> using {@link JAXXCompiler#registerCompiledO=
bject registerCompiledObject}.
+     *
+     * @param id          the object's id
+     * @param javaCode    Java code referring to the object
+     * @param objectClass the object's class
+     * @param force       <code>true</code> to force acceptance of invalid i=
ds
+     * @param compiler    the current <code>JAXXCompiler</code>
+     * @throws CompilerException    if the id is not a valid Java identifier
+     * @throws NullPointerException if id or class is null
+     */
+    public CompiledObject(String id, String javaCode, ClassDescriptor object=
Class, JAXXCompiler compiler, boolean force) throws CompilerException {
+        if (!force) {
+            if (!isValidID(id)) {
+                compiler.reportError("the id '" + id + "' is not a valid Jav=
a identifier");
+            }
+        }
+        this.id =3D id;
+        this.javaCode =3D javaCode;
+
+        if (objectClass =3D=3D null) {
+            throw new NullPointerException();
+        }
+        this.objectClass =3D objectClass;
+    }
+
+
+    public static boolean isValidID(String id) {
+        boolean valid =3D true;
+        if (id.length() =3D=3D 0) {
+            valid =3D false;
+        }
+        if (valid) {
+            if (!Character.isJavaIdentifierStart(id.charAt(0))) {
+                valid =3D false;
+            }
+            if (valid) {
+                for (int i =3D 1; i < id.length(); i++) {
+                    if (!Character.isJavaIdentifierPart(id.charAt(i))) {
+                        valid =3D false;
+                        break;
+                    }
+                }
+            }
+        }
+        return valid;
+    }
+
+
+    /**
+     * True if this object overrides an object in the superclass of the clas=
s being compiled.  For this to be true, the
+     * class currently being compiled must be a subclass of another <code>JA=
XXObject</code> which has an
+     * identically-named object.
+     *
+     * @return <code>true</code> if this object is an override
+     * @see #setOverride
+     */
+    public boolean isOverride() {
+        return override;
+    }
+
+
+    /**
+     * Sets whether this class overrides an identically-named object in the =
parent class.
+     *
+     * @param override <code>true</code> if this object is an override
+     * @see #isOverride
+     */
+    public void setOverride(boolean override) {
+        this.override =3D override;
+    }
+
+
+    /**
+     * Returns this object's CSS style class.
+     *
+     * @return the value of the <code>styleClass</code> attribute
+     */
+    public String getStyleClass() {
+        return styleClass;
+    }
+
+
+    /**
+     * Sets this object's CSS style class.
+     *
+     * @param styleClass the new style class
+     */
+    public void setStyleClass(String styleClass) {
+        this.styleClass =3D styleClass;
+    }
+
+
+    /**
+     * Returns this object's parent container.  Non-visual components (and t=
he root container) return <code>null</code>.
+     *
+     * @return the object's parent container
+     */
+    public CompiledObject getParent() {
+        return parent;
+    }
+
+
+    /**
+     * Sets this object's parent container.
+     *
+     * @param parent the parent container
+     */
+    public void setParent(CompiledObject parent) {
+        if (!ClassDescriptorLoader.getClassDescriptor(Container.class).isAss=
ignableFrom(parent.getObjectClass())) {
+            throw new IllegalArgumentException("parent must descend from jav=
a.awt.Container");
+        }
+        this.parent =3D parent;
+    }
+
+
+    /**
+     * Returns the name of the method that should be generated in the compil=
ed <code>.java</code> file
+     * in order to create this object.  This is just a suggestion and may be=
 ignored.
+     *
+     * @return the suggested name of the method which initializes this object
+     */
+    public String getCreationMethodName() {
+        return "create" + JAXXCompiler.capitalize(getId());
+    }
+
+
+    /**
+     * Returns the name of the method that should be generated in the compil=
ed <code>.java</code> file
+     * in order to add children to this object.  This is just a suggestion a=
nd may be ignored.
+     *
+     * @return the suggested name of the method which completes this object'=
s setup
+     */
+    public String getAdditionMethodName() {
+        return "addChildrenTo" + JAXXCompiler.capitalize(getId());
+    }
+
+
+    /**
+     * Returns the type of this object.
+     *
+     * @return the class this <code>CompiledObject</code> represents
+     */
+    public ClassDescriptor getObjectClass() {
+        return objectClass;
+    }
+
+
+    /**
+     * Returns this object's id.  Generally, a field with this name will be =
created in the compiled <code>.java</code>
+     * file in order to represent this object.
+     *
+     * @return the id used to refer to this object
+     */
+    public String getId() {
+        return id;
+    }
+
+
+    /**
+     * Returns Java code used to refer to this object in the compiled Java f=
ile.  This is usually the same as its
+     * id.
+     *
+     * @return the Java code for this object
+     */
+    public String getJavaCode() {
+        //if (isOverride()) // handle cases where object is overridden to be=
 a different class
+        //    return "((" + JAXXCompiler.getCanonicalName(getObjectClass()) =
+ ") " + javaCode + ")";
+        //else
+        //TODO Check if this is safe
+        return javaCode;
+    }
+
+
+    /**
+     * Returns a list of comma-separated Java code snippets that represent t=
he parameters to pass to this
+     * object's constructor.
+     *
+     * @return the raw constructor params
+     * @see #setConstructorParams
+     */
+    public String getConstructorParams() {
+        return constructorParams;
+    }
+
+
+    /**
+     * Sets the parameters to pass to this object's constructor.
+     *
+     * @param constructorParams comma-separated Java code snippets represent=
ing constructor params
+     * @see #getConstructorParams
+     */
+    public void setConstructorParams(String constructorParams) {
+        this.constructorParams =3D constructorParams;
+    }
+
+
+    /**
+     * Returns the code that performs basic initialization of this object, a=
fter it has already been constructed.
+     * This basic code should not reference any other <code>CompiledObjects<=
/code> as they may not have
+     * been created yet.
+     *
+     * @param compiler compiler to use
+     * @return the code which initializes this object
+     */
+    public String getInitializationCode(JAXXCompiler compiler) {
+        StringBuffer result =3D new StringBuffer(initializationCode.toString=
());
+        for (Object eventHandler : eventHandlers) {
+            EventHandler handler =3D (EventHandler) eventHandler;
+            result.append(getInitializationCode(handler, compiler));
+        }
+        return result.toString();
+    }
+
+
+    protected String getInitializationCode(EventHandler handler, JAXXCompile=
r compiler) {
+        MethodDescriptor addMethod =3D handler.getAddMethod();
+        ClassDescriptor listenerClass =3D addMethod.getParameterTypes()[0];
+        return getJavaCode() + '.' + addMethod.getName() + "((" + JAXXCompil=
er.getCanonicalName(listenerClass) +
+                ") jaxx.runtime.Util.getEventListener(" + JAXXCompiler.getCa=
nonicalName(listenerClass) + ".class, " +
+                TypeManager.getJavaCode(handler.getListenerMethod().getName(=
)) + ", " + compiler.getRootObject().getJavaCode() + ", " +
+                TypeManager.getJavaCode(compiler.getEventHandlerMethodName(h=
andler)) + "));" + JAXXCompiler.getLineSeparator();
+    }
+
+
+    /**
+     * Returns Java code to complete final setup on this object.  This code =
may reference other
+     * <code>CompiledObjects</code>, as they are guaranteed to have all been=
 created by this point.
+     *
+     * @return code which adds children and performs final setup
+     */
+    public String getAdditionCode() {
+        return additionCode.toString();
+    }
+
+
+    /**
+     * Appends code to the initialization code block.  A line separator is a=
utomatically appended to the end.
+     *
+     * @param code the code to add to the initialization block
+     * @see #getInitializationCode
+     */
+    public void appendInitializationCode(String code) {
+        this.initializationCode.append(code);
+        this.initializationCode.append(JAXXCompiler.getLineSeparator());
+    }
+
+
+    /**
+     * Appends code to the addition code block.  A line separator is automat=
ically appended to the end.
+     *
+     * @param code the code to add to the addition block
+     * @see #getAdditionCode
+     */
+    public void appendAdditionCode(String code) {
+        this.additionCode.append(code);
+        this.additionCode.append(JAXXCompiler.getLineSeparator());
+    }
+
+
+    /**
+     * Stores a property for this object.  The only effect of calling this m=
ethod is that the property will
+     * be returned by <code>getProperties()</code>.
+     *
+     * @param property the name of the property
+     * @param value    the property's value
+     * @see #getProperties
+     */
+    public void addProperty(String property, String value) {
+        properties.put(property, value);
+    }
+
+
+    /**
+     * Returns all properties which have been set for this object.
+     *
+     * @return a <code>Map</code> containing all properties defined for this=
 object
+     * @see #addProperty
+     */
+    public Map/*<String, String>*/ getProperties() {
+        return properties;
+    }
+
+
+    // TODO: remove this temporary method and complete switchover to MethodD=
escriptors
+    public void addEventHandler(String eventId, Method addMethod, Method lis=
tenerMethod, String code, JAXXCompiler compiler) {
+        try {
+            ClassDescriptor descriptor =3D ClassDescriptorLoader.getClassDes=
criptor(getObjectClass().getName());
+            String listenerClassName =3D addMethod.getParameterTypes()[0].ge=
tName();
+            ClassDescriptor listenerDescriptor =3D ClassDescriptorLoader.get=
ClassDescriptor(listenerClassName);
+            MethodDescriptor addMethodDescriptor =3D descriptor.getMethodDes=
criptor(addMethod.getName(), new ClassDescriptor[]{listenerDescriptor});
+            MethodDescriptor listenerMethodDescriptor =3D listenerDescriptor=
.getMethodDescriptor(listenerMethod.getName(), new ClassDescriptor[]{ClassDes=
criptorLoader.getClassDescriptor(listenerMethod.getParameterTypes()[0].getNam=
e())});
+            addEventHandler(eventId, addMethodDescriptor, listenerMethodDesc=
riptor, code, compiler);
+        }
+        catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+
+    /**
+     * Adds an event listener to this object.  The generated code will appea=
r in the initialization block.
+     *
+     * @param eventId        unique (per CompiledObject) identifier for the =
event handler
+     * @param addMethod      the method which adds the event listener
+     * @param listenerMethod the method (in the listener class) which is cal=
led when the event is fired
+     * @param code           the Java code for the listenerMethod's body
+     * @param compiler       the current <code>JAXXCompiler</code>
+     * @see #getInitializationCode
+     */
+    public void addEventHandler(String eventId, MethodDescriptor addMethod, =
MethodDescriptor listenerMethod, String code, JAXXCompiler compiler) {
+        EventHandler handler =3D new EventHandler(getId() + "." + eventId, g=
etJavaCode(), addMethod, addMethod.getParameterTypes()[0], listenerMethod, co=
de);
+        compiler.registerEventHandler(handler);
+        eventHandlers.add(handler);
+
+        if (getJavaCode().indexOf(".") !=3D -1) { // object lives in another=
 JAXX file and consequently its initialization code won't be output
+            compiler.appendInitializerCode(getInitializationCode(handler, co=
mpiler));
+        }
+    }
+
+
+    /**
+     * Adds a child component to this container.  The child is added without=
 layout constraints.
+     *
+     * @param child    the component to add
+     * @param compiler the current <code>JAXXCompiler</code>
+     * @throws CompilerException if this object is not a container
+     * @see #addChild(CompiledObject, String, JAXXCompiler)
+     */
+    public void addChild(CompiledObject child, JAXXCompiler compiler) throws=
 CompilerException {
+        addChild(child, null, compiler);
+    }
+
+
+    /**
+     * Adds a child component to this container.  This variant allows the Ja=
va code for a layout constraints
+     * object to be specified.
+     *
+     * @param child       the component to add
+     * @param constraints Java code for the layout constraints object
+     * @param compiler    the current <code>JAXXCompiler</code>
+     * @throws CompilerException if this object is not a container
+     * @see #addChild(CompiledObject, JAXXCompiler)
+     */
+    public void addChild(CompiledObject child, String constraints, JAXXCompi=
ler compiler) throws CompilerException {
+        try {
+            if (constraints !=3D null) {
+                constraints =3D compiler.checkJavaCode(constraints);
+            }
+        }
+        catch (CompilerException e) {
+            compiler.reportError("While parsing 'constraints' attribute: " +=
 e.getMessage());
+        }
+
+        if (!child.isOverride()) {
+            TagHandler tagHandler =3D TagManager.getTagHandler(getObjectClas=
s());
+            if (tagHandler instanceof DefaultComponentHandler && !((DefaultC=
omponentHandler) tagHandler).isContainer()) {
+                compiler.reportError("component " + this + " may not have ch=
ildren");
+            }
+
+            String containerDelegate =3D ((DefaultComponentHandler) tagHandl=
er).getContainerDelegate();
+            String delegateCode =3D containerDelegate !=3D null ? "." + cont=
ainerDelegate + "()" : "";
+
+            child.setParent(this);
+            String javaCode =3D child.getJavaCode();
+            if (compiler.hasValidator()) {
+                // some validators are defined on this object
+                boolean found =3D compiler.isComponentUsedByValidator(child.=
getId());
+                if (found) {
+                    // box the child component in a JxLayer
+                    javaCode =3D "jaxx.runtime.Util.boxComponentWithJxLayer(=
" + javaCode + ")";
+                }
+            }
+
+            if (constraints !=3D null) {
+                appendAdditionCode(getJavaCode() + delegateCode + ".add(" + =
javaCode + ", " + constraints + ");");
+            } else {
+                appendAdditionCode(getJavaCode() + delegateCode + ".add(" + =
javaCode + ");");
+            }
+        }
+    }
+
+    @Override
+    public String toString() {
+        return getObjectClass().getName() + "[id=3D'" + id + "']";
+    }
+
+
+    public void registerDataBinding(String src, String property, String assi=
gnment, JAXXCompiler compiler) throws CompilerException {
+        compiler.registerDataBinding(src, getId() + "." + property, assignme=
nt);
+    }
+
+    /** @return the array of generic types of the compiled object, or a empt=
y array if none defined */
+    public ClassDescriptor[] getGenericTypes() {
+        if (genericTypes =3D=3D null) {
+            return new ClassDescriptor[0];
+        }
+        try {
+            ClassDescriptor[] result =3D new ClassDescriptor[genericTypes.le=
ngth];
+            for (int i =3D 0; i < result.length; i++) {
+                result[i] =3D ClassDescriptorLoader.getClassDescriptor(gener=
icTypes[i], getObjectClass().getClassLoader());
+            }
+            return result;
+        }
+        catch (ClassNotFoundException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public void setGenericTypes(String[] genericTypes) {
+        this.genericTypes =3D genericTypes;
+    }
+}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/DataBinding=
.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/DataBinding.java	20=
08-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/DataBinding.java=
	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,78 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler;
-
-import jaxx.CompilerException;
-import jaxx.types.TypeManager;
-
-/**
- * Represents a data binding in a JAXX file.  <code>DataBinding</code> uses =
{@link DataSource} to
- * track changes to a source expression and update the destination.
- */
-public class DataBinding {
-    private String id;
-
-    /** The DatSource which tracks source expression changes. */
-    private DataSource dataSource;
-
-    /** The data binding destination in the form <code>&lt;id&gt;.&lt;proper=
tyName&gt;</code>. */
-    private String dest;
-
-    /**
-     * A Java snippet which will cause the destination property to be update=
d with the current value of
-     * the binding.
-     */
-    private String assignment;
-
-    /** The current <code>JAXXCompiler</code>. */
-    private JAXXCompiler compiler;
-
-
-    /**
-     * Creates a new data binding.
-     *
-     * @param source     the Java source code for the data binding expression
-     * @param dest       the data binding destination in the form <code>&lt;=
id&gt;.&lt;propertyName&gt;</code>
-     * @param assignment Java snippet which will cause the destination prope=
rty to be updated with the current value of the binding
-     * @param compiler   the current <code>JAXXCompiler</code>
-     */
-    public DataBinding(String source, String dest, String assignment, JAXXCo=
mpiler compiler) {
-        this.id =3D dest;
-        this.dataSource =3D new DataSource(id, source, compiler);
-        this.dest =3D dest;
-        this.assignment =3D assignment;
-        this.compiler =3D compiler;
-    }
-
-
-    public String getId() {
-        return id;
-    }
-
-
-    /**
-     * Compiles the data binding expression.  This method calls methods in <=
code>JAXXCompiler</code>
-     * to add the Java code that performs the data binding setup.
-     *
-     * @param quickNoDependencies true to optimize bindings with no dependen=
cies by simply running them at startup time
-     * @return <code>true</code> if the expression has dependencies, <code>f=
alse</code> otherwise
-     * @throws CompilerException if a compilation error occurs
-     */
-    public boolean compile(boolean quickNoDependencies) throws CompilerExcep=
tion {
-        // DataSource.compile handles all of the listener additions
-        boolean result =3D dataSource.compile("new jaxx.runtime.DataBindingL=
istener(" + compiler.getRootObject().getJavaCode() + ", " + TypeManager.getJa=
vaCode(id) + ")");
-
-        if (!result && quickNoDependencies) {
-            if (!dest.endsWith(".layout")) // layout is specially handled ea=
rly in the chain
-                compiler.initDataBindings.append(assignment).append(JAXXComp=
iler.getLineSeparator());
-            return false; // no dependencies, just a static expression
-        } else {
-            if (compiler.processDataBinding.length() > 0)
-                compiler.processDataBinding.append("else ");
-            compiler.processDataBinding.append("if ($dest.equals(").append(T=
ypeManager.getJavaCode(id)).append(")) { ").append(assignment).append("}\n").=
append(JAXXCompiler.getLineSeparator());
-            return true;
-        }
-    }
-}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/DataBinding.=
java (from rev 977, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/Dat=
aBinding.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/DataBinding.java=
	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/DataBinding.java=
	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2006 Ethan Nicholas. All rights reserved.
+ * Use is subject to license terms.
+ */
+package jaxx.compiler;
+
+import jaxx.CompilerException;
+import jaxx.types.TypeManager;
+
+/**
+ * Represents a data binding in a JAXX file.  <code>DataBinding</code> uses =
{@link DataSource} to
+ * track changes to a source expression and update the destination.
+ */
+public class DataBinding {
+    private String id;
+
+    /** The DatSource which tracks source expression changes. */
+    private DataSource dataSource;
+
+    /** The data binding destination in the form <code>&lt;id&gt;.&lt;proper=
tyName&gt;</code>. */
+    private String dest;
+
+    /**
+     * A Java snippet which will cause the destination property to be update=
d with the current value of
+     * the binding.
+     */
+    private String assignment;
+
+    /** The current <code>JAXXCompiler</code>. */
+    private JAXXCompiler compiler;
+
+
+    /**
+     * Creates a new data binding.
+     *
+     * @param source     the Java source code for the data binding expression
+     * @param dest       the data binding destination in the form <code>&lt;=
id&gt;.&lt;propertyName&gt;</code>
+     * @param assignment Java snippet which will cause the destination prope=
rty to be updated with the current value of the binding
+     * @param compiler   the current <code>JAXXCompiler</code>
+     */
+    public DataBinding(String source, String dest, String assignment, JAXXCo=
mpiler compiler) {
+        this.id =3D dest;
+        this.dataSource =3D new DataSource(id, source, compiler);
+        this.dest =3D dest;
+        this.assignment =3D assignment;
+        this.compiler =3D compiler;
+    }
+
+
+    public String getId() {
+        return id;
+    }
+
+
+    /**
+     * Compiles the data binding expression.  This method calls methods in <=
code>JAXXCompiler</code>
+     * to add the Java code that performs the data binding setup.
+     *
+     * @param quickNoDependencies true to optimize bindings with no dependen=
cies by simply running them at startup time
+     * @return <code>true</code> if the expression has dependencies, <code>f=
alse</code> otherwise
+     * @throws CompilerException if a compilation error occurs
+     */
+    public boolean compile(boolean quickNoDependencies) throws CompilerExcep=
tion {
+        // DataSource.compile handles all of the listener additions
+        boolean result =3D dataSource.compile("new jaxx.runtime.DataBindingL=
istener(" + compiler.getRootObject().getJavaCode() + ", " + TypeManager.getJa=
vaCode(id) + ")");
+
+        if (!result && quickNoDependencies) {
+            if (!dest.endsWith(".layout")) // layout is specially handled ea=
rly in the chain
+                compiler.appendInitDataBindings(assignment+ JAXXCompiler.get=
LineSeparator());
+            return false; // no dependencies, just a static expression
+        }
+        if (compiler.haveProcessDataBinding()) {
+            compiler.appendProcessDataBinding("else ");
+        }
+        compiler.appendProcessDataBinding("if ($dest.equals(" + TypeManager.=
getJavaCode(id) + ")) { " + assignment + "}\n" + JAXXCompiler.getLineSeparato=
r());       =20
+        return true;
+    }
+}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/DataSource.=
java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/DataSource.java	200=
8-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/DataSource.java	=
2008-10-21 07:31:05 UTC (rev 990)
@@ -1,408 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler;
-
-import jaxx.CompilerException;
-import jaxx.UnsupportedAttributeException;
-import jaxx.parser.JavaParser;
-import jaxx.parser.JavaParserConstants;
-import jaxx.parser.JavaParserTreeConstants;
-import jaxx.parser.SimpleNode;
-import jaxx.reflect.ClassDescriptor;
-import jaxx.reflect.ClassDescriptorLoader;
-import jaxx.reflect.FieldDescriptor;
-import jaxx.reflect.MethodDescriptor;
-import jaxx.tags.DefaultObjectHandler;
-import jaxx.tags.TagManager;
-import jaxx.types.TypeManager;
-
-import java.beans.Introspector;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Represents a Java expression which fires a <code>PropertyChangeEvent</cod=
e> when it can be
- * determined that its value may have changed.  Events are fired on a "best =
effort" basis, and events
- * may either be fired too often (the value has not actually changed) or not=
 often enough (the value
- * changed but no event was fired).
- */
-public class DataSource {
-    private class NULL {
-    } // type attached to "null" constants in parsed expressions
-
-    private String id;
-
-    /** The Java source code for the expression. */
-    private String source;
-
-    /** The current <code>JAXXCompiler</code>. */
-    private JAXXCompiler compiler;
-
-    /** List of symbols which this data source expression depends on. */
-    private List<String> dependencySymbols =3D new ArrayList<String>();
-
-    private StringBuffer addListenerCode =3D new StringBuffer();
-    private StringBuffer removeListenerCode =3D new StringBuffer();
-    private boolean compiled;
-
-
-    /**
-     * Creates a new data source.  After creating a <code>DataSource</code>,=
 use {@link #compile}
-     * to cause it to function at runtime.
-     *
-     * @param id       the DataSource's id
-     * @param source   the Java source code for the data source expression
-     * @param compiler the current <code>JAXXCompiler</code>
-     */
-    public DataSource(String id, String source, JAXXCompiler compiler) {
-        this.id =3D id;
-        this.source =3D source;
-        this.compiler =3D compiler;
-    }
-
-
-    public String getId() {
-        return id;
-    }
-
-    /**
-     * Compiles the data source expression and listener.  This method calls =
methods in <code>JAXXCompiler</code>
-     * to add the Java code that performs the data source setup.  Adding lis=
teners to <code>DataSource</code> is
-     * slightly more complicated than with ordinary classes, because <code>D=
ataSource</code> only exists at compile
-     * time.  You must pass in a Java expression which evaluates to  a <code=
>PropertyChangeListener</code>;  this
-     * expression will be compiled and evaluated at runtime to yield the <co=
de>DataSource's</code> listener.
-     *
-     * @param propertyChangeListenerCode Java code snippet which evaluates t=
o a <code>PropertyChangeListener</code>
-     * @return <code>true</code> if the expression has dependencies, <code>f=
alse</code> otherwise
-     * @throws CompilerException if a compilation error occurs
-     */
-    public boolean compile(String propertyChangeListenerCode) throws Compile=
rException {
-        if (compiled)
-            throw new IllegalStateException(this + " has already been compil=
ed");
-        String id =3D compiler.getAutoId(ClassDescriptorLoader.getClassDescr=
iptor(getClass()));
-        JavaParser p =3D new JavaParser(new StringReader(source + ";"));
-        while (!p.Line()) {
-            SimpleNode node =3D p.popNode();
-            scanNode(node, id);
-        }
-
-        if (dependencySymbols.size() > 0)
-            compiler.bodyCode.append("private PropertyChangeListener ").appe=
nd(id).append(" =3D ").append(propertyChangeListenerCode).append(";\n");
-
-        compileListeners();
-        compiled =3D true;
-
-        return dependencySymbols.size() > 0;
-    }
-
-    /** @return a list of symbols on which this data source depends. */
-    public Collection<String> getDependencies() {
-        return Collections.unmodifiableList(dependencySymbols);
-    }
-
-    /**
-     * Examines a node to identify any dependencies it contains.
-     *
-     * @param node       node to scan
-     * @param listenerId id of listener
-     * @throws jaxx.CompilerException ?
-     */
-    private void scanNode(SimpleNode node, String listenerId) throws Compile=
rException {
-        switch (node.getId()) {
-            case JavaParserTreeConstants.JJTMETHODDECLARATION:
-                break;
-            case JavaParserTreeConstants.JJTFIELDDECLARATION:
-                break;
-
-            default:
-                int count =3D node.jjtGetNumChildren();
-                for (int i =3D 0; i < count; i++)
-                    scanNode(node.getChild(i), listenerId);
-                determineNodeType(node, listenerId);
-        }
-    }
-
-    private ClassDescriptor determineLiteralType(SimpleNode node) {
-        assert node.getId() =3D=3D JavaParserTreeConstants.JJTLITERAL;
-        if (node.jjtGetNumChildren() =3D=3D 1) {
-            int id =3D node.getChild(0).getId();
-            if (id =3D=3D JavaParserTreeConstants.JJTBOOLEANLITERAL)
-                return ClassDescriptorLoader.getClassDescriptor(boolean.clas=
s);
-            else if (id =3D=3D JavaParserTreeConstants.JJTNULLLITERAL)
-                return ClassDescriptorLoader.getClassDescriptor(NULL.class);
-            else
-                throw new RuntimeException("Expected BooleanLiteral or NullL=
iteral, found " + JavaParserTreeConstants.jjtNodeName[id]);
-        } else {
-            int id =3D node.firstToken.kind;
-            switch (id) {
-                case JavaParserConstants.INTEGER_LITERAL:
-                    if (node.firstToken.image.toLowerCase().endsWith("l"))
-                        return ClassDescriptorLoader.getClassDescriptor(long=
.class);
-                    else
-                        return ClassDescriptorLoader.getClassDescriptor(int.=
class);
-                case JavaParserConstants.CHARACTER_LITERAL:
-                    return ClassDescriptorLoader.getClassDescriptor(char.cla=
ss);
-                case JavaParserConstants.FLOATING_POINT_LITERAL:
-                    if (node.firstToken.image.toLowerCase().endsWith("f"))
-                        return ClassDescriptorLoader.getClassDescriptor(floa=
t.class);
-                    else
-                        return ClassDescriptorLoader.getClassDescriptor(doub=
le.class);
-                case JavaParserConstants.STRING_LITERAL:
-                    return ClassDescriptorLoader.getClassDescriptor(String.c=
lass);
-                default:
-                    throw new RuntimeException("Expected literal token, foun=
d " + JavaParserConstants.tokenImage[id]);
-            }
-        }
-    }
-
-    /**
-     * Scans through a compound symbol (foo.bar.baz) to identify and track a=
ll trackable pieces of it.
-     *
-     * @param symbol       symbol to scan
-     * @param contextClass
-     * @param isMethod
-     * @param listenerId
-     * @return the type of the symbol (or null if it could not be determined=
).
-     */
-    private ClassDescriptor scanCompoundSymbol(String symbol, ClassDescripto=
r contextClass, boolean isMethod, String listenerId) {
-        String[] tokens =3D symbol.split("\\s*\\.\\s*");
-        StringBuffer currentSymbol =3D new StringBuffer();
-        StringBuffer tokensSeenSoFar =3D new StringBuffer();
-        boolean accepted =3D true; // if this ends up false, it means we wer=
en't able to figure out
-        // which object the method is being invoked on
-        boolean recognizeClassNames =3D true;
-        for (int j =3D 0; j < tokens.length - (isMethod ? 1 : 0); j++) {
-            accepted =3D false;
-
-            if (tokensSeenSoFar.length() > 0)
-                tokensSeenSoFar.append('.');
-            tokensSeenSoFar.append(tokens[j]);
-            if (currentSymbol.length() > 0)
-                currentSymbol.append('.');
-            currentSymbol.append(tokens[j]);
-
-            if (currentSymbol.indexOf(".") =3D=3D -1) {
-                String memberName =3D currentSymbol.toString();
-                CompiledObject object =3D compiler.getCompiledObject(memberN=
ame);
-                if (object !=3D null) {
-                    contextClass =3D object.getObjectClass();
-                    currentSymbol.setLength(0);
-                    accepted =3D true;
-                    recognizeClassNames =3D false;
-                } else {
-                    try {
-                        FieldDescriptor field =3D contextClass.getFieldDescr=
iptor(memberName);
-                        trackMemberIfPossible(tokensSeenSoFar.toString(), co=
ntextClass, field.getName(), false, listenerId);
-                        contextClass =3D field.getType();
-                        currentSymbol.setLength(0);
-                        accepted =3D true;
-                        recognizeClassNames =3D false;
-                    }
-                    catch (NoSuchFieldException e) {
-                        if (j =3D=3D 0 || j =3D=3D 1 && tokens[0].equals(com=
piler.getRootObject().getId())) { // still in root context
-                            FieldDescriptor[] newFields =3D compiler.getScri=
ptFields();
-                            for (FieldDescriptor newField : newFields) {
-                                if (newField.getName().equals(memberName)) {
-                                    addListener(tokensSeenSoFar.toString(),
-                                            null,
-                                            "addPropertyChangeListener(\"" +=
 memberName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator(),
-                                            "removePropertyChangeListener(\"=
" + memberName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator()=
);
-                                    contextClass =3D newField.getType();
-                                    assert contextClass !=3D null : "script =
field '" + memberName + "' is defined, but has type null";
-                                    currentSymbol.setLength(0);
-                                    accepted =3D true;
-                                    recognizeClassNames =3D false;
-                                    break;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-            if (currentSymbol.length() > 0 && recognizeClassNames) {
-                contextClass =3D TagManager.resolveClass(currentSymbol.toStr=
ing(), compiler);
-                if (contextClass !=3D null) {
-                    currentSymbol.setLength(0);
-                    //accepted =3D true;
-                    //recognizeClassNames =3D false;
-                    // TODO: for now we don't handle statics
-                    return null;
-                }
-            }
-            if (!accepted)
-                return null;
-        }
-
-        return contextClass;
-    }
-
-    /**
-     * Adds type information to nodes where possible, and as a side effect a=
dds event listeners to nodes which
-     * can be tracked.
-     *
-     * @param expression
-     * @param listenerId
-     * @return
-     */
-    private ClassDescriptor determineExpressionType(SimpleNode expression, S=
tring listenerId) {
-        assert expression.getId() =3D=3D JavaParserTreeConstants.JJTPRIMARYE=
XPRESSION;
-        SimpleNode prefix =3D expression.getChild(0);
-        if (prefix.jjtGetNumChildren() =3D=3D 1) {
-            int type =3D prefix.getChild(0).getId();
-            if (type =3D=3D JavaParserTreeConstants.JJTLITERAL || type =3D=
=3D JavaParserTreeConstants.JJTEXPRESSION)
-                prefix.setJavaType(prefix.getChild(0).getJavaType());
-            else
-            if (type =3D=3D JavaParserTreeConstants.JJTNAME && expression.jj=
tGetNumChildren() =3D=3D 1) // name with no arguments after it
-                prefix.setJavaType(scanCompoundSymbol(prefix.getText().trim(=
), compiler.getRootObject().getObjectClass(), false, listenerId));
-        }
-
-        if (expression.jjtGetNumChildren() =3D=3D 1) {
-            return prefix.getJavaType();
-        }
-
-        ClassDescriptor contextClass =3D prefix.getJavaType();
-        if (contextClass =3D=3D null)
-            contextClass =3D compiler.getRootObject().getObjectClass();
-        String lastNode =3D prefix.getText().trim();
-
-        for (int i =3D 1; i < expression.jjtGetNumChildren(); i++) {
-            SimpleNode suffix =3D expression.getChild(i);
-            if (suffix.jjtGetNumChildren() =3D=3D 1 && suffix.getChild(0).ge=
tId() =3D=3D JavaParserTreeConstants.JJTARGUMENTS) {
-                if (suffix.getChild(0).jjtGetNumChildren() =3D=3D 0) { // at=
 the moment only no-argument methods are trackable
-                    contextClass =3D scanCompoundSymbol(lastNode, contextCla=
ss, true, listenerId);
-                    if (contextClass =3D=3D null)
-                        return null;
-                    int dotPos =3D lastNode.lastIndexOf(".");
-                    String objectCode =3D dotPos =3D=3D -1 ? "" : lastNode.s=
ubstring(0, dotPos);
-                    for (int j =3D i - 2; j >=3D 0; j--)
-                        objectCode =3D expression.getChild(j).getText() + ob=
jectCode;
-                    if (objectCode.length() =3D=3D 0)
-                        objectCode =3D compiler.getRootObject().getJavaCode(=
);
-                    String methodName =3D lastNode.substring(dotPos + 1).tri=
m();
-                    try {
-                        MethodDescriptor method =3D contextClass.getMethodDe=
scriptor(methodName, new ClassDescriptor[0]);
-                        trackMemberIfPossible(objectCode, contextClass, meth=
od.getName(), true, listenerId);
-                        return method.getReturnType();
-                    }
-                    catch (NoSuchMethodException e) {
-                        // happens for methods defined in the current JAXX f=
ile via scripts
-                        String propertyName =3D null;
-                        if (methodName.startsWith("is"))
-                            propertyName =3D Introspector.decapitalize(metho=
dName.substring("is".length()));
-                        else if (methodName.startsWith("get"))
-                            propertyName =3D Introspector.decapitalize(metho=
dName.substring("get".length()));
-                        if (propertyName !=3D null) {
-                            MethodDescriptor[] newMethods =3D compiler.getSc=
riptMethods();
-                            for (MethodDescriptor newMethod : newMethods) {
-                                if (newMethod.getName().equals(methodName)) {
-                                    addListener(compiler.getRootObject().get=
Id(),
-                                            null,
-                                            "addPropertyChangeListener(\"" +=
 propertyName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator(),
-                                            "removePropertyChangeListener(\"=
" + propertyName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator=
());
-                                    contextClass =3D newMethod.getReturnType=
();
-                                    break;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-            lastNode =3D suffix.getText().trim();
-            if (lastNode.startsWith("."))
-                lastNode =3D lastNode.substring(1);
-        }
-
-        return null;
-    }
-
-    private void trackMemberIfPossible(String objectCode, ClassDescriptor ob=
jectClass, String memberName, boolean method, String listenerId) {
-        if (objectClass.isInterface()) // might be technically possible to t=
rack in some cases, but for now
-            return;                    // we can't create a DefaultObjectHan=
dler for interfaces
-
-        DefaultObjectHandler handler =3D TagManager.getTagHandler(objectClas=
s);
-        try {
-            if (handler.isMemberBound(memberName)) {
-                addListener(objectCode + "." + memberName + (method ? "()" :=
 ""),
-                        objectCode,
-                        handler.getAddMemberListenerCode(objectCode, id, mem=
berName, listenerId, compiler),
-                        handler.getRemoveMemberListenerCode(objectCode, id, =
memberName, listenerId, compiler));
-            }
-        }
-        catch (UnsupportedAttributeException e) {
-            // ignore -- this is thrown for methods like toString(), for whi=
ch there is no tracking and
-            // no setting support
-        }
-    }
-
-    /**
-     * Adds type information to nodes where possible, and as a side effect a=
dds event listeners to nodes which
-     * can be tracked.
-     *
-     * @param node       node to scan
-     * @param listenerId
-     */
-    private void determineNodeType(SimpleNode node, String listenerId) {
-        ClassDescriptor type =3D null;
-        if (node.jjtGetNumChildren() =3D=3D 1)
-            type =3D node.getChild(0).getJavaType();
-        switch (node.getId()) {
-            case JavaParserTreeConstants.JJTCLASSORINTERFACETYPE:
-                type =3D ClassDescriptorLoader.getClassDescriptor(Class.clas=
s);
-                break;
-            case JavaParserTreeConstants.JJTPRIMARYEXPRESSION:
-                type =3D determineExpressionType(node, listenerId);
-                break;
-            case JavaParserTreeConstants.JJTLITERAL:
-                type =3D determineLiteralType(node);
-                break;
-            case JavaParserTreeConstants.JJTCASTEXPRESSION:
-                type =3D TagManager.resolveClass(node.getChild(0).getText(),=
 compiler);
-                break;
-        }
-        node.setJavaType(type);
-    }
-
-    private void addListener(String dependencySymbol, String objectCode, Str=
ing addCode, String removeCode) {
-        if (!dependencySymbols.contains(dependencySymbol)) {
-            dependencySymbols.add(dependencySymbol);
-            if (objectCode !=3D null) {
-                addListenerCode.append("if (").append(objectCode).append(" !=
=3D null) {").append(JAXXCompiler.getLineSeparator());
-                addListenerCode.append("    ");
-            }
-            addListenerCode.append(addCode);
-            if (objectCode !=3D null)
-                addListenerCode.append("}");
-
-            if (objectCode !=3D null) {
-                removeListenerCode.append("if (").append(objectCode).append(=
" !=3D null) {").append(JAXXCompiler.getLineSeparator());
-                removeListenerCode.append("    ");
-            }
-            removeListenerCode.append(removeCode);
-            if (objectCode !=3D null)
-                removeListenerCode.append("}");
-        }
-    }
-
-    private void compileListeners() {
-        if (addListenerCode.length() > 0) {
-            if (compiler.applyDataBinding.length() > 0)
-                compiler.applyDataBinding.append("else ");
-            compiler.applyDataBinding.append("if ($binding.equals(").append(=
TypeManager.getJavaCode(id)).append(")) {").append(JAXXCompiler.getLineSepara=
tor());
-            compiler.applyDataBinding.append("    ").append(addListenerCode)=
.append(JAXXCompiler.getLineSeparator());
-            compiler.applyDataBinding.append("}").append(JAXXCompiler.getLin=
eSeparator());
-        }
-
-        if (removeListenerCode.length() > 0) {
-            if (compiler.removeDataBinding.length() > 0)
-                compiler.removeDataBinding.append("else ");
-            compiler.removeDataBinding.append("if ($binding.equals(").append=
(TypeManager.getJavaCode(id)).append(")) {").append(JAXXCompiler.getLineSepar=
ator());
-            compiler.removeDataBinding.append("    ").append(removeListenerC=
ode).append(JAXXCompiler.getLineSeparator());
-            compiler.removeDataBinding.append("}").append(JAXXCompiler.getLi=
neSeparator());
-        }
-    }
-}

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/DataSource.j=
ava (from rev 977, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/Data=
Source.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/DataSource.java	=
                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/DataSource.java	=
2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,439 @@
+/*
+ * Copyright 2006 Ethan Nicholas. All rights reserved.
+ * Use is subject to license terms.
+ */
+package jaxx.compiler;
+
+import jaxx.CompilerException;
+import jaxx.UnsupportedAttributeException;
+import jaxx.parser.JavaParser;
+import jaxx.parser.JavaParserConstants;
+import jaxx.parser.JavaParserTreeConstants;
+import jaxx.parser.SimpleNode;
+import jaxx.reflect.ClassDescriptor;
+import jaxx.reflect.ClassDescriptorLoader;
+import jaxx.reflect.FieldDescriptor;
+import jaxx.reflect.MethodDescriptor;
+import jaxx.tags.DefaultObjectHandler;
+import jaxx.tags.TagManager;
+import jaxx.types.TypeManager;
+
+import java.beans.Introspector;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Represents a Java expression which fires a <code>PropertyChangeEvent</cod=
e> when it can be
+ * determined that its value may have changed.  Events are fired on a "best =
effort" basis, and events
+ * may either be fired too often (the value has not actually changed) or not=
 often enough (the value
+ * changed but no event was fired).
+ */
+public class DataSource {
+    private class NULL {
+    } // type attached to "null" constants in parsed expressions
+
+    private String id;
+
+    /** The Java source code for the expression. */
+    private String source;
+
+    /** The current <code>JAXXCompiler</code>. */
+    private JAXXCompiler compiler;
+
+    /** List of symbols which this data source expression depends on. */
+    private List<String> dependencySymbols =3D new ArrayList<String>();
+
+    private StringBuffer addListenerCode =3D new StringBuffer();
+    private StringBuffer removeListenerCode =3D new StringBuffer();
+    private boolean compiled;
+
+
+    /**
+     * Creates a new data source.  After creating a <code>DataSource</code>,=
 use {@link #compile}
+     * to cause it to function at runtime.
+     *
+     * @param id       the DataSource's id
+     * @param source   the Java source code for the data source expression
+     * @param compiler the current <code>JAXXCompiler</code>
+     */
+    public DataSource(String id, String source, JAXXCompiler compiler) {
+        this.id =3D id;
+        this.source =3D source;
+        this.compiler =3D compiler;
+    }
+
+
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Compiles the data source expression and listener.  This method calls =
methods in <code>JAXXCompiler</code>
+     * to add the Java code that performs the data source setup.  Adding lis=
teners to <code>DataSource</code> is
+     * slightly more complicated than with ordinary classes, because <code>D=
ataSource</code> only exists at compile
+     * time.  You must pass in a Java expression which evaluates to  a <code=
>PropertyChangeListener</code>;  this
+     * expression will be compiled and evaluated at runtime to yield the <co=
de>DataSource's</code> listener.
+     *
+     * @param propertyChangeListenerCode Java code snippet which evaluates t=
o a <code>PropertyChangeListener</code>
+     * @return <code>true</code> if the expression has dependencies, <code>f=
alse</code> otherwise
+     * @throws CompilerException if a compilation error occurs
+     */
+    public boolean compile(String propertyChangeListenerCode) throws Compile=
rException {
+        if (compiled) {
+            throw new IllegalStateException(this + " has already been compil=
ed");
+        }
+        String id =3D compiler.getAutoId(ClassDescriptorLoader.getClassDescr=
iptor(getClass()));
+        JavaParser p =3D new JavaParser(new StringReader(source + ";"));
+        while (!p.Line()) {
+            SimpleNode node =3D p.popNode();
+            scanNode(node, id);
+        }
+
+        if (dependencySymbols.size() > 0) {
+            compiler.appendBodyCode("private PropertyChangeListener " + id +=
 " =3D " + propertyChangeListenerCode + ";\n");
+        }
+
+        compileListeners();
+        compiled =3D true;
+
+        return dependencySymbols.size() > 0;
+    }
+
+    /** @return a list of symbols on which this data source depends. */
+    public Collection<String> getDependencies() {
+        return Collections.unmodifiableList(dependencySymbols);
+    }
+
+    /**
+     * Examines a node to identify any dependencies it contains.
+     *
+     * @param node       node to scan
+     * @param listenerId id of listener
+     * @throws jaxx.CompilerException ?
+     */
+    private void scanNode(SimpleNode node, String listenerId) throws Compile=
rException {
+        switch (node.getId()) {
+            case JavaParserTreeConstants.JJTMETHODDECLARATION:
+                break;
+            case JavaParserTreeConstants.JJTFIELDDECLARATION:
+                break;
+
+            default:
+                int count =3D node.jjtGetNumChildren();
+                for (int i =3D 0; i < count; i++) {
+                    scanNode(node.getChild(i), listenerId);
+                }
+                determineNodeType(node, listenerId);
+        }
+    }
+
+    private ClassDescriptor determineLiteralType(SimpleNode node) {
+        assert node.getId() =3D=3D JavaParserTreeConstants.JJTLITERAL;
+        if (node.jjtGetNumChildren() =3D=3D 1) {
+            int id =3D node.getChild(0).getId();
+            if (id =3D=3D JavaParserTreeConstants.JJTBOOLEANLITERAL) {
+                return ClassDescriptorLoader.getClassDescriptor(boolean.clas=
s);
+            }
+            if (id =3D=3D JavaParserTreeConstants.JJTNULLLITERAL) {
+                return ClassDescriptorLoader.getClassDescriptor(NULL.class);
+            }
+            throw new RuntimeException("Expected BooleanLiteral or NullLiter=
al, found " + JavaParserTreeConstants.jjtNodeName[id]);
+        }
+        int id =3D node.firstToken.kind;
+        switch (id) {
+            case JavaParserConstants.INTEGER_LITERAL:
+                if (node.firstToken.image.toLowerCase().endsWith("l")) {
+                    return ClassDescriptorLoader.getClassDescriptor(long.cla=
ss);
+                }
+                return ClassDescriptorLoader.getClassDescriptor(int.class);
+            case JavaParserConstants.CHARACTER_LITERAL:
+                return ClassDescriptorLoader.getClassDescriptor(char.class);
+            case JavaParserConstants.FLOATING_POINT_LITERAL:
+                if (node.firstToken.image.toLowerCase().endsWith("f")) {
+                    return ClassDescriptorLoader.getClassDescriptor(float.cl=
ass);
+                }
+                return ClassDescriptorLoader.getClassDescriptor(double.class=
);
+            case JavaParserConstants.STRING_LITERAL:
+                return ClassDescriptorLoader.getClassDescriptor(String.class=
);
+            default:
+                throw new RuntimeException("Expected literal token, found " =
+ JavaParserConstants.tokenImage[id]);
+        }
+    }
+
+    /**
+     * Scans through a compound symbol (foo.bar.baz) to identify and track a=
ll trackable pieces of it.
+     *
+     * @param symbol       symbol to scan
+     * @param contextClass
+     * @param isMethod
+     * @param listenerId
+     * @return the type of the symbol (or null if it could not be determined=
).
+     */
+    private ClassDescriptor scanCompoundSymbol(String symbol, ClassDescripto=
r contextClass, boolean isMethod, String listenerId) {
+        String[] tokens =3D symbol.split("\\s*\\.\\s*");
+        StringBuffer currentSymbol =3D new StringBuffer();
+        StringBuffer tokensSeenSoFar =3D new StringBuffer();
+        boolean accepted =3D true; // if this ends up false, it means we wer=
en't able to figure out
+        // which object the method is being invoked on
+        boolean recognizeClassNames =3D true;
+        for (int j =3D 0; j < tokens.length - (isMethod ? 1 : 0); j++) {
+            accepted =3D false;
+
+            if (tokensSeenSoFar.length() > 0) {
+                tokensSeenSoFar.append('.');
+            }
+            tokensSeenSoFar.append(tokens[j]);
+            if (currentSymbol.length() > 0) {
+                currentSymbol.append('.');
+            }
+            currentSymbol.append(tokens[j]);
+
+            if (currentSymbol.indexOf(".") =3D=3D -1) {
+                String memberName =3D currentSymbol.toString();
+                CompiledObject object =3D compiler.getCompiledObject(memberN=
ame);
+                if (object !=3D null) {
+                    contextClass =3D object.getObjectClass();
+                    currentSymbol.setLength(0);
+                    accepted =3D true;
+                    recognizeClassNames =3D false;
+                } else {
+                    try {
+                        FieldDescriptor field =3D contextClass.getFieldDescr=
iptor(memberName);
+                        trackMemberIfPossible(tokensSeenSoFar.toString(), co=
ntextClass, field.getName(), false, listenerId);
+                        contextClass =3D field.getType();
+                        currentSymbol.setLength(0);
+                        accepted =3D true;
+                        recognizeClassNames =3D false;
+                    }
+                    catch (NoSuchFieldException e) {
+                        if (j =3D=3D 0 || j =3D=3D 1 && tokens[0].equals(com=
piler.getRootObject().getId())) { // still in root context
+                            FieldDescriptor[] newFields =3D compiler.getScri=
ptFields();
+                            for (FieldDescriptor newField : newFields) {
+                                if (newField.getName().equals(memberName)) {
+                                    addListener(tokensSeenSoFar.toString(),
+                                            null,
+                                            "addPropertyChangeListener(\"" +=
 memberName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator(),
+                                            "removePropertyChangeListener(\"=
" + memberName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator()=
);
+                                    contextClass =3D newField.getType();
+                                    assert contextClass !=3D null : "script =
field '" + memberName + "' is defined, but has type null";
+                                    currentSymbol.setLength(0);
+                                    accepted =3D true;
+                                    recognizeClassNames =3D false;
+                                    break;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            if (currentSymbol.length() > 0 && recognizeClassNames) {
+                contextClass =3D TagManager.resolveClass(currentSymbol.toStr=
ing(), compiler);
+                if (contextClass !=3D null) {
+                    currentSymbol.setLength(0);
+                    //accepted =3D true;
+                    //recognizeClassNames =3D false;
+                    // TODO: for now we don't handle statics
+                    return null;
+                }
+            }
+            if (!accepted) {
+                return null;
+            }
+        }
+
+        return contextClass;
+    }
+
+    /**
+     * Adds type information to nodes where possible, and as a side effect a=
dds event listeners to nodes which
+     * can be tracked.
+     *
+     * @param expression
+     * @param listenerId
+     * @return
+     */
+    private ClassDescriptor determineExpressionType(SimpleNode expression, S=
tring listenerId) {
+        assert expression.getId() =3D=3D JavaParserTreeConstants.JJTPRIMARYE=
XPRESSION;
+        SimpleNode prefix =3D expression.getChild(0);
+        if (prefix.jjtGetNumChildren() =3D=3D 1) {
+            int type =3D prefix.getChild(0).getId();
+            if (type =3D=3D JavaParserTreeConstants.JJTLITERAL || type =3D=
=3D JavaParserTreeConstants.JJTEXPRESSION) {
+                prefix.setJavaType(prefix.getChild(0).getJavaType());
+            } else
+            if (type =3D=3D JavaParserTreeConstants.JJTNAME && expression.jj=
tGetNumChildren() =3D=3D 1) // name with no arguments after it
+            {
+                prefix.setJavaType(scanCompoundSymbol(prefix.getText().trim(=
), compiler.getRootObject().getObjectClass(), false, listenerId));
+            }
+        }
+
+        if (expression.jjtGetNumChildren() =3D=3D 1) {
+            return prefix.getJavaType();
+        }
+
+        ClassDescriptor contextClass =3D prefix.getJavaType();
+        if (contextClass =3D=3D null) {
+            contextClass =3D compiler.getRootObject().getObjectClass();
+        }
+        String lastNode =3D prefix.getText().trim();
+
+        for (int i =3D 1; i < expression.jjtGetNumChildren(); i++) {
+            SimpleNode suffix =3D expression.getChild(i);
+            if (suffix.jjtGetNumChildren() =3D=3D 1 && suffix.getChild(0).ge=
tId() =3D=3D JavaParserTreeConstants.JJTARGUMENTS) {
+                if (suffix.getChild(0).jjtGetNumChildren() =3D=3D 0) { // at=
 the moment only no-argument methods are trackable
+                    contextClass =3D scanCompoundSymbol(lastNode, contextCla=
ss, true, listenerId);
+                    if (contextClass =3D=3D null) {
+                        return null;
+                    }
+                    int dotPos =3D lastNode.lastIndexOf(".");
+                    String objectCode =3D dotPos =3D=3D -1 ? "" : lastNode.s=
ubstring(0, dotPos);
+                    for (int j =3D i - 2; j >=3D 0; j--) {
+                        objectCode =3D expression.getChild(j).getText() + ob=
jectCode;
+                    }
+                    if (objectCode.length() =3D=3D 0) {
+                        objectCode =3D compiler.getRootObject().getJavaCode(=
);
+                    }
+                    String methodName =3D lastNode.substring(dotPos + 1).tri=
m();
+                    try {
+                        MethodDescriptor method =3D contextClass.getMethodDe=
scriptor(methodName, new ClassDescriptor[0]);
+                        trackMemberIfPossible(objectCode, contextClass, meth=
od.getName(), true, listenerId);
+                        return method.getReturnType();
+                    }
+                    catch (NoSuchMethodException e) {
+                        // happens for methods defined in the current JAXX f=
ile via scripts
+                        String propertyName =3D null;
+                        if (methodName.startsWith("is")) {
+                            propertyName =3D Introspector.decapitalize(metho=
dName.substring("is".length()));
+                        } else if (methodName.startsWith("get")) {
+                            propertyName =3D Introspector.decapitalize(metho=
dName.substring("get".length()));
+                        }
+                        if (propertyName !=3D null) {
+                            MethodDescriptor[] newMethods =3D compiler.getSc=
riptMethods();
+                            for (MethodDescriptor newMethod : newMethods) {
+                                if (newMethod.getName().equals(methodName)) {
+                                    addListener(compiler.getRootObject().get=
Id(),
+                                            null,
+                                            "addPropertyChangeListener(\"" +=
 propertyName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator(),
+                                            "removePropertyChangeListener(\"=
" + propertyName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator=
());
+                                    contextClass =3D newMethod.getReturnType=
();
+                                    break;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            lastNode =3D suffix.getText().trim();
+            if (lastNode.startsWith(".")) {
+                lastNode =3D lastNode.substring(1);
+            }
+        }
+
+        return null;
+    }
+
+    private void trackMemberIfPossible(String objectCode, ClassDescriptor ob=
jectClass, String memberName, boolean method, String listenerId) {
+        if (objectClass.isInterface()) // might be technically possible to t=
rack in some cases, but for now
+        {
+            return;                    // we can't create a DefaultObjectHan=
dler for interfaces
+        }
+
+        DefaultObjectHandler handler =3D TagManager.getTagHandler(objectClas=
s);
+        try {
+            if (handler.isMemberBound(memberName)) {
+                addListener(objectCode + "." + memberName + (method ? "()" :=
 ""),
+                        objectCode,
+                        handler.getAddMemberListenerCode(objectCode, id, mem=
berName, listenerId, compiler),
+                        handler.getRemoveMemberListenerCode(objectCode, id, =
memberName, listenerId, compiler));
+            }
+        }
+        catch (UnsupportedAttributeException e) {
+            // ignore -- this is thrown for methods like toString(), for whi=
ch there is no tracking and
+            // no setting support
+        }
+    }
+
+    /**
+     * Adds type information to nodes where possible, and as a side effect a=
dds event listeners to nodes which
+     * can be tracked.
+     *
+     * @param node       node to scan
+     * @param listenerId the listener id
+     */
+    private void determineNodeType(SimpleNode node, String listenerId) {
+        ClassDescriptor type =3D null;
+        if (node.jjtGetNumChildren() =3D=3D 1) {
+            type =3D node.getChild(0).getJavaType();
+        }
+        switch (node.getId()) {
+            case JavaParserTreeConstants.JJTCLASSORINTERFACETYPE:
+                type =3D ClassDescriptorLoader.getClassDescriptor(Class.clas=
s);
+                break;
+            case JavaParserTreeConstants.JJTPRIMARYEXPRESSION:
+                type =3D determineExpressionType(node, listenerId);
+                break;
+            case JavaParserTreeConstants.JJTLITERAL:
+                type =3D determineLiteralType(node);
+                break;
+            case JavaParserTreeConstants.JJTCASTEXPRESSION:
+                type =3D TagManager.resolveClass(node.getChild(0).getText(),=
 compiler);
+                break;
+        }
+        node.setJavaType(type);
+    }
+
+    private void addListener(String dependencySymbol, String objectCode, Str=
ing addCode, String removeCode) {
+        if (!dependencySymbols.contains(dependencySymbol)) {
+            dependencySymbols.add(dependencySymbol);
+            if (objectCode !=3D null) {
+                addListenerCode.append("if (").append(objectCode).append(" !=
=3D null) {").append(JAXXCompiler.getLineSeparator());
+                addListenerCode.append("    ");
+            }
+            addListenerCode.append(addCode);
+            if (objectCode !=3D null) {
+                addListenerCode.append("}");
+            }
+
+            if (objectCode !=3D null) {
+                removeListenerCode.append("if (").append(objectCode).append(=
" !=3D null) {").append(JAXXCompiler.getLineSeparator());
+                removeListenerCode.append("    ");
+            }
+            removeListenerCode.append(removeCode);
+            if (objectCode !=3D null) {
+                removeListenerCode.append("}");
+            }
+        }
+    }
+
+    private void compileListeners() {
+        if (addListenerCode.length() > 0) {
+            if (compiler.haveApplyDataBinding()) {
+                compiler.appendApplyDataBinding("else ");
+            }
+            compiler.appendApplyDataBinding("if ($binding.equals(" + TypeMan=
ager.getJavaCode(id) + ")) {" + JAXXCompiler.getLineSeparator());
+            compiler.appendApplyDataBinding("    " + addListenerCode + JAXXC=
ompiler.getLineSeparator());
+            compiler.appendApplyDataBinding("}" + JAXXCompiler.getLineSepara=
tor());
+            //if (compiler.applyDataBinding.length() > 0)
+            //    compiler.applyDataBinding.append("else ");
+            //compiler.applyDataBinding.append("if ($binding.equals(").appen=
d(TypeManager.getJavaCode(id)).append(")) {").append(JAXXCompiler.getLineSepa=
rator());
+            //compiler.applyDataBinding.append("    ").append(addListenerCod=
e).append(JAXXCompiler.getLineSeparator());
+            //compiler.applyDataBinding.append("}").append(JAXXCompiler.getL=
ineSeparator());
+        }
+
+        if (removeListenerCode.length() > 0) {
+            if (compiler.haveRemoveDataBinding()) {
+                compiler.appendRemoveDataBinding("else ");
+            }
+            compiler.appendRemoveDataBinding("if ($binding.equals(" + TypeMa=
nager.getJavaCode(id) + ")) {" + JAXXCompiler.getLineSeparator());
+            compiler.appendRemoveDataBinding("    " + removeListenerCode + J=
AXXCompiler.getLineSeparator());
+            compiler.appendRemoveDataBinding("}" + JAXXCompiler.getLineSepar=
ator());
+            //if (compiler.removeDataBinding.length() > 0)
+            //    compiler.removeDataBinding.append("else ");
+            //compiler.removeDataBinding.append("if ($binding.equals(").appe=
nd(TypeManager.getJavaCode(id)).append(")) {").append(JAXXCompiler.getLineSep=
arator());
+            //compiler.removeDataBinding.append("    ").append(removeListene=
rCode).append(JAXXCompiler.getLineSeparator());
+            //compiler.removeDataBinding.append("}").append(JAXXCompiler.get=
LineSeparator());
+        }
+    }
+}

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/JAXXCompile=
r.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXCompiler.java	2=
008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/JAXXCompiler.jav=
a	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,2173 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.compiler;
-
-import jaxx.CompilerException;
-import jaxx.UnsupportedAttributeException;
-import jaxx.UnsupportedTagException;
-import jaxx.css.Rule;
-import jaxx.css.Stylesheet;
-import jaxx.parser.ParseException;
-import jaxx.reflect.ClassDescriptor;
-import jaxx.reflect.ClassDescriptorLoader;
-import jaxx.reflect.FieldDescriptor;
-import jaxx.reflect.MethodDescriptor;
-import jaxx.runtime.ComponentDescriptor;
-import jaxx.runtime.JAXXObject;
-import jaxx.runtime.JAXXObjectDescriptor;
-import jaxx.runtime.swing.Application;
-import jaxx.spi.Initializer;
-import jaxx.tags.DefaultObjectHandler;
-import jaxx.tags.TagHandler;
-import jaxx.tags.TagManager;
-import jaxx.tags.swing.BeanValidatorHandler.CompiledBeanValidator;
-import jaxx.types.TypeManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.AttributesImpl;
-import org.xml.sax.helpers.XMLFilterImpl;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.sax.SAXSource;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectOutputStream;
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-import java.lang.reflect.Modifier;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.ServiceLoader;
-import java.util.Set;
-import java.util.Stack;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.zip.GZIPOutputStream;
-
-/** Compiles JAXX files into Java classes. */
-public class JAXXCompiler {
-    /** log */
-    protected static final Log log =3D LogFactory.getLog(JAXXCompiler.class);
-
-    /**
-     * True to throw exceptions when we encounter unresolvable classes, fals=
e to ignore.
-     * This is currently set to false until JAXX has full support for inner =
classes
-     * (including enumerations), because currently they don't always resolve=
 (but will
-     * generally compile without error anyway).
-     */
-    public static final boolean STRICT_CHECKS =3D false;
-
-    public static final String JAXX_NAMESPACE =3D "http://www.jaxxframework.=
org/";
-    public static final String JAXX_INTERNAL_NAMESPACE =3D "http://www.jaxxf=
ramework.org/internal";
-
-    /** Maximum length of an inlinable creation method. */
-    private static final int INLINE_THRESHOLD =3D 300;
-
-    /** Contains import declarations (of the form "javax.swing.") which are =
always imported in all compiler instances. */
-    private static List<String> staticImports =3D new ArrayList<String>();
-
-    static {
-        //TODO humm, we should be able to import only what is needed
-        staticImports.add("java.awt.*");
-        staticImports.add("java.awt.event.*");
-        staticImports.add("java.beans.*");
-        staticImports.add("java.io.*");
-        staticImports.add("java.lang.*");
-        staticImports.add("java.util.*");
-        staticImports.add("javax.swing.*");
-        staticImports.add("javax.swing.border.*");
-        staticImports.add("javax.swing.event.*");
-        staticImports.add("jaxx.runtime.swing.JAXXButtonGroup");
-        staticImports.add("jaxx.runtime.swing.HBox");
-        staticImports.add("jaxx.runtime.swing.VBox");
-        staticImports.add("jaxx.runtime.swing.Table");
-        staticImports.add("static org.codelutin.i18n.I18n._");
-        staticImports.add("static org.codelutin.jaxx.util.UIHelper.createIma=
geIcon");
-    }
-
-    private static DefaultObjectHandler firstPassClassTagHandler =3D new Def=
aultObjectHandler(ClassDescriptorLoader.getClassDescriptor(Object.class));
-
-    /**
-     * A list of Runnables which will be run after the first compilation pas=
s.  This is primarily used
-     * to trigger the creation of CompiledObjects, which cannot be created d=
uring the first pass and must be
-     * created in document order.
-     */
-    private List<Runnable> initializers =3D new ArrayList<Runnable>();
-
-    /** Files being compiled during the compilation session, may be modified=
 as compilation progresses and additional dependencies are found. */
-    private static List<File> jaxxFiles =3D new ArrayList<File>();
-
-    /** Class names corresponding to the files in the jaxxFiles list. */
-    private static List<String> jaxxFileClassNames =3D new ArrayList<String>=
();
-
-    /** Maps the names of classes being compiled to the compiler instance ha=
ndling the compilation. */
-    private static Map<String, JAXXCompiler> compilers =3D new HashMap<Strin=
g, JAXXCompiler>();
-
-    /** Maps the names of classes being compiled to their symbol tables (cre=
ated after the first compiler pass). */
-    private static Map<File, SymbolTable> symbolTables =3D new HashMap<File,=
 SymbolTable>();
-
-    private CompilerOptions options;
-
-    /** Used for error reporting purposes, so we can report the right line n=
umber. */
-    private Stack<Element> tagsBeingCompiled =3D new Stack<Element>();
-
-    /** Used for error reporting purposes, so we can report the right source=
 file. */
-    private Stack<File> sourceFiles =3D new Stack<File>();
-
-    /** Maps object ID strings to the objects themselves.  These are created=
 during the second compilation pass. */
-    private Map<String, CompiledObject> objects =3D new LinkedHashMap<String=
, CompiledObject>();
-
-    /** Maps objects to their ID strings.  These are created during the seco=
nd compilation pass. */
-    private Map<CompiledObject, String> ids =3D new LinkedHashMap<CompiledOb=
ject, String>();
-
-    private static int errorCount;
-    private static int warningCount;
-
-    private boolean failed;
-
-    /** Object corresponding to the root tag in the document. */
-    private CompiledObject root;
-
-    /** Contains strings of the form "javax.swing." */
-    private Set<String> importedPackages =3D new HashSet<String>();
-
-    /** Contains strings of the form "javax.swing.Timer" */
-    private Set<String> importedClasses =3D new HashSet<String>();
-
-    /** Keeps track of open components (components still having children add=
ed). */
-    private Stack<CompiledObject> openComponents =3D new Stack<CompiledObjec=
t>();
-
-    /** Sequence number used to create automatic variable names. */
-    private int autogenID =3D 0;
-
-    private List<DataBinding> dataBindings =3D new ArrayList<DataBinding>();
-
-    private JavaFile javaFile =3D new JavaFile();
-
-    // true if a main() method has been declared in a script
-    boolean mainDeclared;
-
-    /** list of validators */
-    protected List<CompiledBeanValidator> validators =3D new ArrayList<Compi=
ledBeanValidator>();
-
-    private SymbolTable symbolTable =3D new SymbolTable();
-
-    // TODO: replace these public StringBuffers with something a little less=
 stupid
-
-    /** Extra code to be added to the instance initializer. */
-    public StringBuffer initializer =3D new StringBuffer();
-
-    /** Extra code to be added at the end of the instance initializer. */
-    public StringBuffer lateInitializer =3D new StringBuffer();
-
-    /** Extra code to be added to the class body. */
-    public StringBuffer bodyCode =3D new StringBuffer();
-
-    /** Code to initialize data bindings. */
-    public StringBuffer initDataBindings =3D new StringBuffer();
-
-    /** Body of the applyDataBinding method. */
-    public StringBuffer applyDataBinding =3D new StringBuffer();
-
-    /** Body of the removeDataBinding method. */
-    public StringBuffer removeDataBinding =3D new StringBuffer();
-
-    /** Body of the processDataBinding method. */
-    public StringBuffer processDataBinding =3D new StringBuffer();
-
-    /** Base directory used for path resolution (normally the directory in w=
hich the .jaxx file resides). */
-    private File baseDir;
-
-    /** .jaxx file being compiled. */
-    private File src;
-
-    /** Generated .java file. */
-    private File dest;
-
-    /** Parsed XML of src file. */
-    private Document document;
-
-    /** Name of class being compiled. */
-    private String outputClassName;
-
-    private ScriptManager scriptManager =3D new ScriptManager(this);
-
-    /** Combination of all stylesheets registered using {@link #registerStyl=
esheet}. */
-    private Stylesheet stylesheet;
-
-    /** Contains all attributes defined inline on class tags. */
-    private List<Rule> inlineStyles =3D new ArrayList<Rule>();
-
-    /**
-     * Maps objects (expressed in Java code) to event listener classes (e.g.=
 MouseListener) to Lists of EventHandlers.  The final list
-     * contains all event  handlers of a particular type attached to a parti=
cular object (again, as represented by a Java expression).
-     */
-    private Map<String, Map<ClassDescriptor, List<EventHandler>>> eventHandl=
ers =3D new HashMap<String, Map<ClassDescriptor, List<EventHandler>>>();
-
-    private Map<Object, String> uniqueIds =3D new HashMap<Object, String>();
-
-    private Map<EventHandler, String> eventHandlerMethodNames =3D new HashMa=
p<EventHandler, String>();
-
-    /** ClassLoader which searches the user-specified class path in addition=
 to the normal class path */
-    private ClassLoader classLoader;
-
-    private static final int PASS_1 =3D 0;
-    private static final int PASS_2 =3D 1;
-    private static int currentPass;
-
-    public static void init() {
-        // forces static initializer to run if it hasn't yet
-    }
-
-    public static void loadLibraries(boolean verbose) throws IOException, Cl=
assNotFoundException, InstantiationException, IllegalAccessException {
-        ClassLoader classloader =3D Thread.currentThread().getContextClassLo=
ader();
-        if (verbose) {
-            log.info("with cl " + classloader);
-        }
-        ServiceLoader<Initializer> loader =3D ServiceLoader.load(Initializer=
.class, classloader);
-        for (Initializer initializer : loader) {
-            if (verbose) {
-                log.info("load initializer " + initializer);
-            }
-            initializer.initialize();
-        }
-    }
-
-    private JAXXCompiler(ClassLoader classLoader) {
-        this.options =3D new CompilerOptions();
-        this.classLoader =3D classLoader;
-        addImport("java.lang.*");
-    }
-
-
-    /**
-     * Creates a new JAXXCompiler.
-     *
-     * @param baseDir         classpath location
-     * @param options         options to pass to javac
-     * @param src             location of file to compile
-     * @param outputClassName the out file name
-     */
-    protected JAXXCompiler(File baseDir, File src, String outputClassName, C=
ompilerOptions options) {
-        this.baseDir =3D baseDir;
-        this.src =3D src;
-        sourceFiles.push(src);
-        this.outputClassName =3D outputClassName;
-        this.options =3D options;
-        addImport(outputClassName.substring(0, outputClassName.lastIndexOf("=
.") + 1) + "*");
-        for (Object staticImport : staticImports) {
-            addImport((String) staticImport);
-        }
-    }
-
-
-    /**
-     * Creates a dummy JAXXCompiler for use in unit testing.
-     *
-     * @return the compiler
-     */
-    public static JAXXCompiler createDummyCompiler() {
-        return createDummyCompiler(JAXXCompiler.class.getClassLoader());
-    }
-
-
-    /**
-     * Creates a dummy JAXXCompiler for use in unit testing.
-     *
-     * @param classLoader class loader to use
-     * @return the compiler
-     */
-    public static JAXXCompiler createDummyCompiler(ClassLoader classLoader) {
-        return new JAXXCompiler(classLoader);
-    }
-
-
-    public CompilerOptions getOptions() {
-        return options;
-    }
-
-
-    public JavaFile getJavaFile() {
-        return javaFile;
-    }
-
-
-    private void compileFirstPass() throws IOException {
-        try {
-            InputStream in =3D new FileInputStream(src);
-            document =3D parseDocument(in);
-            in.close();
-            compileFirstPass(document.getDocumentElement());
-        }
-        catch (SAXParseException e) {
-            reportError(e.getLineNumber(), "Invalid XML: " + e.getMessage());
-        }
-        catch (SAXException e) {
-            reportError(null, "Error parsing XML document: " + e);
-        }
-    }
-
-
-    private void runInitializers() {
-        for (Runnable runnable : initializers) {
-            if (log.isDebugEnabled()) {
-                log.debug(runnable);
-            }
-            runnable.run();
-        }
-        initializers.clear();
-    }
-
-
-    /**
-     * Registers a <code>Runnable</code> which will be executed after the fi=
rst
-     * compilation pass is complete.
-     *
-     * @param r runnable to register
-     */
-    public void registerInitializer(Runnable r) {
-        initializers.add(r);
-    }
-
-
-    private void compileSecondPass() throws IOException {
-        if (!tagsBeingCompiled.isEmpty()) {
-            throw new RuntimeException("Internal error: starting pass two, b=
ut tagsBeingCompiled is not empty: " + tagsBeingCompiled);
-        }
-        compileSecondPass(document.getDocumentElement());
-    }
-
-
-    private void applyStylesheets() {
-        for (Object o : new ArrayList<CompiledObject>(objects.values())) {
-            CompiledObject object =3D (CompiledObject) o;
-            TagManager.getTagHandler(object.getObjectClass()).applyStyleshee=
ts(object, this);
-        }
-    }
-
-
-    private void generateCode() throws IOException {
-        if (options.getTargetDirectory() !=3D null) {
-            dest =3D new File(options.getTargetDirectory(), outputClassName.=
replace('.', File.separatorChar) + ".java");
-        } else {
-            dest =3D new File(baseDir, outputClassName.substring(outputClass=
Name.lastIndexOf(".") + 1) + ".java");
-        }
-        if (dest.exists() && !dest.setLastModified(System.currentTimeMillis(=
))) {
-            log.warn("could not touch file " + dest);
-        }
-        PrintWriter out =3D new PrintWriter(new FileWriter(dest));
-        createJavaSource(out);
-        out.close();
-    }
-
-    private void createJavaSource(PrintWriter out) throws IOException {
-        int dotPos =3D outputClassName.lastIndexOf(".");
-        String packageName =3D dotPos !=3D -1 ? outputClassName.substring(0,=
 dotPos) : null;
-        String simpleClassName =3D outputClassName.substring(dotPos + 1);
-        outputClass(packageName, simpleClassName, out);
-    }
-
-
-    public String getOutputClassName() {
-        return outputClassName;
-    }
-
-    public static SAXParser getSAXParser() {
-        try {
-            SAXParserFactory factory =3D SAXParserFactory.newInstance();
-            factory.setNamespaceAware(true);
-            SAXParser parser;
-            parser =3D factory.newSAXParser();
-            return parser;
-        }
-        catch (SAXException e) {
-            throw new RuntimeException(e);
-        }
-        catch (ParserConfigurationException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    public static Document parseDocument(InputStream in) throws IOException,=
 SAXException {
-        try {
-            TransformerFactory factory =3D TransformerFactory.newInstance();
-            Transformer transformer =3D factory.newTransformer();
-            transformer.setErrorListener(new ErrorListener() {
-                public void warning(TransformerException ex) throws Transfor=
merException {
-                    throw ex;
-                }
-
-                public void error(TransformerException ex) throws Transforme=
rException {
-                    throw ex;
-                }
-
-                public void fatalError(TransformerException ex) throws Trans=
formerException {
-                    throw ex;
-                }
-            });
-
-            DOMResult result =3D new DOMResult();
-            transformer.transform(new SAXSource(new XMLFilterImpl(getSAXPars=
er().getXMLReader()) {
-                Locator locator;
-
-                @Override
-                public void setDocumentLocator(Locator locator) {
-                    this.locator =3D locator;
-                }
-
-                @Override
-                public void startElement(String uri, String localName, Strin=
g qName, Attributes atts) throws SAXException {
-                    AttributesImpl resultAtts =3D new AttributesImpl(atts);
-                    resultAtts.addAttribute(JAXX_INTERNAL_NAMESPACE, "line",=
 "internal:line", "CDATA", String.valueOf(locator.getLineNumber()));
-                    getContentHandler().startElement(uri, localName, qName, =
resultAtts);
-                }
-            }, new InputSource(in)), result);
-            return (Document) result.getNode();
-        }
-        catch (TransformerConfigurationException e) {
-            throw new RuntimeException(e);
-        }
-        catch (TransformerException e) {
-            Throwable ex =3D e;
-            while (ex.getCause() !=3D null) {
-                ex =3D ex.getCause();
-            }
-            if (ex instanceof IOException) {
-                throw (IOException) ex;
-            }
-            if (ex instanceof SAXException) {
-                throw (SAXException) ex;
-            }
-            if (ex instanceof RuntimeException) {
-                throw (RuntimeException) ex;
-            }
-            throw new RuntimeException(ex);
-        }
-    }
-
-
-    public File getBaseDir() {
-        return baseDir;
-    }
-
-
-    public Set<String> getImportedClasses() {
-        return importedClasses;
-    }
-
-
-    public Set<String> getImportedPackages() {
-        return importedPackages;
-    }
-
-
-    private boolean inlineCreation(CompiledObject object) {
-        return object.getId().startsWith("$") && object.getInitializationCod=
e(this).length() < INLINE_THRESHOLD;
-    }
-
-
-    public void checkOverride(CompiledObject object) throws CompilerExceptio=
n {
-        if (object.getId().startsWith("$")) {
-            return;
-        }
-        ClassDescriptor ancestor =3D root.getObjectClass();
-        if (ancestor =3D=3D object.getObjectClass()) {
-            return;
-        }
-        while (ancestor !=3D null) {
-            try {
-                FieldDescriptor f =3D ancestor.getDeclaredFieldDescriptor(ob=
ject.getId());
-                if (!f.getType().isAssignableFrom(object.getObjectClass())) {
-                    reportError("attempting to redefine superclass member '"=
 + object.getId() + "' as incompatible type (was " + f.getType() + ", redefin=
ed as " + object.getObjectClass() + ")");
-                }
-                object.setOverride(true);
-                break;
-            }
-            catch (NoSuchFieldException e) {
-                ancestor =3D ancestor.getSuperclass();
-            }
-        }
-    }
-
-
-    private Iterator<CompiledObject> getObjectCreationOrder() {
-        return objects.values().iterator();
-    }
-
-
-    protected JavaMethod createConstructor(String className) throws Compiler=
Exception {
-        StringBuffer code =3D new StringBuffer();
-        String constructorParams =3D root.getConstructorParams();
-        if (constructorParams !=3D null) {
-            code.append("        super(").append(constructorParams).append("=
);");
-            code.append(getLineSeparator());
-        }
-        code.append("$initialize();");
-        code.append(getLineSeparator());
-        return new JavaMethod(Modifier.PUBLIC, null, className, null, null, =
code.toString());
-    }
-
-
-    protected JavaMethod createInitializer(String className) throws Compiler=
Exception {
-        StringBuffer code =3D new StringBuffer();
-        code.append("$objectMap.put(").append(TypeManager.getJavaCode(root.g=
etId())).append(", this);");
-        code.append(getLineSeparator());
-
-        Iterator<CompiledObject> i =3D getObjectCreationOrder();
-        boolean lastWasMethodCall =3D false;
-        while (i.hasNext()) {
-            CompiledObject object =3D i.next();
-            if (object !=3D root && !object.isOverride()) {
-                if (inlineCreation(object)) {
-                    if (lastWasMethodCall) {
-                        lastWasMethodCall =3D false;
-                        code.append(getLineSeparator());
-                    }
-                    code.append(getCreationCode(object));
-                    code.append(getLineSeparator());
-                } else {
-                    code.append(object.getCreationMethodName()).append("();"=
);
-                    code.append(getLineSeparator());
-                    lastWasMethodCall =3D true;
-                }
-            }
-        }
-        String rootCode =3D root.getInitializationCode(this);
-        if (rootCode !=3D null && rootCode.length() > 0) {
-            code.append(rootCode);
-            code.append(getLineSeparator());
-        }
-        code.append(getLineSeparator());
-        if (initializer.length() > 0) {
-            code.append(initializer);
-            code.append(getLineSeparator());
-        }
-        code.append("$completeSetup();");
-        code.append(getLineSeparator());
-        return new JavaMethod(Modifier.PRIVATE, "void", "$initialize", null,=
 null, code.toString());
-    }
-
-
-    protected JavaMethod createCompleteSetupMethod() {
-        StringBuffer code =3D new StringBuffer();
-        code.append("allComponentsCreated =3D true;");
-        code.append(getLineSeparator());
-        for (CompiledObject object : objects.values()) {
-            if (object.getId().startsWith("$")) {
-                code.append(object.getAdditionCode());
-            } else {
-                code.append(object.getAdditionMethodName()).append("();").ap=
pend(getLineSeparator());
-                String additionCode =3D object.getAdditionCode();
-                if (additionCode.length() > 0) {
-                    additionCode =3D "if (allComponentsCreated) {" + getLine=
Separator() + additionCode + "}";
-                }
-                javaFile.addMethod(new JavaMethod(Modifier.PROTECTED, "void"=
, object.getAdditionMethodName(), null, null, additionCode));
-            }
-            code.append(getLineSeparator());
-        }
-
-        code.append(initDataBindings);
-
-        if (lateInitializer.length() > 0) {
-            code.append(lateInitializer);
-            code.append(getLineSeparator());
-        }
-
-        if (hasValidator()) {
-            // register validator
-            for (CompiledBeanValidator validator : validators) {
-                String id =3D TypeManager.getJavaCode(validator.getId());
-                code.append("$validatorIds.add(").append(id).append(");");
-                code.append(getLineSeparator());
-                code.append("getValidator(").append(id).append(").installLay=
ers();");
-                code.append("getValidator(").append(id).append(").validate()=
;");
-                code.append(getLineSeparator());
-            }
-        }
-        return new JavaMethod(Modifier.PRIVATE, "void", "$completeSetup", nu=
ll, null, code.toString());
-    }
-
-
-    protected JavaMethod createProcessDataBindingMethod() {
-        StringBuffer code =3D new StringBuffer();
-        boolean superclassIsJAXXObject =3D ClassDescriptorLoader.getClassDes=
criptor(JAXXObject.class).isAssignableFrom(root.getObjectClass());
-        // the force parameter forces the update to happen even if it is alr=
eady in activeBindings.  This
-        // is used on superclass invocations b/c by the time the call gets t=
o the superclass, it is already
-        // marked active and would otherwise be skipped
-        if (processDataBinding.length() > 0) {
-            code.append("        if (!$force && $activeBindings.contains($de=
st)) return;");
-            code.append(getLineSeparator());
-            code.append("        $activeBindings.add($dest);");
-            code.append(getLineSeparator());
-            code.append("        try {");
-            code.append(getLineSeparator());
-            if (processDataBinding.length() > 0) {
-                code.append(processDataBinding);
-                code.append(getLineSeparator());
-            }
-            if (superclassIsJAXXObject) {
-                code.append("        else");
-                code.append(getLineSeparator());
-                code.append("            super.processDataBinding($dest, tru=
e);");
-                code.append(getLineSeparator());
-            }
-            code.append("        }");
-            code.append(getLineSeparator());
-            code.append("        finally {");
-            code.append(getLineSeparator());
-            code.append("            $activeBindings.remove($dest);");
-            code.append(getLineSeparator());
-            code.append("        }");
-            code.append(getLineSeparator());
-        } else if (superclassIsJAXXObject) {
-            code.append("        super.processDataBinding($dest, true);");
-            code.append(getLineSeparator());
-        }
-        return new JavaMethod(Modifier.PUBLIC, "void", "processDataBinding",
-                new JavaArgument[]{new JavaArgument("String", "$dest"), new =
JavaArgument("boolean", "$force")},
-                null, code.toString());
-    }
-
-
-    protected void createJavaFile(String packageName, String className) thro=
ws CompilerException {
-        String fullClassName =3D packageName !=3D null ? packageName + "." +=
 className : className;
-        if (root =3D=3D null) {
-            throw new CompilerException("root tag must be a class tag");
-        }
-        ClassDescriptor superclass =3D root.getObjectClass();
-        boolean superclassIsJAXXObject =3D ClassDescriptorLoader.getClassDes=
criptor(JAXXObject.class).isAssignableFrom(superclass);
-        javaFile.setModifiers(Modifier.PUBLIC);
-        javaFile.setClassName(fullClassName);
-        javaFile.setSuperClass(getCanonicalName(superclass));
-        javaFile.setInterfaces(new String[]{getCanonicalName(JAXXObject.clas=
s)});
-
-        for (CompiledObject object : objects.values()) {
-            if (!object.isOverride() && !(object instanceof ScriptInitialize=
r)) {
-                int access =3D object.getId().startsWith("$") ? Modifier.PRI=
VATE : Modifier.PROTECTED;
-                if (object =3D=3D root) {
-                    javaFile.addField(new JavaField(access, fullClassName, o=
bject.getId(), "this"));
-                } else {
-                    javaFile.addField(new JavaField(access, getCanonicalName=
(object.getObjectClass()), object.getId()));
-                }
-            }
-        }
-
-        if (!superclassIsJAXXObject) {
-            // add logger
-            if (getOptions().isAddLogger()) {
-                javaFile.addImport("org.apache.commons.logging.Log");
-                javaFile.addImport("org.apache.commons.logging.LogFactory");
-                javaFile.addField(createLoggerField(fullClassName));
-            }
-
-            javaFile.addField(new JavaField(Modifier.PROTECTED, "java.util.L=
ist<Object>", "$activeBindings", "new ArrayList<Object>()"));
-            javaFile.addField(new JavaField(Modifier.PROTECTED, "java.util.M=
ap<String,Object>", "$bindingSources", "new HashMap<String,Object>()"));
-        }
-
-        javaFile.addImport("jaxx.runtime.BeanValidator");
-        javaFile.addField(new JavaField(Modifier.PROTECTED, "java.util.List<=
String>", "$validatorIds", "new ArrayList<String>()"));
-
-        if (stylesheet !=3D null) {
-            javaFile.addField(new JavaField(0, "java.util.Map", "$previousVa=
lues", "new java.util.HashMap()"));
-        }
-
-        javaFile.addMethod(createConstructor(className));
-        javaFile.addMethod(createInitializer(className));
-        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "BeanValidator<?>=
", "getValidator", new JavaArgument[]{new JavaArgument("String", "validatorId=
")},
-                null, "return (BeanValidator)($validatorIds.contains(validat=
orId)?getObjectById(validatorId):null);"));
-
-        for (DataBinding dataBinding : dataBindings) {
-            if (dataBinding.compile(true)) {
-                initDataBindings.append("applyDataBinding(").append(TypeMana=
ger.getJavaCode(dataBinding.getId())).append(");").append(JAXXCompiler.getLin=
eSeparator());
-            }
-        }
-
-        javaFile.addBodyCode(bodyCode.toString());
-
-        for (CompiledObject object : objects.values()) {
-            if (!inlineCreation(object) && object !=3D root) {
-                javaFile.addMethod(new JavaMethod(Modifier.PROTECTED, "void"=
, object.getCreationMethodName(), null, null, getCreationCode(object)));
-            }
-        }
-
-        javaFile.addField(new JavaField(Modifier.PRIVATE, "boolean", "allCom=
ponentsCreated"));
-
-        javaFile.addMethod(createCompleteSetupMethod());
-
-        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "applyDat=
aBinding", new JavaArgument[]{new JavaArgument("String", "$binding")},
-                null, applyDataBinding.toString() + getLineSeparator() + "  =
  processDataBinding($binding);"));
-
-        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "removeDa=
taBinding", new JavaArgument[]{new JavaArgument("String", "$binding")},
-                null, removeDataBinding.toString()));
-
-        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "processD=
ataBinding", new JavaArgument[]{new JavaArgument("String", "dest")},
-                null, "processDataBinding(dest, false);"));
-
-        javaFile.addMethod(createProcessDataBindingMethod());
-
-        if (!superclassIsJAXXObject) {
-            javaFile.addField(createObjectMap());
-            javaFile.addMethod(createGetObjectByIdMethod());
-        }
-
-        javaFile.addField(createJAXXObjectDescriptorField());
-        javaFile.addMethod(createGetJAXXObjectDescriptorMethod());
-
-        /*
-         * Gestion du context
-         */
-        javaFile.addField(createContextField());
-        javaFile.addMethod(createSetContextValueMethod());
-        javaFile.addMethod(createSetContextValueNameMethod());
-        javaFile.addMethod(createGetContextValueMethod());
-        javaFile.addMethod(createGetContextValueNameMethod());
-        javaFile.addMethod(createGetParentContainer());
-        javaFile.addMethod(createGetParentContainerMore());
-        ClassDescriptor currentClass =3D root.getObjectClass();
-        MethodDescriptor firePropertyChange =3D null;
-        while (firePropertyChange =3D=3D null && currentClass !=3D null) {
-            try {
-                firePropertyChange =3D currentClass.getDeclaredMethodDescrip=
tor("firePropertyChange", new ClassDescriptor[]{
-                        ClassDescriptorLoader.getClassDescriptor(String.clas=
s),
-                        ClassDescriptorLoader.getClassDescriptor(Object.clas=
s),
-                        ClassDescriptorLoader.getClassDescriptor(Object.clas=
s)
-                });
-
-            }
-            catch (NoSuchMethodException e) {
-                currentClass =3D currentClass.getSuperclass();
-            }
-        }
-
-        int modifiers =3D firePropertyChange !=3D null ? firePropertyChange.=
getModifiers() : 0;
-        if (Modifier.isPublic(modifiers)) {
-            // we have all the support we need
-        }
-        if (Modifier.isProtected(modifiers)) {
-            // there is property change support but the firePropertyChange m=
ethod is protected
-            javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "fire=
PropertyChange", new JavaArgument[]{
-                    new JavaArgument("java.lang.String", "propertyName"), ne=
w JavaArgument("java.lang.Object", "oldValue"), new JavaArgument("java.lang.O=
bject", "newValue")},
-                    null, "super.firePropertyChange(propertyName, oldValue, =
newValue);"));
-        } else {
-            // either no support at all or firePropertyChange isn't accessib=
le
-            addPropertyChangeSupport(javaFile);
-        }
-
-        addEventHandlers(javaFile);
-
-        if (ClassDescriptorLoader.getClassDescriptor(Application.class).isAs=
signableFrom(root.getObjectClass()) && !mainDeclared) {
-            // TODO: check for existing main method first
-            javaFile.addMethod(new JavaMethod(Modifier.PUBLIC | Modifier.STA=
TIC, "void", "main",
-                    new JavaArgument[]{new JavaArgument("String[]", "arg")},=
 null,
-                    "SwingUtilities.invokeLater(new Runnable() { public void=
 run() { new " + className + "().setVisible(true); } });"));
-        }
-    }
-
-
-    protected void outputClass(String packageName, String className, PrintWr=
iter out) throws CompilerException {
-        createJavaFile(packageName, className);
-        out.println(javaFile.toString());
-    }
-
-
-    public void addImport(String text) {
-        if (text.endsWith("*")) {
-            importedPackages.add(text.substring(0, text.length() - 1));
-        } else {
-            importedClasses.add(text);
-        }
-
-        if (!text.equals("*")) {
-            getJavaFile().addImport(text);
-        }
-    }
-
-    private JavaField createLoggerField(String className) {
-        return new JavaField(Modifier.PUBLIC + Modifier.STATIC + Modifier.FI=
NAL, "Log", "log", "LogFactory.getLog(" + className + ".class)");
-    }
-
-    /*
-    * Gestion du context
-    */
-    private JavaField createContextField() {
-        return new JavaField(Modifier.PROTECTED, "Map<Object,String>", "$con=
textMap", "new HashMap<Object,String>()");
-    }
-
-    private JavaMethod createSetContextValueMethod() {
-
-        return new JavaMethod(Modifier.PUBLIC, "void", "setContextValue",
-                new JavaArgument[]{new JavaArgument("Object", "clazz")}, nul=
l, getSetContextValueMethodCode());
-    }
-
-    private JavaMethod createSetContextValueNameMethod() {
-        return new JavaMethod(Modifier.PUBLIC, "void", "setContextValue",
-                new JavaArgument[]{new JavaArgument("Object", "clazz"), new =
JavaArgument("String", "name")}, null, getSetContextValueNameMethodCode());
-    }
-
-    private JavaMethod createGetContextValueMethod() {
-        return new JavaMethod(Modifier.PUBLIC, "<T> T", "getContextValue",
-                new JavaArgument[]{new JavaArgument("Class<T>", "clazz")}, n=
ull, getGetContextValueMethodCode());
-    }
-
-    private JavaMethod createGetContextValueNameMethod() {
-        return new JavaMethod(Modifier.PUBLIC, "<T> T", "getContextValue",
-                new JavaArgument[]{new JavaArgument("Class<T>", "clazz"), ne=
w JavaArgument("String", "name")}, null, getGetContextValueNameMethodCode());
-    }
-
-    private JavaMethod createGetParentContainer() {
-        return new JavaMethod(Modifier.PUBLIC, "<O extends Container> O", "g=
etParentContainer",
-                new JavaArgument[]{new JavaArgument("Class<O>", "clazz")}, n=
ull, getGetParentContenerMethodCode());
-    }
-
-    private JavaMethod createGetParentContainerMore() {
-        return new JavaMethod(Modifier.PUBLIC, "<O extends Container> O", "g=
etParentContainer",
-                new JavaArgument[]{new JavaArgument("Object", "source"), new=
 JavaArgument("Class<O>", "clazz")}, null, getGetParentContenerMethodMoreCode=
());
-    }
-
-    private String getSetContextValueMethodCode() {
-        return "this.setContextValue(clazz, null);";
-    }
-
-    private String getSetContextValueNameMethodCode() {
-        StringBuffer result =3D new StringBuffer();
-        result.append("$contextMap.put(clazz, name);");
-        return result.toString();
-    }
-
-    private String getGetContextValueMethodCode() {
-        return "return this.getContextValue(clazz, null);";
-    }
-
-    private String getGetContextValueNameMethodCode() {
-        StringBuffer result =3D new StringBuffer();
-        result.append("for (Map.Entry<Object,String> entry : $contextMap.ent=
rySet())  {");
-        result.append("if (clazz.isAssignableFrom(entry.getKey().getClass())=
 && (name =3D=3D null || name =3D=3D entry.getValue()))  {");
-        result.append("return (T) entry.getKey();}}");
-        result.append("return null;");
-        return result.toString();
-    }
-
-    private String getGetParentContenerMethodCode() {
-        StringBuffer result =3D new StringBuffer();
-        result.append("return this.getParentContainer(this, clazz);");
-        return result.toString();
-    }
-
-    private String getGetParentContenerMethodMoreCode() {
-        StringBuffer result =3D new StringBuffer();
-        result.append("if (!Container.class.isAssignableFrom(source.getClass=
())) {return null;}");
-        result.append(getLineSeparator());
-        result.append("Container parent =3D ((Container)source).getParent();=
");
-        result.append(getLineSeparator());
-        result.append("if (parent !=3D null && !clazz.isAssignableFrom(paren=
t.getClass())){parent =3D getParentContainer(parent, clazz);}");
-        result.append(getLineSeparator());
-        result.append("return (O)parent;");
-        return result.toString();
-    }
-
-    private JavaField createObjectMap() {
-        return new JavaField(Modifier.PROTECTED, "Map<String,Object>", "$obj=
ectMap", "new HashMap<String,Object>()");
-    }
-
-
-    protected JavaMethod createGetObjectByIdMethod() {
-        return new JavaMethod(Modifier.PUBLIC, "java.lang.Object", "getObjec=
tById",
-                new JavaArgument[]{new JavaArgument("String", "id")}, null,
-                "return $objectMap.get(id);");
-    }
-
-
-    public JAXXObjectDescriptor getJAXXObjectDescriptor() {
-        runInitializers();
-        CompiledObject[] components =3D new ArrayList<CompiledObject>(object=
s.values()).toArray(new CompiledObject[objects.size()]);
-        assert initializers.isEmpty() : "there are pending initializers rema=
ining";
-        assert root !=3D null : "root object has not been defined";
-        assert Arrays.asList(components).contains(root) : "root object is no=
t registered";
-        ComponentDescriptor[] descriptors =3D new ComponentDescriptor[compon=
ents.length];
-        // as we print, sort the array so that component's parents are alway=
s before the components themselves
-        for (int i =3D 0; i < components.length; i++) {
-            CompiledObject parent =3D components[i].getParent();
-            while (parent !=3D null) {
-                boolean found =3D false;
-                for (int j =3D i + 1; j < components.length; j++) { // found=
 parent after component, swap them
-                    if (components[j] =3D=3D parent) {
-                        components[j] =3D components[i];
-                        components[i] =3D parent;
-                        found =3D true;
-                        break;
-                    }
-                }
-                if (!found) {
-                    break;
-                }
-                parent =3D components[i].getParent();
-            }
-            int parentIndex =3D -1;
-            if (parent !=3D null) {
-                for (int j =3D 0; j < i; j++) {
-                    if (components[j] =3D=3D parent) {
-                        parentIndex =3D j;
-                        break;
-                    }
-                }
-            }
-            descriptors[i] =3D new ComponentDescriptor(components[i].getId()=
, components[i] =3D=3D root ? outputClassName : components[i].getObjectClass(=
).getName(),
-                    components[i].getStyleClass(), parentIndex !=3D -1 ? des=
criptors[parentIndex] : null);
-        }
-
-        Stylesheet stylesheet =3D getStylesheet();
-        if (stylesheet =3D=3D null) {
-            stylesheet =3D new Stylesheet();
-        }
-
-        return new JAXXObjectDescriptor(descriptors, stylesheet);
-    }
-
-
-    protected JavaField createJAXXObjectDescriptorField() {
-        try {
-            JAXXObjectDescriptor descriptor =3D getJAXXObjectDescriptor();
-            ByteArrayOutputStream buffer =3D new ByteArrayOutputStream();
-            ObjectOutputStream out =3D new ObjectOutputStream(new GZIPOutput=
Stream(buffer));
-            out.writeObject(descriptor);
-            out.close();
-            // the use of the weird deprecated constructor is deliberate -- =
we need to store the data as a String
-            // in the compiled class file, since byte array initialization i=
s horribly inefficient compared to
-            // String initialization.  So we store the bytes in the String, =
and we quite explicitly want a 1:1
-            // mapping between bytes and chars, with the high byte of the ch=
ar set to zero.  We can then safely
-            // reconstitute the original byte[] at a later date.  This is un=
questionably an abuse of the String
-            // type, but if we could efficiently store a byte[] we wouldn't =
have to do this.
-            String data =3D new String(buffer.toByteArray(), 0);
-
-            int sizeLimit =3D 65000; // constant strings are limited to 64K,=
 and I'm not brave enough to push right up to the limit
-            if (data.length() < sizeLimit) {
-                return new JavaField(Modifier.PRIVATE | Modifier.STATIC, "ja=
va.lang.String", "$jaxxObjectDescriptor", TypeManager.getJavaCode(data));
-            } else {
-                StringBuffer initializer =3D new StringBuffer();
-                for (int i =3D 0; i < data.length(); i +=3D sizeLimit) {
-                    String name =3D "$jaxxObjectDescriptor" + i;
-                    javaFile.addField(new JavaField(Modifier.PRIVATE | Modif=
ier.STATIC, "java.lang.String", name,
-                            TypeManager.getJavaCode(data.substring(i, Math.m=
in(i + sizeLimit, data.length())))));
-                    if (initializer.length() > 0) {
-                        initializer.append(" + ");
-                    }
-                    initializer.append("String.valueOf(").append(name).appen=
d(")");
-                }
-                return new JavaField(Modifier.PRIVATE | Modifier.STATIC, "ja=
va.lang.String", "$jaxxObjectDescriptor", initializer.toString());
-            }
-        }
-        catch (IOException e) {
-            throw new RuntimeException("Internal error: can't-happen error",=
 e);
-        }
-    }
-
-
-    protected JavaMethod createGetJAXXObjectDescriptorMethod() {
-        return new JavaMethod(Modifier.PUBLIC | Modifier.STATIC, "jaxx.runti=
me.JAXXObjectDescriptor", "$getJAXXObjectDescriptor",
-                null, null, "return jaxx.runtime.Util.decodeCompressedJAXXOb=
jectDescriptor($jaxxObjectDescriptor);");
-    }
-
-
-    public String getEventHandlerMethodName(EventHandler handler) {
-        String result =3D eventHandlerMethodNames.get(handler);
-        if (result =3D=3D null) {
-            result =3D "$ev" + eventHandlerMethodNames.size();
-            eventHandlerMethodNames.put(handler, result);
-        }
-        return result;
-    }
-
-    protected void addEventHandlers(JavaFile javaFile) {
-        for (Map.Entry<String, Map<ClassDescriptor, List<EventHandler>>> e1 =
: eventHandlers.entrySet()) {
-            // outer loop is iterating over different objects (well, technic=
ally, different Java expressions)
-            for (Map.Entry<ClassDescriptor, List<EventHandler>> e2 : e1.getV=
alue().entrySet()) {
-                // iterate over different types of listeners for this partic=
ular object (MouseListener, ComponentListener, etc.)
-                for (EventHandler handler : e2.getValue()) {
-                    // iterate over individual event handlers of a single ty=
pe
-                    String methodName =3D getEventHandlerMethodName(handler);
-                    MethodDescriptor listenerMethod =3D handler.getListenerM=
ethod();
-                    if (listenerMethod.getParameterTypes().length !=3D 1) {
-                        throw new CompilerException("Expected event handler =
" + listenerMethod.getName() + " of class " + handler.getListenerClass() + " =
to have exactly one argument");
-                    }
-                    javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void=
", methodName,
-                            new JavaArgument[]{new JavaArgument(getCanonical=
Name(listenerMethod.getParameterTypes()[0]), "event")}, null,
-                            handler.getJavaCode()));
-
-                }
-            }
-        }
-    }
-
-    protected String getCreationCode(CompiledObject object) throws CompilerE=
xception {
-        if (object instanceof ScriptInitializer) {
-            return object.getInitializationCode(this);
-        }
-        StringBuffer result =3D new StringBuffer();
-        result.append(object.getId());
-        result.append(" =3D ");
-        String constructorParams =3D object.getConstructorParams();
-        if (constructorParams !=3D null) {
-            result.append(" new ").append(getCanonicalName(object.getObjectC=
lass())).append("(").append(constructorParams).append(");");
-            //result.append("(").append(getCanonicalName(object.getObjectCla=
ss())).append(") new ").append(getCanonicalName(object.getObjectClass())).app=
end("(").append(constructorParams).append(");");
-        } else {
-            result.append("new ").append(getCanonicalName(object.getObjectCl=
ass())).append("();");
-        }
-        result.append(getLineSeparator());
-        String initCode =3D object.getInitializationCode(this);
-        if (initCode !=3D null && initCode.length() > 0) {
-            result.append(initCode);
-        }
-        result.append("$objectMap.put(").append(TypeManager.getJavaCode(obje=
ct.getId())).append(", ").append(object.getId()).append(");");
-
-        return result.toString();
-    }
-
-
-    protected void addPropertyChangeSupport(JavaFile javaFile) throws Compil=
erException {
-        javaFile.addField(new JavaField(0, "java.beans.PropertyChangeSupport=
", "$propertyChangeSupport"));
-
-        javaFile.addMethod(new JavaMethod(0, "java.beans.PropertyChangeSuppo=
rt", "$getPropertyChangeSupport", null, null,
-                "if ($propertyChangeSupport =3D=3D null)\n" +
-                        "    $propertyChangeSupport =3D new PropertyChangeSu=
pport(this);\n" +
-                        "return $propertyChangeSupport;"));
-
-        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "addPrope=
rtyChangeListener", new JavaArgument[]{
-                new JavaArgument("java.beans.PropertyChangeListener", "liste=
ner")}, null,
-                "$getPropertyChangeSupport().addPropertyChangeListener(liste=
ner);"));
-
-        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "addPrope=
rtyChangeListener", new JavaArgument[]{
-                new JavaArgument("java.lang.String", "property"), new JavaAr=
gument("java.beans.PropertyChangeListener", "listener")}, null,
-                "$getPropertyChangeSupport().addPropertyChangeListener(prope=
rty, listener);"));
-
-        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "removePr=
opertyChangeListener", new JavaArgument[]{
-                new JavaArgument("java.beans.PropertyChangeListener", "liste=
ner")}, null,
-                "$getPropertyChangeSupport().removePropertyChangeListener(li=
stener);"));
-
-        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "removePr=
opertyChangeListener", new JavaArgument[]{
-                new JavaArgument("java.lang.String", "property"), new JavaAr=
gument("java.beans.PropertyChangeListener", "listener")}, null,
-                "$getPropertyChangeSupport().removePropertyChangeListener(pr=
operty, listener);"));
-
-        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "fireProp=
ertyChange", new JavaArgument[]{
-                new JavaArgument("java.lang.String", "propertyName"), new Ja=
vaArgument("java.lang.Object", "oldValue"), new JavaArgument("java.lang.Objec=
t", "newValue")},
-                null, "$getPropertyChangeSupport().firePropertyChange(proper=
tyName, oldValue, newValue);"));
-    }
-
-
-    public void compileFirstPass(final Element tag) throws IOException {
-        tagsBeingCompiled.push(tag);
-
-        String namespace =3D tag.getNamespaceURI();
-        String fullClassName;
-        String localName =3D tag.getLocalName();
-        boolean namespacePrefix =3D tag.getPrefix() !=3D null;
-        // resolve class tags into fully-qualified class name
-        if (namespace !=3D null && namespace.endsWith("*")) {
-            String packageName =3D namespace.substring(0, namespace.length()=
 - 1);
-            if (localName.startsWith(packageName)) // class name is fully-qu=
alified already
-            {
-                fullClassName =3D TagManager.resolveClassName(localName, thi=
s);
-            } else { // namespace not included in class name, probably need =
the namespace to resolve
-                fullClassName =3D TagManager.resolveClassName(packageName + =
localName, this);
-                if (fullClassName =3D=3D null && !namespacePrefix) // it was=
 just a default namespace, try again without using the namespace
-                {
-                    fullClassName =3D TagManager.resolveClassName(localName,=
 this);
-                }
-            }
-        } else {
-            fullClassName =3D TagManager.resolveClassName(localName, this);
-        }
-
-        if (fullClassName !=3D null) { // we are definitely dealing with a c=
lass tag
-            addDependencyClass(fullClassName);
-            namespace =3D fullClassName.substring(0, fullClassName.lastIndex=
Of(".") + 1) + "*";
-            if (symbolTable.getSuperclassName() =3D=3D null) {
-                symbolTable.setSuperclassName(fullClassName);
-            }
-            String id =3D tag.getAttribute("id");
-            if (id.length() > 0) {
-                symbolTable.getClassTagIds().put(id, fullClassName);
-            }
-        }
-        // during the first pass, we can't create ClassDescriptors for JAXX =
files because they may not have been processed yet
-        // (and we can't wait until they have been processed because of circ=
ular dependencies).  So we don't do any processing
-        // during the first pass which requires having a ClassDescriptor;  h=
ere we determine whether we have a class tag or not
-        // (class tag namespaces end in "*") and use a generic handler if so=
.  The real handler is used during the second pass.
-        TagHandler handler =3D (namespace !=3D null && namespace.endsWith("*=
")) ? firstPassClassTagHandler : TagManager.getTagHandler(tag.getNamespaceURI=
(), localName, namespacePrefix, this);
-        if (handler !=3D firstPassClassTagHandler && handler instanceof Defa=
ultObjectHandler) {
-            fullClassName =3D ((DefaultObjectHandler) handler).getBeanClass(=
).getName();
-            //namespace =3D fullClassName.substring(0, fullClassName.lastInd=
exOf(".") + 1) + "*";
-            handler =3D firstPassClassTagHandler;
-        }
-        if (handler =3D=3D firstPassClassTagHandler) {
-            final String finalClassName =3D fullClassName;
-            registerInitializer(new Runnable() { // register an initializer =
which will create the CompiledObject after pass 1
-
-                public void run() {
-                    DefaultObjectHandler handler =3D (DefaultObjectHandler) =
TagManager.getTagHandler(null, finalClassName, JAXXCompiler.this);
-                    if (handler =3D=3D null) {
-                        throw new CompilerException("Internal error: missing=
 TagHandler for '" + finalClassName + "'");
-                    }
-                    handler.registerCompiledObject(tag, JAXXCompiler.this);
-                }
-            });
-        }
-        if (handler !=3D null) {
-            try {
-                handler.compileFirstPass(tag, this);
-            }
-            catch (CompilerException e) {
-                reportError(e);
-            }
-        } else {
-            reportError("Could not find a Java class corresponding to: <" + =
tag.getTagName() + ">");
-            failed =3D true;
-        }
-
-        Element finished =3D tagsBeingCompiled.pop();
-        if (finished !=3D tag) {
-            throw new RuntimeException("internal error: just finished compil=
ing " + tag + ", but top of tagsBeingCompiled stack is " + finished);
-        }
-    }
-
-
-    public void compileSecondPass(Element tag) throws IOException {
-        tagsBeingCompiled.push(tag);
-
-        TagHandler handler =3D TagManager.getTagHandler(tag.getNamespaceURI(=
), tag.getLocalName(), tag.getPrefix() !=3D null, this);
-        if (handler !=3D null) {
-            handler.compileSecondPass(tag, this);
-        } else {
-            reportError("Could not find a Java class corresponding to: <" + =
tag.getTagName() + ">");
-            assert false : "can't-happen error: error should have been repor=
ted during the fast pass and caused an abort";
-            failed =3D true;
-        }
-
-        Element finished =3D tagsBeingCompiled.pop();
-        if (finished !=3D tag) {
-            throw new RuntimeException("internal error: just finished compil=
ing " + tag + ", but top of tagsBeingCompiled stack is " + finished);
-        }
-
-    }
-
-
-    // 1.5 adds getCanonicalName; unfortunately we can't depend on 1.5 featu=
res yet
-    public static String getCanonicalName(Class clazz) {
-        if (clazz.isArray()) {
-            String canonicalName =3D getCanonicalName(clazz.getComponentType=
());
-            if (canonicalName !=3D null) {
-                return canonicalName + "[]";
-            }
-            return null;
-        }
-        return clazz.getName().replace('$', '.');
-    }
-
-
-    public static String getCanonicalName(ClassDescriptor clazz) {
-        if (clazz.isArray()) {
-            String canonicalName =3D getCanonicalName(clazz.getComponentType=
());
-            if (canonicalName !=3D null) {
-                return canonicalName + "[]";
-            }
-            return null;
-        }
-        return clazz.getName().replace('$', '.');
-    }
-
-
-    public static String capitalize(String s) {
-        if (s.length() =3D=3D 0) {
-            return s;
-        }
-        return Character.toUpperCase(s.charAt(0)) + s.substring(1);
-    }
-
-
-    public String[] parseParameterList(String parameters) throws CompilerExc=
eption {
-        List<String> result =3D new ArrayList<String>();
-        StringBuffer current =3D new StringBuffer();
-        int state =3D 0; // normal
-        for (int i =3D 0; i < parameters.length(); i++) {
-            char c =3D parameters.charAt(i);
-            switch (state) {
-                case 0: // normal
-                    switch (c) {
-                        case '"':
-                            current.append(c);
-                            state =3D 1;
-                            break; // in quoted string
-                        case '\\':
-                            current.append(c);
-                            state =3D 2;
-                            break; // immediately after backslash
-                        case ',':
-                            if (current.length() > 0) {
-                                result.add(current.toString());
-                                current.setLength(0);
-                                break;
-                            } else {
-                                reportError("error parsing parameter list: "=
 + parameters);
-                            }
-                        default:
-                            current.append(c);
-                    }
-                    break;
-                case 1: // in quoted string
-                    switch (c) {
-                        case '"':
-                            current.append(c);
-                            state =3D 0;
-                            break; // normal
-                        case '\\':
-                            current.append(c);
-                            state =3D 3;
-                            break; // immediate after backslash in quoted st=
ring
-                        default:
-                            current.append(c);
-                    }
-                    break;
-                case 2: // immediately after backslash
-                    current.append(c);
-                    state =3D 0; // normal
-                    break;
-                case 3: // immediately after backslash in quoted string
-                    current.append(c);
-                    state =3D 1; // in quoted string
-                    break;
-            }
-        }
-        if (current.length() > 0) {
-            result.add(current.toString());
-        }
-        return result.toArray(new String[result.size()]);
-    }
-
-
-    public void openComponent(CompiledObject component) throws CompilerExcep=
tion {
-        openComponent(component, null);
-    }
-
-
-    public void openComponent(CompiledObject component, String constraints) =
throws CompilerException {
-        CompiledObject parent =3D getOpenComponent();
-        openInvisibleComponent(component);
-        if (parent !=3D null && !component.isOverride()) {
-            parent.addChild(component, constraints, this);
-        }
-    }
-
-
-    public void openInvisibleComponent(CompiledObject component) {
-        if (!ids.containsKey(component)) {
-            registerCompiledObject(component);
-        }
-        openComponents.push(component);
-    }
-
-
-    public CompiledObject getOpenComponent() {
-        if (openComponents.isEmpty()) {
-            return null;
-        }
-        return openComponents.peek();
-    }
-
-
-    public void closeComponent(CompiledObject component) {
-        if (openComponents.pop() !=3D component) {
-            throw new IllegalArgumentException("can only close the topmost o=
pen object");
-        }
-    }
-
-
-    public CompiledObject getRootObject() {
-        return root;
-    }
-
-
-    public void registerCompiledObject(CompiledObject object) {
-        assert symbolTables.values().contains(symbolTable) : "attempting to =
register CompiledObject before pass 1 is complete";
-        if (root =3D=3D null) {
-            root =3D object;
-        }
-
-        String id =3D object.getId();
-        if (ids.containsKey(object)) {
-            reportError("object '" + object + "' is already registered with =
id '" + ids.get(object) + "', cannot re-register as '" + id + "'");
-        }
-        if (objects.containsKey(id) && !(objects.get(id) instanceof Element)=
) {
-            reportError("id '" + id + "' is already registered to component =
" + objects.get(id));
-        }
-        objects.put(id, object);
-        ids.put(object, id);
-    }
-
-
-    public String getAutoId(ClassDescriptor objectClass) {
-        if (options.getOptimize()) {
-            return "$" + Integer.toString(autogenID++, 36);
-        } else {
-            String name =3D objectClass.getName();
-            name =3D name.substring(name.lastIndexOf(".") + 1);
-            return "$" + name + autogenID++;
-        }
-    }
-
-
-    public String getUniqueId(Object object) {
-        String result =3D uniqueIds.get(object);
-        if (result =3D=3D null) {
-            result =3D "$u" + uniqueIds.size();
-            uniqueIds.put(object, result);
-        }
-        return result;
-    }
-
-
-    public SymbolTable getSymbolTable() {
-        return symbolTable;
-    }
-
-
-    public CompiledObject getCompiledObject(String id) {
-        runInitializers();
-        assert symbolTables.values().contains(symbolTable) : "attempting to =
retrieve CompiledObject before pass 1 is complete";
-        return objects.get(id);
-    }
-
-
-    private Matcher leftBraceMatcher =3D Pattern.compile("^(\\{)|[^\\\\](\\{=
)").matcher("");
-
-    private int getNextLeftBrace(String string, int pos) {
-        leftBraceMatcher.reset(string);
-        return leftBraceMatcher.find(pos) ? Math.max(leftBraceMatcher.start(=
1), leftBraceMatcher.start(2)) : -1;
-    }
-
-
-    private Matcher rightBraceMatcher =3D Pattern.compile("^(\\})|[^\\\\](\\=
})").matcher("");
-
-    private int getNextRightBrace(String string, int pos) {
-        leftBraceMatcher.reset(string);
-        rightBraceMatcher.reset(string);
-        int openCount =3D 1;
-        int rightPos;
-        while (openCount > 0) {
-            pos++;
-            int leftPos =3D leftBraceMatcher.find(pos) ? Math.max(leftBraceM=
atcher.start(1), leftBraceMatcher.start(2)) : -1;
-            rightPos =3D rightBraceMatcher.find(pos) ? Math.max(rightBraceMa=
tcher.start(1), rightBraceMatcher.start(2)) : -1;
-            assert leftPos =3D=3D -1 || leftPos >=3D pos;
-            assert rightPos =3D=3D -1 || rightPos >=3D pos;
-            if (leftPos !=3D -1 && leftPos < rightPos) {
-                pos =3D leftPos;
-                openCount++;
-            } else if (rightPos !=3D -1) {
-                pos =3D rightPos;
-                openCount--;
-            } else {
-                openCount =3D 0;
-            }
-        }
-        return pos;
-    }
-
-
-    /**
-     * Examine an attribute value for data binding expressions.  Returns a '=
cooked' expression which
-     * can be used to determine the resulting value.  It is expected that th=
is expression will be used
-     * as the source expression in a call to {@link #registerDataBinding}.
-     * If the attribute value does not invoke data binding, this method retu=
rns <code>null</code>
-     *
-     * @param stringValue the string value of the property from the XML
-     * @param type        the type of the property, from the <code>JAXXPrope=
rtyDescriptor</code>
-     * @return a processed version of the expression
-     * @throws jaxx.CompilerException ?
-     */
-    public String processDataBindings(String stringValue, ClassDescriptor ty=
pe) throws CompilerException {
-        int pos =3D getNextLeftBrace(stringValue, 0);
-        if (pos !=3D -1) {
-            StringBuffer expression =3D new StringBuffer();
-            int lastPos =3D 0;
-            while (pos !=3D -1 && pos < stringValue.length()) {
-                if (pos > lastPos) {
-                    if (expression.length() > 0) {
-                        expression.append(" + ");
-                    }
-                    expression.append('"');
-                    expression.append(JAXXCompiler.escapeJavaString(stringVa=
lue.substring(lastPos, pos)));
-                    expression.append('"');
-                }
-
-                if (expression.length() > 0) {
-                    expression.append(" + ");
-                }
-                expression.append('(');
-                int pos2 =3D getNextRightBrace(stringValue, pos + 1);
-                if (pos2 =3D=3D -1) {
-                    reportError("unmatched '{' in expression: " + stringValu=
e);
-                    return "";
-                }
-                expression.append(stringValue.substring(pos + 1, pos2));
-                expression.append(')');
-                pos2++;
-                if (pos2 < stringValue.length()) {
-                    pos =3D getNextLeftBrace(stringValue, pos2);
-                    lastPos =3D pos2;
-                } else {
-                    pos =3D stringValue.length();
-                    lastPos =3D pos;
-                }
-            }
-            if (lastPos < stringValue.length()) {
-                if (expression.length() > 0) {
-                    expression.append(" + ");
-                }
-                expression.append('"');
-                expression.append(JAXXCompiler.escapeJavaString(stringValue.=
substring(lastPos)));
-                expression.append('"');
-            }
-            return type =3D=3D ClassDescriptorLoader.getClassDescriptor(Stri=
ng.class) ? "String.valueOf(" + expression + ")" : expression.toString();
-        }
-        return null;
-    }
-
-
-    public void registerDataBinding(String src, String dest, String assignme=
nt) {
-        try {
-            src =3D checkJavaCode(src);
-            dataBindings.add(new DataBinding(src, dest, assignment, this));
-        }
-        catch (CompilerException e) {
-            reportError("While parsing data binding for '" + dest.substring(=
dest.lastIndexOf(".") + 1) + "': " + e.getMessage());
-        }
-    }
-
-
-    public ScriptManager getScriptManager() {
-        return scriptManager;
-    }
-
-
-    /**
-     * Verifies that a snippet of Java code parses correctly.  A warning is =
generated if the string has enclosing
-     * curly braces.
-     *
-     * @param javaCode the Java code snippet to test
-     * @return a "cooked" version of the string which has enclosing curly br=
aces removed.
-     * @throws CompilerException if the code cannot be parsed
-     */
-    public String checkJavaCode(String javaCode) {
-        javaCode =3D scriptManager.trimScript(javaCode);
-        scriptManager.checkParse(javaCode);
-        return javaCode;
-    }
-
-
-    public void registerEventHandler(EventHandler handler) {
-        String objectCode =3D handler.getObjectCode();
-        Map<ClassDescriptor, List<EventHandler>> listeners =3D eventHandlers=
.get(objectCode);
-        if (listeners =3D=3D null) {
-            listeners =3D new HashMap<ClassDescriptor, List<EventHandler>>();
-            eventHandlers.put(objectCode, listeners);
-        }
-        ClassDescriptor listenerClass =3D handler.getListenerClass();
-        List<EventHandler> handlerList =3D listeners.get(listenerClass);
-        if (handlerList =3D=3D null) {
-            handlerList =3D new ArrayList<EventHandler>();
-            listeners.put(listenerClass, handlerList);
-        }
-        handlerList.add(handler);
-    }
-
-
-    public FieldDescriptor[] getScriptFields() {
-        List<FieldDescriptor> scriptFields =3D symbolTable.getScriptFields();
-        return scriptFields.toArray(new FieldDescriptor[scriptFields.size()]=
);
-    }
-
-
-    public void addScriptField(FieldDescriptor field) {
-        symbolTable.getScriptFields().add(field);
-    }
-
-
-    public MethodDescriptor[] getScriptMethods() {
-        List<MethodDescriptor> scriptMethods =3D symbolTable.getScriptMethod=
s();
-        return scriptMethods.toArray(new MethodDescriptor[scriptMethods.size=
()]);
-    }
-
-
-    public void addScriptMethod(MethodDescriptor method) {
-        if (method.getName().equals("main") && method.getParameterTypes().le=
ngth =3D=3D 1 && method.getParameterTypes()[0].getName().equals("[Ljava.lang.=
String;")) {
-            mainDeclared =3D true;
-        }
-        symbolTable.getScriptMethods().add(method);
-    }
-
-
-    public void registerScript(String script) throws CompilerException {
-        registerScript(script, null);
-    }
-
-
-    public void registerScript(String script, File sourceFile) throws Compil=
erException {
-        if (sourceFile !=3D null) {
-            sourceFiles.push(sourceFile);
-        }
-        script =3D script.trim();
-        if (!"".equals(script) && !script.endsWith("}") && !script.endsWith(=
";")) {
-            script +=3D ";";
-        }
-        scriptManager.registerScript(script);
-
-        if (sourceFile !=3D null) {
-            File pop =3D sourceFiles.pop();
-            if (pop !=3D sourceFile) {
-                throw new RuntimeException("leaving registerScript(), but " =
+ sourceFile + " was not the top entry on the stack (found " + pop + " instea=
d)");
-            }
-        }
-    }
-
-
-    public String preprocessScript(String script) throws CompilerException {
-        return scriptManager.preprocessScript(script);
-    }
-
-
-    public void registerStylesheet(Stylesheet stylesheet) {
-        if (this.stylesheet =3D=3D null) {
-            this.stylesheet =3D stylesheet;
-        } else {
-            this.stylesheet.add(stylesheet.getRules());
-        }
-    }
-
-
-    public Stylesheet getStylesheet() {
-        Stylesheet merged =3D new Stylesheet();
-        if (stylesheet !=3D null) {
-            merged.add(stylesheet.getRules());
-        }
-        merged.add(inlineStyles.toArray(new Rule[inlineStyles.size()]));
-        return merged;
-    }
-
-
-    public Stack<File> getSourceFiles() {
-        return sourceFiles;
-    }
-
-
-    public void addInlineStyle(CompiledObject object, String propertyName, b=
oolean dataBinding) {
-        inlineStyles.add(Rule.inlineAttribute(object, propertyName, dataBind=
ing));
-    }
-
-
-    public void reportWarning(String warning) {
-        Element currentTag =3D null;
-        if (!tagsBeingCompiled.isEmpty()) {
-            currentTag =3D tagsBeingCompiled.peek();
-        }
-        reportWarning(currentTag, warning, 0);
-    }
-
-
-    public void reportWarning(Element tag, String warning, int lineOffset) {
-        String lineNumber =3D null;
-        if (tag !=3D null) {
-            String lineAttr =3D tag.getAttributeNS(JAXX_INTERNAL_NAMESPACE, =
"line");
-            if (lineAttr.length() > 0) {
-                lineNumber =3D lineAttr;
-            }
-        }
-        File src =3D sourceFiles.peek();
-        try {
-            src =3D src.getCanonicalFile();
-        }
-        catch (IOException e) {
-            // ignore ?
-        }
-
-        System.err.print(src);
-        if (lineNumber !=3D null) {
-            System.err.print(":" + ((sourceFiles.size() =3D=3D 1) ? Integer.=
parseInt(lineNumber) + lineOffset : lineOffset + 1));
-        }
-        System.err.println(": Warning: " + warning);
-        warningCount++;
-    }
-
-
-    public void reportError(String error) {
-        Element currentTag =3D null;
-        if (!tagsBeingCompiled.isEmpty()) {
-            currentTag =3D tagsBeingCompiled.peek();
-        }
-        reportError(currentTag, error);
-    }
-
-
-    public void reportError(CompilerException ex) {
-        reportError(null, ex);
-    }
-
-
-    public void reportError(String extraMessage, CompilerException ex) {
-        String message =3D ex.getMessage();
-        if (ex.getClass() =3D=3D UnsupportedAttributeException.class || ex.g=
etClass() =3D=3D UnsupportedTagException.class) {
-            message =3D ex.getClass().getName().substring(ex.getClass().getN=
ame().lastIndexOf(".") + 1) + ": " + message;
-        }
-        int lineOffset;
-        if (ex instanceof ParseException) {
-            lineOffset =3D Math.max(0, ((ParseException) ex).getLine() - 1);
-        } else {
-            lineOffset =3D 0;
-        }
-        Element currentTag =3D null;
-        if (!tagsBeingCompiled.isEmpty()) {
-            currentTag =3D tagsBeingCompiled.peek();
-        }
-        reportError(currentTag, extraMessage !=3D null ? extraMessage + mess=
age : message, lineOffset);
-    }
-
-
-    public void reportError(Element tag, String error) {
-        reportError(tag, error, 0);
-    }
-
-
-    public void reportError(Element tag, String error, int lineOffset) {
-        int lineNumber =3D 0;
-        if (tag !=3D null) {
-            String lineAttr =3D tag.getAttributeNS(JAXX_INTERNAL_NAMESPACE, =
"line");
-            if (lineAttr.length() > 0) {
-                lineNumber =3D Integer.parseInt(lineAttr);
-            }
-        }
-        lineNumber =3D Math.max(lineNumber, 1) + lineOffset;
-        reportError(lineNumber, error);
-    }
-
-
-    public void reportError(int lineNumber, String error) {
-        File src =3D sourceFiles.isEmpty() ? null : sourceFiles.peek();
-        try {
-            if (src !=3D null) {
-                src =3D src.getCanonicalFile();
-            }
-        }
-        catch (IOException e) {
-            // ignore ?
-        }
-
-        System.err.print(src !=3D null ? src.getPath() : "<unknown source>");
-        if (lineNumber > 0) {
-            System.err.print(":" + lineNumber);
-        }
-        System.err.println(": " + error);
-        errorCount++;
-        failed =3D true;
-    }
-
-
-    /**
-     * Escapes a string using standard Java escape sequences, generally in p=
reparation to including it in a string literal
-     * in a compiled Java file.
-     *
-     * @param raw the raw string to be escape
-     * @return a string in which all 'dangerous' characters have been replac=
ed by equivalent Java escape sequences
-     */
-    public static String escapeJavaString(String raw) {
-        StringBuffer out =3D new StringBuffer(raw);
-        for (int i =3D 0; i < out.length(); i++) {
-            char c =3D out.charAt(i);
-            if (c =3D=3D '\\' || c =3D=3D '"') {
-                out.insert(i, '\\');
-                i++;
-            } else if (c =3D=3D '\n') {
-                out.replace(i, i + 1, "\\n");
-                i++;
-            } else if (c =3D=3D '\r') {
-                out.replace(i, i + 1, "\\r");
-                i++;
-            } else if (c < 32 || c > 127) {
-                String value =3D Integer.toString((int) c, 16);
-                while (value.length() < 4) {
-                    value =3D "0" + value;
-                }
-                out.replace(i, i + 1, "\\u" + value);
-                i +=3D 5;
-            }
-        }
-        return out.toString();
-    }
-
-
-    /**
-     * Returns the system line separator string.
-     *
-     * @return the string used to separate lines
-     */
-    public static String getLineSeparator() {
-        return System.getProperty("line.separator", "\n");
-    }
-
-
-    /**
-     * Returns a <code>ClassLoader</code> which searches the user-specified =
class path in addition
-     * to the normal system class path.
-     *
-     * @return <code>ClassLoader</code> to use while resolving class referen=
ces
-     */
-    public ClassLoader getClassLoader() {
-        if (classLoader =3D=3D null) {
-            String classPath =3D options.getClassPath();
-            if (classPath =3D=3D null) {
-                classPath =3D ".";
-            }
-            String[] paths =3D classPath.split(File.pathSeparator);
-            URL[] urls =3D new URL[paths.length];
-            for (int i =3D 0; i < paths.length; i++) {
-                try {
-                    urls[i] =3D new File(paths[i]).toURI().toURL();
-                }
-                catch (MalformedURLException e) {
-                    throw new RuntimeException(e);
-                }
-            }
-            classLoader =3D new URLClassLoader(urls, getClass().getClassLoad=
er());
-        }
-
-        return classLoader;
-    }
-
-
-    /**
-     * @param className the name of the class to use
-     * @return the compiler instance which is processing the specified JAXX =
class.  Each class is compiled by a
-     *         different compiler instance.
-     */
-    public static JAXXCompiler getJAXXCompiler(String className) {
-        return compilers !=3D null ? compilers.get(className) : null;
-    }
-
-
-    /**
-     * @param className the name of the class to use
-     * @return the symbol table for the specified JAXX class.  Must be calle=
d during the second compiler pass.
-     *         Returns <code>null</code> if no such symbol table could be fo=
und.
-     */
-    public static SymbolTable getSymbolTable(String className) {
-        JAXXCompiler compiler =3D getJAXXCompiler(className);
-        if (compiler =3D=3D null) {
-            return null;
-        }
-        return compiler.getSymbolTable();
-    }
-
-    public static File URLtoFile(URL url) {
-        return URLtoFile(url.toString());
-    }
-
-    public static File URLtoFile(String urlString) {
-        if (!urlString.startsWith("file:")) {
-            throw new IllegalArgumentException("url must start with 'file:'"=
);
-        }
-        urlString =3D urlString.substring("file:".length());
-        if (urlString.startsWith("/") && System.getProperty("os.name").start=
sWith("Windows")) {
-            urlString =3D urlString.substring(1);
-        }
-        try {
-            return new File(URLDecoder.decode(urlString.replace('/', File.se=
paratorChar), "utf-8"));
-        }
-        catch (UnsupportedEncodingException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    public void addDependencyClass(String className) {
-        if (!jaxxFileClassNames.contains(className)) {
-            URL jaxxURL =3D getClassLoader().getResource(className.replace('=
.', '/') + ".jaxx");
-            URL classURL =3D getClassLoader().getResource(className.replace(=
'.', '/') + ".class");
-            if (jaxxURL !=3D null && classURL !=3D null) {
-                try {
-                    File jaxxFile =3D URLtoFile(jaxxURL);
-                    File classFile =3D URLtoFile(classURL);
-                    if (classFile.lastModified() > jaxxFile.lastModified()) {
-                        return; // class file is newer, no need to recompile
-                    }
-                }
-                catch (Exception e) {
-                    // do nothing
-                }
-            }
-
-            if (jaxxURL !=3D null && jaxxURL.toString().startsWith("file:"))=
 {
-                File jaxxFile =3D URLtoFile(jaxxURL);
-                try {
-                    jaxxFile =3D jaxxFile.getCanonicalFile();
-                }
-                catch (IOException ex) {
-                    // ignore ?
-                }
-                assert jaxxFile.getName().equalsIgnoreCase(className.substri=
ng(className.lastIndexOf(".") + 1) + ".jaxx") :
-                        "expecting file name to match " + className + ", but=
 found " + jaxxFile.getName();
-                if (jaxxFile.getName().equals(className.substring(className.=
lastIndexOf(".") + 1) + ".jaxx")) { // check case match
-                    if (currentPass =3D=3D PASS_2) {
-                        throw new AssertionError("Internal error: adding dep=
endency class " + className + " during second compilation pass");
-                    }
-                    jaxxFileClassNames.add(className);
-                    jaxxFiles.add(jaxxFile);
-                }
-            }
-        }
-    }
-
-
-    /**
-     * Compiled a set of files, expressed as paths relative to a base direct=
ory.  The class names of the compiled files are derived
-     * from the relative path strings (e.g. "example/Foo.jaxx" compiles into=
 a class named "example.Foo").  Returns <code>true</code>
-     * if compilation succeeds, <code>false</code> if it fails.  Warning and=
 error messages are sent to <code>System.err</code>.
-     *
-     * @param base          the directory against which to resolve relative =
paths
-     * @param relativePaths a list of relative paths to .jaxx files being co=
mpiled
-     * @param options       the compiler options to use
-     * @return <code>true</code> if compilation succeeds, <code>false</code>=
 otherwise
-     */
-    public static synchronized boolean compile(File base, String[] relativeP=
aths, CompilerOptions options) {
-        File[] files =3D new File[relativePaths.length];
-        String[] classNames =3D new String[relativePaths.length];
-        for (int i =3D 0; i < files.length; i++) {
-            files[i] =3D new File(base, relativePaths[i]);
-            classNames[i] =3D relativePaths[i].substring(0, relativePaths[i]=
.lastIndexOf("."));
-            classNames[i] =3D classNames[i].replace(File.separatorChar, '.');
-            classNames[i] =3D classNames[i].replace('/', '.');
-            classNames[i] =3D classNames[i].replace('\\', '.');
-            classNames[i] =3D classNames[i].replace(':', '.');
-        }
-        return compile(files, classNames, options);
-    }
-
-
-    /** Resets all state in preparation for a new compilation session. */
-    private static void reset() {
-        errorCount =3D 0;
-        warningCount =3D 0;
-        jaxxFiles.clear();
-        jaxxFileClassNames.clear();
-        symbolTables.clear();
-        compilers.clear();
-    }
-
-
-    /**
-     * Compiled a set of files, with the class names specified explicitly.  =
The class compiled from files[i] will be named classNames[i].
-     * Returns <code>true</code> if compilation succeeds, <code>false</code>=
 if it fails.  Warning and error messages are sent to
-     * <code>System.err</code>.
-     *
-     * @param files      the .jaxx files to compile
-     * @param classNames the names of the classes being compiled
-     * @param options    the compiler options to use
-     * @return <code>true</code> if compilation succeeds, <code>false</code>=
 otherwise
-     */
-    public static synchronized boolean compile(File[] files, String[] classN=
ames, CompilerOptions options) {
-        reset(); // just to be safe...
-        jaxxFiles.addAll(Arrays.asList(files));
-        jaxxFileClassNames.addAll(Arrays.asList(classNames));
-        try {
-            boolean success =3D true;
-
-            // pass 1
-            currentPass =3D PASS_1;
-            boolean compiled;
-            do {
-                compiled =3D false;
-                assert jaxxFiles.size() =3D=3D jaxxFileClassNames.size();
-                java.util.Iterator<File> filesIterator =3D new ArrayList<Fil=
e>(jaxxFiles).iterator(); // clone it so it can safely be modified while we'r=
e iterating
-                java.util.Iterator<String> classNamesIterator =3D new ArrayL=
ist<String>(jaxxFileClassNames).iterator();
-                while (filesIterator.hasNext()) {
-                    File file =3D filesIterator.next();
-                    String className =3D classNamesIterator.next();
-                    if (options.isVerbose()) {
-                        log.info("compile first pass for " + className);
-                    }
-                    if (symbolTables.get(file) =3D=3D null) {
-                        compiled =3D true;
-                        if (compilers.containsKey(className)) {
-                            throw new CompilerException("Internal error: " +=
 className + " is already being compiled, attempting to compile it again");
-                        }
-
-                        File destDir =3D options.getTargetDirectory();
-                        if (destDir !=3D null) {
-                            int dotPos =3D className.lastIndexOf(".");
-                            if (dotPos !=3D -1) {
-                                destDir =3D new File(destDir, className.subs=
tring(0, dotPos).replace('.', File.separatorChar));
-                            }
-                            destDir.mkdirs();
-                        } else {
-                            //destDir =3D file.getParentFile();
-                        }
-                        JAXXCompiler compiler =3D new JAXXCompiler(file.getP=
arentFile(), file, className, options);
-                        compilers.put(className, compiler);
-                        compiler.compileFirstPass();
-                        assert !symbolTables.values().contains(compiler.getS=
ymbolTable()) : "symbolTable is already registered";
-                        symbolTables.put(file, compiler.getSymbolTable());
-                        if (compiler.failed) {
-                            success =3D false;
-                        }
-                    }
-                }
-
-            } while (compiled);
-
-            // pass 2
-            currentPass =3D PASS_2;
-            if (success) {
-                assert jaxxFiles.size() =3D=3D jaxxFileClassNames.size();
-                List<File> jaxxFilesClone =3D new ArrayList<File>(jaxxFiles);
-                for (String className : jaxxFileClassNames) {
-                    JAXXCompiler compiler =3D compilers.get(className);
-                    if (compiler =3D=3D null) {
-                        throw new CompilerException("Internal error: could n=
ot find compiler for " + className + " during second pass");
-                    }
-                    if (options.isVerbose()) {
-
-                        log.info("runInitializers for " + className);
-                    }
-                    if (!compiler.failed) {
-                        compiler.runInitializers();
-                    }
-                    if (options.isVerbose()) {
-
-                        log.info("compile second pass for " + className);
-                    }
-                    compiler.compileSecondPass();
-                    if (options.isVerbose()) {
-
-                        log.info("done with result [" + !compiler.failed + "=
] for " + className);
-                    }
-                    if (!compiler.failed) {
-
-                    } else {
-                        success =3D false;
-                    }
-                }
-                if (!jaxxFilesClone.equals(jaxxFiles)) {
-                    throw new AssertionError("Internal error: compilation se=
t altered during pass 2 (was " + jaxxFilesClone + ", modified to " + jaxxFile=
s + ")");
-                }
-            }
-
-            // stylesheet application
-            if (success) {
-                assert jaxxFiles.size() =3D=3D jaxxFileClassNames.size();
-                for (String className : jaxxFileClassNames) {
-                    JAXXCompiler compiler =3D compilers.get(className);
-                    if (compiler =3D=3D null) {
-                        throw new CompilerException("Internal error: could n=
ot find compiler for " + className + " during stylesheet application");
-                    }
-                    compiler.applyStylesheets();
-                    if (compiler.failed) {
-                        success =3D false;
-                    }
-                }
-            }
-
-            // code generation
-            if (success) {
-                assert jaxxFiles.size() =3D=3D jaxxFileClassNames.size();
-                for (String className : jaxxFileClassNames) {
-                    JAXXCompiler compiler =3D compilers.get(className);
-                    if (compiler =3D=3D null) {
-                        throw new CompilerException("Internal error: could n=
ot find compiler for " + className + " during code generation");
-                    }
-                    compiler.generateCode();
-                    if (compiler.failed) {
-                        success =3D false;
-                    }
-                }
-            }
-
-            if (warningCount =3D=3D 1) {
-                System.err.println("1 warning");
-            } else if (warningCount > 0) {
-                System.err.println(warningCount + " warnings");
-            }
-            if (errorCount =3D=3D 1) {
-                System.err.println("1 error");
-            } else if (errorCount > 0) {
-                System.err.println(errorCount + " errors");
-            }
-            return success;
-        }
-        catch (CompilerException e) {
-            System.err.println(e.getMessage());
-            e.printStackTrace();
-            return false;
-        }
-        catch (Throwable e) {
-            e.printStackTrace();
-            return false;
-        }
-        finally {
-            reset();
-        }
-    }
-
-
-    private static void showUsage() {
-        System.out.println("Usage: jaxxc <options> <source files>");
-        System.out.println();
-        System.out.println("Source files must end in extension .jaxx");
-        System.out.println("Use JAXX_OPTS environment variable to pass argum=
ents to Java runtime");
-        System.out.println();
-        System.out.println("Supported options include:");
-        System.out.println("  -classpath <paths>  paths to search for user c=
lasses");
-        System.out.println("  -cp <paths>         same as -classpath");
-        System.out.println("  -d <directory>      target directory for gener=
ated class files");
-        System.out.println("  -java or -j         produce .java files, but d=
o not compile them");
-        System.out.println("  -keep or -k         preserve generated .java f=
iles after compilation");
-        System.out.println("  -optimize or -o     optimize during compilatio=
n");
-        System.out.println("  -version            display version informatio=
n");
-        System.out.println();
-        System.out.println("See http://www.jaxxframework.org/ for full docum=
entation.");
-    }
-
-
-    public static String getVersion() {
-        return "1.0.4";
-    }
-
-
-    public static void main(String[] arg) throws Exception {
-        boolean success =3D true;
-
-        CompilerOptions options =3D new CompilerOptions();
-        List<String> files =3D new ArrayList<String>();
-        for (int i =3D 0; i < arg.length; i++) {
-            if (arg[i].endsWith(".jaxx")) {
-                files.add(arg[i]);
-            } else if (arg[i].equals("-d")) {
-                if (++i < arg.length) {
-                    File targetDirectory =3D new File(arg[i]);
-                    if (!targetDirectory.exists()) {
-                        System.err.println("Error: could not find target dir=
ectory: " + targetDirectory);
-                        errorCount++;
-                        success =3D false;
-                    }
-                    options.setTargetDirectory(targetDirectory);
-                } else {
-                    success =3D false;
-                }
-            } else if (arg[i].equals("-cp") || arg[i].equals("-classpath")) {
-                if (++i < arg.length) {
-                    options.setClassPath(arg[i]);
-                } else {
-                    success =3D false;
-                }
-            } else if (arg[i].equals("-javac_opts")) {
-                if (++i < arg.length) {
-                    options.setJavacOpts(arg[i]);
-                } else {
-                    success =3D false;
-                }
-            } else if (arg[i].equals("-k") || arg[i].equals("-keep")) {
-                options.setKeepJavaFiles(true);
-            } else if (arg[i].equals("-j") || arg[i].equals("-java")) {
-                options.setKeepJavaFiles(true);
-            } else if (arg[i].equals("-o") || arg[i].equals("-optimize")) {
-                options.setOptimize(true);
-            } else if (arg[i].equals("-version")) {
-                System.err.println("jaxxc version " + getVersion() + " by Et=
han Nicholas");
-                System.err.println("http://www.jaxxframework.org/");
-                System.exit(0);
-            } else if (arg[i].equals("-internalDumpVersion")) { // used by a=
nt to extract the version info
-                System.out.println("jaxx.version=3D" + getVersion());
-                return;
-            } else {
-                success =3D false;
-            }
-        }
-
-        success &=3D (errorCount =3D=3D 0 && files.size() > 0);
-
-        if (success) {
-            success =3D compile(new File("."), files.toArray(new String[file=
s.size()]), options);
-        } else {
-            showUsage();
-            System.exit(1);
-        }
-
-        System.exit(success ? 0 : 1);
-    }
-
-    public File getDest() {
-        return dest;
-    }
-
-    public void setFailed(boolean failed) {
-        this.failed =3D failed;
-    }
-
-    public void registerValidator(CompiledBeanValidator validator) {
-        validators.add(validator);
-    }
-
-    public boolean hasValidator() {
-        return !validators.isEmpty();
-    }
-
-    /**
-     * Check that a reference exists in symbol table on second compil pass
-     *
-     * @param tag       the current tag
-     * @param reference the required reference
-     * @param strict    flag to report an error if reference was not found
-     * @param attribute (if not null reference the attribute where is define=
d the reference)
-     * @return <code>true</code> if reference was found, <code>false</code> =
otherwise and add an error in compiler
-     */
-    public boolean checkReference(Element tag, String reference, boolean str=
ict, String attribute) {
-        String component =3D getSymbolTable().getClassTagIds().get(reference=
);
-        if (component =3D=3D null) {
-            if (strict) {
-                String msg;
-                if (attribute !=3D null) {
-                    msg =3D "tag '" + tag.getLocalName() + "' could not find=
 the reference '" + reference + "' on attribute [" + attribute + "]";
-                } else {
-                    msg =3D "tag '" + tag.getLocalName() + "' could not find=
 the reference '" + reference + "'";
-                }
-                reportError(msg);
-            }
-            return false;
-        }
-        return true;
-    }
-}

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/JAXXCompiler=
.java (from rev 977, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JA=
XXCompiler.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/JAXXCompiler.jav=
a	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/JAXXCompiler.jav=
a	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,1145 @@
+/*
+ * Copyright 2006 Ethan Nicholas. All rights reserved.
+ * Use is subject to license terms.
+ */
+package jaxx.compiler;
+
+import jaxx.CompilerException;
+import jaxx.UnsupportedAttributeException;
+import jaxx.UnsupportedTagException;
+import jaxx.css.Rule;
+import jaxx.css.Stylesheet;
+import jaxx.parser.ParseException;
+import jaxx.reflect.ClassDescriptor;
+import jaxx.reflect.ClassDescriptorLoader;
+import jaxx.reflect.FieldDescriptor;
+import jaxx.reflect.MethodDescriptor;
+import jaxx.runtime.ComponentDescriptor;
+import jaxx.runtime.JAXXObjectDescriptor;
+import jaxx.tags.DefaultObjectHandler;
+import jaxx.tags.TagHandler;
+import jaxx.tags.TagManager;
+import jaxx.tags.validator.BeanValidatorHandler.CompiledBeanValidator;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Stack;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Compiles JAXX files into Java classes.
+ * <p/>
+ * extends the {@link JAXXCompilerHelper} class wich contains all static use=
full method.
+ * <p/>
+ * In that way, this class should not contains any static code, but use by i=
nheritance the ones defined in the {@link JAXXCompilerHelper}
+ * <p/>
+ * use also a {@link #generator} ({@link JAXXObjectGenerator} to generate th=
e java file,
+ * after the compilation.
+ */
+public class JAXXCompiler extends JAXXCompilerHelper {
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- compiler fields ---------------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    /** flag to detec if an error occurs while compiling jaxx file */
+    protected boolean failed;
+
+    /** Object corresponding to the root tag in the document. */
+    protected CompiledObject root;
+
+    /** Contains strings of the form "javax.swing." */
+    protected Set<String> importedPackages =3D new HashSet<String>();
+
+    /** Contains strings of the form "javax.swing.Timer" */
+    protected Set<String> importedClasses =3D new HashSet<String>();
+
+    /** Keeps track of open components (components still having children add=
ed). */
+    protected Stack<CompiledObject> openComponents =3D new Stack<CompiledObj=
ect>();
+
+    /** Sequence number used to create automatic variable names. */
+    protected int autogenID =3D 0;
+
+    protected List<DataBinding> dataBindings =3D new ArrayList<DataBinding>(=
);
+
+    /** list of validators */
+    protected List<CompiledBeanValidator> validators =3D new ArrayList<Compi=
ledBeanValidator>();
+
+    /** list of objectId attached to a validator * */
+    protected List<String> validatedComponents =3D new ArrayList<String>();
+
+    protected SymbolTable symbolTable =3D new SymbolTable();
+
+    /** Base directory used for path resolution (normally the directory in w=
hich the .jaxx file resides). */
+    protected File baseDir;
+
+    /** .jaxx file being compiled. */
+    protected File src;
+
+    /** Parsed XML of src file. */
+    protected Document document;
+
+    /** Name of class being compiled. */
+    protected String outputClassName;
+
+    protected ScriptManager scriptManager =3D new ScriptManager(this);
+
+    /** Combination of all stylesheets registered using {@link #registerStyl=
esheet}. */
+    protected Stylesheet stylesheet;
+
+    /** Contains all attributes defined inline on class tags. */
+    protected List<Rule> inlineStyles =3D new ArrayList<Rule>();
+
+    /**
+     * Maps objects (expressed in Java code) to event listener classes (e.g.=
 MouseListener) to Lists of EventHandlers.  The final list
+     * contains all event  handlers of a particular type attached to a parti=
cular object (again, as represented by a Java expression).
+     */
+    protected Map<String, Map<ClassDescriptor, List<EventHandler>>> eventHan=
dlers =3D new HashMap<String, Map<ClassDescriptor, List<EventHandler>>>();
+
+    /** Maps of uniqued id for objects used in compiler */
+    protected Map<Object, String> uniqueIds =3D new HashMap<Object, String>(=
);
+
+    /** Map of event handler method names used in compiler */
+    protected Map<EventHandler, String> eventHandlerMethodNames =3D new Hash=
Map<EventHandler, String>();
+
+    /** ClassLoader which searches the user-specified class path in addition=
 to the normal class path */
+    protected ClassLoader classLoader;
+
+    /** the generator of the java file */
+    protected final JAXXObjectGenerator generator;
+
+    /**
+     * A list of Runnables which will be run after the first compilation pas=
s.  This is primarily used
+     * to trigger the creation of CompiledObjects, which cannot be created d=
uring the first pass and must be
+     * created in document order.
+     */
+    protected List<Runnable> initializers =3D new ArrayList<Runnable>();
+
+    /** left brace matcher */
+    protected Matcher leftBraceMatcher =3D Pattern.compile("^(\\{)|[^\\\\](\=
\{)").matcher("");
+
+    /** right brace matcher */
+    protected Matcher rightBraceMatcher =3D Pattern.compile("^(\\})|[^\\\\](=
\\})").matcher("");
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- Constructor methods -----------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    protected JAXXCompiler(ClassLoader classLoader) {
+        this.options =3D new CompilerOptions();
+        this.classLoader =3D classLoader;
+        this.generator =3D new JAXXObjectGenerator(this);
+        addImport("java.lang.*");
+    }
+
+    /**
+     * Creates a new JAXXCompiler.
+     *
+     * @param baseDir         classpath location
+     * @param options         options to pass to javac
+     * @param src             location of file to compile
+     * @param outputClassName the out file name
+     */
+    protected JAXXCompiler(File baseDir, File src, String outputClassName, C=
ompilerOptions options) {
+        this.baseDir =3D baseDir;
+        this.src =3D src;
+        sourceFiles.push(src);
+        this.outputClassName =3D outputClassName;
+        this.options =3D options;
+        this.generator =3D new JAXXObjectGenerator(this);
+        addImport(outputClassName.substring(0, outputClassName.lastIndexOf("=
.") + 1) + "*");
+        for (Object staticImport : staticImports) {
+            addImport((String) staticImport);
+        }
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- Initializer methods -----------------------------------------------=
------------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    protected void runInitializers() {
+        for (Runnable runnable : initializers) {
+            if (log.isDebugEnabled()) {
+                log.debug(runnable);
+            }
+            try {
+                runnable.run();
+            } catch (Exception e) {
+                //TC - 20081018 report error and quit
+                reportError(e.getMessage());
+                return;
+            }
+        }
+        initializers.clear();
+    }
+
+
+    /**
+     * Registers a <code>Runnable</code> which will be executed after the fi=
rst
+     * compilation pass is complete.
+     *
+     * @param r runnable to register
+     */
+    public void registerInitializer(Runnable r) {
+        initializers.add(r);
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- Compile methods ---------------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    public void compileFirstPass(final Element tag) throws IOException {
+        tagsBeingCompiled.push(tag);
+
+        String namespace =3D tag.getNamespaceURI();
+        String fullClassName;
+        String localName =3D tag.getLocalName();
+        boolean namespacePrefix =3D tag.getPrefix() !=3D null;
+        // resolve class tags into fully-qualified class name
+        if (namespace !=3D null && namespace.endsWith("*")) {
+            String packageName =3D namespace.substring(0, namespace.length()=
 - 1);
+            if (localName.startsWith(packageName)) // class name is fully-qu=
alified already
+            {
+                fullClassName =3D TagManager.resolveClassName(localName, thi=
s);
+            } else { // namespace not included in class name, probably need =
the namespace to resolve
+                fullClassName =3D TagManager.resolveClassName(packageName + =
localName, this);
+                if (fullClassName =3D=3D null && !namespacePrefix) // it was=
 just a default namespace, try again without using the namespace
+                {
+                    fullClassName =3D TagManager.resolveClassName(localName,=
 this);
+                }
+            }
+        } else {
+            fullClassName =3D TagManager.resolveClassName(localName, this);
+        }
+
+        if (fullClassName !=3D null) { // we are definitely dealing with a c=
lass tag
+            addDependencyClass(fullClassName);
+            namespace =3D fullClassName.substring(0, fullClassName.lastIndex=
Of(".") + 1) + "*";
+            if (symbolTable.getSuperclassName() =3D=3D null) {
+                symbolTable.setSuperclassName(fullClassName);
+            }
+            String id =3D tag.getAttribute("id");
+            if (id.length() > 0) {
+                symbolTable.getClassTagIds().put(id, fullClassName);
+            }
+        }
+        // during the first pass, we can't create ClassDescriptors for JAXX =
files because they may not have been processed yet
+        // (and we can't wait until they have been processed because of circ=
ular dependencies).  So we don't do any processing
+        // during the first pass which requires having a ClassDescriptor;  h=
ere we determine whether we have a class tag or not
+        // (class tag namespaces end in "*") and use a generic handler if so=
.  The real handler is used during the second pass.
+        TagHandler handler =3D (namespace !=3D null && namespace.endsWith("*=
")) ? firstPassClassTagHandler : TagManager.getTagHandler(tag.getNamespaceURI=
(), localName, namespacePrefix, this);
+        if (handler !=3D firstPassClassTagHandler && handler instanceof Defa=
ultObjectHandler) {
+            fullClassName =3D ((DefaultObjectHandler) handler).getBeanClass(=
).getName();
+            //namespace =3D fullClassName.substring(0, fullClassName.lastInd=
exOf(".") + 1) + "*";
+            handler =3D firstPassClassTagHandler;
+        }
+        if (handler =3D=3D firstPassClassTagHandler) {
+            final String finalClassName =3D fullClassName;
+            registerInitializer(new Runnable() { // register an initializer =
which will create the CompiledObject after pass 1
+
+                public void run() {
+                    DefaultObjectHandler handler =3D (DefaultObjectHandler) =
TagManager.getTagHandler(null, finalClassName, JAXXCompiler.this);
+                    if (handler =3D=3D null) {
+                        throw new CompilerException("Internal error: missing=
 TagHandler for '" + finalClassName + "'");
+                    }
+                    handler.registerCompiledObject(tag, JAXXCompiler.this);
+                }
+            });
+        }
+        if (handler !=3D null) {
+            try {
+                handler.compileFirstPass(tag, this);
+            }
+            catch (CompilerException e) {
+                reportError(e);
+            }
+        } else {
+            reportError("Could not find a Java class corresponding to: <" + =
tag.getTagName() + ">");
+            failed =3D true;
+        }
+
+        Element finished =3D tagsBeingCompiled.pop();
+        if (finished !=3D tag) {
+            throw new RuntimeException("internal error: just finished compil=
ing " + tag + ", but top of tagsBeingCompiled stack is " + finished);
+        }
+    }
+
+
+    public void compileSecondPass(Element tag) throws IOException {
+        tagsBeingCompiled.push(tag);
+
+        TagHandler handler =3D TagManager.getTagHandler(tag.getNamespaceURI(=
), tag.getLocalName(), tag.getPrefix() !=3D null, this);
+        if (handler !=3D null) {
+            handler.compileSecondPass(tag, this);
+        } else {
+            reportError("Could not find a Java class corresponding to: <" + =
tag.getTagName() + ">");
+            assert false : "can't-happen error: error should have been repor=
ted during the fast pass and caused an abort";
+            failed =3D true;
+        }
+
+        Element finished =3D tagsBeingCompiled.pop();
+        if (finished !=3D tag) {
+            throw new RuntimeException("internal error: just finished compil=
ing " + tag + ", but top of tagsBeingCompiled stack is " + finished);
+        }
+
+    }
+
+    protected void compileFirstPass() throws IOException {
+        try {
+            InputStream in =3D new FileInputStream(src);
+            document =3D parseDocument(in);
+            in.close();
+            compileFirstPass(document.getDocumentElement());
+        }
+        catch (SAXParseException e) {
+            reportError(e.getLineNumber(), "Invalid XML: " + e.getMessage());
+        }
+        catch (SAXException e) {
+            reportError(null, "Error parsing XML document: " + e);
+        }
+    }
+
+    protected void compileSecondPass() throws IOException {
+        if (!tagsBeingCompiled.isEmpty()) {
+            throw new RuntimeException("Internal error: starting pass two, b=
ut tagsBeingCompiled is not empty: " + tagsBeingCompiled);
+        }
+        compileSecondPass(document.getDocumentElement());
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- CompiledObject methods --------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    public void openComponent(CompiledObject component) throws CompilerExcep=
tion {
+        openComponent(component, null);
+    }
+
+    public void openComponent(CompiledObject component, String constraints) =
throws CompilerException {
+        CompiledObject parent =3D getOpenComponent();
+        openInvisibleComponent(component);
+        if (parent !=3D null && !component.isOverride()) {
+            parent.addChild(component, constraints, this);
+        }
+    }
+
+    public void openInvisibleComponent(CompiledObject component) {
+        if (!ids.containsKey(component)) {
+            registerCompiledObject(component);
+        }
+        openComponents.push(component);
+    }
+
+    public CompiledObject getOpenComponent() {
+        if (openComponents.isEmpty()) {
+            return null;
+        }
+        return openComponents.peek();
+    }
+
+    public void closeComponent(CompiledObject component) {
+        if (openComponents.pop() !=3D component) {
+            throw new IllegalArgumentException("can only close the topmost o=
pen object");
+        }
+    }
+
+    public void registerCompiledObject(CompiledObject object) {
+        assert symbolTables.values().contains(symbolTable) : "attempting to =
register CompiledObject before pass 1 is complete";
+        if (root =3D=3D null) {
+            root =3D object;
+        }
+
+        String id =3D object.getId();
+        if (ids.containsKey(object)) {
+            reportError("object '" + object + "' is already registered with =
id '" + ids.get(object) + "', cannot re-register as '" + id + "'");
+        }
+        if (objects.containsKey(id) && !(objects.get(id) instanceof Element)=
) {
+            reportError("id '" + id + "' is already registered to component =
" + objects.get(id));
+        }
+        objects.put(id, object);
+        ids.put(object, id);
+    }
+
+    public CompiledObject getCompiledObject(String id) {
+        runInitializers();
+        assert symbolTables.values().contains(symbolTable) : "attempting to =
retrieve CompiledObject before pass 1 is complete";
+        return objects.get(id);
+    }
+
+
+    protected boolean inlineCreation(CompiledObject object) {
+        return object.getId().startsWith("$") && object.getInitializationCod=
e(this).length() < INLINE_THRESHOLD;
+    }
+
+    public void checkOverride(CompiledObject object) throws CompilerExceptio=
n {
+        if (object.getId().startsWith("$")) {
+            return;
+        }
+        ClassDescriptor ancestor =3D root.getObjectClass();
+        if (ancestor =3D=3D object.getObjectClass()) {
+            return;
+        }
+        while (ancestor !=3D null) {
+            try {
+                FieldDescriptor f =3D ancestor.getDeclaredFieldDescriptor(ob=
ject.getId());
+                if (!f.getType().isAssignableFrom(object.getObjectClass())) {
+                    reportError("attempting to redefine superclass member '"=
 + object.getId() + "' as incompatible type (was " + f.getType() + ", redefin=
ed as " + object.getObjectClass() + ")");
+                }
+                object.setOverride(true);
+                break;
+            }
+            catch (NoSuchFieldException e) {
+                ancestor =3D ancestor.getSuperclass();
+            }
+        }
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- DataBinding methods -----------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    /**
+     * Examine an attribute value for data binding expressions.  Returns a '=
cooked' expression which
+     * can be used to determine the resulting value.  It is expected that th=
is expression will be used
+     * as the source expression in a call to {@link #registerDataBinding}.
+     * If the attribute value does not invoke data binding, this method retu=
rns <code>null</code>
+     *
+     * @param stringValue the string value of the property from the XML
+     * @param type        the type of the property, from the <code>JAXXPrope=
rtyDescriptor</code>
+     * @return a processed version of the expression
+     * @throws jaxx.CompilerException ?
+     */
+    public String processDataBindings(String stringValue, ClassDescriptor ty=
pe) throws CompilerException {
+        int pos =3D getNextLeftBrace(stringValue, 0);
+        if (pos !=3D -1) {
+            StringBuffer expression =3D new StringBuffer();
+            int lastPos =3D 0;
+            while (pos !=3D -1 && pos < stringValue.length()) {
+                if (pos > lastPos) {
+                    if (expression.length() > 0) {
+                        expression.append(" + ");
+                    }
+                    expression.append('"');
+                    expression.append(JAXXCompiler.escapeJavaString(stringVa=
lue.substring(lastPos, pos)));
+                    expression.append('"');
+                }
+
+                if (expression.length() > 0) {
+                    expression.append(" + ");
+                }
+                expression.append('(');
+                int pos2 =3D getNextRightBrace(stringValue, pos + 1);
+                if (pos2 =3D=3D -1) {
+                    reportError("unmatched '{' in expression: " + stringValu=
e);
+                    return "";
+                }
+                expression.append(stringValue.substring(pos + 1, pos2));
+                expression.append(')');
+                pos2++;
+                if (pos2 < stringValue.length()) {
+                    pos =3D getNextLeftBrace(stringValue, pos2);
+                    lastPos =3D pos2;
+                } else {
+                    pos =3D stringValue.length();
+                    lastPos =3D pos;
+                }
+            }
+            if (lastPos < stringValue.length()) {
+                if (expression.length() > 0) {
+                    expression.append(" + ");
+                }
+                expression.append('"');
+                expression.append(JAXXCompiler.escapeJavaString(stringValue.=
substring(lastPos)));
+                expression.append('"');
+            }
+            return type =3D=3D ClassDescriptorLoader.getClassDescriptor(Stri=
ng.class) ? "String.valueOf(" + expression + ")" : expression.toString();
+        }
+        return null;
+    }
+
+
+    public void registerDataBinding(String src, String dest, String assignme=
nt) {
+        try {
+            src =3D checkJavaCode(src);
+            dataBindings.add(new DataBinding(src, dest, assignment, this));
+        }
+        catch (CompilerException e) {
+            reportError("While parsing data binding for '" + dest.substring(=
dest.lastIndexOf(".") + 1) + "': " + e.getMessage());
+        }
+    }
+
+    public void registerEventHandler(EventHandler handler) {
+        String objectCode =3D handler.getObjectCode();
+        Map<ClassDescriptor, List<EventHandler>> listeners =3D eventHandlers=
.get(objectCode);
+        if (listeners =3D=3D null) {
+            listeners =3D new HashMap<ClassDescriptor, List<EventHandler>>();
+            eventHandlers.put(objectCode, listeners);
+        }
+        ClassDescriptor listenerClass =3D handler.getListenerClass();
+        List<EventHandler> handlerList =3D listeners.get(listenerClass);
+        if (handlerList =3D=3D null) {
+            handlerList =3D new ArrayList<EventHandler>();
+            listeners.put(listenerClass, handlerList);
+        }
+        handlerList.add(handler);
+    }
+
+    public String getEventHandlerMethodName(EventHandler handler) {
+        String result =3D eventHandlerMethodNames.get(handler);
+        if (result =3D=3D null) {
+            result =3D "$ev" + eventHandlerMethodNames.size();
+            eventHandlerMethodNames.put(handler, result);
+        }
+        return result;
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- Script methods ----------------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    public void addScriptField(FieldDescriptor field) {
+        symbolTable.getScriptFields().add(field);
+    }
+
+    public void addScriptMethod(MethodDescriptor method) {
+        if (method.getName().equals("main") && method.getParameterTypes().le=
ngth =3D=3D 1 && method.getParameterTypes()[0].getName().equals("[Ljava.lang.=
String;")) {
+            generator.setMainDeclared(true);
+        }
+        symbolTable.getScriptMethods().add(method);
+    }
+
+    public void registerScript(String script) throws CompilerException {
+        registerScript(script, null);
+    }
+
+    public void registerScript(String script, File sourceFile) throws Compil=
erException {
+        if (sourceFile !=3D null) {
+            sourceFiles.push(sourceFile);
+        }
+        script =3D script.trim();
+        if (!"".equals(script) && !script.endsWith("}") && !script.endsWith(=
";")) {
+            script +=3D ";";
+        }
+        scriptManager.registerScript(script);
+
+        if (sourceFile !=3D null) {
+            File pop =3D sourceFiles.pop();
+            if (pop !=3D sourceFile) {
+                throw new RuntimeException("leaving registerScript(), but " =
+ sourceFile + " was not the top entry on the stack (found " + pop + " instea=
d)");
+            }
+        }
+    }
+
+    public String preprocessScript(String script) throws CompilerException {
+        return scriptManager.preprocessScript(script);
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- StyleSheet methods ------------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    protected void applyStylesheets() {
+        for (Object o : new ArrayList<CompiledObject>(objects.values())) {
+            CompiledObject object =3D (CompiledObject) o;
+            TagManager.getTagHandler(object.getObjectClass()).applyStyleshee=
ts(object, this);
+        }
+    }
+
+    public void registerStylesheet(Stylesheet stylesheet) {
+        if (this.stylesheet =3D=3D null) {
+            this.stylesheet =3D stylesheet;
+        } else {
+            this.stylesheet.add(stylesheet.getRules());
+        }
+    }
+
+    public void addInlineStyle(CompiledObject object, String propertyName, b=
oolean dataBinding) {
+        inlineStyles.add(Rule.inlineAttribute(object, propertyName, dataBind=
ing));
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- Report methods ----------------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    public void reportWarning(String warning) {
+        Element currentTag =3D null;
+        if (!tagsBeingCompiled.isEmpty()) {
+            currentTag =3D tagsBeingCompiled.peek();
+        }
+        reportWarning(currentTag, warning, 0);
+    }
+
+
+    public void reportWarning(Element tag, String warning, int lineOffset) {
+        String lineNumber =3D null;
+        if (tag !=3D null) {
+            String lineAttr =3D tag.getAttributeNS(JAXX_INTERNAL_NAMESPACE, =
"line");
+            if (lineAttr.length() > 0) {
+                lineNumber =3D lineAttr;
+            }
+        }
+        File src =3D sourceFiles.peek();
+        try {
+            src =3D src.getCanonicalFile();
+        }
+        catch (IOException e) {
+            // ignore ?
+        }
+
+        System.err.print(src);
+        if (lineNumber !=3D null) {
+            System.err.print(":" + ((sourceFiles.size() =3D=3D 1) ? Integer.=
parseInt(lineNumber) + lineOffset : lineOffset + 1));
+        }
+        System.err.println(": Warning: " + warning);
+        warningCount++;
+    }
+
+
+    public void reportError(String error) {
+        Element currentTag =3D null;
+        if (!tagsBeingCompiled.isEmpty()) {
+            currentTag =3D tagsBeingCompiled.peek();
+        }
+        reportError(currentTag, error);
+    }
+
+    public void reportError(CompilerException ex) {
+        reportError(null, ex);
+    }
+
+    public void reportError(String extraMessage, CompilerException ex) {
+        String message =3D ex.getMessage();
+        if (ex.getClass() =3D=3D UnsupportedAttributeException.class || ex.g=
etClass() =3D=3D UnsupportedTagException.class) {
+            message =3D ex.getClass().getName().substring(ex.getClass().getN=
ame().lastIndexOf(".") + 1) + ": " + message;
+        }
+        int lineOffset;
+        if (ex instanceof ParseException) {
+            lineOffset =3D Math.max(0, ((ParseException) ex).getLine() - 1);
+        } else {
+            lineOffset =3D 0;
+        }
+        Element currentTag =3D null;
+        if (!tagsBeingCompiled.isEmpty()) {
+            currentTag =3D tagsBeingCompiled.peek();
+        }
+        reportError(currentTag, extraMessage !=3D null ? extraMessage + mess=
age : message, lineOffset);
+    }
+
+    public void reportError(Element tag, String error) {
+        reportError(tag, error, 0);
+    }
+
+    public void reportError(Element tag, String error, int lineOffset) {
+        int lineNumber =3D 0;
+        if (tag !=3D null) {
+            String lineAttr =3D tag.getAttributeNS(JAXX_INTERNAL_NAMESPACE, =
"line");
+            if (lineAttr.length() > 0) {
+                lineNumber =3D Integer.parseInt(lineAttr);
+            }
+        }
+        lineNumber =3D Math.max(lineNumber, 1) + lineOffset;
+        reportError(lineNumber, error);
+    }
+
+    public void reportError(int lineNumber, String error) {
+        File src =3D sourceFiles.isEmpty() ? null : sourceFiles.peek();
+        try {
+            if (src !=3D null) {
+                src =3D src.getCanonicalFile();
+            }
+        }
+        catch (IOException e) {
+            // ignore ?
+        }
+
+        System.err.print(src !=3D null ? src.getPath() : "<unknown source>");
+        if (lineNumber > 0) {
+            System.err.print(":" + lineNumber);
+        }
+        System.err.println(": " + error);
+        errorCount++;
+        failed =3D true;
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- Validator methods -------------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    /**
+     * Register in this compiler a new compiled validator.
+     *
+     * @param validator the compiled validator to register
+     */
+    public void registerValidator(CompiledBeanValidator validator) {
+        validators.add(validator);
+        validatedComponents.addAll(validator.getFields().values());
+    }
+
+    /** @return <code>true</code> if some validators were detected, <code>fa=
lse</code> otherwise */
+    public boolean hasValidator() {
+        return !validators.isEmpty();
+    }
+
+    /**
+     * Test if a given CompiledObject is attached to a validator.
+     *
+     * @param componentId the compiled object to test
+     * @return <code>true</code> if the given compiled object is attached to=
 a validator, <code>false</code> otherwise
+     */
+    public boolean isComponentUsedByValidator(String componentId) {
+        return validatedComponents.contains(componentId);
+    }
+
+    /**
+     * Test if a given bean is attached to a validator.
+     *
+     * @param beanId the bean to test
+     * @return <code>true</code> if the given bean is attached to a validato=
r, <code>false</code> otherwise
+     */
+    public boolean isBeanUsedByValidator(String beanId) {
+        for (CompiledBeanValidator validator : validators) {
+            if (beanId.equals(validator.getBean())) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- Getter methods ----------------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    public Map<String, CompiledObject> getObjects() {
+        return objects;
+    }
+
+    public List<DataBinding> getDataBindings() {
+        return dataBindings;
+    }
+
+    public List<CompiledBeanValidator> getValidators() {
+        return validators;
+    }
+
+    public Map<String, Map<ClassDescriptor, List<EventHandler>>> getEventHan=
dlers() {
+        return eventHandlers;
+    }
+
+    public CompilerOptions getOptions() {
+        return options;
+    }
+
+    public String getOutputClassName() {
+        return outputClassName;
+    }
+
+    public File getBaseDir() {
+        return baseDir;
+    }
+
+    public Set<String> getImportedClasses() {
+        return importedClasses;
+    }
+
+    public Set<String> getImportedPackages() {
+        return importedPackages;
+    }
+
+    protected Iterator<CompiledObject> getObjectCreationOrder() {
+        return objects.values().iterator();
+    }
+
+    public CompiledObject getRootObject() {
+        return root;
+    }
+
+    public Stack<File> getSourceFiles() {
+        return sourceFiles;
+    }
+
+    public ScriptManager getScriptManager() {
+        return scriptManager;
+    }
+
+    public SymbolTable getSymbolTable() {
+        return symbolTable;
+    }
+
+    public Stylesheet getStylesheet() {
+        Stylesheet merged =3D new Stylesheet();
+        if (stylesheet !=3D null) {
+            merged.add(stylesheet.getRules());
+        }
+        merged.add(inlineStyles.toArray(new Rule[inlineStyles.size()]));
+        return merged;
+    }
+
+    public FieldDescriptor[] getScriptFields() {
+        List<FieldDescriptor> scriptFields =3D symbolTable.getScriptFields();
+        return scriptFields.toArray(new FieldDescriptor[scriptFields.size()]=
);
+    }
+
+    public MethodDescriptor[] getScriptMethods() {
+        List<MethodDescriptor> scriptMethods =3D symbolTable.getScriptMethod=
s();
+        return scriptMethods.toArray(new MethodDescriptor[scriptMethods.size=
()]);
+    }
+
+    /**
+     * Returns a <code>ClassLoader</code> which searches the user-specified =
class path in addition
+     * to the normal system class path.
+     *
+     * @return <code>ClassLoader</code> to use while resolving class referen=
ces
+     */
+    public ClassLoader getClassLoader() {
+        if (classLoader =3D=3D null) {
+            String classPath =3D options.getClassPath();
+            if (classPath =3D=3D null) {
+                classPath =3D ".";
+            }
+            String[] paths =3D classPath.split(File.pathSeparator);
+            URL[] urls =3D new URL[paths.length];
+            for (int i =3D 0; i < paths.length; i++) {
+                try {
+                    urls[i] =3D new File(paths[i]).toURI().toURL();
+                }
+                catch (MalformedURLException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+            classLoader =3D new URLClassLoader(urls, getClass().getClassLoad=
er());
+        }
+
+        return classLoader;
+    }
+
+    public JAXXObjectDescriptor getJAXXObjectDescriptor() {
+        runInitializers();
+        CompiledObject[] components =3D new ArrayList<CompiledObject>(object=
s.values()).toArray(new CompiledObject[objects.size()]);
+        assert initializers.isEmpty() : "there are pending initializers rema=
ining";
+        assert root !=3D null : "root object has not been defined";
+        assert Arrays.asList(components).contains(root) : "root object is no=
t registered";
+        ComponentDescriptor[] descriptors =3D new ComponentDescriptor[compon=
ents.length];
+        // as we print, sort the array so that component's parents are alway=
s before the components themselves
+        for (int i =3D 0; i < components.length; i++) {
+            CompiledObject parent =3D components[i].getParent();
+            while (parent !=3D null) {
+                boolean found =3D false;
+                for (int j =3D i + 1; j < components.length; j++) { // found=
 parent after component, swap them
+                    if (components[j] =3D=3D parent) {
+                        components[j] =3D components[i];
+                        components[i] =3D parent;
+                        found =3D true;
+                        break;
+                    }
+                }
+                if (!found) {
+                    break;
+                }
+                parent =3D components[i].getParent();
+            }
+            int parentIndex =3D -1;
+            if (parent !=3D null) {
+                for (int j =3D 0; j < i; j++) {
+                    if (components[j] =3D=3D parent) {
+                        parentIndex =3D j;
+                        break;
+                    }
+                }
+            }
+            descriptors[i] =3D new ComponentDescriptor(components[i].getId()=
, components[i] =3D=3D root ? outputClassName : components[i].getObjectClass(=
).getName(),
+                    components[i].getStyleClass(), parentIndex !=3D -1 ? des=
criptors[parentIndex] : null);
+        }
+
+        Stylesheet stylesheet =3D getStylesheet();
+        if (stylesheet =3D=3D null) {
+            stylesheet =3D new Stylesheet();
+        }
+
+        return new JAXXObjectDescriptor(descriptors, stylesheet);
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- Setter methods ----------------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    public void setFailed(boolean failed) {
+        this.failed =3D failed;
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- Delegate methods from JAXXObjectGenerator -------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    public void appendInitializerCode(String code) {
+        generator.getInitializer().append(code);
+    }
+
+    public void appendBodyCode(String code) {
+        generator.getBodyCode().append(code);
+    }
+
+    public void appendInitDataBindings(String code) {
+        generator.getInitDataBindings().append(code);
+    }
+
+    public void appendProcessDataBinding(String code) {
+        generator.getProcessDataBinding().append(code);
+    }
+
+    public void appendApplyDataBinding(String code) {
+        generator.getApplyDataBinding().append(code);
+    }
+
+    public void appendRemoveDataBinding(String code) {
+        generator.getRemoveDataBinding().append(code);
+    }
+
+    public void appendLateInitializer(String code) {
+        generator.getLateInitializer().append(code);
+    }
+
+    public boolean haveProcessDataBinding() {
+        return generator.getProcessDataBinding().length() > 0;
+    }
+
+    public boolean haveApplyDataBinding() {
+        return generator.getApplyDataBinding().length() > 0;
+    }
+
+    public boolean haveRemoveDataBinding() {
+        return generator.getRemoveDataBinding().length() > 0;
+    }
+
+    public void addMethodToJavaFile(JavaMethod method) {
+        generator.getJavaFile().addMethod(method);
+    }
+
+    public boolean hasMethod(String methodName) {
+        JavaMethod[] methods =3D generator.getJavaFile().getMethods();
+        for (JavaMethod method : methods) {
+            if (methodName.equals(method.getName())) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- Other methods -----------------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    public void addImport(String text) {
+        if (text.endsWith("*")) {
+            importedPackages.add(text.substring(0, text.length() - 1));
+        } else {
+            importedClasses.add(text);
+        }
+
+        if (!text.equals("*")) {
+            generator.getJavaFile().addImport(text);
+        }
+    }
+
+    public void addDependencyClass(String className) {
+        if (!jaxxFileClassNames.contains(className)) {
+            URL jaxxURL =3D getClassLoader().getResource(className.replace('=
.', '/') + ".jaxx");
+            URL classURL =3D getClassLoader().getResource(className.replace(=
'.', '/') + ".class");
+            if (jaxxURL !=3D null && classURL !=3D null) {
+                try {
+                    File jaxxFile =3D URLtoFile(jaxxURL);
+                    File classFile =3D URLtoFile(classURL);
+                    if (classFile.lastModified() > jaxxFile.lastModified()) {
+                        return; // class file is newer, no need to recompile
+                    }
+                }
+                catch (Exception e) {
+                    // do nothing
+                }
+            }
+
+            if (jaxxURL !=3D null && jaxxURL.toString().startsWith("file:"))=
 {
+                File jaxxFile =3D URLtoFile(jaxxURL);
+                try {
+                    jaxxFile =3D jaxxFile.getCanonicalFile();
+                }
+                catch (IOException ex) {
+                    // ignore ?
+                }
+                assert jaxxFile.getName().equalsIgnoreCase(className.substri=
ng(className.lastIndexOf(".") + 1) + ".jaxx") :
+                        "expecting file name to match " + className + ", but=
 found " + jaxxFile.getName();
+                if (jaxxFile.getName().equals(className.substring(className.=
lastIndexOf(".") + 1) + ".jaxx")) { // check case match
+                    if (currentPass =3D=3D PASS_2) {
+                        throw new AssertionError("Internal error: adding dep=
endency class " + className + " during second compilation pass");
+                    }
+                    jaxxFileClassNames.add(className);
+                    jaxxFiles.add(jaxxFile);
+                }
+            }
+        }
+    }
+
+    /**
+     * Verifies that a snippet of Java code parses correctly.  A warning is =
generated if the string has enclosing
+     * curly braces.
+     *
+     * @param javaCode the Java code snippet to test
+     * @return a "cooked" version of the string which has enclosing curly br=
aces removed.
+     * @throws CompilerException if the code cannot be parsed
+     */
+    public String checkJavaCode(String javaCode) {
+        javaCode =3D scriptManager.trimScript(javaCode);
+        scriptManager.checkParse(javaCode);
+        return javaCode;
+    }
+
+    /**
+     * Check that a reference exists in symbol table on second compil pass
+     *
+     * @param tag       the current tag
+     * @param reference the required reference
+     * @param strict    flag to report an error if reference was not found
+     * @param attribute (if not null reference the attribute where is define=
d the reference)
+     * @return <code>true</code> if reference was found, <code>false</code> =
otherwise and add an error in compiler
+     */
+    public boolean checkReference(Element tag, String reference, boolean str=
ict, String attribute) {
+        String component =3D getSymbolTable().getClassTagIds().get(reference=
);
+        if (component =3D=3D null) {
+            if (strict) {
+                String msg;
+                if (attribute !=3D null) {
+                    msg =3D "tag '" + tag.getLocalName() + "' could not find=
 the reference '" + reference + "' on attribute [" + attribute + "]";
+                } else {
+                    msg =3D "tag '" + tag.getLocalName() + "' could not find=
 the reference '" + reference + "'";
+                }
+                reportError(msg);
+            }
+            return false;
+        }
+        return true;
+    }
+
+    protected int getNextLeftBrace(String string, int pos) {
+        leftBraceMatcher.reset(string);
+        return leftBraceMatcher.find(pos) ? Math.max(leftBraceMatcher.start(=
1), leftBraceMatcher.start(2)) : -1;
+    }
+
+    protected int getNextRightBrace(String string, int pos) {
+        leftBraceMatcher.reset(string);
+        rightBraceMatcher.reset(string);
+        int openCount =3D 1;
+        int rightPos;
+        while (openCount > 0) {
+            pos++;
+            int leftPos =3D leftBraceMatcher.find(pos) ? Math.max(leftBraceM=
atcher.start(1), leftBraceMatcher.start(2)) : -1;
+            rightPos =3D rightBraceMatcher.find(pos) ? Math.max(rightBraceMa=
tcher.start(1), rightBraceMatcher.start(2)) : -1;
+            assert leftPos =3D=3D -1 || leftPos >=3D pos;
+            assert rightPos =3D=3D -1 || rightPos >=3D pos;
+            if (leftPos !=3D -1 && leftPos < rightPos) {
+                pos =3D leftPos;
+                openCount++;
+            } else if (rightPos !=3D -1) {
+                pos =3D rightPos;
+                openCount--;
+            } else {
+                openCount =3D 0;
+            }
+        }
+        return pos;
+    }
+
+    public String[] parseParameterList(String parameters) throws CompilerExc=
eption {
+        List<String> result =3D new ArrayList<String>();
+        StringBuffer current =3D new StringBuffer();
+        int state =3D 0; // normal
+        for (int i =3D 0; i < parameters.length(); i++) {
+            char c =3D parameters.charAt(i);
+            switch (state) {
+                case 0: // normal
+                    switch (c) {
+                        case '"':
+                            current.append(c);
+                            state =3D 1;
+                            break; // in quoted string
+                        case '\\':
+                            current.append(c);
+                            state =3D 2;
+                            break; // immediately after backslash
+                        case ',':
+                            if (current.length() > 0) {
+                                result.add(current.toString());
+                                current.setLength(0);
+                                break;
+                            } else {
+                                reportError("error parsing parameter list: "=
 + parameters);
+                            }
+                        default:
+                            current.append(c);
+                    }
+                    break;
+                case 1: // in quoted string
+                    switch (c) {
+                        case '"':
+                            current.append(c);
+                            state =3D 0;
+                            break; // normal
+                        case '\\':
+                            current.append(c);
+                            state =3D 3;
+                            break; // immediate after backslash in quoted st=
ring
+                        default:
+                            current.append(c);
+                    }
+                    break;
+                case 2: // immediately after backslash
+                    current.append(c);
+                    state =3D 0; // normal
+                    break;
+                case 3: // immediately after backslash in quoted string
+                    current.append(c);
+                    state =3D 1; // in quoted string
+                    break;
+            }
+        }
+        if (current.length() > 0) {
+            result.add(current.toString());
+        }
+        return result.toArray(new String[result.size()]);
+    }
+
+    public String getAutoId(ClassDescriptor objectClass) {
+        if (options.getOptimize()) {
+            return "$" + Integer.toString(autogenID++, 36);
+        } else {
+            String name =3D objectClass.getName();
+            name =3D name.substring(name.lastIndexOf(".") + 1);
+            return "$" + name + autogenID++;
+        }
+    }
+
+    public String getUniqueId(Object object) {
+        String result =3D uniqueIds.get(object);
+        if (result =3D=3D null) {
+            result =3D "$u" + uniqueIds.size();
+            uniqueIds.put(object, result);
+        }
+        return result;
+    }
+
+}

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/JAXXCompiler=
Helper.java (from rev 977, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compi=
ler/JAXXCompilerHelper.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/JAXXCompilerHelp=
er.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/JAXXCompilerHelp=
er.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,657 @@
+package jaxx.compiler;
+
+import jaxx.CompilerException;
+import jaxx.reflect.ClassDescriptor;
+import jaxx.reflect.ClassDescriptorLoader;
+import jaxx.spi.Initializer;
+import jaxx.tags.DefaultObjectHandler;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.ErrorListener;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.sax.SAXSource;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.ServiceLoader;
+import java.util.Stack;
+
+/** @author chemit */
+public class JAXXCompilerHelper {
+
+    /** log */
+    protected static final Log log =3D LogFactory.getLog(JAXXCompiler.class);
+
+    /**
+     * True to throw exceptions when we encounter unresolvable classes, fals=
e to ignore.
+     * This is currently set to false until JAXX has full support for inner =
classes
+     * (including enumerations), because currently they don't always resolve=
 (but will
+     * generally compile without error anyway).
+     */
+    public static final boolean STRICT_CHECKS =3D false;
+
+    public static final String JAXX_NAMESPACE =3D "http://www.jaxxframework.=
org/";
+
+    public static final String JAXX_INTERNAL_NAMESPACE =3D "http://www.jaxxf=
ramework.org/internal";
+
+    /** Maximum length of an inlinable creation method. */
+    protected static final int INLINE_THRESHOLD =3D 300;
+
+    protected static final int PASS_1 =3D 0;
+
+    protected static final int PASS_2 =3D 1;
+
+    /** Contains import declarations (of the form "javax.swing.") which are =
always imported in all compiler instances. */
+    protected static List<String> staticImports =3D new ArrayList<String>();
+
+    static {
+        //TODO humm, we should be able to import only what is needed
+        staticImports.add("java.awt.*");
+        staticImports.add("java.awt.event.*");
+        staticImports.add("java.beans.*");
+        staticImports.add("java.io.*");
+        staticImports.add("java.lang.*");
+        staticImports.add("java.util.*");
+        staticImports.add("javax.swing.*");
+        staticImports.add("javax.swing.border.*");
+        staticImports.add("javax.swing.event.*");
+        staticImports.add("jaxx.runtime.swing.JAXXButtonGroup");
+        staticImports.add("jaxx.runtime.swing.HBox");
+        staticImports.add("jaxx.runtime.swing.VBox");
+        staticImports.add("jaxx.runtime.swing.Table");
+        staticImports.add("static org.codelutin.i18n.I18n._");
+        staticImports.add("static org.codelutin.jaxx.util.UIHelper.createIma=
geIcon");
+    }
+
+    protected static DefaultObjectHandler firstPassClassTagHandler =3D new D=
efaultObjectHandler(ClassDescriptorLoader.getClassDescriptor(Object.class));
+
+    /** Files being compiled during the compilation session, may be modified=
 as compilation progresses and additional dependencies are found. */
+    protected static List<File> jaxxFiles =3D new ArrayList<File>();
+
+    /** Class names corresponding to the files in the jaxxFiles list. */
+    protected static List<String> jaxxFileClassNames =3D new ArrayList<Strin=
g>();
+
+    /** Maps the names of classes being compiled to the compiler instance ha=
ndling the compilation. */
+    protected static Map<String, JAXXCompiler> compilers =3D new HashMap<Str=
ing, JAXXCompiler>();
+
+    /** Maps the names of classes being compiled to their symbol tables (cre=
ated after the first compiler pass). */
+    protected static Map<File, SymbolTable> symbolTables =3D new HashMap<Fil=
e, SymbolTable>();
+
+    protected static int currentPass;
+
+    protected CompilerOptions options;
+
+    /** Used for error reporting purposes, so we can report the right line n=
umber. */
+    protected Stack<Element> tagsBeingCompiled =3D new Stack<Element>();
+
+    /** Used for error reporting purposes, so we can report the right source=
 file. */
+    protected Stack<File> sourceFiles =3D new Stack<File>();
+
+    /** Maps object ID strings to the objects themselves.  These are created=
 during the second compilation pass. */
+    protected Map<String, CompiledObject> objects =3D new LinkedHashMap<Stri=
ng, CompiledObject>();
+
+    /** Maps objects to their ID strings.  These are created during the seco=
nd compilation pass. */
+    protected Map<CompiledObject, String> ids =3D new LinkedHashMap<Compiled=
Object, String>();
+
+    protected static int errorCount;
+    protected static int warningCount;
+
+    public static void loadLibraries(boolean verbose) throws IOException, Cl=
assNotFoundException, InstantiationException, IllegalAccessException {
+        ClassLoader classloader =3D Thread.currentThread().getContextClassLo=
ader();
+        if (verbose) {
+            log.info("with cl " + classloader);
+        }
+        ServiceLoader<Initializer> loader =3D ServiceLoader.load(Initializer=
.class, classloader);
+        for (Initializer initializer : loader) {
+            if (verbose) {
+                log.info("load initializer " + initializer);
+            }
+            initializer.initialize();
+        }
+    }
+
+    public static void init() {
+        // forces static initializer to run if it hasn't yet
+    }
+
+    /** Resets all state in preparation for a new compilation session. */
+    protected static void reset() {
+        errorCount =3D warningCount =3D 0;
+        jaxxFiles.clear();
+        jaxxFileClassNames.clear();
+        symbolTables.clear();
+        compilers.clear();
+    }
+
+    public static String getVersion() {
+        return "1.0.4";
+    }
+
+    /**
+     * Creates a dummy JAXXCompiler for use in unit testing.
+     *
+     * @return the compiler
+     */
+    public static JAXXCompiler createDummyCompiler() {
+        return createDummyCompiler(JAXXCompiler.class.getClassLoader());
+    }
+
+    /**
+     * Creates a dummy JAXXCompiler for use in unit testing.
+     *
+     * @param classLoader class loader to use
+     * @return the compiler
+     */
+    public static JAXXCompiler createDummyCompiler(ClassLoader classLoader) {
+        return new JAXXCompiler(classLoader);
+    }
+
+    /**
+     * @param className the name of the class to use
+     * @return the compiler instance which is processing the specified JAXX =
class.  Each class is compiled by a
+     *         different compiler instance.
+     */
+    public static JAXXCompiler getJAXXCompiler(String className) {
+        return compilers !=3D null ? compilers.get(className) : null;
+    }
+
+    /**
+     * @param className the name of the class to use
+     * @return the symbol table for the specified JAXX class.  Must be calle=
d during the second compiler pass.
+     *         Returns <code>null</code> if no such symbol table could be fo=
und.
+     */
+    public static SymbolTable getSymbolTable(String className) {
+        JAXXCompiler compiler =3D getJAXXCompiler(className);
+        if (compiler =3D=3D null) {
+            return null;
+        }
+        return compiler.getSymbolTable();
+    }
+
+    /**
+     * Returns the system line separator string.
+     *
+     * @return the string used to separate lines
+     */
+    public static String getLineSeparator() {
+        return System.getProperty("line.separator", "\n");
+    }
+
+    /**
+     * Compiled a set of files, expressed as paths relative to a base direct=
ory.  The class names of the compiled files are derived
+     * from the relative path strings (e.g. "example/Foo.jaxx" compiles into=
 a class named "example.Foo").  Returns <code>true</code>
+     * if compilation succeeds, <code>false</code> if it fails.  Warning and=
 error messages are sent to <code>System.err</code>.
+     *
+     * @param base          the directory against which to resolve relative =
paths
+     * @param relativePaths a list of relative paths to .jaxx files being co=
mpiled
+     * @param options       the compiler options to use
+     * @return <code>true</code> if compilation succeeds, <code>false</code>=
 otherwise
+     */
+    public static synchronized boolean compile(File base, String[] relativeP=
aths, CompilerOptions options) {
+        File[] files =3D new File[relativePaths.length];
+        String[] classNames =3D new String[relativePaths.length];
+        for (int i =3D 0; i < files.length; i++) {
+            files[i] =3D new File(base, relativePaths[i]);
+            classNames[i] =3D relativePaths[i].substring(0, relativePaths[i]=
.lastIndexOf("."));
+            classNames[i] =3D classNames[i].replace(File.separatorChar, '.');
+            classNames[i] =3D classNames[i].replace('/', '.');
+            classNames[i] =3D classNames[i].replace('\\', '.');
+            classNames[i] =3D classNames[i].replace(':', '.');
+        }
+        return compile(files, classNames, options);
+    }
+
+    /**
+     * Compiled a set of files, with the class names specified explicitly.  =
The class compiled from files[i] will be named classNames[i].
+     * Returns <code>true</code> if compilation succeeds, <code>false</code>=
 if it fails.  Warning and error messages are sent to
+     * <code>System.err</code>.
+     *
+     * @param files      the .jaxx files to compile
+     * @param classNames the names of the classes being compiled
+     * @param options    the compiler options to use
+     * @return <code>true</code> if compilation succeeds, <code>false</code>=
 otherwise
+     */
+    public static synchronized boolean compile(File[] files, String[] classN=
ames, CompilerOptions options) {
+        reset(); // just to be safe...
+        jaxxFiles.addAll(Arrays.asList(files));
+        jaxxFileClassNames.addAll(Arrays.asList(classNames));
+        try {
+            boolean success =3D true;
+
+            // pass 1
+            currentPass =3D PASS_1;
+            boolean compiled;
+            do {
+                compiled =3D false;
+                assert jaxxFiles.size() =3D=3D jaxxFileClassNames.size();
+                java.util.Iterator<File> filesIterator =3D new ArrayList<Fil=
e>(jaxxFiles).iterator(); // clone it so it can safely be modified while we'r=
e iterating
+                java.util.Iterator<String> classNamesIterator =3D new ArrayL=
ist<String>(jaxxFileClassNames).iterator();
+                while (filesIterator.hasNext()) {
+                    File file =3D filesIterator.next();
+                    String className =3D classNamesIterator.next();
+                    if (options.isVerbose()) {
+                        log.info("compile first pass for " + className);
+                    }
+                    if (symbolTables.get(file) =3D=3D null) {
+                        compiled =3D true;
+                        if (compilers.containsKey(className)) {
+                            throw new CompilerException("Internal error: " +=
 className + " is already being compiled, attempting to compile it again");
+                        }
+
+                        File destDir =3D options.getTargetDirectory();
+                        if (destDir !=3D null) {
+                            int dotPos =3D className.lastIndexOf(".");
+                            if (dotPos !=3D -1) {
+                                destDir =3D new File(destDir, className.subs=
tring(0, dotPos).replace('.', File.separatorChar));
+                            }
+                            destDir.mkdirs();
+                        } else {
+                            //destDir =3D file.getParentFile();
+                        }
+                        JAXXCompiler compiler =3D new JAXXCompiler(file.getP=
arentFile(), file, className, options);
+                        compilers.put(className, compiler);
+                        compiler.compileFirstPass();
+                        assert !symbolTables.values().contains(compiler.getS=
ymbolTable()) : "symbolTable is already registered";
+                        symbolTables.put(file, compiler.getSymbolTable());
+                        if (compiler.failed) {
+                            success =3D false;
+                        }
+                    }
+                }
+
+            } while (compiled);
+
+            // pass 2
+            currentPass =3D PASS_2;
+            if (success) {
+                assert jaxxFiles.size() =3D=3D jaxxFileClassNames.size();
+                List<File> jaxxFilesClone =3D new ArrayList<File>(jaxxFiles);
+                for (String className : jaxxFileClassNames) {
+                    JAXXCompiler compiler =3D compilers.get(className);
+                    if (compiler =3D=3D null) {
+                        throw new CompilerException("Internal error: could n=
ot find compiler for " + className + " during second pass");
+                    }
+                    if (options.isVerbose()) {
+
+                        log.info("runInitializers for " + className);
+                    }
+                    if (!compiler.failed) {
+                        compiler.runInitializers();
+                    }
+                    if (options.isVerbose()) {
+
+                        log.info("compile second pass for " + className);
+                    }
+                    compiler.compileSecondPass();
+                    if (options.isVerbose()) {
+
+                        log.info("done with result [" + !compiler.failed + "=
] for " + className);
+                    }
+                    if (!compiler.failed) {
+
+                    } else {
+                        success =3D false;
+                    }
+                }
+                if (!jaxxFilesClone.equals(jaxxFiles)) {
+                    throw new AssertionError("Internal error: compilation se=
t altered during pass 2 (was " + jaxxFilesClone + ", modified to " + jaxxFile=
s + ")");
+                }
+            }
+
+            // stylesheet application
+            if (success) {
+                assert jaxxFiles.size() =3D=3D jaxxFileClassNames.size();
+                for (String className : jaxxFileClassNames) {
+                    JAXXCompiler compiler =3D compilers.get(className);
+                    if (compiler =3D=3D null) {
+                        throw new CompilerException("Internal error: could n=
ot find compiler for " + className + " during stylesheet application");
+                    }
+                    compiler.applyStylesheets();
+                    if (compiler.failed) {
+                        success =3D false;
+                    }
+                }
+            }
+
+            // code generation
+            if (success) {
+                assert jaxxFiles.size() =3D=3D jaxxFileClassNames.size();
+                for (String className : jaxxFileClassNames) {
+                    JAXXCompiler compiler =3D compilers.get(className);
+                    if (compiler =3D=3D null) {
+                        throw new CompilerException("Internal error: could n=
ot find compiler for " + className + " during code generation");
+                    }
+                    compiler.generator.generateCode();
+                    //compiler.generateCode();
+                    if (compiler.failed) {
+                        success =3D false;
+                    }
+                }
+            }
+
+            if (warningCount =3D=3D 1) {
+                System.err.println("1 warning");
+            } else if (warningCount > 0) {
+                System.err.println(warningCount + " warnings");
+            }
+            if (errorCount =3D=3D 1) {
+                System.err.println("1 error");
+            } else if (errorCount > 0) {
+                System.err.println(errorCount + " errors");
+            }
+            return success;
+        }
+        catch (CompilerException e) {
+            System.err.println(e.getMessage());
+            e.printStackTrace();
+            return false;
+        }
+        catch (Throwable e) {
+            e.printStackTrace();
+            return false;
+        }
+        finally {
+            //TC - 20081018 only reset when no error was detected
+            if (errorCount =3D=3D 0) {
+                reset();
+            }
+        }
+    }
+
+    // 1.5 adds getCanonicalName; unfortunately we can't depend on 1.5 featu=
res yet
+    public static String getCanonicalName(Class clazz) {
+        if (clazz.isArray()) {
+            String canonicalName =3D getCanonicalName(clazz.getComponentType=
());
+            if (canonicalName !=3D null) {
+                return canonicalName + "[]";
+            }
+            return null;
+        }
+        return clazz.getName().replace('$', '.');
+    }
+
+    public static String getCanonicalName(ClassDescriptor clazz) {
+        if (clazz.isArray()) {
+            String canonicalName =3D getCanonicalName(clazz.getComponentType=
());
+            if (canonicalName !=3D null) {
+                return canonicalName + "[]";
+            }
+            return null;
+        }
+        return clazz.getName().replace('$', '.');
+    }
+
+    public static String getCanonicalName(CompiledObject compiled) {
+        ClassDescriptor clazz =3D compiled.getObjectClass();
+        if (clazz.isArray()) {
+            String canonicalName =3D getCanonicalName(clazz.getComponentType=
());
+            if (canonicalName !=3D null) {
+                if (compiled.getGenericTypes().length > 0) {
+                    canonicalName +=3D "<";
+                    for (int i =3D 0; i < compiled.getGenericTypes().length;=
 i++) {
+                        ClassDescriptor classDescriptor =3D compiled.getGene=
ricTypes()[i];
+                        if (i > 0) {
+                            canonicalName +=3D " ,";
+                        }
+                        canonicalName +=3D classDescriptor.getName();
+                    }
+                    canonicalName +=3D ">";
+                }
+                return canonicalName + "[]";
+            }
+            return null;
+        }
+
+        String canonicalName =3D clazz.getName().replace('$', '.');
+        if (compiled.getGenericTypes().length > 0) {
+            canonicalName +=3D "<";
+            for (int i =3D 0; i < compiled.getGenericTypes().length; i++) {
+                ClassDescriptor classDescriptor =3D compiled.getGenericTypes=
()[i];
+                if (i > 0) {
+                    canonicalName +=3D " ,";
+                }
+                canonicalName +=3D classDescriptor.getName();
+            }
+            canonicalName +=3D ">";
+        }
+        return canonicalName;
+    }
+
+    public static String capitalize(String s) {
+        if (s.length() =3D=3D 0) {
+            return s;
+        }
+        return Character.toUpperCase(s.charAt(0)) + s.substring(1);
+    }
+
+    /**
+     * Escapes a string using standard Java escape sequences, generally in p=
reparation to including it in a string literal
+     * in a compiled Java file.
+     *
+     * @param raw the raw string to be escape
+     * @return a string in which all 'dangerous' characters have been replac=
ed by equivalent Java escape sequences
+     */
+    public static String escapeJavaString(String raw) {
+        StringBuffer out =3D new StringBuffer(raw);
+        for (int i =3D 0; i < out.length(); i++) {
+            char c =3D out.charAt(i);
+            if (c =3D=3D '\\' || c =3D=3D '"') {
+                out.insert(i, '\\');
+                i++;
+            } else if (c =3D=3D '\n') {
+                out.replace(i, i + 1, "\\n");
+                i++;
+            } else if (c =3D=3D '\r') {
+                out.replace(i, i + 1, "\\r");
+                i++;
+            } else if (c < 32 || c > 127) {
+                String value =3D Integer.toString((int) c, 16);
+                while (value.length() < 4) {
+                    value =3D "0" + value;
+                }
+                out.replace(i, i + 1, "\\u" + value);
+                i +=3D 5;
+            }
+        }
+        return out.toString();
+    }
+
+    public static File URLtoFile(URL url) {
+        return URLtoFile(url.toString());
+    }
+
+    public static File URLtoFile(String urlString) {
+        if (!urlString.startsWith("file:")) {
+            throw new IllegalArgumentException("url must start with 'file:'"=
);
+        }
+        urlString =3D urlString.substring("file:".length());
+        if (urlString.startsWith("/") && System.getProperty("os.name").start=
sWith("Windows")) {
+            urlString =3D urlString.substring(1);
+        }
+        try {
+            return new File(URLDecoder.decode(urlString.replace('/', File.se=
paratorChar), "utf-8"));
+        }
+        catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public static SAXParser getSAXParser() {
+        try {
+            SAXParserFactory factory =3D SAXParserFactory.newInstance();
+            factory.setNamespaceAware(true);
+            SAXParser parser;
+            parser =3D factory.newSAXParser();
+            return parser;
+        }
+        catch (SAXException e) {
+            throw new RuntimeException(e);
+        }
+        catch (ParserConfigurationException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public static Document parseDocument(InputStream in) throws IOException,=
 SAXException {
+        try {
+            TransformerFactory factory =3D TransformerFactory.newInstance();
+            Transformer transformer =3D factory.newTransformer();
+            transformer.setErrorListener(new ErrorListener() {
+                public void warning(TransformerException ex) throws Transfor=
merException {
+                    throw ex;
+                }
+
+                public void error(TransformerException ex) throws Transforme=
rException {
+                    throw ex;
+                }
+
+                public void fatalError(TransformerException ex) throws Trans=
formerException {
+                    throw ex;
+                }
+            });
+
+            DOMResult result =3D new DOMResult();
+            transformer.transform(new SAXSource(new XMLFilterImpl(getSAXPars=
er().getXMLReader()) {
+                Locator locator;
+
+                @Override
+                public void setDocumentLocator(Locator locator) {
+                    this.locator =3D locator;
+                }
+
+                @Override
+                public void startElement(String uri, String localName, Strin=
g qName, Attributes atts) throws SAXException {
+                    AttributesImpl resultAtts =3D new AttributesImpl(atts);
+                    resultAtts.addAttribute(JAXX_INTERNAL_NAMESPACE, "line",=
 "internal:line", "CDATA", String.valueOf(locator.getLineNumber()));
+                    getContentHandler().startElement(uri, localName, qName, =
resultAtts);
+                }
+            }, new InputSource(in)), result);
+            return (Document) result.getNode();
+        }
+        catch (TransformerConfigurationException e) {
+            throw new RuntimeException(e);
+        }
+        catch (TransformerException e) {
+            Throwable ex =3D e;
+            while (ex.getCause() !=3D null) {
+                ex =3D ex.getCause();
+            }
+            if (ex instanceof IOException) {
+                throw (IOException) ex;
+            }
+            if (ex instanceof SAXException) {
+                throw (SAXException) ex;
+            }
+            if (ex instanceof RuntimeException) {
+                throw (RuntimeException) ex;
+            }
+            throw new RuntimeException(ex);
+        }
+    }
+
+    protected static void showUsage() {
+        System.out.println("Usage: jaxxc <options> <source files>");
+        System.out.println();
+        System.out.println("Source files must end in extension .jaxx");
+        System.out.println("Use JAXX_OPTS environment variable to pass argum=
ents to Java runtime");
+        System.out.println();
+        System.out.println("Supported options include:");
+        System.out.println("  -classpath <paths>  paths to search for user c=
lasses");
+        System.out.println("  -cp <paths>         same as -classpath");
+        System.out.println("  -d <directory>      target directory for gener=
ated class files");
+        System.out.println("  -java or -j         produce .java files, but d=
o not compile them");
+        System.out.println("  -keep or -k         preserve generated .java f=
iles after compilation");
+        System.out.println("  -optimize or -o     optimize during compilatio=
n");
+        System.out.println("  -version            display version informatio=
n");
+        System.out.println();
+        System.out.println("See http://www.jaxxframework.org/ for full docum=
entation.");
+    }
+
+    public static void main(String[] arg) throws Exception {
+        boolean success =3D true;
+
+        CompilerOptions options =3D new CompilerOptions();
+        List<String> files =3D new ArrayList<String>();
+        for (int i =3D 0; i < arg.length; i++) {
+            if (arg[i].endsWith(".jaxx")) {
+                files.add(arg[i]);
+            } else if (arg[i].equals("-d")) {
+                if (++i < arg.length) {
+                    File targetDirectory =3D new File(arg[i]);
+                    if (!targetDirectory.exists()) {
+                        System.err.println("Error: could not find target dir=
ectory: " + targetDirectory);
+                        JAXXCompiler.errorCount++;
+                        success =3D false;
+                    }
+                    options.setTargetDirectory(targetDirectory);
+                } else {
+                    success =3D false;
+                }
+            } else if (arg[i].equals("-cp") || arg[i].equals("-classpath")) {
+                if (++i < arg.length) {
+                    options.setClassPath(arg[i]);
+                } else {
+                    success =3D false;
+                }
+            } else if (arg[i].equals("-javac_opts")) {
+                if (++i < arg.length) {
+                    options.setJavacOpts(arg[i]);
+                } else {
+                    success =3D false;
+                }
+            } else if (arg[i].equals("-k") || arg[i].equals("-keep")) {
+                options.setKeepJavaFiles(true);
+            } else if (arg[i].equals("-j") || arg[i].equals("-java")) {
+                options.setKeepJavaFiles(true);
+            } else if (arg[i].equals("-o") || arg[i].equals("-optimize")) {
+                options.setOptimize(true);
+            } else if (arg[i].equals("-version")) {
+                System.err.println("jaxxc version " + getVersion() + " by Et=
han Nicholas");
+                System.err.println("http://www.jaxxframework.org/");
+                System.exit(0);
+            } else if (arg[i].equals("-internalDumpVersion")) { // used by a=
nt to extract the version info
+                System.out.println("jaxx.version=3D" + getVersion());
+                return;
+            } else {
+                success =3D false;
+            }
+        }
+
+        success &=3D (JAXXCompiler.errorCount =3D=3D 0 && files.size() > 0);
+
+        if (success) {
+            success =3D JAXXCompiler.compile(new File("."), files.toArray(ne=
w String[files.size()]), options);
+        } else {
+            showUsage();
+            System.exit(1);
+        }
+
+        System.exit(success ? 0 : 1);
+    }
+
+}

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/JAXXObjectGe=
nerator.java (from rev 977, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/comp=
iler/JAXXObjectGenerator.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/JAXXObjectGenera=
tor.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/JAXXObjectGenera=
tor.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,657 @@
+package jaxx.compiler;
+
+import jaxx.CompilerException;
+import jaxx.reflect.ClassDescriptor;
+import jaxx.reflect.ClassDescriptorLoader;
+import jaxx.reflect.MethodDescriptor;
+import jaxx.runtime.JAXXObject;
+import jaxx.runtime.JAXXObjectDescriptor;
+import jaxx.runtime.swing.Application;
+import jaxx.tags.validator.BeanValidatorHandler.CompiledBeanValidator;
+import jaxx.types.TypeManager;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.io.PrintWriter;
+import java.lang.reflect.Modifier;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.zip.GZIPOutputStream;
+
+/**
+ * This class is a refactoring of the {@link jaxx.compiler.JAXXCompiler}.
+ * <p/>
+ * We delegate now the generation of a {@link jaxx.runtime.JAXXObject} to th=
is class, the
+ * {@link jaxx.compiler.JAXXCompiler} now only deals with the compilation of=
 files.
+ *
+ * @author chemit
+ */
+public class JAXXObjectGenerator {
+
+    /** log */
+    protected static final Log log =3D LogFactory.getLog(JAXXObjectGenerator=
.class);
+
+    /** the compile used to parse the file to be generated here. */
+    protected JAXXCompiler compiler;
+
+    /** the file to be generated */
+    protected JavaFile javaFile =3D new JavaFile();
+
+    /** Generated .java file. */
+    protected File dest;
+
+    /** Extra code to be added to the instance initializer. */
+    protected StringBuffer initializer =3D new StringBuffer();
+
+    /** Extra code to be added at the end of the instance initializer. */
+    protected StringBuffer lateInitializer =3D new StringBuffer();
+
+    /** Extra code to be added to the class body. */
+    protected StringBuffer bodyCode =3D new StringBuffer();
+
+    /** Code to initialize data bindings. */
+    protected StringBuffer initDataBindings =3D new StringBuffer();
+
+    /** Body of the applyDataBinding method. */
+    protected StringBuffer applyDataBinding =3D new StringBuffer();
+
+    /** Body of the removeDataBinding method. */
+    protected StringBuffer removeDataBinding =3D new StringBuffer();
+
+    /** Body of the processDataBinding method. */
+    protected StringBuffer processDataBinding =3D new StringBuffer();
+
+    /** true if a main() method has been declared in a script */
+    protected boolean mainDeclared;
+
+    public JAXXObjectGenerator(JAXXCompiler compiler) {
+        this.compiler =3D compiler;
+    }
+
+    protected void generateCode() throws IOException {
+        if (getOptions().getTargetDirectory() !=3D null) {
+            dest =3D new File(getOptions().getTargetDirectory(), getOutputCl=
assName().replace('.', File.separatorChar) + ".java");
+        } else {
+            dest =3D new File(getBaseDir(), getOutputClassName().substring(g=
etOutputClassName().lastIndexOf(".") + 1) + ".java");
+        }
+        if (dest.exists() && !dest.setLastModified(System.currentTimeMillis(=
))) {
+            log.warn("could not touch file " + dest);
+        }
+        PrintWriter out =3D new PrintWriter(new FileWriter(dest));
+        createJavaSource(out);
+        out.close();
+    }
+
+    protected void createJavaSource(PrintWriter out) throws IOException {
+        int dotPos =3D getOutputClassName().lastIndexOf(".");
+        String packageName =3D dotPos !=3D -1 ? getOutputClassName().substri=
ng(0, dotPos) : null;
+        String simpleClassName =3D getOutputClassName().substring(dotPos + 1=
);
+        outputClass(packageName, simpleClassName, out);
+    }
+
+    protected void outputClass(String packageName, String className, PrintWr=
iter out) throws CompilerException {
+        createJavaFile(packageName, className);
+        out.println(javaFile.toString());
+    }
+
+    protected void createJavaFile(String packageName, String className) thro=
ws CompilerException {
+        String fullClassName =3D packageName !=3D null ? packageName + "." +=
 className : className;
+        CompiledObject root =3D compiler.getRootObject();
+        if (root =3D=3D null) {
+            throw new CompilerException("root tag must be a class tag");
+        }
+        Map<String, CompiledObject> objects =3D compiler.getObjects();
+        ClassDescriptor superclass =3D root.getObjectClass();
+        boolean superclassIsJAXXObject =3D ClassDescriptorLoader.getClassDes=
criptor(JAXXObject.class).isAssignableFrom(superclass);
+        javaFile.setModifiers(Modifier.PUBLIC);
+        javaFile.setClassName(fullClassName);
+        javaFile.setSuperClass(JAXXCompiler.getCanonicalName(superclass));
+        javaFile.setInterfaces(new String[]{JAXXCompiler.getCanonicalName(JA=
XXObject.class)});
+
+        for (CompiledObject object : compiler.getObjects().values()) {
+            if (!object.isOverride() && !(object instanceof ScriptInitialize=
r)) {
+                int access =3D object.getId().startsWith("$") ? Modifier.PRI=
VATE : Modifier.PROTECTED;
+                if (object =3D=3D root) {
+                    javaFile.addField(new JavaField(access, fullClassName, o=
bject.getId(), "this"));
+                } else {
+                    //TC -20081017 can have generic on compiled Object
+                    javaFile.addField(new JavaField(access, JAXXCompiler.get=
CanonicalName(object), object.getId()));
+                    //javaFile.addField(new JavaField(access, getCanonicalNa=
me(object.getObjectClass()), object.getId()));
+                }
+            }
+        }
+
+        if (!superclassIsJAXXObject) {
+            // add logger
+            if (getOptions().isAddLogger()) {
+                javaFile.addImport("org.apache.commons.logging.Log");
+                javaFile.addImport("org.apache.commons.logging.LogFactory");
+                javaFile.addField(createLoggerField(fullClassName));
+            }
+
+            javaFile.addField(new JavaField(Modifier.PROTECTED, "java.util.L=
ist<Object>", "$activeBindings", "new ArrayList<Object>()"));
+            javaFile.addField(new JavaField(Modifier.PROTECTED, "java.util.M=
ap<String,Object>", "$bindingSources", "new HashMap<String,Object>()"));
+            javaFile.addField(new JavaField(Modifier.PROTECTED, "java.util.L=
ist<String>", "validatorIds", "new ArrayList<String>()"));
+        }
+
+        javaFile.addImport("jaxx.runtime.validator.BeanValidator");
+
+        if (compiler.getStylesheet() !=3D null) {
+            javaFile.addField(new JavaField(0, "java.util.Map", "$previousVa=
lues", "new java.util.HashMap()"));
+        }
+
+        javaFile.addMethod(createConstructor(className));
+        javaFile.addMethod(createInitializer(className));
+        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "BeanValidator<?>=
", "getValidator", new JavaArgument[]{new JavaArgument("String", "validatorId=
")},
+                null, "return (BeanValidator)(validatorIds.contains(validato=
rId)?getObjectById(validatorId):null);"));
+
+        for (DataBinding dataBinding : compiler.getDataBindings()) {
+            if (dataBinding.compile(true)) {
+                initDataBindings.append("applyDataBinding(").append(TypeMana=
ger.getJavaCode(dataBinding.getId())).append(");").append(JAXXCompiler.getLin=
eSeparator());
+            }
+        }
+
+        javaFile.addBodyCode(bodyCode.toString());
+
+        for (CompiledObject object : objects.values()) {
+            if (!compiler.inlineCreation(object) && object !=3D root) {
+                javaFile.addMethod(new JavaMethod(Modifier.PROTECTED, "void"=
, object.getCreationMethodName(), null, null, getCreationCode(object)));
+            }
+        }
+
+        javaFile.addField(new JavaField(Modifier.PRIVATE, "boolean", "allCom=
ponentsCreated"));
+
+        javaFile.addMethod(createCompleteSetupMethod());
+
+        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "applyDat=
aBinding", new JavaArgument[]{new JavaArgument("String", "$binding")},
+                null, applyDataBinding.toString() + JAXXCompiler.getLineSepa=
rator() + "    processDataBinding($binding);"));
+
+        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "removeDa=
taBinding", new JavaArgument[]{new JavaArgument("String", "$binding")},
+                null, removeDataBinding.toString()));
+
+        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "processD=
ataBinding", new JavaArgument[]{new JavaArgument("String", "dest")},
+                null, "processDataBinding(dest, false);"));
+
+        javaFile.addMethod(createProcessDataBindingMethod());
+
+        if (!superclassIsJAXXObject) {
+            javaFile.addField(createObjectMap());
+            javaFile.addMethod(createGetObjectByIdMethod());
+        }
+
+        javaFile.addField(createJAXXObjectDescriptorField());
+        javaFile.addMethod(createGetJAXXObjectDescriptorMethod());
+
+        /*
+        * Gestion du context
+        */
+        javaFile.addField(createContextField());
+        javaFile.addMethod(createSetContextValueMethod());
+        javaFile.addMethod(createSetContextValueNameMethod());
+        javaFile.addMethod(createGetContextValueMethod());
+        javaFile.addMethod(createGetContextValueNameMethod());
+        javaFile.addMethod(createGetParentContainer());
+        javaFile.addMethod(createGetParentContainerMore());
+        ClassDescriptor currentClass =3D root.getObjectClass();
+        MethodDescriptor firePropertyChange =3D null;
+        while (firePropertyChange =3D=3D null && currentClass !=3D null) {
+            try {
+                firePropertyChange =3D currentClass.getDeclaredMethodDescrip=
tor("firePropertyChange", new ClassDescriptor[]{
+                        ClassDescriptorLoader.getClassDescriptor(String.clas=
s),
+                        ClassDescriptorLoader.getClassDescriptor(Object.clas=
s),
+                        ClassDescriptorLoader.getClassDescriptor(Object.clas=
s)
+                });
+
+            }
+            catch (NoSuchMethodException e) {
+                currentClass =3D currentClass.getSuperclass();
+            }
+        }
+
+        int modifiers =3D firePropertyChange !=3D null ? firePropertyChange.=
getModifiers() : 0;
+        if (Modifier.isPublic(modifiers)) {
+            // we have all the support we need
+        }
+        if (Modifier.isProtected(modifiers)) {
+            // there is property change support but the firePropertyChange m=
ethod is protected
+            javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "fire=
PropertyChange", new JavaArgument[]{
+                    new JavaArgument("java.lang.String", "propertyName"), ne=
w JavaArgument("java.lang.Object", "oldValue"), new JavaArgument("java.lang.O=
bject", "newValue")},
+                    null, "super.firePropertyChange(propertyName, oldValue, =
newValue);"));
+        } else {
+            // either no support at all or firePropertyChange isn't accessib=
le
+            addPropertyChangeSupport(javaFile);
+        }
+
+        addEventHandlers(javaFile);
+
+        if (ClassDescriptorLoader.getClassDescriptor(Application.class).isAs=
signableFrom(root.getObjectClass()) && !isMainDeclared()) {
+            // TODO: check for existing main method first
+            javaFile.addMethod(new JavaMethod(Modifier.PUBLIC | Modifier.STA=
TIC, "void", "main",
+                    new JavaArgument[]{new JavaArgument("String[]", "arg")},=
 null,
+                    "SwingUtilities.invokeLater(new Runnable() { public void=
 run() { new " + className + "().setVisible(true); } });"));
+        }
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- Create fields -----------------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    private JavaField createObjectMap() {
+        return new JavaField(Modifier.PROTECTED, "Map<String,Object>", "$obj=
ectMap", "new HashMap<String,Object>()");
+    }
+
+    private JavaField createContextField() {
+        return new JavaField(Modifier.PROTECTED, "Map<Object,String>", "$con=
textMap", "new HashMap<Object,String>()");
+    }
+
+    private JavaField createLoggerField(String className) {
+        return new JavaField(Modifier.PUBLIC + Modifier.STATIC + Modifier.FI=
NAL, "Log", "log", "LogFactory.getLog(" + className + ".class)");
+    }
+
+    protected JavaField createJAXXObjectDescriptorField() {
+        try {
+            JAXXObjectDescriptor descriptor =3D compiler.getJAXXObjectDescri=
ptor();
+            ByteArrayOutputStream buffer =3D new ByteArrayOutputStream();
+            ObjectOutputStream out =3D new ObjectOutputStream(new GZIPOutput=
Stream(buffer));
+            out.writeObject(descriptor);
+            out.close();
+            // the use of the weird deprecated constructor is deliberate -- =
we need to store the data as a String
+            // in the compiled class file, since byte array initialization i=
s horribly inefficient compared to
+            // String initialization.  So we store the bytes in the String, =
and we quite explicitly want a 1:1
+            // mapping between bytes and chars, with the high byte of the ch=
ar set to zero.  We can then safely
+            // reconstitute the original byte[] at a later date.  This is un=
questionably an abuse of the String
+            // type, but if we could efficiently store a byte[] we wouldn't =
have to do this.
+            String data =3D new String(buffer.toByteArray(), 0);
+
+            int sizeLimit =3D 65000; // constant strings are limited to 64K,=
 and I'm not brave enough to push right up to the limit
+            if (data.length() < sizeLimit) {
+                return new JavaField(Modifier.PRIVATE | Modifier.STATIC, "ja=
va.lang.String", "$jaxxObjectDescriptor", TypeManager.getJavaCode(data));
+            } else {
+                StringBuffer initializer =3D new StringBuffer();
+                for (int i =3D 0; i < data.length(); i +=3D sizeLimit) {
+                    String name =3D "$jaxxObjectDescriptor" + i;
+                    javaFile.addField(new JavaField(Modifier.PRIVATE | Modif=
ier.STATIC, "java.lang.String", name,
+                            TypeManager.getJavaCode(data.substring(i, Math.m=
in(i + sizeLimit, data.length())))));
+                    if (initializer.length() > 0) {
+                        initializer.append(" + ");
+                    }
+                    initializer.append("String.valueOf(").append(name).appen=
d(")");
+                }
+                return new JavaField(Modifier.PRIVATE | Modifier.STATIC, "ja=
va.lang.String", "$jaxxObjectDescriptor", initializer.toString());
+            }
+        } catch (IOException e) {
+            throw new RuntimeException("Internal error: can't-happen error",=
 e);
+        }
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- Create methods ----------------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    protected JavaMethod createGetJAXXObjectDescriptorMethod() {
+        return new JavaMethod(Modifier.PUBLIC | Modifier.STATIC, "jaxx.runti=
me.JAXXObjectDescriptor", "$getJAXXObjectDescriptor",
+                null, null, "return jaxx.runtime.Util.decodeCompressedJAXXOb=
jectDescriptor($jaxxObjectDescriptor);");
+    }
+
+    protected JavaMethod createGetObjectByIdMethod() {
+        return new JavaMethod(Modifier.PUBLIC, "java.lang.Object", "getObjec=
tById",
+                new JavaArgument[]{new JavaArgument("String", "id")}, null,
+                "return $objectMap.get(id);");
+    }
+
+    private JavaMethod createSetContextValueMethod() {
+
+        return new JavaMethod(Modifier.PUBLIC, "void", "setContextValue",
+                new JavaArgument[]{new JavaArgument("Object", "clazz")}, nul=
l, getSetContextValueMethodCode());
+    }
+
+    private JavaMethod createSetContextValueNameMethod() {
+        return new JavaMethod(Modifier.PUBLIC, "void", "setContextValue",
+                new JavaArgument[]{new JavaArgument("Object", "clazz"), new =
JavaArgument("String", "name")}, null, getSetContextValueNameMethodCode());
+    }
+
+    private JavaMethod createGetContextValueMethod() {
+        return new JavaMethod(Modifier.PUBLIC, "<T> T", "getContextValue",
+                new JavaArgument[]{new JavaArgument("Class<T>", "clazz")}, n=
ull, getGetContextValueMethodCode());
+    }
+
+    private JavaMethod createGetContextValueNameMethod() {
+        return new JavaMethod(Modifier.PUBLIC, "<T> T", "getContextValue",
+                new JavaArgument[]{new JavaArgument("Class<T>", "clazz"), ne=
w JavaArgument("String", "name")}, null, getGetContextValueNameMethodCode());
+    }
+
+    private JavaMethod createGetParentContainer() {
+        return new JavaMethod(Modifier.PUBLIC, "<O extends Container> O", "g=
etParentContainer",
+                new JavaArgument[]{new JavaArgument("Class<O>", "clazz")}, n=
ull, getGetParentContenerMethodCode());
+    }
+
+    private JavaMethod createGetParentContainerMore() {
+        return new JavaMethod(Modifier.PUBLIC, "<O extends Container> O", "g=
etParentContainer",
+                new JavaArgument[]{new JavaArgument("Object", "source"), new=
 JavaArgument("Class<O>", "clazz")}, null, getGetParentContenerMethodMoreCode=
());
+    }
+
+
+    protected void addPropertyChangeSupport(JavaFile javaFile) throws Compil=
erException {
+        javaFile.addField(new JavaField(0, "java.beans.PropertyChangeSupport=
", "$propertyChangeSupport"));
+
+        javaFile.addMethod(new JavaMethod(0, "java.beans.PropertyChangeSuppo=
rt", "$getPropertyChangeSupport", null, null,
+                "if ($propertyChangeSupport =3D=3D null)\n" +
+                        "    $propertyChangeSupport =3D new PropertyChangeSu=
pport(this);\n" +
+                        "return $propertyChangeSupport;"));
+
+        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "addPrope=
rtyChangeListener", new JavaArgument[]{
+                new JavaArgument("java.beans.PropertyChangeListener", "liste=
ner")}, null,
+                "$getPropertyChangeSupport().addPropertyChangeListener(liste=
ner);"));
+
+        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "addPrope=
rtyChangeListener", new JavaArgument[]{
+                new JavaArgument("java.lang.String", "property"), new JavaAr=
gument("java.beans.PropertyChangeListener", "listener")}, null,
+                "$getPropertyChangeSupport().addPropertyChangeListener(prope=
rty, listener);"));
+
+        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "removePr=
opertyChangeListener", new JavaArgument[]{
+                new JavaArgument("java.beans.PropertyChangeListener", "liste=
ner")}, null,
+                "$getPropertyChangeSupport().removePropertyChangeListener(li=
stener);"));
+
+        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "removePr=
opertyChangeListener", new JavaArgument[]{
+                new JavaArgument("java.lang.String", "property"), new JavaAr=
gument("java.beans.PropertyChangeListener", "listener")}, null,
+                "$getPropertyChangeSupport().removePropertyChangeListener(pr=
operty, listener);"));
+
+        javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void", "fireProp=
ertyChange", new JavaArgument[]{
+                new JavaArgument("java.lang.String", "propertyName"), new Ja=
vaArgument("java.lang.Object", "oldValue"), new JavaArgument("java.lang.Objec=
t", "newValue")},
+                null, "$getPropertyChangeSupport().firePropertyChange(proper=
tyName, oldValue, newValue);"));
+    }
+
+
+    protected void addEventHandlers(JavaFile javaFile) {
+        for (Map.Entry<String, Map<ClassDescriptor, List<EventHandler>>> e1 =
: compiler.getEventHandlers().entrySet()) {
+            // outer loop is iterating over different objects (well, technic=
ally, different Java expressions)
+            for (Map.Entry<ClassDescriptor, List<EventHandler>> e2 : e1.getV=
alue().entrySet()) {
+                // iterate over different types of listeners for this partic=
ular object (MouseListener, ComponentListener, etc.)
+                for (EventHandler handler : e2.getValue()) {
+                    // iterate over individual event handlers of a single ty=
pe
+                    String methodName =3D compiler.getEventHandlerMethodName=
(handler);
+                    MethodDescriptor listenerMethod =3D handler.getListenerM=
ethod();
+                    if (listenerMethod.getParameterTypes().length !=3D 1) {
+                        throw new CompilerException("Expected event handler =
" + listenerMethod.getName() + " of class " + handler.getListenerClass() + " =
to have exactly one argument");
+                    }
+                    javaFile.addMethod(new JavaMethod(Modifier.PUBLIC, "void=
", methodName,
+                            new JavaArgument[]{new JavaArgument(JAXXCompiler=
.getCanonicalName(listenerMethod.getParameterTypes()[0]), "event")}, null,
+                            handler.getJavaCode()));
+                }
+            }
+        }
+    }
+
+    protected JavaMethod createConstructor(String className) throws Compiler=
Exception {
+        StringBuffer code =3D new StringBuffer();
+        String constructorParams =3D compiler.getRootObject().getConstructor=
Params();
+        if (constructorParams !=3D null) {
+            code.append("        super(").append(constructorParams).append("=
);");
+            code.append(JAXXCompiler.getLineSeparator());
+        }
+        code.append("$initialize();");
+        code.append(JAXXCompiler.getLineSeparator());
+        return new JavaMethod(Modifier.PUBLIC, null, className, null, null, =
code.toString());
+    }
+
+
+    protected JavaMethod createInitializer(String className) throws Compiler=
Exception {
+        StringBuffer code =3D new StringBuffer();
+        CompiledObject root =3D compiler.getRootObject();
+        code.append("$objectMap.put(").append(TypeManager.getJavaCode(root.g=
etId())).append(", this);");
+        code.append(JAXXCompiler.getLineSeparator());
+
+        Iterator<CompiledObject> i =3D compiler.getObjectCreationOrder();
+        boolean lastWasMethodCall =3D false;
+        while (i.hasNext()) {
+            CompiledObject object =3D i.next();
+            if (object !=3D root && !object.isOverride()) {
+                if (compiler.inlineCreation(object)) {
+                    if (lastWasMethodCall) {
+                        lastWasMethodCall =3D false;
+                        code.append(JAXXCompiler.getLineSeparator());
+                    }
+                    code.append(getCreationCode(object));
+                    code.append(JAXXCompiler.getLineSeparator());
+                } else {
+                    code.append(object.getCreationMethodName()).append("();"=
);
+                    code.append(JAXXCompiler.getLineSeparator());
+                    lastWasMethodCall =3D true;
+                }
+            }
+        }
+        String rootCode =3D root.getInitializationCode(compiler);
+        if (rootCode !=3D null && rootCode.length() > 0) {
+            code.append(rootCode);
+            code.append(JAXXCompiler.getLineSeparator());
+        }
+        code.append(JAXXCompiler.getLineSeparator());
+        if (initializer.length() > 0) {
+            code.append(initializer);
+            code.append(JAXXCompiler.getLineSeparator());
+        }
+        code.append("$completeSetup();");
+        code.append(JAXXCompiler.getLineSeparator());
+        return new JavaMethod(Modifier.PRIVATE, "void", "$initialize", null,=
 null, code.toString());
+    }
+
+
+    protected JavaMethod createCompleteSetupMethod() {
+        StringBuffer code =3D new StringBuffer();
+        code.append("allComponentsCreated =3D true;");
+        code.append(JAXXCompiler.getLineSeparator());
+        for (CompiledObject object : compiler.getObjects().values()) {
+            //TC - 20081017 only generate the method if not empty ?
+            if (object.getId().startsWith("$")) {
+                code.append(object.getAdditionCode()).append(JAXXCompiler.ge=
tLineSeparator());
+            } else {
+                String additionCode =3D object.getAdditionCode();
+                if (additionCode.length() > 0) {
+                    code.append(object.getAdditionMethodName()).append("();"=
).append(JAXXCompiler.getLineSeparator());
+                    additionCode =3D "if (allComponentsCreated) {" + JAXXCom=
piler.getLineSeparator() + additionCode + "}";
+                    javaFile.addMethod(new JavaMethod(Modifier.PROTECTED, "v=
oid", object.getAdditionMethodName(), null, null, additionCode));
+                }
+            }
+            //code.append(getLineSeparator());
+        }
+
+        code.append(initDataBindings);
+
+        if (lateInitializer.length() > 0) {
+            code.append(lateInitializer);
+            code.append(JAXXCompiler.getLineSeparator());
+        }
+
+        if (compiler.hasValidator()) {
+            // register validator
+            for (CompiledBeanValidator validator : compiler.getValidators())=
 {
+                String id =3D TypeManager.getJavaCode(validator.getId());
+                code.append("validatorIds.add(").append(id).append(");");
+                code.append(JAXXCompiler.getLineSeparator());
+                code.append("getValidator(").append(id).append(").installUIs=
();");
+                code.append("getValidator(").append(id).append(").validate()=
;");
+                code.append(JAXXCompiler.getLineSeparator());
+            }
+        }
+        return new JavaMethod(Modifier.PRIVATE, "void", "$completeSetup", nu=
ll, null, code.toString());
+    }
+
+    protected JavaMethod createProcessDataBindingMethod() {
+        StringBuffer code =3D new StringBuffer();
+        boolean superclassIsJAXXObject =3D ClassDescriptorLoader.getClassDes=
criptor(JAXXObject.class).isAssignableFrom(compiler.getRootObject().getObject=
Class());
+        // the force parameter forces the update to happen even if it is alr=
eady in activeBindings.  This
+        // is used on superclass invocations b/c by the time the call gets t=
o the superclass, it is already
+        // marked active and would otherwise be skipped
+        if (processDataBinding.length() > 0) {
+            code.append("        if (!$force && $activeBindings.contains($de=
st)) return;");
+            code.append(JAXXCompiler.getLineSeparator());
+            code.append("        $activeBindings.add($dest);");
+            code.append(JAXXCompiler.getLineSeparator());
+            code.append("        try {");
+            code.append(JAXXCompiler.getLineSeparator());
+            if (processDataBinding.length() > 0) {
+                code.append(processDataBinding);
+                code.append(JAXXCompiler.getLineSeparator());
+            }
+            if (superclassIsJAXXObject) {
+                code.append("        else");
+                code.append(JAXXCompiler.getLineSeparator());
+                code.append("            super.processDataBinding($dest, tru=
e);");
+                code.append(JAXXCompiler.getLineSeparator());
+            }
+            code.append("        }");
+            code.append(JAXXCompiler.getLineSeparator());
+            code.append("        finally {");
+            code.append(JAXXCompiler.getLineSeparator());
+            code.append("            $activeBindings.remove($dest);");
+            code.append(JAXXCompiler.getLineSeparator());
+            code.append("        }");
+            code.append(JAXXCompiler.getLineSeparator());
+        } else if (superclassIsJAXXObject) {
+            code.append("        super.processDataBinding($dest, true);");
+            code.append(JAXXCompiler.getLineSeparator());
+        }
+        return new JavaMethod(Modifier.PUBLIC, "void", "processDataBinding",
+                new JavaArgument[]{new JavaArgument("String", "$dest"), new =
JavaArgument("boolean", "$force")},
+                null, code.toString());
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- Create methods code -----------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+    private String getSetContextValueMethodCode() {
+        return "this.setContextValue(clazz, null);";
+    }
+
+    private String getSetContextValueNameMethodCode() {
+        StringBuffer result =3D new StringBuffer();
+        result.append("$contextMap.put(clazz, name);");
+        return result.toString();
+    }
+
+    private String getGetContextValueMethodCode() {
+        return "return this.getContextValue(clazz, null);";
+    }
+
+    private String getGetContextValueNameMethodCode() {
+        StringBuffer result =3D new StringBuffer();
+        result.append("for (Map.Entry<Object,String> entry : $contextMap.ent=
rySet())  {");
+        result.append("if (clazz.isAssignableFrom(entry.getKey().getClass())=
 && (name =3D=3D null || name =3D=3D entry.getValue()))  {");
+        result.append("return (T) entry.getKey();}}");
+        result.append("return null;");
+        return result.toString();
+    }
+
+    private String getGetParentContenerMethodCode() {
+        StringBuffer result =3D new StringBuffer();
+        result.append("return this.getParentContainer(this, clazz);");
+        return result.toString();
+    }
+
+    private String getGetParentContenerMethodMoreCode() {
+        StringBuffer result =3D new StringBuffer();
+        result.append("if (!Container.class.isAssignableFrom(source.getClass=
())) {return null;}");
+        result.append(JAXXCompiler.getLineSeparator());
+        result.append("Container parent =3D ((Container)source).getParent();=
");
+        result.append(JAXXCompiler.getLineSeparator());
+        result.append("if (parent !=3D null && !clazz.isAssignableFrom(paren=
t.getClass())){parent =3D getParentContainer(parent, clazz);}");
+        result.append(JAXXCompiler.getLineSeparator());
+        result.append("return (O)parent;");
+        return result.toString();
+    }
+
+    protected String getCreationCode(CompiledObject object) throws CompilerE=
xception {
+        if (object instanceof ScriptInitializer) {
+            return object.getInitializationCode(compiler);
+        }
+        StringBuffer result =3D new StringBuffer();
+        result.append(object.getId());
+        result.append(" =3D ");
+        String constructorParams =3D object.getConstructorParams();
+        if (constructorParams !=3D null) {
+            //TC - 20081017 compiledObject can have generics
+            result.append(" new ").append(JAXXCompiler.getCanonicalName(obje=
ct)).append("(").append(constructorParams).append(");");
+            //result.append("(").append(getCanonicalName(object.getObjectCla=
ss())).append(") new ").append(getCanonicalName(object.getObjectClass())).app=
end("(").append(constructorParams).append(");");
+        } else {
+            //TC - 20081017 compiledObject can have generics
+            result.append("new ").append(JAXXCompiler.getCanonicalName(objec=
t)).append("();");
+        }
+        result.append(JAXXCompiler.getLineSeparator());
+        String initCode =3D object.getInitializationCode(compiler);
+        if (initCode !=3D null && initCode.length() > 0) {
+            result.append(initCode);
+        }
+        result.append("$objectMap.put(").append(TypeManager.getJavaCode(obje=
ct.getId())).append(", ").append(object.getId()).append(");");
+
+        return result.toString();
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- Delegate methods from JAXXCompiler --------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    public String getOutputClassName() {
+        return compiler.getOutputClassName();
+    }
+
+    public File getBaseDir() {
+        return compiler.getBaseDir();
+    }
+
+    public CompilerOptions getOptions() {
+        return compiler.getOptions();
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- Getter methods ----------------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    public JavaFile getJavaFile() {
+        return javaFile;
+    }
+
+    public StringBuffer getInitializer() {
+        return initializer;
+    }
+
+    public StringBuffer getLateInitializer() {
+        return lateInitializer;
+    }
+
+    public StringBuffer getBodyCode() {
+        return bodyCode;
+    }
+
+    public StringBuffer getInitDataBindings() {
+        return initDataBindings;
+    }
+
+    public StringBuffer getApplyDataBinding() {
+        return applyDataBinding;
+    }
+
+    public StringBuffer getRemoveDataBinding() {
+        return removeDataBinding;
+    }
+
+    public StringBuffer getProcessDataBinding() {
+        return processDataBinding;
+    }
+
+    public boolean isMainDeclared() {
+        return mainDeclared;
+    }
+
+    /*----------------------------------------------------------------------=
-----------*/
+    /*-- Setter methods ----------------------------------------------------=
-----------*/
+    /*----------------------------------------------------------------------=
-----------*/
+
+    public void setMainDeclared(boolean mainDeclared) {
+        this.mainDeclared =3D mainDeclared;
+    }
+}

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/ScriptManag=
er.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/ScriptManager.java	=
2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/ScriptManager.ja=
va	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,336 +0,0 @@
-package jaxx.compiler;
-
-import jaxx.CompilerException;
-import jaxx.parser.JavaParser;
-import jaxx.parser.JavaParserTreeConstants;
-import jaxx.parser.SimpleNode;
-import jaxx.reflect.FieldDescriptor;
-import jaxx.reflect.MethodDescriptor;
-import jaxx.tags.TagManager;
-
-import java.io.StringReader;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-public class ScriptManager {
-    private JAXXCompiler compiler;
-
-
-    ScriptManager(JAXXCompiler compiler) {
-        this.compiler =3D compiler;
-    }
-
-
-    /**
-     * Strips unnecessary curly braces from around the script, generating a =
warning if they are found.
-     *
-     * @param script script to trim
-     * @return the trimed script
-     */
-    public String trimScript(String script) {
-        script =3D script.trim();
-        if (script.startsWith("{") && script.endsWith("}")) {
-            compiler.reportWarning("curly braces are unnecessary for script =
'" + script + "'");
-            script =3D script.substring(1, script.length() - 1);
-        }
-        return script;
-    }
-
-
-    public void checkParse(String script) throws CompilerException {
-        script =3D trimScript(script);
-        JavaParser p =3D new JavaParser(new StringReader(script));
-        while (!p.Line()) {
-            // ???
-        }
-    }
-
-
-    public String preprocessScript(String script) throws CompilerException {
-        script =3D trimScript(script);
-        StringBuffer result =3D new StringBuffer();
-        JavaParser p =3D new JavaParser(new StringReader(script));
-        //JavaParser p =3D new JavaParser(new StringReader(script + ";"));
-        while (!p.Line()) {
-            SimpleNode node =3D p.popNode();
-            if (node !=3D null) {
-                preprocessScriptNode(node, false);
-                result.append(node.getText());
-            }
-        }
-        return result.toString();
-    }
-
-
-    /**
-     * Scans through a compound symbol (foo.bar.baz) to identify and compile=
 the JAXX class it refers to, if any.
-     *
-     * @param symbol symbol to scan
-     */
-    private void scanCompoundSymbol(String symbol) {
-        String[] tokens =3D symbol.split("\\.");
-        StringBuffer currentSymbol =3D new StringBuffer();
-        for (String token : tokens) {
-            if (currentSymbol.length() > 0)
-                currentSymbol.append('.');
-            currentSymbol.append(token.trim());
-
-            String contextClass =3D TagManager.resolveClassName(currentSymbo=
l.toString(), compiler);
-            if (contextClass !=3D null) {
-                compiler.addDependencyClass(contextClass);
-            }
-        }
-    }
-
-
-    private void preprocessScriptNode(SimpleNode node, boolean staticContext=
) throws CompilerException {
-        // identify static methods and initializers -- we can't fire events =
statically
-        if (node.getId() =3D=3D JavaParserTreeConstants.JJTMETHODDECLARATION=
) {
-            if (node.getParent().getChild(0).getText().indexOf("static") !=
=3D -1) {
-                staticContext =3D true;
-            }
-        } else if (node.getId() =3D=3D JavaParserTreeConstants.JJTINITIALIZE=
R)
-            if (node.getText().trim().startsWith("static")) {
-                staticContext =3D true;
-            }
-
-        int count =3D node.jjtGetNumChildren();
-        for (int i =3D 0; i < count; i++) {
-            preprocessScriptNode(node.getChild(i), staticContext);
-        }
-
-        int id =3D node.getId();
-        if (id =3D=3D JavaParserTreeConstants.JJTNAME || id =3D=3D JavaParse=
rTreeConstants.JJTCLASSORINTERFACETYPE) {
-            scanCompoundSymbol(node.getText());
-        }
-        if (!staticContext) {
-            String lhs =3D null;
-            if (id =3D=3D JavaParserTreeConstants.JJTASSIGNMENTEXPRESSION ||=
 (id =3D=3D JavaParserTreeConstants.JJTPOSTFIXEXPRESSION && node.jjtGetNumChi=
ldren() =3D=3D 2)) {
-                lhs =3D ((SimpleNode) node.jjtGetChild(0)).getText().trim();
-            }
-            else
-            if (id =3D=3D JavaParserTreeConstants.JJTPREINCREMENTEXPRESSION =
|| id =3D=3D JavaParserTreeConstants.JJTPREDECREMENTEXPRESSION) {
-                lhs =3D ((SimpleNode) node.jjtGetChild(0)).getText().trim();
-            }
-            if (lhs !=3D null) {
-                FieldDescriptor[] fields =3D compiler.getScriptFields();
-                for (FieldDescriptor field : fields) {
-                    if (field.getName().equals(lhs)) {
-                        //lhs.substring(lhs.lastIndexOf(".") + 1);
-                        node.firstToken.image =3D "jaxx.runtime.Util.assignm=
ent(" + node.firstToken.image;
-                        String outputClassName =3D compiler.getOutputClassNa=
me();
-                        node.lastToken.image =3D node.lastToken.image + ", \=
"" + lhs + "\", " + outputClassName + ".this)";
-                    }
-                }
-            }
-        }
-    }
-
-
-    /**
-     * Examines a Line to determine its real type.  As all tokens returned b=
y the parser are Lines, and
-     * they are just a tiny wrapper around the real node, this method strips=
 off the wrapper layers to identify
-     * the real type of a node.
-     *
-     * @param line line to scan
-     * @return the line type
-     */
-    private int getLineType(SimpleNode line) {
-        if (line.jjtGetNumChildren() =3D=3D 1) {
-            SimpleNode node =3D line.getChild(0);
-            if (node.getId() =3D=3D JavaParserTreeConstants.JJTBLOCKSTATEMEN=
T) {
-                if (node.jjtGetNumChildren() =3D=3D 1) {
-                    return node.getChild(0).getId();
-                }
-            } else
-            if (node.getId() =3D=3D JavaParserTreeConstants.JJTCLASSORINTERF=
ACEBODYDECLARATION) {
-                int id =3D node.getChild(0).getId();
-                if (id =3D=3D JavaParserTreeConstants.JJTMODIFIERS) {
-                    return node.getChild(1).getId();
-                }
-                if (id =3D=3D JavaParserTreeConstants.JJTINITIALIZER) {
-                    return id;
-                }
-            }
-            return node.getId();
-        }
-        return JavaParserTreeConstants.JJTLINE; // generic value implying th=
at it's okay to put into the initializer block
-    }
-
-
-    private SimpleNode findExplicitConstructorInvocation(SimpleNode parent) {
-        if (parent.getId() =3D=3D JavaParserTreeConstants.JJTEXPLICITCONSTRU=
CTORINVOCATION) {
-            return parent;
-        }
-
-        int count =3D parent.jjtGetNumChildren();
-        for (int i =3D 0; i < count; i++) {
-            SimpleNode result =3D findExplicitConstructorInvocation(parent.g=
etChild(i));
-            if (result !=3D null) {
-                return result;
-            }
-        }
-        return null;
-    }
-
-
-    private void processConstructor(String modifiers, SimpleNode node) {
-        assert node.getId() =3D=3D JavaParserTreeConstants.JJTCONSTRUCTORDEC=
LARATION : "expected node to be ConstructorDeclaration, found " + JavaParserT=
reeConstants.jjtNodeName[node.getId()] + " instead";
-        assert node.getChild(0).getId() =3D=3D JavaParserTreeConstants.JJTFO=
RMALPARAMETERS : "expected node 0 to be FormalParameters, found " + JavaParse=
rTreeConstants.jjtNodeName[node.getChild(1).getId()] + " instead";
-        String code =3D "";
-        if (node.getChild(0).jjtGetNumChildren() =3D=3D 0) {
-            compiler.reportError("The default no-argument constructor may no=
t be redefined");
-        }
-        else {
-            SimpleNode explicitConstructorInvocation =3D findExplicitConstru=
ctorInvocation(node);
-            if (explicitConstructorInvocation =3D=3D null || explicitConstru=
ctorInvocation.getText().trim().startsWith("super(")) {
-                code =3D "$initialize();" + JAXXCompiler.getLineSeparator();
-                if (explicitConstructorInvocation =3D=3D null) {
-                    node.getChild(1).firstToken.image =3D node.getChild(1).f=
irstToken.image;
-                }
-                else {
-                    explicitConstructorInvocation.lastToken.image +=3D code;
-                }
-            }
-        }
-
-        compiler.bodyCode.append(modifiers).append(" ").append(node.getText(=
).substring(0,node.getText().length()-1) + code + "}");
-        //compiler.bodyCode.append(";\n");
-    }
-
-
-    private void scanScriptNode(SimpleNode node) throws CompilerException {
-        int nodeType =3D getLineType(node);
-        if (nodeType =3D=3D JavaParserTreeConstants.JJTIMPORTDECLARATION) { =
// have to handle imports early so the preprocessing takes them into account
-            String text =3D node.getChild(0).getText().trim();
-            if (text.startsWith("import")) {
-                text =3D text.substring("import".length()).trim();
-            }
-            if (text.endsWith(";")) {
-                text =3D text.substring(0, text.length() - 1);
-            }
-            compiler.addImport(text);
-        }
-
-        preprocessScriptNode(node, false);
-
-        if (nodeType =3D=3D JavaParserTreeConstants.JJTIMPORTDECLARATION) {
-            // do nothing, already handled above
-        } else if (nodeType =3D=3D JavaParserTreeConstants.JJTMETHODDECLARAT=
ION) {
-            String returnType =3D null;
-            String name =3D null;
-            List<String> parameterTypes =3D new ArrayList<String>();
-            //List<String> parameterNames =3D new ArrayList<String>();
-            SimpleNode methodDeclaration =3D node.getChild(0).getChild(1);
-            assert methodDeclaration.getId() =3D=3D JavaParserTreeConstants.=
JJTMETHODDECLARATION;
-            for (int i =3D 0; i < methodDeclaration.jjtGetNumChildren(); i++=
) {
-                SimpleNode child =3D methodDeclaration.getChild(i);
-                int type =3D child.getId();
-                if (type =3D=3D JavaParserTreeConstants.JJTRESULTTYPE) {
-                    String rawReturnType =3D child.getText().trim();
-                    returnType =3D TagManager.resolveClassName(rawReturnType=
, compiler);
-                    // FIXME: this check fails for inner classes defined in =
this file
-                    //if (returnType =3D=3D null)
-                    //    throw new CompilerException("could not find class =
'" + rawReturnType + "'");
-                } else
-                if (type =3D=3D JavaParserTreeConstants.JJTMETHODDECLARATOR)=
 {
-                    name =3D child.firstToken.image.trim();
-                    SimpleNode formalParameters =3D child.getChild(0);
-                    assert formalParameters.getId() =3D=3D JavaParserTreeCon=
stants.JJTFORMALPARAMETERS;
-                    for (int j =3D 0; j < formalParameters.jjtGetNumChildren=
(); j++)
-                    {
-                        SimpleNode parameter =3D formalParameters.getChild(j=
);
-                        String rawParameterType =3D parameter.getChild(1).ge=
tText().trim().replaceAll("\\.\\.\\.", "[]");
-                        String parameterType =3D TagManager.resolveClassName=
(rawParameterType, compiler);
-                        // FIXME: this check fails for inner classes defined=
 in this file
-                        //if (parameterType =3D=3D null)
-                        //    throw new CompilerException("could not find cl=
ass '" + rawParameterType + "'");
-                        parameterTypes.add(parameterType);
-                        //parameterNames.add(parameter.getChild(2).getText()=
.trim());
-                    }
-                }
-            }
-            compiler.bodyCode.append(node.getText());
-            //compiler.bodyCode.append(";\n");
-            compiler.addScriptMethod(new MethodDescriptor(name, Modifier.PUB=
LIC, returnType, parameterTypes.toArray(new String[parameterTypes.size()]), c=
ompiler.getClassLoader()));
-        } else
-        if (nodeType =3D=3D JavaParserTreeConstants.JJTCLASSORINTERFACEDECLA=
RATION ||
-                nodeType =3D=3D JavaParserTreeConstants.JJTINITIALIZER) {
-            String str =3D node.getText().trim();
-            if (str.endsWith(";")) {
-                str+=3D";";
-            }
-            compiler.bodyCode.append(str);
-            //compiler.bodyCode.append(";\n");
-        } else
-        if (nodeType =3D=3D JavaParserTreeConstants.JJTCONSTRUCTORDECLARATIO=
N) {
-            processConstructor(node.getChild(0).getChild(0).getText(), node.=
getChild(0).getChild(1));
-        } else
-        if (nodeType =3D=3D JavaParserTreeConstants.JJTLOCALVARIABLEDECLARAT=
ION || nodeType =3D=3D JavaParserTreeConstants.JJTFIELDDECLARATION) {
-            // the "local" variable declarations in this expression aren't a=
ctually local -- they are flagged local
-            // just because there isn't an enclosing class scope visible to =
the parser.  "Real" local variable
-            // declarations won't show up here, because they will be buried =
inside of methods.
-            String text =3D node.getText().trim();
-            if (!text.endsWith(";")) {
-                text+=3D";";
-            }
-            String declaration =3D text;
-            int equals =3D text.indexOf("=3D");
-            if (equals !=3D -1) {
-                declaration =3D declaration.substring(0, equals);
-            }
-            declaration =3D declaration.trim();
-            String[] declarationTokens =3D declaration.split("\\s");
-            boolean isFinal =3D Arrays.asList(declarationTokens).contains("f=
inal");
-            boolean isStatic =3D Arrays.asList(declarationTokens).contains("=
static");
-            String name =3D declarationTokens[declarationTokens.length - 1];
-            if (name.endsWith(";")) {
-                name =3D name.substring(0, name.length() - 1).trim();
-            }
-            String className =3D declarationTokens[declarationTokens.length =
- 2];
-            String type =3D TagManager.resolveClassName(className, compiler);
-            compiler.addScriptField(new FieldDescriptor(name, Modifier.PUBLI=
C, type, compiler.getClassLoader())); // TODO: determine the actual modifiers
-            if (equals !=3D -1 && !isFinal && !isStatic) { // declare the fi=
eld in the class body, but wait to actually initialize it
-                //compiler.bodyCode.append(text.substring(0, equals).trim());
-                compiler.bodyCode.append(text.substring(0, equals).trim()).a=
ppend(";");
-                String initializer =3D text.substring(equals + 1).trim();
-                if (type.endsWith("[]")) {
-                    initializer =3D "new " + type + " " + initializer;
-                }
-                final String finalInitializer =3D name + " =3D " + initializ=
er;
-                compiler.registerInitializer(new Runnable() {
-                    public void run() {
-                        compiler.registerCompiledObject(new ScriptInitialize=
r(finalInitializer, compiler));
-                    }
-                });
-            } else {
-                compiler.bodyCode.append(text);
-            }
-            compiler.bodyCode.append("\n");
-            //compiler.bodyCode.append(";\n");
-        } else {
-            String text =3D node.getText().trim();
-            if (text.length() > 0) {
-                if (!text.endsWith(";")) {
-                    text +=3D ";";
-                }
-                compiler.initializer.append(text);
-                //compiler.initializer.append(";\n");
-            }
-        }
-    }
-
-
-    public void registerScript(String script) throws CompilerException {
-        JavaParser p =3D new JavaParser(new StringReader(script));
-        //JavaParser p =3D new JavaParser(new StringReader(script + ";"));
-        while (!p.Line()) {
-            SimpleNode node =3D p.popNode();
-            if (node !=3D null) {
-                scanScriptNode(node);
-            }
-        }
-    }
-}

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/ScriptManage=
r.java (from rev 977, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/S=
criptManager.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/ScriptManager.ja=
va	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/compiler/ScriptManager.ja=
va	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,336 @@
+package jaxx.compiler;
+
+import jaxx.CompilerException;
+import jaxx.parser.JavaParser;
+import jaxx.parser.JavaParserTreeConstants;
+import jaxx.parser.SimpleNode;
+import jaxx.reflect.FieldDescriptor;
+import jaxx.reflect.MethodDescriptor;
+import jaxx.tags.TagManager;
+
+import java.io.StringReader;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class ScriptManager {
+    private JAXXCompiler compiler;
+
+
+    ScriptManager(JAXXCompiler compiler) {
+        this.compiler =3D compiler;
+    }
+
+
+    /**
+     * Strips unnecessary curly braces from around the script, generating a =
warning if they are found.
+     *
+     * @param script script to trim
+     * @return the trimed script
+     */
+    public String trimScript(String script) {
+        script =3D script.trim();
+        if (script.startsWith("{") && script.endsWith("}")) {
+            compiler.reportWarning("curly braces are unnecessary for script =
'" + script + "'");
+            script =3D script.substring(1, script.length() - 1);
+        }
+        return script;
+    }
+
+
+    public void checkParse(String script) throws CompilerException {
+        script =3D trimScript(script);
+        JavaParser p =3D new JavaParser(new StringReader(script));
+        while (!p.Line()) {
+            // ???
+        }
+    }
+
+
+    public String preprocessScript(String script) throws CompilerException {
+        script =3D trimScript(script);
+        StringBuffer result =3D new StringBuffer();
+        JavaParser p =3D new JavaParser(new StringReader(script));
+        //JavaParser p =3D new JavaParser(new StringReader(script + ";"));
+        while (!p.Line()) {
+            SimpleNode node =3D p.popNode();
+            if (node !=3D null) {
+                preprocessScriptNode(node, false);
+                result.append(node.getText());
+            }
+        }
+        return result.toString();
+    }
+
+
+    /**
+     * Scans through a compound symbol (foo.bar.baz) to identify and compile=
 the JAXX class it refers to, if any.
+     *
+     * @param symbol symbol to scan
+     */
+    private void scanCompoundSymbol(String symbol) {
+        String[] tokens =3D symbol.split("\\.");
+        StringBuffer currentSymbol =3D new StringBuffer();
+        for (String token : tokens) {
+            if (currentSymbol.length() > 0)
+                currentSymbol.append('.');
+            currentSymbol.append(token.trim());
+
+            String contextClass =3D TagManager.resolveClassName(currentSymbo=
l.toString(), compiler);
+            if (contextClass !=3D null) {
+                compiler.addDependencyClass(contextClass);
+            }
+        }
+    }
+
+
+    private void preprocessScriptNode(SimpleNode node, boolean staticContext=
) throws CompilerException {
+        // identify static methods and initializers -- we can't fire events =
statically
+        if (node.getId() =3D=3D JavaParserTreeConstants.JJTMETHODDECLARATION=
) {
+            if (node.getParent().getChild(0).getText().indexOf("static") !=
=3D -1) {
+                staticContext =3D true;
+            }
+        } else if (node.getId() =3D=3D JavaParserTreeConstants.JJTINITIALIZE=
R)
+            if (node.getText().trim().startsWith("static")) {
+                staticContext =3D true;
+            }
+
+        int count =3D node.jjtGetNumChildren();
+        for (int i =3D 0; i < count; i++) {
+            preprocessScriptNode(node.getChild(i), staticContext);
+        }
+
+        int id =3D node.getId();
+        if (id =3D=3D JavaParserTreeConstants.JJTNAME || id =3D=3D JavaParse=
rTreeConstants.JJTCLASSORINTERFACETYPE) {
+            scanCompoundSymbol(node.getText());
+        }
+        if (!staticContext) {
+            String lhs =3D null;
+            if (id =3D=3D JavaParserTreeConstants.JJTASSIGNMENTEXPRESSION ||=
 (id =3D=3D JavaParserTreeConstants.JJTPOSTFIXEXPRESSION && node.jjtGetNumChi=
ldren() =3D=3D 2)) {
+                lhs =3D ((SimpleNode) node.jjtGetChild(0)).getText().trim();
+            }
+            else
+            if (id =3D=3D JavaParserTreeConstants.JJTPREINCREMENTEXPRESSION =
|| id =3D=3D JavaParserTreeConstants.JJTPREDECREMENTEXPRESSION) {
+                lhs =3D ((SimpleNode) node.jjtGetChild(0)).getText().trim();
+            }
+            if (lhs !=3D null) {
+                FieldDescriptor[] fields =3D compiler.getScriptFields();
+                for (FieldDescriptor field : fields) {
+                    if (field.getName().equals(lhs)) {
+                        //lhs.substring(lhs.lastIndexOf(".") + 1);
+                        node.firstToken.image =3D "jaxx.runtime.Util.assignm=
ent(" + node.firstToken.image;
+                        String outputClassName =3D compiler.getOutputClassNa=
me();
+                        node.lastToken.image =3D node.lastToken.image + ", \=
"" + lhs + "\", " + outputClassName + ".this)";
+                    }
+                }
+            }
+        }
+    }
+
+
+    /**
+     * Examines a Line to determine its real type.  As all tokens returned b=
y the parser are Lines, and
+     * they are just a tiny wrapper around the real node, this method strips=
 off the wrapper layers to identify
+     * the real type of a node.
+     *
+     * @param line line to scan
+     * @return the line type
+     */
+    private int getLineType(SimpleNode line) {
+        if (line.jjtGetNumChildren() =3D=3D 1) {
+            SimpleNode node =3D line.getChild(0);
+            if (node.getId() =3D=3D JavaParserTreeConstants.JJTBLOCKSTATEMEN=
T) {
+                if (node.jjtGetNumChildren() =3D=3D 1) {
+                    return node.getChild(0).getId();
+                }
+            } else
+            if (node.getId() =3D=3D JavaParserTreeConstants.JJTCLASSORINTERF=
ACEBODYDECLARATION) {
+                int id =3D node.getChild(0).getId();
+                if (id =3D=3D JavaParserTreeConstants.JJTMODIFIERS) {
+                    return node.getChild(1).getId();
+                }
+                if (id =3D=3D JavaParserTreeConstants.JJTINITIALIZER) {
+                    return id;
+                }
+            }
+            return node.getId();
+        }
+        return JavaParserTreeConstants.JJTLINE; // generic value implying th=
at it's okay to put into the initializer block
+    }
+
+
+    private SimpleNode findExplicitConstructorInvocation(SimpleNode parent) {
+        if (parent.getId() =3D=3D JavaParserTreeConstants.JJTEXPLICITCONSTRU=
CTORINVOCATION) {
+            return parent;
+        }
+
+        int count =3D parent.jjtGetNumChildren();
+        for (int i =3D 0; i < count; i++) {
+            SimpleNode result =3D findExplicitConstructorInvocation(parent.g=
etChild(i));
+            if (result !=3D null) {
+                return result;
+            }
+        }
+        return null;
+    }
+
+
+    private void processConstructor(String modifiers, SimpleNode node) {
+        assert node.getId() =3D=3D JavaParserTreeConstants.JJTCONSTRUCTORDEC=
LARATION : "expected node to be ConstructorDeclaration, found " + JavaParserT=
reeConstants.jjtNodeName[node.getId()] + " instead";
+        assert node.getChild(0).getId() =3D=3D JavaParserTreeConstants.JJTFO=
RMALPARAMETERS : "expected node 0 to be FormalParameters, found " + JavaParse=
rTreeConstants.jjtNodeName[node.getChild(1).getId()] + " instead";
+        String code =3D "";
+        if (node.getChild(0).jjtGetNumChildren() =3D=3D 0) {
+            compiler.reportError("The default no-argument constructor may no=
t be redefined");
+        }
+        else {
+            SimpleNode explicitConstructorInvocation =3D findExplicitConstru=
ctorInvocation(node);
+            if (explicitConstructorInvocation =3D=3D null || explicitConstru=
ctorInvocation.getText().trim().startsWith("super(")) {
+                code =3D "$initialize();" + JAXXCompiler.getLineSeparator();
+                if (explicitConstructorInvocation =3D=3D null) {
+                    node.getChild(1).firstToken.image =3D node.getChild(1).f=
irstToken.image;
+                }
+                else {
+                    explicitConstructorInvocation.lastToken.image +=3D code;
+                }
+            }
+        }
+
+        compiler.appendBodyCode(modifiers + " "+ node.getText().substring(0,=
node.getText().length()-1) + code + "}");
+        //compiler.bodyCode.append(";\n");
+    }
+
+
+    private void scanScriptNode(SimpleNode node) throws CompilerException {
+        int nodeType =3D getLineType(node);
+        if (nodeType =3D=3D JavaParserTreeConstants.JJTIMPORTDECLARATION) { =
// have to handle imports early so the preprocessing takes them into account
+            String text =3D node.getChild(0).getText().trim();
+            if (text.startsWith("import")) {
+                text =3D text.substring("import".length()).trim();
+            }
+            if (text.endsWith(";")) {
+                text =3D text.substring(0, text.length() - 1);
+            }
+            compiler.addImport(text);
+        }
+
+        preprocessScriptNode(node, false);
+
+        if (nodeType =3D=3D JavaParserTreeConstants.JJTIMPORTDECLARATION) {
+            // do nothing, already handled above
+        } else if (nodeType =3D=3D JavaParserTreeConstants.JJTMETHODDECLARAT=
ION) {
+            String returnType =3D null;
+            String name =3D null;
+            List<String> parameterTypes =3D new ArrayList<String>();
+            //List<String> parameterNames =3D new ArrayList<String>();
+            SimpleNode methodDeclaration =3D node.getChild(0).getChild(1);
+            assert methodDeclaration.getId() =3D=3D JavaParserTreeConstants.=
JJTMETHODDECLARATION;
+            for (int i =3D 0; i < methodDeclaration.jjtGetNumChildren(); i++=
) {
+                SimpleNode child =3D methodDeclaration.getChild(i);
+                int type =3D child.getId();
+                if (type =3D=3D JavaParserTreeConstants.JJTRESULTTYPE) {
+                    String rawReturnType =3D child.getText().trim();
+                    returnType =3D TagManager.resolveClassName(rawReturnType=
, compiler);
+                    // FIXME: this check fails for inner classes defined in =
this file
+                    //if (returnType =3D=3D null)
+                    //    throw new CompilerException("could not find class =
'" + rawReturnType + "'");
+                } else
+                if (type =3D=3D JavaParserTreeConstants.JJTMETHODDECLARATOR)=
 {
+                    name =3D child.firstToken.image.trim();
+                    SimpleNode formalParameters =3D child.getChild(0);
+                    assert formalParameters.getId() =3D=3D JavaParserTreeCon=
stants.JJTFORMALPARAMETERS;
+                    for (int j =3D 0; j < formalParameters.jjtGetNumChildren=
(); j++)
+                    {
+                        SimpleNode parameter =3D formalParameters.getChild(j=
);
+                        String rawParameterType =3D parameter.getChild(1).ge=
tText().trim().replaceAll("\\.\\.\\.", "[]");
+                        String parameterType =3D TagManager.resolveClassName=
(rawParameterType, compiler);
+                        // FIXME: this check fails for inner classes defined=
 in this file
+                        //if (parameterType =3D=3D null)
+                        //    throw new CompilerException("could not find cl=
ass '" + rawParameterType + "'");
+                        parameterTypes.add(parameterType);
+                        //parameterNames.add(parameter.getChild(2).getText()=
.trim());
+                    }
+                }
+            }
+            compiler.appendBodyCode(node.getText());
+            //compiler.bodyCode.append(";\n");
+            compiler.addScriptMethod(new MethodDescriptor(name, Modifier.PUB=
LIC, returnType, parameterTypes.toArray(new String[parameterTypes.size()]), c=
ompiler.getClassLoader()));
+        } else
+        if (nodeType =3D=3D JavaParserTreeConstants.JJTCLASSORINTERFACEDECLA=
RATION ||
+                nodeType =3D=3D JavaParserTreeConstants.JJTINITIALIZER) {
+            String str =3D node.getText().trim();
+            if (str.endsWith(";")) {
+                str+=3D";";
+            }
+            compiler.appendBodyCode(str);
+            //compiler.bodyCode.append(";\n");
+        } else
+        if (nodeType =3D=3D JavaParserTreeConstants.JJTCONSTRUCTORDECLARATIO=
N) {
+            processConstructor(node.getChild(0).getChild(0).getText(), node.=
getChild(0).getChild(1));
+        } else
+        if (nodeType =3D=3D JavaParserTreeConstants.JJTLOCALVARIABLEDECLARAT=
ION || nodeType =3D=3D JavaParserTreeConstants.JJTFIELDDECLARATION) {
+            // the "local" variable declarations in this expression aren't a=
ctually local -- they are flagged local
+            // just because there isn't an enclosing class scope visible to =
the parser.  "Real" local variable
+            // declarations won't show up here, because they will be buried =
inside of methods.
+            String text =3D node.getText().trim();
+            if (!text.endsWith(";")) {
+                text+=3D";";
+            }
+            String declaration =3D text;
+            int equals =3D text.indexOf("=3D");
+            if (equals !=3D -1) {
+                declaration =3D declaration.substring(0, equals);
+            }
+            declaration =3D declaration.trim();
+            String[] declarationTokens =3D declaration.split("\\s");
+            boolean isFinal =3D Arrays.asList(declarationTokens).contains("f=
inal");
+            boolean isStatic =3D Arrays.asList(declarationTokens).contains("=
static");
+            String name =3D declarationTokens[declarationTokens.length - 1];
+            if (name.endsWith(";")) {
+                name =3D name.substring(0, name.length() - 1).trim();
+            }
+            String className =3D declarationTokens[declarationTokens.length =
- 2];
+            String type =3D TagManager.resolveClassName(className, compiler);
+            compiler.addScriptField(new FieldDescriptor(name, Modifier.PUBLI=
C, type, compiler.getClassLoader())); // TODO: determine the actual modifiers
+            if (equals !=3D -1 && !isFinal && !isStatic) { // declare the fi=
eld in the class body, but wait to actually initialize it
+                //compiler.bodyCode.append(text.substring(0, equals).trim());
+                compiler.appendBodyCode(text.substring(0, equals).trim() + "=
;");
+                String initializer =3D text.substring(equals + 1).trim();
+                if (type.endsWith("[]")) {
+                    initializer =3D "new " + type + " " + initializer;
+                }
+                final String finalInitializer =3D name + " =3D " + initializ=
er;
+                compiler.registerInitializer(new Runnable() {
+                    public void run() {
+                        compiler.registerCompiledObject(new ScriptInitialize=
r(finalInitializer, compiler));
+                    }
+                });
+            } else {
+                compiler.appendBodyCode(text);
+            }
+            compiler.appendBodyCode("\n");
+            //compiler.bodyCode.append(";\n");
+        } else {
+            String text =3D node.getText().trim();
+            if (text.length() > 0) {
+                if (!text.endsWith(";")) {
+                    text +=3D ";";
+                }
+                compiler.appendInitializerCode(text);
+                //compiler.initializer.append(";\n");
+            }
+        }
+    }
+
+
+    public void registerScript(String script) throws CompilerException {
+        JavaParser p =3D new JavaParser(new StringReader(script));
+        //JavaParser p =3D new JavaParser(new StringReader(script + ";"));
+        while (!p.Line()) {
+            SimpleNode node =3D p.popNode();
+            if (node !=3D null) {
+                scanScriptNode(node);
+            }
+        }
+    }
+}

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/css/Stylesheet.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/css/Stylesheet.java	2008-10-=
17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/css/Stylesheet.java	2008-=
10-21 07:31:05 UTC (rev 990)
@@ -1,447 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.css;
-
-import jaxx.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.DataBinding;
-import jaxx.compiler.DataSource;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.parser.JavaParser;
-import jaxx.parser.JavaParserTreeConstants;
-import jaxx.parser.SimpleNode;
-import jaxx.reflect.ClassDescriptor;
-import jaxx.reflect.ClassDescriptorLoader;
-import jaxx.reflect.MethodDescriptor;
-import jaxx.tags.DefaultObjectHandler;
-import jaxx.tags.TagManager;
-import jaxx.types.TypeManager;
-
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.io.Serializable;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-public class Stylesheet implements Serializable {
-    private Rule[] rules;
-    private static final long serialVersionUID =3D 1135373056555320671L;
-
-
-    public Stylesheet() {
-        rules =3D new Rule[0];
-    }
-
-
-    public Stylesheet(Rule[] rules) {
-        this.rules =3D rules;
-        Arrays.sort(rules);
-    }
-
-
-    public Rule[] getRules() {
-        return rules;
-    }
-
-
-    public void add(Rule newRule) {
-        Rule[] oldRules =3D rules;
-        rules =3D new Rule[oldRules.length + 1];
-        System.arraycopy(oldRules, 0, rules, 0, oldRules.length);
-        rules[rules.length - 1] =3D newRule;
-        Arrays.sort(rules);
-    }
-
-
-    public void add(Rule[] newRules) {
-        Rule[] oldRules =3D rules;
-        rules =3D new Rule[oldRules.length + newRules.length];
-        System.arraycopy(oldRules, 0, rules, 0, oldRules.length);
-        System.arraycopy(newRules, 0, rules, oldRules.length, newRules.lengt=
h);
-        Arrays.sort(rules);
-    }
-
-
-    public void applyTo(CompiledObject object, JAXXCompiler compiler, Styles=
heet overrides) throws CompilerException {
-        Map<String, String> overriddenProperties;
-        if (overrides !=3D null)
-            overriddenProperties =3D overrides.getApplicableProperties(objec=
t);
-        else
-            overriddenProperties =3D null;
-
-        Map<String, String> properties =3D getApplicableProperties(object);
-        if (properties !=3D null) {
-            if (overriddenProperties !=3D null)
-                properties.keySet().removeAll(overriddenProperties.keySet());
-            DefaultObjectHandler handler =3D TagManager.getTagHandler(object=
.getObjectClass());
-            for (Map.Entry<String, String> e : properties.entrySet()) {
-                String value =3D e.getValue();
-                if (value.equals(Rule.INLINE_ATTRIBUTE) || value.equals(Rule=
.DATA_BINDING))
-                    continue;
-                handler.setAttribute(object, e.getKey(), e.getValue(), false=
, compiler);
-            }
-        }
-
-        Rule[] pseudoClasses =3D getApplicablePseudoClasses(object);
-        if (pseudoClasses !=3D null) {
-            Map<String, Map<String, String>> combinedPseudoClasses =3D new L=
inkedHashMap<String, Map<String, String>>();
-            for (Rule pseudoClass1 : pseudoClasses) {
-                Selector[] selectors =3D pseudoClass1.getSelectors();
-                for (Selector selector : selectors) {
-                    if (selector.appliesTo(object) =3D=3D Selector.PSEUDOCLA=
SS_APPLIES) {
-                        properties =3D pseudoClass1.getProperties();
-                        String pseudoClass =3D selector.getPseudoClass();
-                        // TODO: overrides by downstream pseudoclasses are n=
ot handled
-                        Map<String, String> combinedProperties =3D combinedP=
seudoClasses.get(pseudoClass);
-                        if (combinedProperties =3D=3D null) {
-                            combinedProperties =3D new HashMap<String, Strin=
g>();
-                            combinedPseudoClasses.put(pseudoClass, combinedP=
roperties);
-                        }
-                        combinedProperties.putAll(properties);
-                    }
-                }
-            }
-
-            int count =3D 0;
-            for (Map.Entry<String, Map<String, String>> e : combinedPseudoCl=
asses.entrySet()) {
-                applyPseudoClass(e.getKey(), e.getValue(), object, compiler,=
 count++);
-            }
-        }
-    }
-
-
-    /**
-     * Replaces all references to the variable "object" with the actual obje=
ct ID.
-     *
-     * @param code ?
-     * @param id   ?
-     * @return ?
-     * @throws jaxx.CompilerException ?
-     */
-    private String replaceObjectReferences(String code, String id) throws Co=
mpilerException {
-        JavaParser p =3D new JavaParser(new StringReader(code + ";"));
-        p.Expression();
-        SimpleNode node =3D p.popNode();
-        scanNode(node, id);
-        return node.getText();
-    }
-
-
-    private void scanNode(SimpleNode node, String id) {
-        if (node.getId() =3D=3D JavaParserTreeConstants.JJTNAME) {
-            String name =3D node.getText();
-            if (name.equals("object") || (name.indexOf(".") !=3D -1 && name.=
substring(0, name.indexOf(".")).trim().equals("object")))
-                node.firstToken.image =3D id;
-        } else {
-            int count =3D node.jjtGetNumChildren();
-            for (int i =3D 0; i < count; i++)
-                scanNode(node.getChild(i), id);
-        }
-    }
-
-
-    private void compilePseudoClassAdd(String pseudoClass, CompiledObject ob=
ject, String propertyCode, JAXXCompiler compiler) throws CompilerException {
-        if (pseudoClass.equals("mouseover")) {
-            try {
-                MethodDescriptor addMouseListener =3D object.getObjectClass(=
).getMethodDescriptor("addMouseListener",
-                        new ClassDescriptor[]{ClassDescriptorLoader.getClass=
Descriptor(MouseListener.class)});
-                object.addEventHandler("style." + pseudoClass + ".add", addM=
ouseListener,
-                        ClassDescriptorLoader.getClassDescriptor(MouseListen=
er.class).getMethodDescriptor("mouseEntered",
-                                new ClassDescriptor[]{ClassDescriptorLoader.=
getClassDescriptor(MouseEvent.class)}),
-                        propertyCode, compiler);
-            }
-            catch (NoSuchMethodException e) {
-                compiler.reportError("mouseover pseudoclass cannot be applie=
d to object " + object.getObjectClass().getName() + " (no addMouseListener me=
thod)");
-            }
-        } else if (pseudoClass.equals("mouseout")) {
-            try {
-                MethodDescriptor addMouseListener =3D object.getObjectClass(=
).getMethodDescriptor("addMouseListener",
-                        new ClassDescriptor[]{ClassDescriptorLoader.getClass=
Descriptor(MouseListener.class)});
-                object.addEventHandler("style." + pseudoClass + ".add", addM=
ouseListener,
-                        ClassDescriptorLoader.getClassDescriptor(MouseListen=
er.class).getMethodDescriptor("mouseExited",
-                                new ClassDescriptor[]{ClassDescriptorLoader.=
getClassDescriptor(MouseEvent.class)}),
-                        propertyCode, compiler);
-                compiler.initDataBindings.append("{").append(propertyCode).a=
ppend("}");
-            }
-            catch (NoSuchMethodException e) {
-                compiler.reportError("mouseout pseudoclass cannot be applied=
 to object " + object.getObjectClass().getName() + " (no addMouseListener met=
hod)");
-            }
-        } else if (pseudoClass.equals("mousedown")) {
-            try {
-                MethodDescriptor addMouseListener =3D object.getObjectClass(=
).getMethodDescriptor("addMouseListener",
-                        new ClassDescriptor[]{ClassDescriptorLoader.getClass=
Descriptor(MouseListener.class)});
-                object.addEventHandler("style." + pseudoClass + ".add", addM=
ouseListener,
-                        ClassDescriptorLoader.getClassDescriptor(MouseListen=
er.class).getMethodDescriptor("mousePressed",
-                                new ClassDescriptor[]{ClassDescriptorLoader.=
getClassDescriptor(MouseEvent.class)}),
-                        propertyCode, compiler);
-            }
-            catch (NoSuchMethodException e) {
-                compiler.reportError("mousedown pseudoclass cannot be applie=
d to object " + object.getObjectClass().getName() + " (no addMouseListener me=
thod)");
-            }
-        } else if (pseudoClass.equals("mouseup")) {
-            try {
-                MethodDescriptor addMouseListener =3D object.getObjectClass(=
).getMethodDescriptor("addMouseListener",
-                        new ClassDescriptor[]{ClassDescriptorLoader.getClass=
Descriptor(MouseListener.class)});
-                object.addEventHandler("style." + pseudoClass + ".add", addM=
ouseListener,
-                        ClassDescriptorLoader.getClassDescriptor(MouseListen=
er.class).getMethodDescriptor("mouseReleased",
-                                new ClassDescriptor[]{ClassDescriptorLoader.=
getClassDescriptor(MouseEvent.class)}),
-                        propertyCode, compiler);
-                compiler.initDataBindings.append("{").append(propertyCode).a=
ppend("}");
-            }
-            catch (NoSuchMethodException e) {
-                compiler.reportError("mouseup pseudoclass cannot be applied =
to object " + object.getObjectClass().getName() + " (no addMouseListener meth=
od)");
-            }
-        } else if (pseudoClass.startsWith("{")) {
-            pseudoClass =3D pseudoClass.substring(1, pseudoClass.length() - =
1).trim();
-            pseudoClass =3D replaceObjectReferences(pseudoClass, object.getJ=
avaCode());
-            String dest =3D object.getId() + ".style." + pseudoClass + ".add=
";
-            String destCode =3D TypeManager.getJavaCode(dest);
-            if (compiler.processDataBinding.length() > 0)
-                compiler.processDataBinding.append("else ");
-            compiler.processDataBinding.append("if ($dest.equals(").append(d=
estCode).append(")) { if (").append(pseudoClass).append(") { ").append(proper=
tyCode).append("} }");
-            new DataSource(dest, pseudoClass, compiler).compile("new jaxx.ru=
ntime.DataBindingListener(" + compiler.getRootObject().getJavaCode() + ", " +=
 destCode + ")");
-            compiler.initDataBindings.append("applyDataBinding(").append(des=
tCode).append(");");
-        } else
-            throw new IllegalArgumentException("unrecognized pseudoclass: " =
+ pseudoClass);
-    }
-
-
-    private void compilePseudoClassRemove(String pseudoClass, CompiledObject=
 object, String propertyCode, JAXXCompiler compiler) throws CompilerException=
 {
-        if (pseudoClass.equals("mouseover")) {
-            try {
-                MethodDescriptor addMouseListener =3D object.getObjectClass(=
).getMethodDescriptor("addMouseListener",
-                        new ClassDescriptor[]{ClassDescriptorLoader.getClass=
Descriptor(MouseListener.class)});
-                object.addEventHandler("style." + pseudoClass + ".remove", a=
ddMouseListener,
-                        ClassDescriptorLoader.getClassDescriptor(MouseListen=
er.class).getMethodDescriptor("mouseExited",
-                                new ClassDescriptor[]{ClassDescriptorLoader.=
getClassDescriptor(MouseEvent.class)}),
-                        propertyCode, compiler);
-            }
-            catch (NoSuchMethodException e) {
-                compiler.reportError("mouseover pseudoclass cannot be applie=
d to object " + object.getObjectClass().getName() + " (no addMouseListener me=
thod)");
-            }
-        } else if (pseudoClass.equals("mouseout")) {
-            try {
-                MethodDescriptor addMouseListener =3D object.getObjectClass(=
).getMethodDescriptor("addMouseListener",
-                        new ClassDescriptor[]{ClassDescriptorLoader.getClass=
Descriptor(MouseListener.class)});
-                object.addEventHandler("style." + pseudoClass + ".remove", a=
ddMouseListener,
-                        ClassDescriptorLoader.getClassDescriptor(MouseListen=
er.class).getMethodDescriptor("mouseEntered",
-                                new ClassDescriptor[]{ClassDescriptorLoader.=
getClassDescriptor(MouseEvent.class)}),
-                        propertyCode, compiler);
-            }
-            catch (NoSuchMethodException e) {
-                compiler.reportError("mouseout pseudoclass cannot be applied=
 to object " + object.getObjectClass().getName() + " (no addMouseListener met=
hod)");
-            }
-        } else if (pseudoClass.equals("mousedown")) {
-            try {
-                MethodDescriptor addMouseListener =3D object.getObjectClass(=
).getMethodDescriptor("addMouseListener",
-                        new ClassDescriptor[]{ClassDescriptorLoader.getClass=
Descriptor(MouseListener.class)});
-                object.addEventHandler("style." + pseudoClass + ".remove", a=
ddMouseListener,
-                        ClassDescriptorLoader.getClassDescriptor(MouseListen=
er.class).getMethodDescriptor("mouseReleased",
-                                new ClassDescriptor[]{ClassDescriptorLoader.=
getClassDescriptor(MouseEvent.class)}),
-                        propertyCode, compiler);
-            }
-            catch (NoSuchMethodException e) {
-                compiler.reportError("mousedown pseudoclass cannot be applie=
d to object " + object.getObjectClass().getName() + " (no addMouseListener me=
thod)");
-            }
-        } else if (pseudoClass.equals("mouseup")) {
-            try {
-                MethodDescriptor addMouseListener =3D object.getObjectClass(=
).getMethodDescriptor("addMouseListener",
-                        new ClassDescriptor[]{ClassDescriptorLoader.getClass=
Descriptor(MouseListener.class)});
-                object.addEventHandler("style." + pseudoClass + ".remove", a=
ddMouseListener,
-                        ClassDescriptorLoader.getClassDescriptor(MouseListen=
er.class).getMethodDescriptor("mousePressed",
-                                new ClassDescriptor[]{ClassDescriptorLoader.=
getClassDescriptor(MouseEvent.class)}),
-                        propertyCode, compiler);
-            }
-            catch (NoSuchMethodException e) {
-                compiler.reportError("mouseup pseudoclass cannot be applied =
to object " + object.getObjectClass().getName() + " (no addMouseListener meth=
od)");
-            }
-        } else if (pseudoClass.startsWith("{")) {
-            pseudoClass =3D pseudoClass.substring(1, pseudoClass.length() - =
1).trim();
-            pseudoClass =3D replaceObjectReferences(pseudoClass, object.getJ=
avaCode());
-            String dest =3D object.getId() + ".style." + pseudoClass + ".rem=
ove";
-            String destCode =3D TypeManager.getJavaCode(dest);
-            if (compiler.processDataBinding.length() > 0)
-                compiler.processDataBinding.append("else ");
-            compiler.processDataBinding.append("if ($dest.equals(").append(d=
estCode).append(")) { if (").append(invert(pseudoClass)).append(") { ").appen=
d(propertyCode).append("} }");
-            new DataSource(dest, pseudoClass, compiler).compile("new jaxx.ru=
ntime.DataBindingListener(" + compiler.getRootObject().getJavaCode() + ", " +=
 destCode + ")");
-            compiler.initDataBindings.append("applyDataBinding(").append(des=
tCode).append(");");
-        } else
-            throw new IllegalArgumentException("unrecognized pseudoclass: " =
+ pseudoClass);
-    }
-
-
-    private String invert(String javaCode) {
-        javaCode =3D javaCode.trim();
-        if (javaCode.startsWith("!"))
-            return javaCode.substring(1);
-        else
-            return "!(" + javaCode + ")";
-    }
-
-
-    private String unwrap(ClassDescriptor type, String valueCode) {
-        if (type =3D=3D ClassDescriptorLoader.getClassDescriptor(boolean.cla=
ss))
-            return "((java.lang.Boolean) " + valueCode + ").booleanValue()";
-        else if (type =3D=3D ClassDescriptorLoader.getClassDescriptor(byte.c=
lass))
-            return "((java.lang.Byte) " + valueCode + ").byteValue()";
-        else if (type =3D=3D ClassDescriptorLoader.getClassDescriptor(short.=
class))
-            return "((java.lang.Short) " + valueCode + ").shortValue()";
-        else if (type =3D=3D ClassDescriptorLoader.getClassDescriptor(int.cl=
ass))
-            return "((java.lang.Integer) " + valueCode + ").intValue()";
-        else if (type =3D=3D ClassDescriptorLoader.getClassDescriptor(long.c=
lass))
-            return "((java.lang.Long) " + valueCode + ").longValue()";
-        else if (type =3D=3D ClassDescriptorLoader.getClassDescriptor(float.=
class))
-            return "((java.lang.Float) " + valueCode + ").floatValue()";
-        else if (type =3D=3D ClassDescriptorLoader.getClassDescriptor(double=
.class))
-            return "((java.lang.Double) " + valueCode + ").doubleValue()";
-        else if (type =3D=3D ClassDescriptorLoader.getClassDescriptor(char.c=
lass))
-            return "((java.lang.Character) " + valueCode + ").charValue()";
-        else
-            return valueCode;
-    }
-
-
-    protected void applyPseudoClass(String pseudoClass, Map<String, String> =
properties,
-                                    CompiledObject object, JAXXCompiler comp=
iler, int priority) throws CompilerException {
-        if (pseudoClass.indexOf("[") !=3D -1)
-            pseudoClass =3D pseudoClass.substring(0, pseudoClass.indexOf("["=
));
-        final StringBuffer buffer =3D new StringBuffer();
-        /*CompiledObject bufferObject =3D new CompiledObject(object.getId(),=
 object.getJavaCode(), object.getObjectClass(), compiler, true) {
-            public void appendInitializationCode(String code) {
-                buffer.append(code);
-            }
-            public void registerDataBinding(String src, String property, Str=
ing assignment, JAXXCompiler compiler) throws CompilerException {
-                buffer.append(assignment);
-            }
-        };*/
-
-        DefaultObjectHandler handler =3D TagManager.getTagHandler(object.get=
ObjectClass());
-        boolean valueDeclared =3D false;
-        for (Map.Entry<String, String> e : properties.entrySet()) {
-            String property =3D e.getKey();
-            ClassDescriptor type =3D handler.getPropertyType(object, propert=
y, compiler);
-            String dataBinding =3D compiler.processDataBindings(e.getValue()=
, type);
-            String valueCode;
-            if (dataBinding !=3D null) {
-                valueCode =3D "new jaxx.runtime.css.DataBinding(" + TypeMana=
ger.getJavaCode(object.getId() + "." + property + "." + priority) + ")";
-                new DataBinding(dataBinding, object.getId() + "." + property=
 + "." + priority, handler.getSetPropertyCode(object.getJavaCode(),
-                        property, "(" + JAXXCompiler.getCanonicalName(type) =
+ ") " + dataBinding, compiler), compiler).compile(false);
-            } else {
-                try {
-                    Class typeClass =3D type !=3D null ? ClassDescriptorLoad=
er.getClass(type.getName(), type.getClassLoader()) : null;
-                    valueCode =3D TypeManager.getJavaCode(TypeManager.conver=
tFromString(e.getValue(), typeClass));
-                }
-                catch (ClassNotFoundException ex) {
-                    compiler.reportError("could not find class " + type.getN=
ame());
-                    return;
-                }
-            }
-            if (!valueDeclared) {
-                buffer.append("java.lang.Object ");
-                valueDeclared =3D true;
-            }
-            buffer.append("value =3D jaxx.runtime.css.Pseudoclasses.applyPro=
perty(").append(compiler.getOutputClassName()).append(".this, ").append(objec=
t.getJavaCode()).append(", ").append(TypeManager.getJavaCode(property)).appen=
d(", ").append(valueCode).append(", jaxx.runtime.css.Pseudoclasses.wrap(").ap=
pend(handler.getGetPropertyCode(object.getJavaCode(), property, compiler)).ap=
pend("), ").append(priority).append(");").append(JAXXCompiler.getLineSeparato=
r());
-            buffer.append("if (!(value instanceof jaxx.runtime.css.DataBindi=
ng)) {").append(JAXXCompiler.getLineSeparator());
-            String unwrappedValue =3D unwrap(type, "value");
-            buffer.append("    ").append(handler.getSetPropertyCode(object.g=
etJavaCode(), property, "(" + JAXXCompiler.getCanonicalName(type) +
-                    ") " + unwrappedValue, compiler)).append(JAXXCompiler.ge=
tLineSeparator());
-            buffer.append("}").append(JAXXCompiler.getLineSeparator());
-        }
-
-        if (pseudoClass.equals("focused")) {
-            pseudoClass =3D "{ object.hasFocus() }";
-        } else if (pseudoClass.equals("unfocused")) {
-            pseudoClass =3D "{ !object.hasFocus() }";
-        } else if (pseudoClass.equals("enabled")) {
-            pseudoClass =3D "{ object.isEnabled() }";
-        } else if (pseudoClass.equals("disabled")) {
-            pseudoClass =3D "{ !object.isEnabled() }";
-        } else if (pseudoClass.equals("selected")) {
-            pseudoClass =3D "{ object.isSelected() }";
-        } else if (pseudoClass.equals("deselected")) {
-            pseudoClass =3D "{ !object.isSelected() }";
-        }
-
-        compilePseudoClassAdd(pseudoClass, object, buffer.toString(), compil=
er);
-
-        buffer.setLength(0);
-        valueDeclared =3D false;
-        for (Map.Entry<String, String> e : properties.entrySet()) {
-            String property =3D e.getKey();
-            ClassDescriptor type =3D handler.getPropertyType(object, propert=
y, compiler);
-            String dataBinding =3D compiler.processDataBindings(e.getValue()=
, type);
-            String valueCode;
-            if (dataBinding !=3D null) {
-                valueCode =3D "new jaxx.runtime.css.DataBinding(" + TypeMana=
ger.getJavaCode(object.getId() + "." + property + "." + priority) + ")";
-                new jaxx.compiler.DataBinding(dataBinding, object.getId() + =
"." + property + "." + priority, handler.getSetPropertyCode(object.getJavaCod=
e(),
-                        property, "(" + JAXXCompiler.getCanonicalName(type) =
+ ") " + dataBinding, compiler), compiler).compile(false);
-            } else {
-                try {
-                    Class typeClass =3D type !=3D null ? ClassDescriptorLoad=
er.getClass(type.getName(), type.getClassLoader()) : null;
-                    valueCode =3D TypeManager.getJavaCode(TypeManager.conver=
tFromString(e.getValue(), typeClass));
-                }
-                catch (ClassNotFoundException ex) {
-                    compiler.reportError("could not find class " + type.getN=
ame());
-                    return;
-                }
-            }
-            if (!valueDeclared) {
-                buffer.append("java.lang.Object ");
-                valueDeclared =3D true;
-            }
-            buffer.append("value =3D jaxx.runtime.css.Pseudoclasses.removePr=
operty(").append(compiler.getOutputClassName()).append(".this, ").append(obje=
ct.getJavaCode()).append(", ").append(TypeManager.getJavaCode(property)).appe=
nd(", ").append(valueCode).append(", jaxx.runtime.css.Pseudoclasses.wrap(").a=
ppend(handler.getGetPropertyCode(object.getJavaCode(), property, compiler)).a=
ppend("), ").append(priority).append(");").append(JAXXCompiler.getLineSeparat=
or());
-            buffer.append("if (!(value instanceof jaxx.runtime.css.DataBindi=
ng)) {").append(JAXXCompiler.getLineSeparator());
-            String unwrappedValue =3D unwrap(type, "value");
-            buffer.append("    ").append(handler.getSetPropertyCode(object.g=
etJavaCode(), property, "(" + JAXXCompiler.getCanonicalName(type) +
-                    ") " + unwrappedValue, compiler)).append(JAXXCompiler.ge=
tLineSeparator());
-            buffer.append("}").append(JAXXCompiler.getLineSeparator());
-        }
-        compilePseudoClassRemove(pseudoClass, object, buffer.toString(), com=
piler);
-    }
-
-
-    public Map<String, String> getApplicableProperties(CompiledObject object=
) throws CompilerException {
-        DefaultObjectHandler handler =3D TagManager.getTagHandler(object.get=
ObjectClass());
-        Map<String, String> result =3D null;
-        for (Rule rule : rules) {
-            int apply =3D rule.appliesTo(object);
-            if (apply =3D=3D Selector.ALWAYS_APPLIES || apply =3D=3D Selecto=
r.ALWAYS_APPLIES_INHERIT_ONLY) {
-                if (result =3D=3D null)
-                    result =3D new HashMap<String, String>();
-                for (Map.Entry<String, String> entry : rule.getProperties().=
entrySet()) {
-                    String property =3D entry.getKey();
-                    if (apply =3D=3D Selector.ALWAYS_APPLIES || handler.isPr=
opertyInherited(property)) {
-                        result.put(property, entry.getValue());
-                    }
-                }
-            }
-        }
-        return result;
-    }
-
-
-    public Rule[] getApplicablePseudoClasses(CompiledObject object) throws C=
ompilerException {
-        List<Rule> result =3D null;
-        for (Rule rule : rules) {
-            if (rule.appliesTo(object) =3D=3D Selector.PSEUDOCLASS_APPLIES) {
-                if (result =3D=3D null) {
-                    result =3D new ArrayList<Rule>();
-                }
-                result.add(rule);
-            }
-        }
-        return result !=3D null ? result.toArray(new Rule[result.size()]) : =
null;
-    }
-
-    @Override
-    public String toString() {
-        return "Stylesheet" + Arrays.asList(rules);
-    }
-}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/css/Stylesheet.java (=
from rev 977, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/css/Stylesheet.jav=
a)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/css/Stylesheet.java	     =
                   (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/css/Stylesheet.java	2008-=
10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,449 @@
+/*
+ * Copyright 2006 Ethan Nicholas. All rights reserved.
+ * Use is subject to license terms.
+ */
+package jaxx.css;
+
+import jaxx.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.DataBinding;
+import jaxx.compiler.DataSource;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.parser.JavaParser;
+import jaxx.parser.JavaParserTreeConstants;
+import jaxx.parser.SimpleNode;
+import jaxx.reflect.ClassDescriptor;
+import jaxx.reflect.ClassDescriptorLoader;
+import jaxx.reflect.MethodDescriptor;
+import jaxx.tags.DefaultObjectHandler;
+import jaxx.tags.TagManager;
+import jaxx.types.TypeManager;
+
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.io.Serializable;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+public class Stylesheet implements Serializable {
+    private Rule[] rules;
+    private static final long serialVersionUID =3D 1135373056555320671L;
+
+
+    public Stylesheet() {
+        rules =3D new Rule[0];
+    }
+
+
+    public Stylesheet(Rule[] rules) {
+        this.rules =3D rules;
+        Arrays.sort(rules);
+    }
+
+
+    public Rule[] getRules() {
+        return rules;
+    }
+
+
+    public void add(Rule newRule) {
+        Rule[] oldRules =3D rules;
+        rules =3D new Rule[oldRules.length + 1];
+        System.arraycopy(oldRules, 0, rules, 0, oldRules.length);
+        rules[rules.length - 1] =3D newRule;
+        Arrays.sort(rules);
+    }
+
+
+    public void add(Rule[] newRules) {
+        Rule[] oldRules =3D rules;
+        rules =3D new Rule[oldRules.length + newRules.length];
+        System.arraycopy(oldRules, 0, rules, 0, oldRules.length);
+        System.arraycopy(newRules, 0, rules, oldRules.length, newRules.lengt=
h);
+        Arrays.sort(rules);
+    }
+
+
+    public void applyTo(CompiledObject object, JAXXCompiler compiler, Styles=
heet overrides) throws CompilerException {
+        Map<String, String> overriddenProperties;
+        if (overrides !=3D null)
+            overriddenProperties =3D overrides.getApplicableProperties(objec=
t);
+        else
+            overriddenProperties =3D null;
+
+        Map<String, String> properties =3D getApplicableProperties(object);
+        if (properties !=3D null) {
+            if (overriddenProperties !=3D null)
+                properties.keySet().removeAll(overriddenProperties.keySet());
+            DefaultObjectHandler handler =3D TagManager.getTagHandler(object=
.getObjectClass());
+            for (Map.Entry<String, String> e : properties.entrySet()) {
+                String value =3D e.getValue();
+                if (value.equals(Rule.INLINE_ATTRIBUTE) || value.equals(Rule=
.DATA_BINDING))
+                    continue;
+                handler.setAttribute(object, e.getKey(), e.getValue(), false=
, compiler);
+            }
+        }
+
+        Rule[] pseudoClasses =3D getApplicablePseudoClasses(object);
+        if (pseudoClasses !=3D null) {
+            Map<String, Map<String, String>> combinedPseudoClasses =3D new L=
inkedHashMap<String, Map<String, String>>();
+            for (Rule pseudoClass1 : pseudoClasses) {
+                Selector[] selectors =3D pseudoClass1.getSelectors();
+                for (Selector selector : selectors) {
+                    if (selector.appliesTo(object) =3D=3D Selector.PSEUDOCLA=
SS_APPLIES) {
+                        properties =3D pseudoClass1.getProperties();
+                        String pseudoClass =3D selector.getPseudoClass();
+                        // TODO: overrides by downstream pseudoclasses are n=
ot handled
+                        Map<String, String> combinedProperties =3D combinedP=
seudoClasses.get(pseudoClass);
+                        if (combinedProperties =3D=3D null) {
+                            combinedProperties =3D new HashMap<String, Strin=
g>();
+                            combinedPseudoClasses.put(pseudoClass, combinedP=
roperties);
+                        }
+                        combinedProperties.putAll(properties);
+                    }
+                }
+            }
+
+            int count =3D 0;
+            for (Map.Entry<String, Map<String, String>> e : combinedPseudoCl=
asses.entrySet()) {
+                applyPseudoClass(e.getKey(), e.getValue(), object, compiler,=
 count++);
+            }
+        }
+    }
+
+
+    /**
+     * Replaces all references to the variable "object" with the actual obje=
ct ID.
+     *
+     * @param code ?
+     * @param id   ?
+     * @return ?
+     * @throws jaxx.CompilerException ?
+     */
+    private String replaceObjectReferences(String code, String id) throws Co=
mpilerException {
+        JavaParser p =3D new JavaParser(new StringReader(code + ";"));
+        p.Expression();
+        SimpleNode node =3D p.popNode();
+        scanNode(node, id);
+        return node.getText();
+    }
+
+
+    private void scanNode(SimpleNode node, String id) {
+        if (node.getId() =3D=3D JavaParserTreeConstants.JJTNAME) {
+            String name =3D node.getText();
+            if (name.equals("object") || (name.indexOf(".") !=3D -1 && name.=
substring(0, name.indexOf(".")).trim().equals("object")))
+                node.firstToken.image =3D id;
+        } else {
+            int count =3D node.jjtGetNumChildren();
+            for (int i =3D 0; i < count; i++)
+                scanNode(node.getChild(i), id);
+        }
+    }
+
+
+    private void compilePseudoClassAdd(String pseudoClass, CompiledObject ob=
ject, String propertyCode, JAXXCompiler compiler) throws CompilerException {
+        if (pseudoClass.equals("mouseover")) {
+            try {
+                MethodDescriptor addMouseListener =3D object.getObjectClass(=
).getMethodDescriptor("addMouseListener",
+                        new ClassDescriptor[]{ClassDescriptorLoader.getClass=
Descriptor(MouseListener.class)});
+                object.addEventHandler("style." + pseudoClass + ".add", addM=
ouseListener,
+                        ClassDescriptorLoader.getClassDescriptor(MouseListen=
er.class).getMethodDescriptor("mouseEntered",
+                                new ClassDescriptor[]{ClassDescriptorLoader.=
getClassDescriptor(MouseEvent.class)}),
+                        propertyCode, compiler);
+            }
+            catch (NoSuchMethodException e) {
+                compiler.reportError("mouseover pseudoclass cannot be applie=
d to object " + object.getObjectClass().getName() + " (no addMouseListener me=
thod)");
+            }
+        } else if (pseudoClass.equals("mouseout")) {
+            try {
+                MethodDescriptor addMouseListener =3D object.getObjectClass(=
).getMethodDescriptor("addMouseListener",
+                        new ClassDescriptor[]{ClassDescriptorLoader.getClass=
Descriptor(MouseListener.class)});
+                object.addEventHandler("style." + pseudoClass + ".add", addM=
ouseListener,
+                        ClassDescriptorLoader.getClassDescriptor(MouseListen=
er.class).getMethodDescriptor("mouseExited",
+                                new ClassDescriptor[]{ClassDescriptorLoader.=
getClassDescriptor(MouseEvent.class)}),
+                        propertyCode, compiler);
+                compiler.appendInitDataBindings("{" + propertyCode + "}");
+            }
+            catch (NoSuchMethodException e) {
+                compiler.reportError("mouseout pseudoclass cannot be applied=
 to object " + object.getObjectClass().getName() + " (no addMouseListener met=
hod)");
+            }
+        } else if (pseudoClass.equals("mousedown")) {
+            try {
+                MethodDescriptor addMouseListener =3D object.getObjectClass(=
).getMethodDescriptor("addMouseListener",
+                        new ClassDescriptor[]{ClassDescriptorLoader.getClass=
Descriptor(MouseListener.class)});
+                object.addEventHandler("style." + pseudoClass + ".add", addM=
ouseListener,
+                        ClassDescriptorLoader.getClassDescriptor(MouseListen=
er.class).getMethodDescriptor("mousePressed",
+                                new ClassDescriptor[]{ClassDescriptorLoader.=
getClassDescriptor(MouseEvent.class)}),
+                        propertyCode, compiler);
+            }
+            catch (NoSuchMethodException e) {
+                compiler.reportError("mousedown pseudoclass cannot be applie=
d to object " + object.getObjectClass().getName() + " (no addMouseListener me=
thod)");
+            }
+        } else if (pseudoClass.equals("mouseup")) {
+            try {
+                MethodDescriptor addMouseListener =3D object.getObjectClass(=
).getMethodDescriptor("addMouseListener",
+                        new ClassDescriptor[]{ClassDescriptorLoader.getClass=
Descriptor(MouseListener.class)});
+                object.addEventHandler("style." + pseudoClass + ".add", addM=
ouseListener,
+                        ClassDescriptorLoader.getClassDescriptor(MouseListen=
er.class).getMethodDescriptor("mouseReleased",
+                                new ClassDescriptor[]{ClassDescriptorLoader.=
getClassDescriptor(MouseEvent.class)}),
+                        propertyCode, compiler);
+                compiler.appendInitDataBindings("{" + propertyCode + "}");
+            }
+            catch (NoSuchMethodException e) {
+                compiler.reportError("mouseup pseudoclass cannot be applied =
to object " + object.getObjectClass().getName() + " (no addMouseListener meth=
od)");
+            }
+        } else if (pseudoClass.startsWith("{")) {
+            pseudoClass =3D pseudoClass.substring(1, pseudoClass.length() - =
1).trim();
+            pseudoClass =3D replaceObjectReferences(pseudoClass, object.getJ=
avaCode());
+            String dest =3D object.getId() + ".style." + pseudoClass + ".add=
";
+            String destCode =3D TypeManager.getJavaCode(dest);
+            if (compiler.haveProcessDataBinding()) {
+                compiler.appendProcessDataBinding("else ");
+            }
+            compiler.appendProcessDataBinding("if ($dest.equals(" +  destCod=
e + ")) { if (" + pseudoClass + ") { "+ propertyCode + "} }");
+            new DataSource(dest, pseudoClass, compiler).compile("new jaxx.ru=
ntime.DataBindingListener(" + compiler.getRootObject().getJavaCode() + ", " +=
 destCode + ")");
+            compiler.appendInitDataBindings("applyDataBinding("+ destCode + =
");");
+        } else
+            throw new IllegalArgumentException("unrecognized pseudoclass: " =
+ pseudoClass);
+    }
+
+
+    private void compilePseudoClassRemove(String pseudoClass, CompiledObject=
 object, String propertyCode, JAXXCompiler compiler) throws CompilerException=
 {
+        if (pseudoClass.equals("mouseover")) {
+            try {
+                MethodDescriptor addMouseListener =3D object.getObjectClass(=
).getMethodDescriptor("addMouseListener",
+                        new ClassDescriptor[]{ClassDescriptorLoader.getClass=
Descriptor(MouseListener.class)});
+                object.addEventHandler("style." + pseudoClass + ".remove", a=
ddMouseListener,
+                        ClassDescriptorLoader.getClassDescriptor(MouseListen=
er.class).getMethodDescriptor("mouseExited",
+                                new ClassDescriptor[]{ClassDescriptorLoader.=
getClassDescriptor(MouseEvent.class)}),
+                        propertyCode, compiler);
+            }
+            catch (NoSuchMethodException e) {
+                compiler.reportError("mouseover pseudoclass cannot be applie=
d to object " + object.getObjectClass().getName() + " (no addMouseListener me=
thod)");
+            }
+        } else if (pseudoClass.equals("mouseout")) {
+            try {
+                MethodDescriptor addMouseListener =3D object.getObjectClass(=
).getMethodDescriptor("addMouseListener",
+                        new ClassDescriptor[]{ClassDescriptorLoader.getClass=
Descriptor(MouseListener.class)});
+                object.addEventHandler("style." + pseudoClass + ".remove", a=
ddMouseListener,
+                        ClassDescriptorLoader.getClassDescriptor(MouseListen=
er.class).getMethodDescriptor("mouseEntered",
+                                new ClassDescriptor[]{ClassDescriptorLoader.=
getClassDescriptor(MouseEvent.class)}),
+                        propertyCode, compiler);
+            }
+            catch (NoSuchMethodException e) {
+                compiler.reportError("mouseout pseudoclass cannot be applied=
 to object " + object.getObjectClass().getName() + " (no addMouseListener met=
hod)");
+            }
+        } else if (pseudoClass.equals("mousedown")) {
+            try {
+                MethodDescriptor addMouseListener =3D object.getObjectClass(=
).getMethodDescriptor("addMouseListener",
+                        new ClassDescriptor[]{ClassDescriptorLoader.getClass=
Descriptor(MouseListener.class)});
+                object.addEventHandler("style." + pseudoClass + ".remove", a=
ddMouseListener,
+                        ClassDescriptorLoader.getClassDescriptor(MouseListen=
er.class).getMethodDescriptor("mouseReleased",
+                                new ClassDescriptor[]{ClassDescriptorLoader.=
getClassDescriptor(MouseEvent.class)}),
+                        propertyCode, compiler);
+            }
+            catch (NoSuchMethodException e) {
+                compiler.reportError("mousedown pseudoclass cannot be applie=
d to object " + object.getObjectClass().getName() + " (no addMouseListener me=
thod)");
+            }
+        } else if (pseudoClass.equals("mouseup")) {
+            try {
+                MethodDescriptor addMouseListener =3D object.getObjectClass(=
).getMethodDescriptor("addMouseListener",
+                        new ClassDescriptor[]{ClassDescriptorLoader.getClass=
Descriptor(MouseListener.class)});
+                object.addEventHandler("style." + pseudoClass + ".remove", a=
ddMouseListener,
+                        ClassDescriptorLoader.getClassDescriptor(MouseListen=
er.class).getMethodDescriptor("mousePressed",
+                                new ClassDescriptor[]{ClassDescriptorLoader.=
getClassDescriptor(MouseEvent.class)}),
+                        propertyCode, compiler);
+            }
+            catch (NoSuchMethodException e) {
+                compiler.reportError("mouseup pseudoclass cannot be applied =
to object " + object.getObjectClass().getName() + " (no addMouseListener meth=
od)");
+            }
+        } else if (pseudoClass.startsWith("{")) {
+            pseudoClass =3D pseudoClass.substring(1, pseudoClass.length() - =
1).trim();
+            pseudoClass =3D replaceObjectReferences(pseudoClass, object.getJ=
avaCode());
+            String dest =3D object.getId() + ".style." + pseudoClass + ".rem=
ove";
+            String destCode =3D TypeManager.getJavaCode(dest);
+            if (compiler.haveProcessDataBinding()) {
+                compiler.appendProcessDataBinding("else ");
+            }
+            compiler.appendProcessDataBinding("if ($dest.equals(" + destCode=
 + ")) { if (" + invert(pseudoClass) + ") { " + propertyCode + "} }");
+            new DataSource(dest, pseudoClass, compiler).compile("new jaxx.ru=
ntime.DataBindingListener(" + compiler.getRootObject().getJavaCode() + ", " +=
 destCode + ")");
+            compiler.appendInitDataBindings("applyDataBinding(" + destCode +=
 ");");
+        } else
+            throw new IllegalArgumentException("unrecognized pseudoclass: " =
+ pseudoClass);
+    }
+
+
+    private String invert(String javaCode) {
+        javaCode =3D javaCode.trim();
+        if (javaCode.startsWith("!"))
+            return javaCode.substring(1);
+        else
+            return "!(" + javaCode + ")";
+    }
+
+
+    private String unwrap(ClassDescriptor type, String valueCode) {
+        if (type =3D=3D ClassDescriptorLoader.getClassDescriptor(boolean.cla=
ss))
+            return "((java.lang.Boolean) " + valueCode + ").booleanValue()";
+        else if (type =3D=3D ClassDescriptorLoader.getClassDescriptor(byte.c=
lass))
+            return "((java.lang.Byte) " + valueCode + ").byteValue()";
+        else if (type =3D=3D ClassDescriptorLoader.getClassDescriptor(short.=
class))
+            return "((java.lang.Short) " + valueCode + ").shortValue()";
+        else if (type =3D=3D ClassDescriptorLoader.getClassDescriptor(int.cl=
ass))
+            return "((java.lang.Integer) " + valueCode + ").intValue()";
+        else if (type =3D=3D ClassDescriptorLoader.getClassDescriptor(long.c=
lass))
+            return "((java.lang.Long) " + valueCode + ").longValue()";
+        else if (type =3D=3D ClassDescriptorLoader.getClassDescriptor(float.=
class))
+            return "((java.lang.Float) " + valueCode + ").floatValue()";
+        else if (type =3D=3D ClassDescriptorLoader.getClassDescriptor(double=
.class))
+            return "((java.lang.Double) " + valueCode + ").doubleValue()";
+        else if (type =3D=3D ClassDescriptorLoader.getClassDescriptor(char.c=
lass))
+            return "((java.lang.Character) " + valueCode + ").charValue()";
+        else
+            return valueCode;
+    }
+
+
+    protected void applyPseudoClass(String pseudoClass, Map<String, String> =
properties,
+                                    CompiledObject object, JAXXCompiler comp=
iler, int priority) throws CompilerException {
+        if (pseudoClass.indexOf("[") !=3D -1)
+            pseudoClass =3D pseudoClass.substring(0, pseudoClass.indexOf("["=
));
+        final StringBuffer buffer =3D new StringBuffer();
+        /*CompiledObject bufferObject =3D new CompiledObject(object.getId(),=
 object.getJavaCode(), object.getObjectClass(), compiler, true) {
+            public void appendInitializationCode(String code) {
+                buffer.append(code);
+            }
+            public void registerDataBinding(String src, String property, Str=
ing assignment, JAXXCompiler compiler) throws CompilerException {
+                buffer.append(assignment);
+            }
+        };*/
+
+        DefaultObjectHandler handler =3D TagManager.getTagHandler(object.get=
ObjectClass());
+        boolean valueDeclared =3D false;
+        for (Map.Entry<String, String> e : properties.entrySet()) {
+            String property =3D e.getKey();
+            ClassDescriptor type =3D handler.getPropertyType(object, propert=
y, compiler);
+            String dataBinding =3D compiler.processDataBindings(e.getValue()=
, type);
+            String valueCode;
+            if (dataBinding !=3D null) {
+                valueCode =3D "new jaxx.runtime.css.DataBinding(" + TypeMana=
ger.getJavaCode(object.getId() + "." + property + "." + priority) + ")";
+                new DataBinding(dataBinding, object.getId() + "." + property=
 + "." + priority, handler.getSetPropertyCode(object.getJavaCode(),
+                        property, "(" + JAXXCompiler.getCanonicalName(type) =
+ ") " + dataBinding, compiler), compiler).compile(false);
+            } else {
+                try {
+                    Class typeClass =3D type !=3D null ? ClassDescriptorLoad=
er.getClass(type.getName(), type.getClassLoader()) : null;
+                    valueCode =3D TypeManager.getJavaCode(TypeManager.conver=
tFromString(e.getValue(), typeClass));
+                }
+                catch (ClassNotFoundException ex) {
+                    compiler.reportError("could not find class " + type.getN=
ame());
+                    return;
+                }
+            }
+            if (!valueDeclared) {
+                buffer.append("java.lang.Object ");
+                valueDeclared =3D true;
+            }
+            buffer.append("value =3D jaxx.runtime.css.Pseudoclasses.applyPro=
perty(").append(compiler.getOutputClassName()).append(".this, ").append(objec=
t.getJavaCode()).append(", ").append(TypeManager.getJavaCode(property)).appen=
d(", ").append(valueCode).append(", jaxx.runtime.css.Pseudoclasses.wrap(").ap=
pend(handler.getGetPropertyCode(object.getJavaCode(), property, compiler)).ap=
pend("), ").append(priority).append(");").append(JAXXCompiler.getLineSeparato=
r());
+            buffer.append("if (!(value instanceof jaxx.runtime.css.DataBindi=
ng)) {").append(JAXXCompiler.getLineSeparator());
+            String unwrappedValue =3D unwrap(type, "value");
+            buffer.append("    ").append(handler.getSetPropertyCode(object.g=
etJavaCode(), property, "(" + JAXXCompiler.getCanonicalName(type) +
+                    ") " + unwrappedValue, compiler)).append(JAXXCompiler.ge=
tLineSeparator());
+            buffer.append("}").append(JAXXCompiler.getLineSeparator());
+        }
+
+        if (pseudoClass.equals("focused")) {
+            pseudoClass =3D "{ object.hasFocus() }";
+        } else if (pseudoClass.equals("unfocused")) {
+            pseudoClass =3D "{ !object.hasFocus() }";
+        } else if (pseudoClass.equals("enabled")) {
+            pseudoClass =3D "{ object.isEnabled() }";
+        } else if (pseudoClass.equals("disabled")) {
+            pseudoClass =3D "{ !object.isEnabled() }";
+        } else if (pseudoClass.equals("selected")) {
+            pseudoClass =3D "{ object.isSelected() }";
+        } else if (pseudoClass.equals("deselected")) {
+            pseudoClass =3D "{ !object.isSelected() }";
+        }
+
+        compilePseudoClassAdd(pseudoClass, object, buffer.toString(), compil=
er);
+
+        buffer.setLength(0);
+        valueDeclared =3D false;
+        for (Map.Entry<String, String> e : properties.entrySet()) {
+            String property =3D e.getKey();
+            ClassDescriptor type =3D handler.getPropertyType(object, propert=
y, compiler);
+            String dataBinding =3D compiler.processDataBindings(e.getValue()=
, type);
+            String valueCode;
+            if (dataBinding !=3D null) {
+                valueCode =3D "new jaxx.runtime.css.DataBinding(" + TypeMana=
ger.getJavaCode(object.getId() + "." + property + "." + priority) + ")";
+                new jaxx.compiler.DataBinding(dataBinding, object.getId() + =
"." + property + "." + priority, handler.getSetPropertyCode(object.getJavaCod=
e(),
+                        property, "(" + JAXXCompiler.getCanonicalName(type) =
+ ") " + dataBinding, compiler), compiler).compile(false);
+            } else {
+                try {
+                    Class typeClass =3D type !=3D null ? ClassDescriptorLoad=
er.getClass(type.getName(), type.getClassLoader()) : null;
+                    valueCode =3D TypeManager.getJavaCode(TypeManager.conver=
tFromString(e.getValue(), typeClass));
+                }
+                catch (ClassNotFoundException ex) {
+                    compiler.reportError("could not find class " + type.getN=
ame());
+                    return;
+                }
+            }
+            if (!valueDeclared) {
+                buffer.append("java.lang.Object ");
+                valueDeclared =3D true;
+            }
+            buffer.append("value =3D jaxx.runtime.css.Pseudoclasses.removePr=
operty(").append(compiler.getOutputClassName()).append(".this, ").append(obje=
ct.getJavaCode()).append(", ").append(TypeManager.getJavaCode(property)).appe=
nd(", ").append(valueCode).append(", jaxx.runtime.css.Pseudoclasses.wrap(").a=
ppend(handler.getGetPropertyCode(object.getJavaCode(), property, compiler)).a=
ppend("), ").append(priority).append(");").append(JAXXCompiler.getLineSeparat=
or());
+            buffer.append("if (!(value instanceof jaxx.runtime.css.DataBindi=
ng)) {").append(JAXXCompiler.getLineSeparator());
+            String unwrappedValue =3D unwrap(type, "value");
+            buffer.append("    ").append(handler.getSetPropertyCode(object.g=
etJavaCode(), property, "(" + JAXXCompiler.getCanonicalName(type) +
+                    ") " + unwrappedValue, compiler)).append(JAXXCompiler.ge=
tLineSeparator());
+            buffer.append("}").append(JAXXCompiler.getLineSeparator());
+        }
+        compilePseudoClassRemove(pseudoClass, object, buffer.toString(), com=
piler);
+    }
+
+
+    public Map<String, String> getApplicableProperties(CompiledObject object=
) throws CompilerException {
+        DefaultObjectHandler handler =3D TagManager.getTagHandler(object.get=
ObjectClass());
+        Map<String, String> result =3D null;
+        for (Rule rule : rules) {
+            int apply =3D rule.appliesTo(object);
+            if (apply =3D=3D Selector.ALWAYS_APPLIES || apply =3D=3D Selecto=
r.ALWAYS_APPLIES_INHERIT_ONLY) {
+                if (result =3D=3D null)
+                    result =3D new HashMap<String, String>();
+                for (Map.Entry<String, String> entry : rule.getProperties().=
entrySet()) {
+                    String property =3D entry.getKey();
+                    if (apply =3D=3D Selector.ALWAYS_APPLIES || handler.isPr=
opertyInherited(property)) {
+                        result.put(property, entry.getValue());
+                    }
+                }
+            }
+        }
+        return result;
+    }
+
+
+    public Rule[] getApplicablePseudoClasses(CompiledObject object) throws C=
ompilerException {
+        List<Rule> result =3D null;
+        for (Rule rule : rules) {
+            if (rule.appliesTo(object) =3D=3D Selector.PSEUDOCLASS_APPLIES) {
+                if (result =3D=3D null) {
+                    result =3D new ArrayList<Rule>();
+                }
+                result.add(rule);
+            }
+        }
+        return result !=3D null ? result.toArray(new Rule[result.size()]) : =
null;
+    }
+
+    @Override
+    public String toString() {
+        return "Stylesheet" + Arrays.asList(rules);
+    }
+}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/BeanValidato=
r.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/BeanValidator.java	2=
008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/BeanValidator.jav=
a	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,490 +0,0 @@
-/* *##%
- *  Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
- *
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU General Public License
- *  as published by the Free Software Foundation; either version 2
- *  of the License, or (at your option) any later version.
- *
- *  This program 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 General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- *##%*/
-
-package jaxx.runtime;
-
-
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.ValidationAwareSupport;
-import com.opensymphony.xwork2.config.Configuration;
-import com.opensymphony.xwork2.config.ConfigurationManager;
-import com.opensymphony.xwork2.util.ValueStack;
-import com.opensymphony.xwork2.util.ValueStackFactory;
-import com.opensymphony.xwork2.validator.ActionValidatorManager;
-import com.opensymphony.xwork2.validator.DelegatingValidatorContext;
-import com.opensymphony.xwork2.validator.ValidationException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jdesktop.jxlayer.JXLayer;
-import org.jdesktop.jxlayer.plaf.AbstractLayerUI;
-
-import javax.swing.BorderFactory;
-import javax.swing.DefaultListModel;
-import javax.swing.JComponent;
-import javax.swing.JList;
-import javax.swing.SwingUtilities;
-import java.awt.AlphaComposite;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Graphics2D;
-import java.awt.Insets;
-import java.awt.Rectangle;
-import java.awt.RenderingHints;
-import java.awt.image.BufferedImage;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * <p/>
- * Permet d'ajouter facilement le support de la validation des champs d'un
- * bean et de le relier a une interface graphique.
- * Utilise xwork pour la validation et JXLayer pour la visualisation.
- * <p/>
- * <p/>
- * Le mieux pour son integration dans Jaxx est de faire de la generation pour
- * force la compilation du code suivant:
- * <p/>
- * <pre>
- * myValidor.getBean().get<field>();
- * </pre>
- * <p/>
- * et ceci pour chaque field ajoute a la map fieldRepresentation. De cette
- * facon meme si le champs field est en texte on a une verification de son
- * existance a la compilation.
- * <p/>
- * <p/>
- * La representation en tag pourrait etre
- * <pre>
- * &lt;validator id=3D"myValidator" beanClass=3D"{Personne.class}" errorList=
=3D"$list"&gt;
- *   &lt;field name=3D"name" component=3D"$name"/&gt;
- *   &lt;field name=3D"firstName" component=3D"$firstName"/&gt;
- *   &lt;field name=3D"birthDate" component=3D"$birthDate"/&gt;
- * &lt;/validator>
- * &lt;validator beanClass=3D"{Personne.class}" autoField=3D"true" errorList=
=3D"$list"&gt;
- *   &lt;fieldRepresentation name=3D"name" component=3D"$lastName"/&gt;
- * &lt;/validator&gt;
- * </pre>
- * <p/>
- * dans le premier exemple on fait un mapping explicite des champs, mais on =
voit
- * que le nom du composant graphique est le meme que celui du champs. Pour e=
viter
- * de longue saisie, il est possible d'utiliser le flag <b>autoField</b>
- * qui pour chaque champs du ayant une methode get du bean recherche un comp=
osant
- * avec cet Id. Il est aussi possible de surcharge un champs explicitement
- * comme ici name, dans le cas ou le composant qui porterait ce nom serait
- * utilise pour autre chose.
- * <p/>
- * <p/>
- * Il faut un handler particulier pour ce composant car les attributs
- * <b>beanClass</b> et <b>autoField</b> ne sont present que dans le XML jaxx=
 et
- * servent a la generation. Il faut aussi prendre en compte les elements
- * fieldRepresentation fils du tag validator.
- * <p/>
- * <p/>
- * Voici ce que pourrait etre le code genere par jaxx
- * <pre>
- * // declaration du bean
- * BeanValidator<beanClass> $myValidator;
- * // init du bean
- * protected void createMyValidator() {
- *   $myValidator =3D new BeanValidator<beanClass>();
- *   // genere seulement si autoField =3D true
- *   for (Method m : beanClass.getMethod()) {
- *     if (m.getName().startsWith("get")) {
- *       String fieldName =3D m.getName().substring(3).toLowerCase();
- *       $myValidator.setFieldRepresentation(fieldName, $objectMap.get(field=
Name));
- *     }
- *   }
- *   // pour chaque tag fieldRepresentation
- *   myValidator.setFieldRepresentation("name", $lastName);
- *   // si beanClass est specifie et n'est pas Object, on force l'acces au c=
hamps
- *   // pour validation a la compilation
- *   $myValidator.getBean().getName();
- *   $objectMap.put("myValidator", $myValidator);
- * }
- * </pre>
- *
- * @author poussin
- * @version $Revision$
- *          <p/>
- *          Last update: $Date$
- *          by : $Author$
- */
-public class BeanValidator<T> {
-
-    /** to use log facility, just put in your code: log.info(\"...\"); */
-    static private Log log =3D LogFactory.getLog(BeanValidator.class);
-
-    protected PropertyChangeSupport pcs;
-
-    protected ValidationAwareSupport validationSupport;
-    protected DelegatingValidatorContext validationContext;
-
-    protected transient ActionValidatorManager validator;
-
-    /** indique si le bean a ete modifie depuis son arrivee */
-    protected boolean changed =3D false;
-
-    /** le bean a surveiller */
-    protected T bean =3D null;
-
-    /** l'objet qui recoit les notifications de modification du bean */
-    protected Listener l =3D new Listener();
-
-    /** permet de faire le lien en un champs du bean et l'objet qui permet d=
e l'editer */
-    protected Map<String, JComponent> fieldRepresentation;
-
-    /** Objet servant a afficher toutes les erreurs */
-    protected JList errorList =3D null;
-
-    /** Object servant a contenir la liste des erreurs */
-    protected DefaultListModel errorListModel;
-
-    public BeanValidator() {
-        pcs =3D new PropertyChangeSupport(this);
-        validationSupport =3D new ValidationAwareSupport();
-        validationContext =3D new DelegatingValidatorContext(validationSuppo=
rt);
-        fieldRepresentation =3D new HashMap<String, JComponent>();
-    }
-
-    /**
-     * Permet de modifier l'objet permettant d'afficher toutes les errors
-     *
-     * @param errorList si null arrete d'afficher les errors
-     */
-    public void setErrorList(JList errorList) {
-        this.errorList =3D errorList;
-    }
-
-    public JList getErrorList() {
-        return errorList;
-    }
-
-    public DefaultListModel getErrorListModel() {
-        return errorListModel;
-    }
-
-    public void setErrorListModel(DefaultListModel errorListModel) {
-        this.errorListModel =3D errorListModel;
-    }
-
-    /**
-     * Permet d'indiquer le composant graphique responsable de l'affichage
-     * d'un attribut du bean
-     *
-     * @param fieldname the field name in the bean
-     * @param c         the editor component for the field
-     */
-    public void setFieldRepresentation(String fieldname, JComponent c) {
-        JComponent old =3D fieldRepresentation.put(fieldname, c);
-        setErrorRepresentation(fieldname, old, c);
-    }
-
-    public void setFieldRepresentation(Map<String, JComponent> fieldRepresen=
tation) {
-        for (Map.Entry<String, JComponent> e : fieldRepresentation.entrySet(=
)) {
-            setFieldRepresentation(e.getKey(), e.getValue());
-        }
-    }
-
-    public JComponent getFieldRepresentation(String fieldname) {
-        return fieldRepresentation.get(fieldname);
-    }
-
-    /**
-     * Retourne vrai si l'objet bean a ete modifie depuis le dernier
-     * {@link #setBean}
-     *
-     * @return <code>true</code> if bean was modify since last {@link #setBe=
an(Object)} invocation
-     */
-    public boolean isChanged() {
-        return changed;
-    }
-
-    /**
-     * Permet de force la remise a false de l'etat de changement du bean
-     *
-     * @param changed flag to force reset of property {@link #changed}
-     */
-    public void setChanged(boolean changed) {
-        boolean oldChanged =3D this.changed;
-        this.changed =3D changed;
-        pcs.firePropertyChange("changed", oldChanged, changed);
-    }
-
-    public T getBean() {
-        return bean;
-    }
-
-    public void setBean(T bean) {
-        T oldBean =3D this.bean;
-        if (this.bean !=3D null) {
-            try {
-                Method method =3D this.bean.getClass().getMethod("removeProp=
ertyChangeListener", PropertyChangeListener.class);
-                method.invoke(this.bean, l);
-            } catch (Exception eee) {
-                log.info("Can't register as listener", eee);
-            }
-        }
-        this.bean =3D bean;
-        if (this.bean !=3D null) {
-            try {
-                Method method =3D this.bean.getClass().getMethod("addPropert=
yChangeListener", PropertyChangeListener.class);
-                method.invoke(this.bean, l);
-            } catch (Exception eee) {
-                log.info("Can't register as listener", eee);
-            }
-        }
-        validate();
-        pcs.firePropertyChange("bean", oldBean, bean);
-    }
-
-    /** install layers on required components */
-    public void installLayers() {
-        SwingUtilities.invokeLater(new Runnable() {
-            public void run() {
-                for (String fieldname : fieldRepresentation.keySet()) {
-                    JComponent c =3D fieldRepresentation.get(fieldname);
-                    setErrorRepresentation(fieldname, null, c);
-                }
-            }
-        });
-
-    }
-
-    protected ActionValidatorManager getValidator() {
-        if (validator =3D=3D null) {
-            ConfigurationManager confManager =3D new ConfigurationManager();
-            Configuration conf =3D confManager.getConfiguration();
-
-            ValueStackFactory vsf =3D conf.getContainer().getInstance(
-                    ValueStackFactory.class);
-            ValueStack vs =3D vsf.createValueStack();
-            ActionContext context =3D new ActionContext(vs.getContext());
-            ActionContext.setContext(context);
-
-            validator =3D conf.getContainer().getInstance(
-                    ActionValidatorManager.class, "no-annotations");
-        }
-        return validator;
-    }
-
-    /**
-     * il faut eviter le code re-intrant (durant une validation, une autre e=
st
-     * demandee). Pour cela on fait la validation dans un thread, et tant
-     * que la premiere validation n'est pas fini, on ne repond pas aux
-     * solicitations.
-     * Cette method est public pour permettre de force une validation par
-     * programmation, ce qui est utile par exemple si le bean ne supporte
-     * pas les {@link PropertyChangeListener}
-     */
-    public void validate() {
-        // on ne valide que si il y a un bean et que le resultat de la valid=
ation
-        // pourra etre affiche quelque part
-        if (bean =3D=3D null || getErrorListModel() =3D=3D null || fieldRepr=
esentation.size() =3D=3D 0) {
-            return;
-        }
-
-        try {
-            List<String> newErrors =3D new ArrayList<String>();
-
-            Enumeration enumeration =3D getErrorListModel().elements();
-            while (enumeration.hasMoreElements()) {
-                Object o =3D enumeration.nextElement();
-                newErrors.add((String) o);
-            }
-            for (Object o : validationContext.getFieldErrors().entrySet()) {
-                Map.Entry<?, ?> r =3D (Map.Entry<?, ?>) o;
-                String field =3D (String) r.getKey();
-                List<String> errors =3D (List<String>) r.getValue();
-                JComponent component =3D fieldRepresentation.get(field);
-                for (String error : errors) {
-                    newErrors.remove(component.getName() + " : " + error);
-                }
-            }
-
-            validationSupport.clearErrorsAndMessages();
-
-            getValidator().validate(bean, null, validationContext);
-
-            if (log.isDebugEnabled()) {
-                log.debug("Action errors: " + validationContext.getActionErr=
ors());
-                log.debug("Action messages: " + validationContext.getActionM=
essages());
-                log.debug("Field errors: " + validationContext.getFieldError=
s());
-            }
-
-            log.info(this + " : " + validationContext.getFieldErrors());
-
-            for (Object o : validationContext.getFieldErrors().entrySet()) {
-                Map.Entry<?, ?> r =3D (Map.Entry<?, ?>) o;
-                String field =3D (String) r.getKey();
-                List<String> errors =3D (List<String>) r.getValue();
-                JComponent component =3D fieldRepresentation.get(field);
-                for (String error : errors) {
-                    newErrors.add(component.getName() + " : " + error);
-                }
-            }
-
-            getErrorListModel().clear();
-            for (String newError : newErrors) {
-                getErrorListModel().addElement(newError);
-            }
-
-            for (String fieldname : fieldRepresentation.keySet()) {
-                JComponent c =3D fieldRepresentation.get(fieldname);
-                //todo:  a supprimer mais actuellemnt le layer ne se repaint=
 pas bien, cela n'est pas normal
-                c.getParent().repaint();
-            }
-        } catch (ValidationException eee) {
-            log.warn("Error during validation", eee);
-        }
-    }
-
-    protected void setErrorRepresentation(String fieldname, JComponent old, =
JComponent c) {
-        if (old !=3D c) {
-            if (old !=3D null) {
-                // suppression du jxlayer sous l'ancien composant
-                Container container =3D old.getParent();
-                if (container instanceof JXLayer) {
-                    JXLayer<?> jx =3D (JXLayer<?>) container;
-                    jx.setUI(null);
-                }
-            }
-            if (c !=3D null) {
-                // ajout du jxlayer sous ce composant
-                Container container =3D c.getParent();
-                if (container instanceof JXLayer) {
-                    IconValidationUI ui =3D new IconValidationUI(fieldname, =
c.getName(), validationSupport);
-                    // TranslucentValidationUI ui =3D new TranslucentValidat=
ionUI(fieldname, validationSupport.getFieldErrors());
-                    ui.setEnabled(true);
-                    JXLayer<JComponent> jx =3D (JXLayer<JComponent>) contain=
er;
-                    jx.setUI(ui);
-                }
-            }
-        }
-    }
-
-    protected class Listener implements PropertyChangeListener {
-
-        public void propertyChange(PropertyChangeEvent evt) {
-            validate();
-            setChanged(true);
-        }
-    }
-
-
-    public static class TranslucentValidationUI extends AbstractLayerUI<JCom=
ponent> {
-
-        protected String field =3D null;
-        protected Map resultValidation =3D null;
-
-        public TranslucentValidationUI(String field, Map resultValidation) {
-            this.field =3D field;
-            this.resultValidation =3D resultValidation;
-        }
-
-        @Override
-        protected void paintLayer(Graphics2D g2, JXLayer<JComponent> l) {
-            // paints the layer as is
-            super.paintLayer(g2, l);
-
-            // to be in sync with the view if the layer has a border
-            Insets layerInsets =3D l.getInsets();
-            g2.translate(layerInsets.left, layerInsets.top);
-
-            JComponent view =3D l.getView();
-            // To prevent painting on view's border
-            Insets insets =3D view.getInsets();
-            g2.clip(new Rectangle(insets.left, insets.top,
-                    view.getWidth() - insets.left - insets.right,
-                    view.getHeight() - insets.top - insets.bottom));
-
-            g2.setColor(!resultValidation.containsKey(field) ?
-                    Color.GREEN : Color.RED);
-            g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OV=
ER, .2f));
-            g2.fillRect(0, 0, l.getWidth(), l.getHeight());
-        }
-    }
-
-    public static class IconValidationUI extends AbstractLayerUI<JComponent>=
 {
-
-        // The red icon to be shown at the layer's corner
-        private final static BufferedImage INVALID_ICON;
-
-        static {
-            int width =3D 7;
-            int height =3D 8;
-            INVALID_ICON =3D new BufferedImage(width, height, BufferedImage.=
TYPE_INT_ARGB);
-            Graphics2D g2 =3D (Graphics2D) INVALID_ICON.getGraphics();
-            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHi=
nts.VALUE_ANTIALIAS_ON);
-            g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, Rendering=
Hints.VALUE_STROKE_PURE);
-            g2.setColor(Color.RED);
-            g2.fillRect(0, 0, width, height);
-            g2.setColor(Color.WHITE);
-            g2.drawLine(0, 0, width, height);
-            g2.drawLine(0, height, width, 0);
-            g2.dispose();
-        }
-
-        /** bean validation field */
-        protected String field =3D null;
-
-        /** component id */
-        protected String componentId =3D null;
-        protected ValidationAwareSupport resultValidation =3D null;
-
-        public IconValidationUI(String field, String componentId, Validation=
AwareSupport resultValidation) {
-            this.field =3D field;
-            this.resultValidation =3D resultValidation;
-            this.componentId =3D componentId;
-            log.info("install " + this + "<field:" + field + ", componentId:=
" + componentId + ">");
-        }
-
-        @Override
-        public void installUI(JComponent c) {
-            super.installUI(c);
-            c.setBorder(BorderFactory.createEmptyBorder(2, 0, 0, 3));
-        }
-
-        @Override
-        public void uninstallUI(JComponent c) {
-            super.uninstallUI(c);
-            c.setBorder(null);
-        }
-
-        @Override
-        protected void paintLayer(Graphics2D g2, JXLayer<JComponent> l) {
-            super.paintLayer(g2, l);
-            Component component =3D l.getComponent(1);
-            // There is no need to take insets into account for this painter
-            if (resultValidation.getFieldErrors().containsKey(field)) {
-                log.info("requiredId : " + componentId + " : componentName :=
 " + component.getName());
-                g2.drawImage(INVALID_ICON, l.getWidth() - INVALID_ICON.getWi=
dth() - 1, 0, null);
-                // g2.drawImage(INVALID_ICON, 0, 0, null);
-            }
-        }
-    }
-
-}

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXContext.=
java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/JAXXContext.java	200=
8-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXContext.java	=
2008-10-21 07:31:05 UTC (rev 990)
@@ -1,65 +0,0 @@
-package jaxx.runtime;
-
-import java.awt.Container;
-
-/**
- * todo (make javadoc :) )
- *=20
- * @author letellier
- */
-interface JAXXContext {
-
-    /**
-     * Map actions objects used by JAXX interface.
-     *=20
-     * @param o todo
-     */
-     public void setContextValue(Object o);
-
-     /**
-     * Map actions objects used by JAXX interface and their names.
-     *
-     * @param o todo
-     * @param name todo
-     */
-     public void setContextValue(Object o, String name);
-   =20
-    /**
-     * Return action object used by JAXX interface.
-     * This is an exemple to call a method in JAXX :
-     *=20
-     * <code>
-     * <JButton onActionPerformed=3D'{getContextValue(Action.class).method(a=
rgs[])}'/>
-     * </code>
-     *
-     * @param clazz todo
-     * @return  todo
-     */
-     public <T> T getContextValue(Class<T> clazz);
-    =20
-    /**
-     * Return action object used by JAXX interface.
-     *
-     * @param clazz  todo
-     * @param  name todo
-     * @return  todo
-     */
-     public <T> T getContextValue(Class<T> clazz, String name);
-    =20
-    /**
-     * Return parent's container corresponding to the Class clazz
-     *
-     * @param clazz clazz desired
-     * @return parent's container
-     */
-     public <O extends Container> O getParentContainer(Class<O> clazz);
-    =20
-     /**
-     * Return parent's container corresponding to the Class clazz
-     *
-     * @param top  todo
-     * @param clazz desired
-     * @return parent's container
-     */
-     public <O extends Container> O getParentContainer(Object top, Class<O> =
clazz);
-}

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXContext.j=
ava (from rev 954, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/JAXXC=
ontext.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXContext.java	=
                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXContext.java	=
2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,65 @@
+package jaxx.runtime;
+
+import java.awt.Container;
+
+/**
+ * todo (make javadoc :) )
+ *=20
+ * @author letellier
+ */
+public interface JAXXContext {
+
+    /**
+     * Map actions objects used by JAXX interface.
+     *=20
+     * @param o todo
+     */
+     public void setContextValue(Object o);
+
+     /**
+     * Map actions objects used by JAXX interface and their names.
+     *
+     * @param o todo
+     * @param name todo
+     */
+     public void setContextValue(Object o, String name);
+   =20
+    /**
+     * Return action object used by JAXX interface.
+     * This is an exemple to call a method in JAXX :
+     *=20
+     * <code>
+     * <JButton onActionPerformed=3D'{getContextValue(Action.class).method(a=
rgs[])}'/>
+     * </code>
+     *
+     * @param clazz todo
+     * @return  todo
+     */
+     public <T> T getContextValue(Class<T> clazz);
+    =20
+    /**
+     * Return action object used by JAXX interface.
+     *
+     * @param clazz  todo
+     * @param  name todo
+     * @return  todo
+     */
+     public <T> T getContextValue(Class<T> clazz, String name);
+    =20
+    /**
+     * Return parent's container corresponding to the Class clazz
+     *
+     * @param clazz clazz desired
+     * @return parent's container
+     */
+     public <O extends Container> O getParentContainer(Class<O> clazz);
+    =20
+     /**
+     * Return parent's container corresponding to the Class clazz
+     *
+     * @param top  todo
+     * @param clazz desired
+     * @return parent's container
+     */
+     public <O extends Container> O getParentContainer(Object top, Class<O> =
clazz);
+}

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXObject.j=
ava
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/JAXXObject.java	2008=
-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXObject.java	2=
008-10-21 07:31:05 UTC (rev 990)
@@ -1,50 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.runtime;
-
-/** The <code>JAXXObject</code> interface is implemented by all classes prod=
uced by the JAXX compiler. */
-public interface JAXXObject extends JAXXContext{
-    /**
-     * Retrieves an object defined in an XML tag by its ID.
-     *
-     * @param id the id of the component to retrieve
-     * @return the object
-     */
-    public Object getObjectById(String id);
-
-    /**
-     * Pretrieves the dictonary of knwon objects indexed by their ids.
-     * @return the dictonary of objects.
-     */
-    public java.util.Map<String,Object> get$objectMap();
-
-    public void applyDataBinding(String id);
-
-
-    public void removeDataBinding(String id);
-
-
-    /**
-     * Processes a data binding by name.  Data binding names are comprised o=
f an object ID and a property name:
-     * for example, the data binding in the tag <code>&lt;JLabel id=3D'label=
' text=3D'{foo.getText()}'/&gt;</code> is
-     * named <code>"label.text"</code>.  Processing a data binding causes it=
 to reevaluate its expression, in this
-     * case <code>foo.getText()</code>.
-     *
-     * @param dest the name of the data binding to run
-     */
-    public void processDataBinding(String dest);
-
-
-    /**
-     * All <code>JAXXObject</code> implements are capable of broadcasting <c=
ode>PropertyChangeEvent</code>, and
-     * furthermore (for technical reasons) must allow code in outside packag=
es, specifically the JAXX runtime,
-     * to trigger these events.
-     *
-     * @param name     the name of the property which changed
-     * @param oldValue the old value of the property
-     * @param newValue the new value of the property
-     */
-    public void firePropertyChange(String name, Object oldValue, Object newV=
alue);
-}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXObject.ja=
va (from rev 955, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/JAXXOb=
ject.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXObject.java	 =
                       (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXObject.java	2=
008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2006 Ethan Nicholas. All rights reserved.
+ * Use is subject to license terms.
+ */
+package jaxx.runtime;
+
+/** The <code>JAXXObject</code> interface is implemented by all classes prod=
uced by the JAXX compiler. */
+public interface JAXXObject extends JAXXContext, JAXXValidator {
+    /**
+     * Retrieves an object defined in an XML tag by its ID.
+     *
+     * @param id the id of the component to retrieve
+     * @return the object
+     */
+    public Object getObjectById(String id);
+
+    /**
+     * Pretrieves the dictonary of knwon objects indexed by their ids.
+     *
+     * @return the dictonary of objects.
+     */
+    public java.util.Map<String, Object> get$objectMap();
+
+    public void applyDataBinding(String id);
+
+
+    public void removeDataBinding(String id);
+
+
+    /**
+     * Processes a data binding by name.  Data binding names are comprised o=
f an object ID and a property name:
+     * for example, the data binding in the tag <code>&lt;JLabel id=3D'label=
' text=3D'{foo.getText()}'/&gt;</code> is
+     * named <code>"label.text"</code>.  Processing a data binding causes it=
 to reevaluate its expression, in this
+     * case <code>foo.getText()</code>.
+     *
+     * @param dest the name of the data binding to run
+     */
+    public void processDataBinding(String dest);
+
+
+    /**
+     * All <code>JAXXObject</code> implements are capable of broadcasting <c=
ode>PropertyChangeEvent</code>, and
+     * furthermore (for technical reasons) must allow code in outside packag=
es, specifically the JAXX runtime,
+     * to trigger these events.
+     *
+     * @param name     the name of the property which changed
+     * @param oldValue the old value of the property
+     * @param newValue the new value of the property
+     */
+    public void firePropertyChange(String name, Object oldValue, Object newV=
alue);
+}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXValidator=
.java (from rev 958, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/JAX=
XValidator.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXValidator.jav=
a	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/JAXXValidator.jav=
a	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,25 @@
+package jaxx.runtime;
+
+import jaxx.runtime.validator.BeanValidator;
+
+import java.util.List;
+
+/**
+ * The contract of a validator-able object.
+ *
+ * @author chemit
+ */
+public interface JAXXValidator {
+
+    /**
+     * Obtain a validator from his id
+     *
+     * @param validatorId validator id
+     * @return the associated validator, or <code>null</code> if not find
+     */
+    BeanValidator<?> getValidator(String validatorId);
+
+    /** @return the list of ids of all registred validator */
+    List<String> getValidatorIds();
+
+}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/Util.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/Util.java	2008-10-17=
 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/Util.java	2008-10=
-21 07:31:05 UTC (rev 990)
@@ -1,334 +0,0 @@
-package jaxx.runtime;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.swing.JComponent;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.beans.BeanInfo;
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.lang.ref.WeakReference;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.EventListener;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.WeakHashMap;
-import java.util.zip.GZIPInputStream;
-
-public class Util {
-
-    /** to use log facility, just put in your code: log.info(\"...\"); */
-    static private Log log =3D LogFactory.getLog(Util.class);
-
-
-    // Maps root objects to lists of event listeners
-    private static Map<Object, WeakReference<List<EventListenerDescriptor>>>=
 eventListeners =3D new WeakHashMap<Object, WeakReference<List<EventListenerD=
escriptor>>>();
-    private static Map<JAXXObject, WeakReference<List<DataBindingUpdateListe=
ner>>> dataBindingUpdateListeners =3D new WeakHashMap<JAXXObject, WeakReferen=
ce<List<DataBindingUpdateListener>>>();
-
-
-    private static class EventListenerDescriptor {
-        Class listenerClass;
-        String listenerMethodName;
-        String methodName;
-        Object eventListener;
-    }
-
-
-    /**
-     * Decodes the serialized representation of a JAXXObjectDescriptor.  The=
 string must be a byte-to-character mapping
-     * of the binary serialization data for a JAXXObjectDescriptor.  See the=
 comments in JAXXCompiler.createJAXXObjectDescriptorField
-     * for the rationale behind this (admittedly ugly) approach.
-     *
-     * @param descriptor descriptor to decode
-     * @return the dedoced descriptor
-     */
-    public static JAXXObjectDescriptor decodeJAXXObjectDescriptor(String des=
criptor) {
-        try {
-            byte[] data =3D new byte[descriptor.length()];
-            // copy low-order bytes into the array.  The high-order bytes sh=
ould all be zero.
-            System.arraycopy(descriptor.getBytes(), 0, data, 0, data.length);
-            //descriptor.getBytes(0, descriptor.length(), data, 0);
-            ObjectInputStream in =3D new ObjectInputStream(new ByteArrayInpu=
tStream(data));
-            return (JAXXObjectDescriptor) in.readObject();
-        }
-        catch (IOException e) {
-            throw new RuntimeException("Internal error: can't-happen error",=
 e);
-        }
-        catch (ClassNotFoundException e) {
-            throw new RuntimeException("Internal error: can't-happen error",=
 e);
-        }
-    }
-
-
-    public static JAXXObjectDescriptor decodeCompressedJAXXObjectDescriptor(=
String descriptor) {
-        try {
-            byte[] data =3D new byte[descriptor.length()];
-            // copy low-order bytes into the array.  The high-order bytes sh=
ould all be zero.
-            System.arraycopy(descriptor.getBytes(), 0, data, 0, data.length);
-            //descriptor.getBytes(0, descriptor.length(), data, 0);=20
-            ObjectInputStream in =3D new ObjectInputStream(new GZIPInputStre=
am(new ByteArrayInputStream(data)));
-            return (JAXXObjectDescriptor) in.readObject();
-        }
-        catch (IOException e) {
-            throw new RuntimeException("Internal error: can't-happen error",=
 e);
-        }
-        catch (ClassNotFoundException e) {
-            throw new RuntimeException("Internal error: can't-happen error",=
 e);
-        }
-    }
-
-
-    public static Object getEventListener(Class<? extends EventListener> lis=
tenerClass, final String listenerMethodName, final Object methodContainer, fi=
nal String methodName) {
-        WeakReference<List<EventListenerDescriptor>> ref =3D eventListeners.=
get(methodContainer);
-        List<EventListenerDescriptor> descriptors =3D ref !=3D null ? ref.ge=
t() : null;
-        if (descriptors =3D=3D null) {
-            descriptors =3D new ArrayList<EventListenerDescriptor>();
-            eventListeners.put(methodContainer, new WeakReference<List<Event=
ListenerDescriptor>>(descriptors));
-        } else {
-            for (EventListenerDescriptor descriptor : descriptors) {
-                if (listenerClass =3D=3D descriptor.listenerClass &&
-                        (listenerMethodName =3D=3D null ? descriptor.listene=
rMethodName =3D=3D null : listenerMethodName.equals(descriptor.listenerMethod=
Name)) &&
-                        methodName.equals(descriptor.methodName)) {
-                    return descriptor.eventListener;
-                }
-            }
-        }
-
-        // else we need to create a new listener
-        final EventListenerDescriptor descriptor =3D new EventListenerDescri=
ptor();
-        descriptor.listenerClass =3D listenerClass;
-        descriptor.listenerMethodName =3D listenerMethodName;
-        descriptor.methodName =3D methodName;
-        try {
-            final List<Method> listenerMethods =3D Arrays.asList(listenerCla=
ss.getMethods());
-            Method listenerMethod =3D null;
-            if (listenerMethodName !=3D null) {
-                for (Method listenerMethod1 : listenerMethods) {
-                    if ((listenerMethod1).getName().equals(listenerMethodNam=
e)) {
-                        listenerMethod =3D listenerMethod1;
-                        break;
-                    }
-                }
-            }
-            if (listenerMethodName !=3D null && listenerMethod =3D=3D null) {
-                throw new IllegalArgumentException("no method named " + list=
enerMethodName + " found in class " + listenerClass.getName());
-            }
-            Class[] parameterTypes =3D listenerMethods.get(0).getParameterTy=
pes();
-            Class<?> methodContainerClass =3D methodContainer.getClass();
-            final Method targetMethod =3D methodContainerClass.getMethod(met=
hodName, parameterTypes);
-            descriptor.eventListener =3D Proxy.newProxyInstance(listenerClas=
s.getClassLoader(),
-                    new Class[]{listenerClass},
-                    new InvocationHandler() {
-                        public Object invoke(Object proxy, Method method, Ob=
ject[] args) {
-                            String methodName =3D method.getName();
-                            if ((listenerMethodName =3D=3D null && listenerM=
ethods.contains(method)) || methodName.equals(listenerMethodName)) {
-                                try {
-                                    return targetMethod.invoke(methodContain=
er, args);
-                                }
-                                catch (IllegalAccessException e) {
-                                    throw new RuntimeException(e);
-                                }
-                                catch (InvocationTargetException e) {
-                                    throw new RuntimeException(e);
-                                }
-                            }
-                            if (methodName.equals("toString")) {
-                                return toString();
-                            }
-                            if (methodName.equals("equals")) {
-                                return descriptor.eventListener =3D=3D args[=
0];
-                            }
-                            if (methodName.equals("hashCode")) {
-                                return hashCode();
-                            }
-                            return null;
-                        }
-                    });
-            descriptors.add(descriptor);
-            return descriptor.eventListener;
-        }
-        catch (NoSuchMethodException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-
-    public static Object getEventListener(Class<? extends EventListener> lis=
tenerClass, final Object methodContainer, final String methodName) {
-        return getEventListener(listenerClass, null, methodContainer, method=
Name);
-    }
-
-
-    public static DataBindingUpdateListener getDataBindingUpdateListener(JAX=
XObject object, String bindingName) {
-        WeakReference<List<DataBindingUpdateListener>> ref =3D dataBindingUp=
dateListeners.get(object);
-        List<DataBindingUpdateListener> listeners =3D ref =3D=3D null ? null=
 : ref.get();
-        if (listeners =3D=3D null) {
-            listeners =3D new ArrayList<DataBindingUpdateListener>();
-            dataBindingUpdateListeners.put(object, new WeakReference<List<Da=
taBindingUpdateListener>>(listeners));
-        } else {
-            for (DataBindingUpdateListener listener : listeners) {
-                if (bindingName.equals(listener.getBindingName())) {
-                    return listener;
-                }
-            }
-        }
-        DataBindingUpdateListener listener =3D new DataBindingUpdateListener=
(object, bindingName);
-        listeners.add(listener);
-        return listener;
-    }
-
-
-    public static void setComponentWidth(Component component, int width) {
-        component.setSize(width, component.getHeight());
-        if (component instanceof JComponent) {
-            JComponent jcomponent =3D (JComponent) component;
-            jcomponent.setPreferredSize(new Dimension(width, jcomponent.getP=
referredSize().height));
-            jcomponent.setMinimumSize(new Dimension(width, jcomponent.getPre=
ferredSize().height));
-            if (jcomponent.isDisplayable()) {
-                jcomponent.revalidate();
-            }
-        }
-    }
-
-
-    public static void setComponentHeight(Component component, int height) {
-        component.setSize(component.getWidth(), height);
-        if (component instanceof JComponent) {
-            JComponent jcomponent =3D (JComponent) component;
-            jcomponent.setPreferredSize(new Dimension(jcomponent.getPreferre=
dSize().width, height));
-            jcomponent.setMinimumSize(new Dimension(jcomponent.getPreferredS=
ize().width, height));
-            if (jcomponent.isDisplayable()) {
-                jcomponent.revalidate();
-            }
-        }
-    }
-
-
-    public static boolean assignment(boolean value, String name, JAXXObject =
src) {
-        src.firePropertyChange(name.trim(), null, "dummy value");
-        return value;
-    }
-
-
-    public static byte assignment(byte value, String name, JAXXObject src) {
-        src.firePropertyChange(name.trim(), null, "dummy value");
-        return value;
-    }
-
-
-    public static short assignment(short value, String name, JAXXObject src)=
 {
-        src.firePropertyChange(name.trim(), null, "dummy value");
-        return value;
-    }
-
-
-    public static int assignment(int value, String name, JAXXObject src) {
-        src.firePropertyChange(name.trim(), null, "dummy value");
-        return value;
-    }
-
-
-    public static long assignment(long value, String name, JAXXObject src) {
-        src.firePropertyChange(name.trim(), null, "dummy value");
-        return value;
-    }
-
-
-    public static float assignment(float value, String name, JAXXObject src)=
 {
-        src.firePropertyChange(name.trim(), null, "dummy value");
-        return value;
-    }
-
-
-    public static double assignment(double value, String name, JAXXObject sr=
c) {
-        src.firePropertyChange(name.trim(), null, "dummy value");
-        return value;
-    }
-
-
-    public static char assignment(char value, String name, JAXXObject src) {
-        src.firePropertyChange(name.trim(), null, "dummy value");
-        return value;
-    }
-
-
-    public static java.lang.Object assignment(java.lang.Object value, String=
 name, JAXXObject src) {
-        src.firePropertyChange(name.trim(), null, "dummy value");
-        return value;
-    }
-
-    /**
-     * recherche les composants portant le meme nom que les champs de la cla=
sse
-     * clazz. Cette methode est statique pour pouvoir eventuellement l'utili=
ser
-     * dans un autre context (je pense par exemple a la generation jaxx).
-     * <p/>
-     * <p/>
-     * Si la recherche echoue pour quelque raison que se soit, aucune except=
ion
-     * n'est leve, et la map retournee est tout simplement vide ou incomplete
-     *
-     * @param clazz     la classe ou recherche les champs
-     * @param container le container ou rechercher les composants d'edition
-     * @return
-     */
-    public static Map<String, JComponent> lookingForEditor(Class clazz, Cont=
ainer container) {
-        Map<String, JComponent> result =3D new HashMap<String, JComponent>();
-        try {
-            // looking for all component with name set
-            Map<String, JComponent> allNamedComponent =3D new HashMap<String=
, JComponent>();
-            List<Container> todo =3D new LinkedList<Container>();
-            todo.add(container);
-            while (todo.size() > 0) {
-                for (ListIterator<Container> i =3D todo.listIterator(); i.ha=
sNext();) {
-                    Container parent =3D i.next();
-                    i.remove();
-                    for (Component c : parent.getComponents()) {
-                        if (c instanceof Container) {
-                            i.add((Container) c);
-                            String name =3D c.getName();
-                            if (c instanceof JComponent &&
-                                    name !=3D null && !"".equals(name)) {
-                                allNamedComponent.put(name, (JComponent) c);
-                            }
-                        }
-                    }
-                }
-            }
-
-            // looking for all properties on class
-            BeanInfo info =3D Introspector.getBeanInfo(clazz);
-            PropertyDescriptor[] props =3D info.getPropertyDescriptors();
-
-            // find if one properties have same name that component
-            for (PropertyDescriptor prop : props) {
-                String name =3D prop.getName();
-                if (allNamedComponent.containsKey(name)) {
-                    result.put(name, allNamedComponent.get(name));
-                }
-            }
-
-        } catch (IntrospectionException eee) {
-            log.warn("Can't introspect bean", eee);
-        }
-
-        if (log.isDebugEnabled()) {
-            log.debug("Result: " + result);
-        }
-
-        return result;
-    }
-
-}

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/Util.java (fr=
om rev 961, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/Util.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/Util.java	       =
                 (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/Util.java	2008-10=
-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,346 @@
+package jaxx.runtime;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.jxlayer.JXLayer;
+
+import javax.swing.JComponent;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.beans.BeanInfo;
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.lang.ref.WeakReference;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.EventListener;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.WeakHashMap;
+import java.util.zip.GZIPInputStream;
+
+public class Util {
+
+    /** to use log facility, just put in your code: log.info(\"...\"); */
+    static private Log log =3D LogFactory.getLog(Util.class);
+
+
+    // Maps root objects to lists of event listeners
+    private static Map<Object, WeakReference<List<EventListenerDescriptor>>>=
 eventListeners =3D new WeakHashMap<Object, WeakReference<List<EventListenerD=
escriptor>>>();
+    private static Map<JAXXObject, WeakReference<List<DataBindingUpdateListe=
ner>>> dataBindingUpdateListeners =3D new WeakHashMap<JAXXObject, WeakReferen=
ce<List<DataBindingUpdateListener>>>();
+
+
+    private static class EventListenerDescriptor {
+        Class listenerClass;
+        String listenerMethodName;
+        String methodName;
+        Object eventListener;
+    }
+
+
+    /**
+     * Decodes the serialized representation of a JAXXObjectDescriptor.  The=
 string must be a byte-to-character mapping
+     * of the binary serialization data for a JAXXObjectDescriptor.  See the=
 comments in JAXXCompiler.createJAXXObjectDescriptorField
+     * for the rationale behind this (admittedly ugly) approach.
+     *
+     * @param descriptor descriptor to decode
+     * @return the dedoced descriptor
+     */
+    public static JAXXObjectDescriptor decodeJAXXObjectDescriptor(String des=
criptor) {
+        try {
+            byte[] data =3D new byte[descriptor.length()];
+            // copy low-order bytes into the array.  The high-order bytes sh=
ould all be zero.
+            System.arraycopy(descriptor.getBytes(), 0, data, 0, data.length);
+            //descriptor.getBytes(0, descriptor.length(), data, 0);
+            ObjectInputStream in =3D new ObjectInputStream(new ByteArrayInpu=
tStream(data));
+            return (JAXXObjectDescriptor) in.readObject();
+        }
+        catch (IOException e) {
+            throw new RuntimeException("Internal error: can't-happen error",=
 e);
+        }
+        catch (ClassNotFoundException e) {
+            throw new RuntimeException("Internal error: can't-happen error",=
 e);
+        }
+    }
+
+
+    public static JAXXObjectDescriptor decodeCompressedJAXXObjectDescriptor(=
String descriptor) {
+        try {
+            byte[] data =3D new byte[descriptor.length()];
+            // copy low-order bytes into the array.  The high-order bytes sh=
ould all be zero.
+            System.arraycopy(descriptor.getBytes(), 0, data, 0, data.length);
+            //descriptor.getBytes(0, descriptor.length(), data, 0);=20
+            ObjectInputStream in =3D new ObjectInputStream(new GZIPInputStre=
am(new ByteArrayInputStream(data)));
+            return (JAXXObjectDescriptor) in.readObject();
+        }
+        catch (IOException e) {
+            throw new RuntimeException("Internal error: can't-happen error",=
 e);
+        }
+        catch (ClassNotFoundException e) {
+            throw new RuntimeException("Internal error: can't-happen error",=
 e);
+        }
+    }
+
+
+    public static Object getEventListener(Class<? extends EventListener> lis=
tenerClass, final String listenerMethodName, final Object methodContainer, fi=
nal String methodName) {
+        WeakReference<List<EventListenerDescriptor>> ref =3D eventListeners.=
get(methodContainer);
+        List<EventListenerDescriptor> descriptors =3D ref !=3D null ? ref.ge=
t() : null;
+        if (descriptors =3D=3D null) {
+            descriptors =3D new ArrayList<EventListenerDescriptor>();
+            eventListeners.put(methodContainer, new WeakReference<List<Event=
ListenerDescriptor>>(descriptors));
+        } else {
+            for (EventListenerDescriptor descriptor : descriptors) {
+                if (listenerClass =3D=3D descriptor.listenerClass &&
+                        (listenerMethodName =3D=3D null ? descriptor.listene=
rMethodName =3D=3D null : listenerMethodName.equals(descriptor.listenerMethod=
Name)) &&
+                        methodName.equals(descriptor.methodName)) {
+                    return descriptor.eventListener;
+                }
+            }
+        }
+
+        // else we need to create a new listener
+        final EventListenerDescriptor descriptor =3D new EventListenerDescri=
ptor();
+        descriptor.listenerClass =3D listenerClass;
+        descriptor.listenerMethodName =3D listenerMethodName;
+        descriptor.methodName =3D methodName;
+        try {
+            final List<Method> listenerMethods =3D Arrays.asList(listenerCla=
ss.getMethods());
+            Method listenerMethod =3D null;
+            if (listenerMethodName !=3D null) {
+                for (Method listenerMethod1 : listenerMethods) {
+                    if ((listenerMethod1).getName().equals(listenerMethodNam=
e)) {
+                        listenerMethod =3D listenerMethod1;
+                        break;
+                    }
+                }
+            }
+            if (listenerMethodName !=3D null && listenerMethod =3D=3D null) {
+                throw new IllegalArgumentException("no method named " + list=
enerMethodName + " found in class " + listenerClass.getName());
+            }
+            Class[] parameterTypes =3D listenerMethods.get(0).getParameterTy=
pes();
+            Class<?> methodContainerClass =3D methodContainer.getClass();
+            final Method targetMethod =3D methodContainerClass.getMethod(met=
hodName, parameterTypes);
+            descriptor.eventListener =3D Proxy.newProxyInstance(listenerClas=
s.getClassLoader(),
+                    new Class[]{listenerClass},
+                    new InvocationHandler() {
+                        public Object invoke(Object proxy, Method method, Ob=
ject[] args) {
+                            String methodName =3D method.getName();
+                            if ((listenerMethodName =3D=3D null && listenerM=
ethods.contains(method)) || methodName.equals(listenerMethodName)) {
+                                try {
+                                    return targetMethod.invoke(methodContain=
er, args);
+                                }
+                                catch (IllegalAccessException e) {
+                                    throw new RuntimeException(e);
+                                }
+                                catch (InvocationTargetException e) {
+                                    throw new RuntimeException(e);
+                                }
+                            }
+                            if (methodName.equals("toString")) {
+                                return toString();
+                            }
+                            if (methodName.equals("equals")) {
+                                return descriptor.eventListener =3D=3D args[=
0];
+                            }
+                            if (methodName.equals("hashCode")) {
+                                return hashCode();
+                            }
+                            return null;
+                        }
+                    });
+            descriptors.add(descriptor);
+            return descriptor.eventListener;
+        }
+        catch (NoSuchMethodException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+
+    public static Object getEventListener(Class<? extends EventListener> lis=
tenerClass, final Object methodContainer, final String methodName) {
+        return getEventListener(listenerClass, null, methodContainer, method=
Name);
+    }
+
+
+    public static DataBindingUpdateListener getDataBindingUpdateListener(JAX=
XObject object, String bindingName) {
+        WeakReference<List<DataBindingUpdateListener>> ref =3D dataBindingUp=
dateListeners.get(object);
+        List<DataBindingUpdateListener> listeners =3D ref =3D=3D null ? null=
 : ref.get();
+        if (listeners =3D=3D null) {
+            listeners =3D new ArrayList<DataBindingUpdateListener>();
+            dataBindingUpdateListeners.put(object, new WeakReference<List<Da=
taBindingUpdateListener>>(listeners));
+        } else {
+            for (DataBindingUpdateListener listener : listeners) {
+                if (bindingName.equals(listener.getBindingName())) {
+                    return listener;
+                }
+            }
+        }
+        DataBindingUpdateListener listener =3D new DataBindingUpdateListener=
(object, bindingName);
+        listeners.add(listener);
+        return listener;
+    }
+
+
+    public static void setComponentWidth(Component component, int width) {
+        component.setSize(width, component.getHeight());
+        if (component instanceof JComponent) {
+            JComponent jcomponent =3D (JComponent) component;
+            jcomponent.setPreferredSize(new Dimension(width, jcomponent.getP=
referredSize().height));
+            jcomponent.setMinimumSize(new Dimension(width, jcomponent.getPre=
ferredSize().height));
+            if (jcomponent.isDisplayable()) {
+                jcomponent.revalidate();
+            }
+        }
+    }
+
+
+    public static void setComponentHeight(Component component, int height) {
+        component.setSize(component.getWidth(), height);
+        if (component instanceof JComponent) {
+            JComponent jcomponent =3D (JComponent) component;
+            jcomponent.setPreferredSize(new Dimension(jcomponent.getPreferre=
dSize().width, height));
+            jcomponent.setMinimumSize(new Dimension(jcomponent.getPreferredS=
ize().width, height));
+            if (jcomponent.isDisplayable()) {
+                jcomponent.revalidate();
+            }
+        }
+    }
+
+
+    public static boolean assignment(boolean value, String name, JAXXObject =
src) {
+        src.firePropertyChange(name.trim(), null, "dummy value");
+        return value;
+    }
+
+
+    public static byte assignment(byte value, String name, JAXXObject src) {
+        src.firePropertyChange(name.trim(), null, "dummy value");
+        return value;
+    }
+
+
+    public static short assignment(short value, String name, JAXXObject src)=
 {
+        src.firePropertyChange(name.trim(), null, "dummy value");
+        return value;
+    }
+
+
+    public static int assignment(int value, String name, JAXXObject src) {
+        src.firePropertyChange(name.trim(), null, "dummy value");
+        return value;
+    }
+
+
+    public static long assignment(long value, String name, JAXXObject src) {
+        src.firePropertyChange(name.trim(), null, "dummy value");
+        return value;
+    }
+
+
+    public static float assignment(float value, String name, JAXXObject src)=
 {
+        src.firePropertyChange(name.trim(), null, "dummy value");
+        return value;
+    }
+
+
+    public static double assignment(double value, String name, JAXXObject sr=
c) {
+        src.firePropertyChange(name.trim(), null, "dummy value");
+        return value;
+    }
+
+
+    public static char assignment(char value, String name, JAXXObject src) {
+        src.firePropertyChange(name.trim(), null, "dummy value");
+        return value;
+    }
+
+
+    public static java.lang.Object assignment(java.lang.Object value, String=
 name, JAXXObject src) {
+        src.firePropertyChange(name.trim(), null, "dummy value");
+        return value;
+    }
+
+    /**
+     * recherche les composants portant le meme nom que les champs de la cla=
sse
+     * clazz. Cette methode est statique pour pouvoir eventuellement l'utili=
ser
+     * dans un autre context (je pense par exemple a la generation jaxx).
+     * <p/>
+     * <p/>
+     * Si la recherche echoue pour quelque raison que se soit, aucune except=
ion
+     * n'est leve, et la map retournee est tout simplement vide ou incomplete
+     *
+     * @param clazz     la classe ou recherche les champs
+     * @param container le container ou rechercher les composants d'edition
+     * @return le dictionnaire des composants recherches.
+     */
+    public static Map<String, JComponent> lookingForEditor(Class clazz, Cont=
ainer container) {
+        Map<String, JComponent> result =3D new HashMap<String, JComponent>();
+        try {
+            // looking for all component with name set
+            Map<String, JComponent> allNamedComponent =3D new HashMap<String=
, JComponent>();
+            List<Container> todo =3D new LinkedList<Container>();
+            todo.add(container);
+            while (todo.size() > 0) {
+                for (ListIterator<Container> i =3D todo.listIterator(); i.ha=
sNext();) {
+                    Container parent =3D i.next();
+                    i.remove();
+                    for (Component c : parent.getComponents()) {
+                        if (c instanceof Container) {
+                            i.add((Container) c);
+                            String name =3D c.getName();
+                            if (c instanceof JComponent &&
+                                    name !=3D null && !"".equals(name)) {
+                                allNamedComponent.put(name, (JComponent) c);
+                            }
+                        }
+                    }
+                }
+            }
+
+            // looking for all properties on class
+            BeanInfo info =3D Introspector.getBeanInfo(clazz);
+            PropertyDescriptor[] props =3D info.getPropertyDescriptors();
+
+            // find if one properties have same name that component
+            for (PropertyDescriptor prop : props) {
+                String name =3D prop.getName();
+                if (allNamedComponent.containsKey(name)) {
+                    result.put(name, allNamedComponent.get(name));
+                }
+            }
+
+        } catch (IntrospectionException eee) {
+            log.warn("Can't introspect bean", eee);
+        }
+
+        if (log.isDebugEnabled()) {
+            log.debug("Result: " + result);
+        }
+
+        return result;
+    }
+
+    /**
+     * Box a component in a {@link org.jdesktop.jxlayer.JXLayer}.
+     *
+     * @param component the component to box
+     * @return the {@link org.jdesktop.jxlayer.JXLayer} boxing the component
+     */
+    public static JXLayer boxComponentWithJxLayer(JComponent component) {
+        JXLayer layer =3D new org.jdesktop.jxlayer.JXLayer();
+        layer.add(component);
+        return layer;
+    }
+}

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator (fr=
om rev 957, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/validator)

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Bea=
nValidator.java (from rev 980, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/r=
untime/validator/BeanValidator.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/BeanVal=
idator.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/BeanVal=
idator.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,402 @@
+/* *##%
+ *  Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version 2
+ *  of the License, or (at your option) any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
+ *  USA.
+ *##%*/
+
+package jaxx.runtime.validator;
+
+
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.ValidationAware;
+import com.opensymphony.xwork2.ValidationAwareSupport;
+import com.opensymphony.xwork2.config.Configuration;
+import com.opensymphony.xwork2.config.ConfigurationManager;
+import com.opensymphony.xwork2.util.ValueStack;
+import com.opensymphony.xwork2.util.ValueStackFactory;
+import com.opensymphony.xwork2.validator.ActionValidatorManager;
+import com.opensymphony.xwork2.validator.DelegatingValidatorContext;
+import com.opensymphony.xwork2.validator.ValidationException;
+import jaxx.runtime.validator.ui.AbstractBeanValidatorUI;
+import jaxx.runtime.validator.ui.IconValidationUI;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.jxlayer.JXLayer;
+
+import javax.swing.JComponent;
+import javax.swing.SwingUtilities;
+import java.awt.Container;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * <p/>
+ * Permet d'ajouter facilement le support de la validation des champs d'un
+ * bean et de le relier a une interface graphique.
+ * Utilise xwork pour la validation et JXLayer pour la visualisation.
+ * <p/>
+ * <p/>
+ * Le mieux pour son integration dans Jaxx est de faire de la generation pour
+ * force la compilation du code suivant:
+ * <p/>
+ * <pre>
+ * myValidor.getBean().get<field>();
+ * </pre>
+ * <p/>
+ * et ceci pour chaque field ajoute a la map fieldRepresentation. De cette
+ * facon meme si le champs field est en texte on a une verification de son
+ * existance a la compilation.
+ * <p/>
+ * <p/>
+ * La representation en tag pourrait etre
+ * <pre>
+ * &lt;validator id=3D"myValidator" beanClass=3D"{Personne.class}" errorList=
=3D"$list"&gt;
+ *   &lt;field name=3D"name" component=3D"$name"/&gt;
+ *   &lt;field name=3D"firstName" component=3D"$firstName"/&gt;
+ *   &lt;field name=3D"birthDate" component=3D"$birthDate"/&gt;
+ * &lt;/validator>
+ * &lt;validator beanClass=3D"{Personne.class}" autoField=3D"true" errorList=
=3D"$list"&gt;
+ *   &lt;fieldRepresentation name=3D"name" component=3D"$lastName"/&gt;
+ * &lt;/validator&gt;
+ * </pre>
+ * <p/>
+ * dans le premier exemple on fait un mapping explicite des champs, mais on =
voit
+ * que le nom du composant graphique est le meme que celui du champs. Pour e=
viter
+ * de longue saisie, il est possible d'utiliser le flag <b>autoField</b>
+ * qui pour chaque champs du ayant une methode get du bean recherche un comp=
osant
+ * avec cet Id. Il est aussi possible de surcharge un champs explicitement
+ * comme ici name, dans le cas ou le composant qui porterait ce nom serait
+ * utilise pour autre chose.
+ * <p/>
+ * <p/>
+ * Il faut un handler particulier pour ce composant car les attributs
+ * <b>beanClass</b> et <b>autoField</b> ne sont present que dans le XML jaxx=
 et
+ * servent a la generation. Il faut aussi prendre en compte les elements
+ * fieldRepresentation fils du tag validator.
+ * <p/>
+ * <p/>
+ * Voici ce que pourrait etre le code genere par jaxx
+ * <pre>
+ * // declaration du bean
+ * BeanValidator<beanClass> $myValidator;
+ * // init du bean
+ * protected void createMyValidator() {
+ *   $myValidator =3D new BeanValidator<beanClass>();
+ *   // genere seulement si autoField =3D true
+ *   for (Method m : beanClass.getMethod()) {
+ *     if (m.getName().startsWith("get")) {
+ *       String fieldName =3D m.getName().substring(3).toLowerCase();
+ *       $myValidator.setFieldRepresentation(fieldName, $objectMap.get(field=
Name));
+ *     }
+ *   }
+ *   // pour chaque tag fieldRepresentation
+ *   myValidator.setFieldRepresentation("name", $lastName);
+ *   // si beanClass est specifie et n'est pas Object, on force l'acces au c=
hamps
+ *   // pour validation a la compilation
+ *   $myValidator.getBean().getName();
+ *   $objectMap.put("myValidator", $myValidator);
+ * }
+ * </pre>
+ *
+ * @author poussin
+ * @version $Revision$
+ *          <p/>
+ *          Last update: $Date$
+ *          by : $Author$
+ */
+public class BeanValidator<T> {
+
+    /** to use log facility, just put in your code: log.info(\"...\"); */
+    static private final Log log =3D LogFactory.getLog(BeanValidator.class);
+
+    static private final Class<? extends AbstractBeanValidatorUI> DEFAULT_UI=
_CLASS =3D IconValidationUI.class;
+
+    protected PropertyChangeSupport pcs;
+
+    protected ValidationAwareSupport validationSupport;
+    protected DelegatingValidatorContext validationContext;
+
+    protected transient ActionValidatorManager validator;
+
+    /** indique si le bean a ete modifie depuis son arrivee */
+    protected boolean changed =3D false;
+
+    /** le bean a surveiller */
+    protected T bean =3D null;
+
+    /** l'objet qui recoit les notifications de modification du bean */
+    protected Listener l =3D new Listener();
+
+    /** permet de faire le lien en un champs du bean et l'objet qui permet d=
e l'editer */
+    protected Map<String, JComponent> fieldRepresentation;
+
+    /** Object servant a contenir la liste des erreurs */
+    protected BeanValidatorErrorListModel errorListModel;
+
+    protected Class<? extends AbstractBeanValidatorUI> uiClass;
+
+    public BeanValidator() {
+        pcs =3D new PropertyChangeSupport(this);
+        validationSupport =3D new ValidationAwareSupport();
+        validationContext =3D new DelegatingValidatorContext(validationSuppo=
rt);
+        fieldRepresentation =3D new HashMap<String, JComponent>();
+    }
+
+    public BeanValidatorErrorListModel getErrorListModel() {
+        return errorListModel;
+    }
+
+    public void setErrorListModel(BeanValidatorErrorListModel errorListModel=
) {
+        this.errorListModel =3D errorListModel;
+        if (errorListModel !=3D null) {
+            errorListModel.registerValidator(this);
+        }
+    }
+
+    /**
+     * Permet d'indiquer le composant graphique responsable de l'affichage
+     * d'un attribut du bean
+     *
+     * @param fieldname the field name in the bean
+     * @param c         the editor component for the field
+     */
+    public void setFieldRepresentation(String fieldname, JComponent c) {
+        fieldRepresentation.put(fieldname, c);
+        //todo we do not want at this moment to add something in ui, since u=
i is perharps not useable
+        //todo prefer to use the method installUIs
+        //JComponent old =3D fieldRepresentation.put(fieldname, c);
+        //setErrorRepresentation(fieldname, old, c, uiClass);
+    }
+
+    public void setFieldRepresentation(Map<String, JComponent> fieldRepresen=
tation) {
+        for (Map.Entry<String, JComponent> e : fieldRepresentation.entrySet(=
)) {
+            setFieldRepresentation(e.getKey(), e.getValue());
+        }
+    }
+
+    public JComponent getFieldRepresentation(String fieldname) {
+        return fieldRepresentation.get(fieldname);
+    }
+
+    /**
+     * Retourne vrai si l'objet bean a ete modifie depuis le dernier
+     * {@link #setBean}
+     *
+     * @return <code>true</code> if bean was modify since last {@link #setBe=
an(Object)} invocation
+     */
+    public boolean isChanged() {
+        return changed;
+    }
+
+    /**
+     * Permet de force la remise a false de l'etat de changement du bean
+     *
+     * @param changed flag to force reset of property {@link #changed}
+     */
+    public void setChanged(boolean changed) {
+        boolean oldChanged =3D this.changed;
+        this.changed =3D changed;
+        pcs.firePropertyChange("changed", oldChanged, changed);
+    }
+
+    public T getBean() {
+        return bean;
+    }
+
+    public void setBean(T bean) {
+        T oldBean =3D this.bean;
+        if (this.bean !=3D null) {
+            try {
+                Method method =3D this.bean.getClass().getMethod("removeProp=
ertyChangeListener", PropertyChangeListener.class);
+                method.invoke(this.bean, l);
+            } catch (Exception eee) {
+                log.info("Can't register as listener", eee);
+            }
+        }
+        this.bean =3D bean;
+        if (this.bean !=3D null) {
+            try {
+                Method method =3D this.bean.getClass().getMethod("addPropert=
yChangeListener", PropertyChangeListener.class);
+                method.invoke(this.bean, l);
+            } catch (Exception eee) {
+                log.info("Can't register as listener", eee);
+            }
+        }
+        validate();
+        pcs.firePropertyChange("bean", oldBean, bean);
+    }
+
+    public Class<? extends AbstractBeanValidatorUI> getUiClass() {
+        return uiClass;
+    }
+
+    public void setUiClass(Class<? extends AbstractBeanValidatorUI> uiClass)=
 {
+        this.uiClass =3D uiClass;
+    }
+
+    /** @return <code>true</code> if errors are detected, <code>false</code>=
 otherwise */
+    public boolean hasErrors() {
+        //todo should also detecte actionErrors ?
+        return validationContext.hasFieldErrors();
+        //return validationContext.hasFieldErrors() || validationContext.has=
ActionErrors();
+    }
+
+    public Map getFieldErrors() {
+        return validationContext.getFieldErrors();
+    }
+
+    public Collection getActionErrors() {
+        return validationContext.getActionErrors();
+    }
+
+    public Collection getActionMessages() {
+        return validationContext.getActionMessages();
+    }
+
+    /** install ui on required components */
+    public void installUIs() {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                if (uiClass =3D=3D null) {
+                    // use the default one
+                    uiClass =3D DEFAULT_UI_CLASS;
+                }
+                for (String fieldname : fieldRepresentation.keySet()) {
+                    try {
+                        setErrorRepresentation(fieldname, null, fieldReprese=
ntation.get(fieldname), uiClass);
+                    } catch (Exception e) {
+                        throw new RuntimeException(e);
+                    }
+                }
+            }
+        });
+
+    }
+
+    /**
+     * il faut eviter le code re-intrant (durant une validation, une autre e=
st
+     * demandee). Pour cela on fait la validation dans un thread, et tant
+     * que la premiere validation n'est pas fini, on ne repond pas aux
+     * solicitations.
+     * Cette method est public pour permettre de force une validation par
+     * programmation, ce qui est utile par exemple si le bean ne supporte
+     * pas les {@link PropertyChangeListener}
+     */
+    public void validate() {
+        // on ne valide que si il y a un bean et que le resultat de la valid=
ation
+        // pourra etre affiche quelque part
+        if (bean =3D=3D null || getErrorListModel() =3D=3D null || fieldRepr=
esentation.size() =3D=3D 0) {
+            return;
+        }
+
+        try {
+
+            validationSupport.clearErrorsAndMessages();
+
+            getValidator().validate(bean, null, validationContext);
+
+            if (log.isDebugEnabled()) {
+                log.debug("Action errors: " + validationContext.getActionErr=
ors());
+                log.debug("Action messages: " + validationContext.getActionM=
essages());
+                log.debug("Field errors: " + validationContext.getFieldError=
s());
+            }
+
+            log.info(this + " : " + validationContext.getFieldErrors());
+
+            // add errors
+            errorListModel.addErrors(this);
+
+            for (String fieldname : fieldRepresentation.keySet()) {
+                JComponent c =3D fieldRepresentation.get(fieldname);
+                //todo:  a supprimer mais actuellemnt le layer ne se repaint=
 pas bien, cela n'est pas normal
+                if (c.getParent() !=3D null) {
+                    c.getParent().repaint();
+                }
+            }
+        } catch (ValidationException eee) {
+            log.warn("Error during validation", eee);
+        }
+    }
+
+    protected ActionValidatorManager getValidator() {
+        if (validator =3D=3D null) {
+            ConfigurationManager confManager =3D new ConfigurationManager();
+            Configuration conf =3D confManager.getConfiguration();
+
+            ValueStackFactory vsf =3D conf.getContainer().getInstance(
+                    ValueStackFactory.class);
+            ValueStack vs =3D vsf.createValueStack();
+            ActionContext context =3D new ActionContext(vs.getContext());
+            ActionContext.setContext(context);
+
+            validator =3D conf.getContainer().getInstance(
+                    ActionValidatorManager.class, "no-annotations");
+        }
+        return validator;
+    }
+
+    protected void setErrorRepresentation(String fieldname, JComponent old, =
JComponent c, Class<? extends AbstractBeanValidatorUI> uiClass) throws Invoca=
tionTargetException, IllegalAccessException, InstantiationException, NoSuchMe=
thodException {
+        if (old !=3D c) {
+            if (old !=3D null) {
+                // suppression du jxlayer sous l'ancien composant
+                Container container =3D old.getParent();
+                if (container instanceof JXLayer) {
+                    JXLayer<?> jx =3D (JXLayer<?>) container;
+                    jx.setUI(null);
+                }
+            }
+            if (c !=3D null) {
+                // ajout du jxlayer sous ce composant
+                Container container =3D c.getParent();
+                if (container instanceof JXLayer) {
+                    Constructor<? extends AbstractBeanValidatorUI> cons =3D =
uiClass.getConstructor(String.class, String.class, ValidationAware.class);
+                    AbstractBeanValidatorUI ui =3D cons.newInstance(fieldnam=
e, c.getName(), validationSupport);
+                    ui.setEnabled(true);
+                    JXLayer<JComponent> jx =3D (JXLayer<JComponent>) contain=
er;
+                    jx.setUI(ui);
+                }
+            }
+        }
+    }
+
+    protected class Listener implements PropertyChangeListener {
+
+        public void propertyChange(PropertyChangeEvent evt) {
+            // only validate if the property has really changed...
+            Object oldValue =3D evt.getOldValue();
+            Object newValue =3D evt.getNewValue();
+            if (oldValue =3D=3D null && newValue =3D=3D null) {
+                return;
+            }
+            if ((oldValue !=3D null && oldValue.equals(newValue)) || (newVal=
ue !=3D null && newValue.equals(oldValue))) {
+                return;
+            }
+            if (log.isDebugEnabled()) {
+                log.debug("launch validation from event [name:" + evt.getPro=
pertyName() + " <old:" + oldValue + ", new:" + newValue + ">]");
+            }
+            validate();
+            setChanged(true);
+        }
+    }
+
+}

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Bea=
nValidatorError.java (from rev 958, lutinjaxx/trunk/jaxx-core/src/main/java/j=
axx/runtime/validator/BeanValidatorError.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/BeanVal=
idatorError.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/BeanVal=
idatorError.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,83 @@
+package jaxx.runtime.validator;
+
+import org.codelutin.i18n.I18n;
+
+import javax.swing.JComponent;
+
+/**
+ * The model of an error.
+ *
+ * @author chemit
+ */
+public class BeanValidatorError<T> {
+
+    protected BeanValidator<T> validator;
+
+    protected String fieldName;
+
+    protected String error;
+
+    protected JComponent component;
+
+    public BeanValidator<T> getValidator() {
+        return validator;
+    }
+
+    public String getFieldName() {
+        return fieldName;
+    }
+
+    public String getError() {
+        return error;
+    }
+
+    public JComponent getComponent() {
+        return component;
+    }
+
+    public void setValidator(BeanValidator<T> validator) {
+        this.validator =3D validator;
+    }
+
+    public void setFieldName(String fieldName) {
+        this.fieldName =3D fieldName;
+    }
+
+    public void setError(String error) {
+        this.error =3D error;
+    }
+
+    public void setComponent(JComponent component) {
+        this.component =3D component;
+    }
+
+    @Override
+    public String toString() {
+        return component.getName() + " : " + I18n._(error);
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this =3D=3D o) {
+            return true;
+        }
+        if (!(o instanceof BeanValidatorError)) {
+            return false;
+        }
+
+        BeanValidatorError that =3D (BeanValidatorError) o;
+
+        return component.equals(that.component) && error.equals(that.error) =
&& fieldName.equals(that.fieldName) && validator.equals(that.validator);
+
+    }
+
+    @Override
+    public int hashCode() {
+        int result;
+        result =3D validator.hashCode();
+        result =3D 31 * result + fieldName.hashCode();
+        result =3D 31 * result + error.hashCode();
+        result =3D 31 * result + component.hashCode();
+        return result;
+    }
+}

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Bea=
nValidatorErrorListModel.java (from rev 958, lutinjaxx/trunk/jaxx-core/src/ma=
in/java/jaxx/runtime/validator/BeanValidatorErrorListModel.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/BeanVal=
idatorErrorListModel.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/BeanVal=
idatorErrorListModel.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,140 @@
+package jaxx.runtime.validator;
+
+import javax.swing.DefaultListModel;
+import javax.swing.JComponent;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The model of the list of errors
+ *
+ * @author chemit
+ */
+public class BeanValidatorErrorListModel extends DefaultListModel {
+    private static final long serialVersionUID =3D 1L;
+
+    /** list of registred validators */
+    protected transient List<BeanValidator<?>> validators;
+
+    /** comporatorof errors */
+    protected transient Comparator<BeanValidatorError> comparator;
+
+    public BeanValidatorErrorListModel() {
+        validators =3D new ArrayList<BeanValidator<?>>();
+    }
+
+    public void registerValidator(BeanValidator<?> validator) {
+        if (validators.contains(validator)) {
+            throw new IllegalArgumentException("the validator " + validator =
+ " is already registred in " + this);
+        }
+        validators.add(validator);
+    }
+
+    public <T> void addErrors(BeanValidator<T> validator) {
+        if (!validators.contains(validator)) {
+            throw new IllegalArgumentException("the validator " + validator =
+ " is not registred in " + this);
+        }
+
+        // new errors for the given validator
+        List<BeanValidatorError> newErrors =3D new ArrayList<BeanValidatorEr=
ror>();
+        // old errors for the given validator
+        List<BeanValidatorError> oldErrors =3D new ArrayList<BeanValidatorEr=
ror>();
+        // old errors for other validators
+        List<BeanValidatorError> oldOtherErrors =3D new ArrayList<BeanValida=
torError>();
+
+        // split old errors from other validators
+        splitOldErrors(validator, oldErrors, oldOtherErrors);
+
+        // fill new errors
+        fillNewErrors(validator, newErrors);
+
+        // check if something has changed for the given validator
+        if (hasChanged(oldErrors, newErrors)) {
+
+            // reinject other errors
+            newErrors.addAll(oldOtherErrors);
+
+            // sort errors
+            Collections.sort(newErrors, getComparator());
+
+            // clean errors in model
+            clear();
+
+            // reinject in list model, all the errors
+            for (BeanValidatorError error : newErrors) {
+                addElement(error);
+            }
+
+            // notify thaht the model has changed
+            fireContentsChanged(this, 0, getSize() - 1);
+        }
+    }
+
+    protected boolean hasChanged(List<BeanValidatorError> oldErrors, List<Be=
anValidatorError> newErrors) {
+        if (oldErrors.size() !=3D newErrors.size()) {
+            return true;
+        }
+        for (BeanValidatorError oldError : oldErrors) {
+            if (!newErrors.contains(oldError)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    protected <T> void fillNewErrors(BeanValidator<T> validator, List<BeanVa=
lidatorError> newErrors) {
+        if (validator.hasErrors()) {
+            // inject this validator errors
+            for (Object o : validator.getFieldErrors().entrySet()) {
+                Map.Entry<?, ?> r =3D (Map.Entry<?, ?>) o;
+                BeanValidatorError<T> error;
+                String field =3D (String) r.getKey();
+
+                JComponent component =3D validator.getFieldRepresentation(fi=
eld);
+                if (component!=3Dnull) {
+                    for (Object errorString : (List<?>) r.getValue()) {
+                        String error1 =3D (String) errorString;
+                        error =3D new BeanValidatorError<T>();
+                        error.setComponent(component);
+                        error.setValidator(validator);
+                        error.setError(error1);
+                        error.setFieldName(field);
+                        newErrors.add(error);
+                    }
+                }
+            }
+            //todo should also do actionErrors
+        }
+    }
+
+    protected <T> void splitOldErrors(BeanValidator<T> validator, List<BeanV=
alidatorError> oldErrors, List<BeanValidatorError> oldOtherErrors) {
+        Enumeration enumeration =3D elements();
+
+        while (enumeration.hasMoreElements()) {
+            Object o =3D enumeration.nextElement();
+            BeanValidatorError<?> error =3D (BeanValidatorError) o;
+            if (!error.getValidator().equals(validator)) {
+                // error from another validator, keep it
+                oldOtherErrors.add(error);
+            } else {
+                oldErrors.add(error);
+            }
+        }
+    }
+
+    protected Comparator<BeanValidatorError> getComparator() {
+        if (comparator =3D=3D null) {
+            comparator =3D new Comparator<BeanValidatorError>() {
+                public int compare(BeanValidatorError o1, BeanValidatorError=
 o2) {
+                    return o1.toString().compareTo(o2.toString());
+                }
+            };
+        }
+        return comparator;
+    }
+
+}

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Exi=
stingDirectoryFieldValidator.java (from rev 981, lutinjaxx/trunk/jaxx-core/sr=
c/main/java/jaxx/runtime/validator/ExistingDirectoryFieldValidator.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Existin=
gDirectoryFieldValidator.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Existin=
gDirectoryFieldValidator.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,72 @@
+package jaxx.runtime.validator;
+
+import com.opensymphony.xwork2.validator.ValidationException;
+import com.opensymphony.xwork2.validator.validators.FieldValidatorSupport;
+
+import java.io.File;
+
+/**
+ * <!-- START SNIPPET: javadoc -->
+ * ExistingDirectoryFieldValidator checks that a File field exists and is a =
directory.
+ * <!-- END SNIPPET: javadoc -->
+ * <p/>
+ * <p/>
+ * <!-- START SNIPPET: parameters -->
+ * <ul>
+ * <li>fieldName - The field name this validator is validating. Required if =
using Plain-Validator Syntax otherwise not required</li>
+ * </ul>
+ * <!-- END SNIPPET: parameters -->
+ * <p/>
+ * <p/>
+ * <pre>
+ * <!-- START SNIPPET: examples -->
+ *     &lt;validators&gt;
+ *         &lt;!-- Plain-Validator Syntax --&gt;
+ *         &lt;validator type=3D"existingDirectory"&gt;
+ *             &lt;param name=3D"fieldName"&gt;tmp&lt;/param&gt;
+ *             &lt;message&gt;tmp is not an existing directory&lt;/message&g=
t;
+ *         &lt;/validator&gt;
+ * <p/>
+ *         &lt;!-- Field-Validator Syntax --&gt;
+ *         &lt;field name=3D"tmp"&gt;
+ *         	  &lt;field-validator type=3D"existingDirectory"&gt;
+ *                 &lt;message&gt;tmp is not an existing directory&lt;/messa=
ge&gt;
+ *            &lt;/field-validator&gt;
+ *         &lt;/field&gt;
+ *     &lt;/validators&gt;
+ * <!-- END SNIPPET: examples -->
+ * </pre>
+ *
+ * @author chemit
+ */
+public class ExistingDirectoryFieldValidator extends FieldValidatorSupport {
+
+    public void validate(Object object) throws ValidationException {
+        String fieldName =3D getFieldName();
+        Object value =3D this.getFieldValue(fieldName, object);
+        if (value=3D=3Dnull) {
+            // no value defined
+            addFieldError(fieldName, object);
+            return;
+        }
+        File f;
+        if (value instanceof File) {
+            f =3D (File) value;
+        } else if (value instanceof String) {
+            f =3D new File((String) value);
+        } else {
+            addFieldError(fieldName, object);
+            return;
+        }
+
+        if (!(f.isDirectory() && f.exists())) {
+            // f is not a directory, nor exists
+            addFieldError(fieldName, object);
+        }
+    }
+
+    @Override
+    public String getValidatorType() {
+        return "existingDirectory";
+    }
+}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Exi=
stingFileFieldValidator.java (from rev 981, lutinjaxx/trunk/jaxx-core/src/mai=
n/java/jaxx/runtime/validator/ExistingFileFieldValidator.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Existin=
gFileFieldValidator.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Existin=
gFileFieldValidator.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,72 @@
+package jaxx.runtime.validator;
+
+import com.opensymphony.xwork2.validator.ValidationException;
+import com.opensymphony.xwork2.validator.validators.FieldValidatorSupport;
+
+import java.io.File;
+
+/**
+ * <!-- START SNIPPET: javadoc -->
+ * ExistingFileFieldValidator checks that a File field exists. *
+ * <!-- END SNIPPET: javadoc -->
+ * <p/>
+ * <p/>
+ * <!-- START SNIPPET: parameters -->
+ * <ul>
+ * <li>fieldName - The field name this validator is validating. Required if =
using Plain-Validator Syntax otherwise not required</li>
+ * </ul>
+ * <!-- END SNIPPET: parameters -->
+ * <p/>
+ * <p/>
+ * <pre>
+ * <!-- START SNIPPET: examples -->
+ *     &lt;validators&gt;
+ *         &lt;!-- Plain-Validator Syntax --&gt;
+ *         &lt;validator type=3D"fileExisting"&gt;
+ *             &lt;param name=3D"fieldName"&gt;tmp&lt;/param&gt;
+ *             &lt;message&gt;tmp is not an existing file&lt;/message&gt;
+ *         &lt;/validator&gt;
+ * <p/>
+ *         &lt;!-- Field-Validator Syntax --&gt;
+ *         &lt;field name=3D"tmp"&gt;
+ *         	  &lt;field-validator type=3D"fileExisting"&gt;
+ *                 &lt;message&gt;tmp is not an existing file&lt;/message&gt;
+ *            &lt;/field-validator&gt;
+ *         &lt;/field&gt;
+ *     &lt;/validators&gt;
+ * <!-- END SNIPPET: examples -->
+ * </pre>
+ *
+ * @author chemit
+ */
+public class ExistingFileFieldValidator extends FieldValidatorSupport {
+
+    public void validate(Object object) throws ValidationException {
+        String fieldName =3D getFieldName();
+        Object value =3D this.getFieldValue(fieldName, object);
+        if (value =3D=3D null) {
+            // no value defined
+            addFieldError(fieldName, object);
+            return;
+        }
+        File f;
+        if (value instanceof File) {
+            f =3D (File) value;
+        } else if (value instanceof String) {
+            f =3D new File((String) value);
+        } else {
+            addFieldError(fieldName, object);
+            return;
+        }
+
+        if (!(f.isFile() && f.exists())) {
+            // f is  not a file nor exists
+            addFieldError(fieldName, object);
+        }
+    }
+
+    @Override
+    public String getValidatorType() {
+        return "existingFile";
+    }
+}

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Not=
ExistingDirectoryFieldValidator.java (from rev 981, lutinjaxx/trunk/jaxx-core=
/src/main/java/jaxx/runtime/validator/NotExistingDirectoryFieldValidator.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/NotExis=
tingDirectoryFieldValidator.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/NotExis=
tingDirectoryFieldValidator.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,72 @@
+package jaxx.runtime.validator;
+
+import com.opensymphony.xwork2.validator.ValidationException;
+import com.opensymphony.xwork2.validator.validators.FieldValidatorSupport;
+
+import java.io.File;
+
+/**
+ * <!-- START SNIPPET: javadoc -->
+ * NotExistingDirectoryFieldValidator checks that a File field as a director=
y does not exist. *
+ * <!-- END SNIPPET: javadoc -->
+ * <p/>
+ * <p/>
+ * <!-- START SNIPPET: parameters -->
+ * <ul>
+ * <li>fieldName - The field name this validator is validating. Required if =
using Plain-Validator Syntax otherwise not required</li>
+ * </ul>
+ * <!-- END SNIPPET: parameters -->
+ * <p/>
+ * <p/>
+ * <pre>
+ * <!-- START SNIPPET: examples -->
+ *     &lt;validators&gt;
+ *         &lt;!-- Plain-Validator Syntax --&gt;
+ *         &lt;validator type=3D"notExistingDirectory"&gt;
+ *             &lt;param name=3D"fieldName"&gt;tmp&lt;/param&gt;
+ *             &lt;message&gt;tmp is an existing directory&lt;/message&gt;
+ *         &lt;/validator&gt;
+ * <p/>
+ *         &lt;!-- Field-Validator Syntax --&gt;
+ *         &lt;field name=3D"tmp"&gt;
+ *         	  &lt;field-validator type=3D"notExistingDirectory"&gt;
+ *                 &lt;message&gt;tmp is an existing directory&lt;/message&g=
t;
+ *            &lt;/field-validator&gt;
+ *         &lt;/field&gt;
+ *     &lt;/validators&gt;
+ * <!-- END SNIPPET: examples -->
+ * </pre>
+ *
+ * @author chemit
+ */
+public class NotExistingDirectoryFieldValidator extends FieldValidatorSuppor=
t {
+
+    @Override
+    public void validate(Object object) throws ValidationException {
+        String fieldName =3D getFieldName();
+        Object value =3D this.getFieldValue(fieldName, object);
+        if (value =3D=3D null) {
+            // no value defined
+            addFieldError(fieldName, object);
+            return;
+        }
+        File f;
+        if (value instanceof File) {
+            f =3D (File) value;
+        } else if (value instanceof String) {
+            f =3D new File((String) value);
+        } else {
+            addFieldError(fieldName, object);
+            return;
+        }
+
+        if (f.exists() || f.isFile()) {
+            addFieldError(fieldName, object);
+        }
+    }
+
+    @Override
+    public String getValidatorType() {
+        return "notExistingDirectory";
+    }
+}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Not=
ExistingFileFieldValidator.java (from rev 981, lutinjaxx/trunk/jaxx-core/src/=
main/java/jaxx/runtime/validator/NotExistingFileFieldValidator.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/NotExis=
tingFileFieldValidator.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/NotExis=
tingFileFieldValidator.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,73 @@
+package jaxx.runtime.validator;
+
+import com.opensymphony.xwork2.validator.ValidationException;
+import com.opensymphony.xwork2.validator.validators.FieldValidatorSupport;
+
+import java.io.File;
+
+/**
+ * <!-- START SNIPPET: javadoc -->
+ * NotExistingFileFieldValidator checks that a File field as a file does not=
 exist. *
+ * <!-- END SNIPPET: javadoc -->
+ * <p/>
+ * <p/>
+ * <!-- START SNIPPET: parameters -->
+ * <ul>
+ * <li>fieldName - The field name this validator is validating. Required if =
using Plain-Validator Syntax otherwise not required</li>
+ * </ul>
+ * <!-- END SNIPPET: parameters -->
+ * <p/>
+ * <p/>
+ * <pre>
+ * <!-- START SNIPPET: examples -->
+ *     &lt;validators&gt;
+ *         &lt;!-- Plain-Validator Syntax --&gt;
+ *         &lt;validator type=3D"notExistingFile"&gt;
+ *             &lt;param name=3D"fieldName"&gt;tmp&lt;/param&gt;
+ *             &lt;message&gt;tmp is an existing file&lt;/message&gt;
+ *         &lt;/validator&gt;
+ * <p/>
+ *         &lt;!-- Field-Validator Syntax --&gt;
+ *         &lt;field name=3D"tmp"&gt;
+ *         	  &lt;field-validator type=3D"notExistingFile"&gt;
+ *                 &lt;message&gt;tmp is an existing file&lt;/message&gt;
+ *            &lt;/field-validator&gt;
+ *         &lt;/field&gt;
+ *     &lt;/validators&gt;
+ * <!-- END SNIPPET: examples -->
+ * </pre>
+ *
+ * @author chemit
+ */
+public class NotExistingFileFieldValidator extends FieldValidatorSupport {
+
+    @Override
+    public void validate(Object object) throws ValidationException {
+        String fieldName =3D getFieldName();
+        Object value =3D this.getFieldValue(fieldName, object);
+        if (value=3D=3Dnull) {
+            // no value defined
+            addFieldError(fieldName, object);           =20
+            return;
+        }
+        File f;
+        if (value instanceof File) {
+            f =3D (File) value;
+        } else if (value instanceof String) {
+            f =3D new File((String) value);
+        } else {
+            addFieldError(fieldName, object);
+            return;
+        }
+
+        if (f.exists() || f.isDirectory()) {
+            // f is not a file and exist
+            addFieldError(fieldName, object);
+        }
+    }
+
+    @Override
+    public String getValidatorType() {
+        return "notExistingFile";
+    }
+}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Req=
uiredFileFieldValidator.java (from rev 983, lutinjaxx/trunk/jaxx-core/src/mai=
n/java/jaxx/runtime/validator/RequiredFileFieldValidator.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Require=
dFileFieldValidator.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/Require=
dFileFieldValidator.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,72 @@
+package jaxx.runtime.validator;
+
+import com.opensymphony.xwork2.validator.ValidationException;
+import com.opensymphony.xwork2.validator.validators.FieldValidatorSupport;
+
+import java.io.File;
+
+/**
+ * <!-- START SNIPPET: javadoc -->
+ * RequiredFileFieldValidator checks that a File field is not null nor have =
an empty filename.
+ * <!-- END SNIPPET: javadoc -->
+ * <p/>
+ * <p/>
+ * <!-- START SNIPPET: parameters -->
+ * <ul>
+ * <li>fieldName - The field name this validator is validating. Required if =
using Plain-Validator Syntax otherwise not required</li>
+ * </ul>
+ * <!-- END SNIPPET: parameters -->
+ * <p/>
+ * <p/>
+ * <pre>
+ * <!-- START SNIPPET: examples -->
+ *     &lt;validators&gt;
+ *         &lt;!-- Plain-Validator Syntax --&gt;
+ *         &lt;validator type=3D"requiredFile"&gt;
+ *             &lt;param name=3D"fieldName"&gt;tmp&lt;/param&gt;
+ *             &lt;message&gt;tmp is required&lt;/message&gt;
+ *         &lt;/validator&gt;
+ * <p/>
+ *         &lt;!-- Field-Validator Syntax --&gt;
+ *         &lt;field name=3D"tmp"&gt;
+ *         	  &lt;field-validator type=3D"requiredFile"&gt;
+ *                 &lt;message&gt;tmp is required&lt;/message&gt;
+ *            &lt;/field-validator&gt;
+ *         &lt;/field&gt;
+ *     &lt;/validators&gt;
+ * <!-- END SNIPPET: examples -->
+ * </pre>
+ *
+ * @author chemit
+ */
+public class RequiredFileFieldValidator extends FieldValidatorSupport {
+
+    public void validate(Object object) throws ValidationException {
+        String fieldName =3D getFieldName();
+        Object value =3D this.getFieldValue(fieldName, object);
+        if (value =3D=3D null) {
+            // no value defined
+            addFieldError(fieldName, object);
+            return;
+        }
+        File f;
+        if (value instanceof File) {
+            f =3D (File) value;
+        } else if (value instanceof String) {
+            f =3D new File((String) value);
+        } else {
+            addFieldError(fieldName, object);
+            return;
+        }
+
+        if (f.getPath().trim().isEmpty()) {
+            // f is not a directory nor exists
+            addFieldError(fieldName, object);
+        }
+    }
+
+    @Override
+    public String getValidatorType() {
+        return "requiredFile";
+    }
+}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui =
(from rev 958, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/validator=
/ui)

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui=
/AbstractBeanValidatorUI.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/validator/ui/Abstrac=
tBeanValidatorUI.java	2008-10-17 20:55:15 UTC (rev 958)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui/Abst=
ractBeanValidatorUI.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,33 +0,0 @@
-package jaxx.runtime.validator.ui;
-
-import com.opensymphony.xwork2.ValidationAware;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jdesktop.jxlayer.plaf.AbstractLayerUI;
-
-/**
- * Abstract renderer
- *
- * @author chemit
- */
-public abstract class AbstractBeanValidatorUI extends AbstractLayerUI<javax.=
swing.JComponent> {
-
-    /** to use log facility, just put in your code: log.info(\"...\"); */
-    protected static Log log =3D LogFactory.getLog(AbstractBeanValidatorUI.c=
lass);
-
-    /** bean field */
-    protected String field;
-
-    /** component id */
-    protected String componentId;
-
-    /** validation context */
-    protected ValidationAware validationContext;
-
-    public AbstractBeanValidatorUI(String field,String componentId, Validati=
onAware validationContext) {
-        this.componentId =3D componentId;
-        this.field =3D field;
-        this.validationContext =3D validationContext;
-        log.info("install " + this + "<field:" + field + ", componentId:" + =
componentId + ">");
-    }
-}

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui/=
AbstractBeanValidatorUI.java (from rev 960, lutinjaxx/trunk/jaxx-core/src/mai=
n/java/jaxx/runtime/validator/ui/AbstractBeanValidatorUI.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui/Abst=
ractBeanValidatorUI.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui/Abst=
ractBeanValidatorUI.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,33 @@
+package jaxx.runtime.validator.ui;
+
+import com.opensymphony.xwork2.ValidationAware;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.jxlayer.plaf.AbstractLayerUI;
+
+/**
+ * Abstract renderer
+ *
+ * @author chemit
+ */
+public abstract class AbstractBeanValidatorUI extends AbstractLayerUI<javax.=
swing.JComponent> {
+
+    /** to use log facility, just put in your code: log.info(\"...\"); */
+    protected static Log log =3D LogFactory.getLog(AbstractBeanValidatorUI.c=
lass);
+
+    /** bean field */
+    protected String field;
+
+    /** component id */
+    protected String componentId;
+
+    /** validation context */
+    protected ValidationAware validationContext;
+
+    public AbstractBeanValidatorUI(String field, String componentId, Validat=
ionAware validationContext) {
+        this.componentId =3D componentId;
+        this.field =3D field;
+        this.validationContext =3D validationContext;
+        log.info("install " + this + "<field:" + field + ", componentId:" + =
componentId + ">");
+    }
+}

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui=
/TranslucentValidationUI.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/validator/ui/Translu=
centValidationUI.java	2008-10-17 20:55:15 UTC (rev 958)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui/Tran=
slucentValidationUI.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,42 +0,0 @@
-package jaxx.runtime.validator.ui;
-
-import com.opensymphony.xwork2.ValidationAware;
-import org.jdesktop.jxlayer.JXLayer;
-
-import javax.swing.JComponent;
-import java.awt.AlphaComposite;
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.Insets;
-import java.awt.Rectangle;
-
-/** @author chemit */
-public class TranslucentValidationUI extends AbstractBeanValidatorUI {
-
-    public TranslucentValidationUI(String field, String componentId, Validat=
ionAware validationContext) {
-        super(componentId, field, validationContext);
-
-    }
-
-    @Override
-    protected void paintLayer(Graphics2D g2, JXLayer<JComponent> l) {
-        // paints the layer as is
-        super.paintLayer(g2, l);
-
-        // to be in sync with the view if the layer has a border
-        Insets layerInsets =3D l.getInsets();
-        g2.translate(layerInsets.left, layerInsets.top);
-
-        JComponent view =3D l.getView();
-        // To prevent painting on view's border
-        Insets insets =3D view.getInsets();
-        g2.clip(new Rectangle(insets.left, insets.top,
-                view.getWidth() - insets.left - insets.right,
-                view.getHeight() - insets.top - insets.bottom));
-
-        g2.setColor(!validationContext.getFieldErrors().containsKey(field) ?
-                Color.GREEN : Color.RED);
-        g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, =
.2f));
-        g2.fillRect(0, 0, l.getWidth(), l.getHeight());
-    }
-}

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui/=
TranslucentValidationUI.java (from rev 960, lutinjaxx/trunk/jaxx-core/src/mai=
n/java/jaxx/runtime/validator/ui/TranslucentValidationUI.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui/Tran=
slucentValidationUI.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/runtime/validator/ui/Tran=
slucentValidationUI.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,41 @@
+package jaxx.runtime.validator.ui;
+
+import com.opensymphony.xwork2.ValidationAware;
+import org.jdesktop.jxlayer.JXLayer;
+
+import javax.swing.JComponent;
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Insets;
+import java.awt.Rectangle;
+
+/** @author chemit */
+public class TranslucentValidationUI extends AbstractBeanValidatorUI {
+
+    public TranslucentValidationUI(String field, String componentId, Validat=
ionAware validationContext) {
+        super(field, componentId, validationContext);
+    }
+
+    @Override
+    protected void paintLayer(Graphics2D g2, JXLayer<JComponent> l) {
+        // paints the layer as is
+        super.paintLayer(g2, l);
+
+        // to be in sync with the view if the layer has a border
+        Insets layerInsets =3D l.getInsets();
+        g2.translate(layerInsets.left, layerInsets.top);
+
+        JComponent view =3D l.getView();
+        // To prevent painting on view's border
+        Insets insets =3D view.getInsets();
+        g2.clip(new Rectangle(insets.left, insets.top,
+                view.getWidth() - insets.left - insets.right,
+                view.getHeight() - insets.top - insets.bottom));
+
+        g2.setColor(!validationContext.getFieldErrors().containsKey(field) ?
+                Color.GREEN : Color.RED);
+        g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, =
.2f));
+        g2.fillRect(0, 0, l.getWidth(), l.getHeight());
+    }
+}

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/DefaultComponen=
tHandler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/DefaultComponentHandler=
.java	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/DefaultComponentHand=
ler.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,275 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.tags;
-
-import jaxx.CompilerException;
-import jaxx.UnsupportedAttributeException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.I18nHelper;
-import jaxx.reflect.ClassDescriptor;
-import jaxx.reflect.ClassDescriptorLoader;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.w3c.dom.Element;
-
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.event.ComponentListener;
-import java.awt.event.ContainerListener;
-import java.awt.event.FocusListener;
-import java.beans.IntrospectionException;
-import java.io.IOException;
-import java.lang.reflect.Field;
-
-public class DefaultComponentHandler extends DefaultObjectHandler {
-    /** log */
-    protected static final Log log =3D LogFactory.getLog(DefaultComponentHan=
dler.class);
-
-    private String containerDelegate;
-
-    public DefaultComponentHandler(ClassDescriptor beanClass) {
-        super(beanClass);
-        ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, Compo=
nent.class);
-        /*if (!ClassDescriptorLoader.getClassDescriptor(Component.class).isA=
ssignableFrom(beanClass)) {
-            throw new IllegalArgumentException(getClass().getName() + " does=
 not support the class " + beanClass.getName());
-        }*/
-    }
-
-    @Override
-    protected void init() throws IntrospectionException {
-        if (jaxxBeanInfo =3D=3D null) {
-            super.init();
-
-            containerDelegate =3D (String) getJAXXBeanInfo().getJAXXBeanDesc=
riptor().getValue("containerDelegate");
-            if (containerDelegate =3D=3D null && ClassDescriptorLoader.getCl=
assDescriptor(Container.class).isAssignableFrom(getBeanClass().getSuperclass(=
))) {
-                DefaultObjectHandler tagHandler =3D TagManager.getTagHandler=
(getBeanClass().getSuperclass());
-                if (tagHandler instanceof DefaultComponentHandler) {
-                    containerDelegate =3D ((DefaultComponentHandler) tagHand=
ler).getContainerDelegate();
-                } else {
-                    /*tagHandler =3D TagManager.getTagHandler(getBeanClass()=
);
-                    if (tagHandler instanceof DefaultComponentHandler) {
-                        containerDelegate =3D ((DefaultComponentHandler) tag=
Handler).getContainerDelegate();
-                    } else {*/
-                    log.warn("could not find componentHandler for " + getBea=
nClass());
-                    //}
-                }
-            }
-        }
-    }
-
-    @Override
-    protected void configureProxyEventInfo() {
-        super.configureProxyEventInfo();
-        addProxyEventInfo("hasFocus", FocusListener.class);
-        addProxyEventInfo("isVisible", ComponentListener.class);
-        addProxyEventInfo("getBounds", ComponentListener.class);
-        addProxyEventInfo("getLocation", ComponentListener.class);
-        addProxyEventInfo("getLocationOnScreen", ComponentListener.class);
-        addProxyEventInfo("getSize", ComponentListener.class);
-        addProxyEventInfo("getX", ComponentListener.class);
-        addProxyEventInfo("getY", ComponentListener.class);
-        addProxyEventInfo("getWidth", ComponentListener.class);
-        addProxyEventInfo("getHeight", ComponentListener.class);
-        if (ClassDescriptorLoader.getClassDescriptor(Container.class).isAssi=
gnableFrom(getBeanClass())) {
-            addProxyEventInfo("getComponentCount", ContainerListener.class);
-        }
-    }
-
-    @Override
-    protected void setDefaults(CompiledObject object, Element tag, JAXXCompi=
ler compiler) throws CompilerException {
-        super.setDefaults(object, tag, compiler);
-        setAttribute(object, "name", object.getId(), false, compiler);
-        openComponent(object, tag, compiler);
-    }
-
-    @Override
-    public void compileFirstPass(Element tag, JAXXCompiler compiler) throws =
CompilerException, IOException {
-        super.compileFirstPass(tag, compiler);
-    }
-
-    @Override
-    public void compileSecondPass(Element tag, JAXXCompiler compiler) throws=
 CompilerException, IOException {
-        super.compileSecondPass(tag, compiler);
-        closeComponent(compiler.getOpenComponent(), tag, compiler);
-    }
-
-
-    protected void openComponent(CompiledObject object, Element tag, JAXXCom=
piler compiler) throws CompilerException {
-        String constraints =3D tag.getAttribute("constraints");
-        if (constraints !=3D null && constraints.length() > 0) {
-            compiler.openComponent(object, constraints);
-        } else {
-            compiler.openComponent(object);
-        }
-    }
-
-    protected void closeComponent(CompiledObject object, Element tag, JAXXCo=
mpiler compiler) throws CompilerException {
-        compiler.closeComponent(object);
-    }
-
-    @Override
-    public boolean isPropertyInherited(String property) throws UnsupportedAt=
tributeException {
-        return property.equals("font") || property.startsWith("font-") || pr=
operty.equals("foreground") || property.equals("enabled");
-    }
-
-    @Override
-    public ClassDescriptor getPropertyType(CompiledObject object, String pro=
pertyName, JAXXCompiler compiler) throws CompilerException {
-        if (propertyName.equals("x") || propertyName.equals("y") || property=
Name.equals("width") || propertyName.equals("height") ||
-                "font-size".equals(propertyName))
-            return ClassDescriptorLoader.getClassDescriptor(Integer.class);
-        if (propertyName.equals("font-face") || propertyName.equals("font-st=
yle") || propertyName.equals("font-weight")) {
-            return ClassDescriptorLoader.getClassDescriptor(String.class);
-        }
-        return super.getPropertyType(object, propertyName, compiler);
-    }
-
-    @Override
-    public String getGetPropertyCode(String id, String name, JAXXCompiler co=
mpiler) throws CompilerException {
-        if (name.equals("font-face")) {
-            return id + ".getFont().getFontName()";
-        }
-        if (name.equals("font-size")) {
-            return id + ".getFont().getSize()";
-        }
-        if (name.equals("font-weight")) {
-            return "(" + id + ".getFont().getStyle() & Font.BOLD) !=3D 0 ? \=
"bold\" : \"normal\"";
-        }
-        if (name.equals("font-style")) {
-            return "(" + id + ".getFont().getStyle() & Font.ITALIC) !=3D 0 ?=
 \"italic\" : \"normal\"";
-        }
-        return super.getGetPropertyCode(id, name, compiler);
-    }
-
-    @Override
-    public String getSetPropertyCode(String id, String name, String valueCod=
e, JAXXCompiler compiler) throws CompilerException {
-        if (name.equals("x")) {
-            return id + ".setLocation(" + valueCode + ", " + id + ".getY());=
";
-        }
-        if (name.equals("y")) {
-            return id + ".setLocation(" + id + ".getX(), " + valueCode + ");=
";
-        }
-        if (name.equals("width")) { // need to optimize case when both width=
 and height are being assigned
-            return "jaxx.runtime.Util.setComponentWidth(" + id + "," + value=
Code + ");\n";
-        }
-        if (name.equals("height")) {
-            return "jaxx.runtime.Util.setComponentHeight(" + id + "," + valu=
eCode + ");\n";
-        }
-        if (name.equals("font-face")) {
-            return "if (" + id + ".getFont() !=3D null) " + id + ".setFont(n=
ew Font(" + valueCode + ", " + id + ".getFont().getStyle(), " + id + ".getFon=
t().getSize()));";
-        }
-        if (name.equals("font-size")) {
-            return "if (" + id + ".getFont() !=3D null) " + id + ".setFont("=
 + id + ".getFont().deriveFont((float) " + valueCode + "));";
-        }
-        if (name.equals("font-weight")) {
-            if (valueCode.equals("\"bold\"")) {
-                return "if (" + id + ".getFont() !=3D null) " + id + ".setFo=
nt(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.BOL=
D));";
-            }
-            if (valueCode.equals("\"normal\"")) {
-                return "if (" + id + ".getFont() !=3D null) " + id + ".setFo=
nt(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.BO=
LD));";
-            }
-            if (!valueCode.startsWith("\"")) {
-                return "if (" + id + ".getFont() !=3D null) { if ((" + value=
Code + ").equals(\"bold\")) " +
-                        id + ".setFont(" + id + ".getFont().deriveFont(" + i=
d + ".getFont().getStyle() | Font.BOLD)); else " +
-                        id + ".setFont(" + id + ".getFont().deriveFont(" + i=
d + ".getFont().getStyle() & ~Font.BOLD)); }";
-            }
-            compiler.reportError("font-weight must be either \"normal\" or \=
"bold\", found " + valueCode);
-            return "";
-        }
-        if (name.equals("font-style")) {
-            if (valueCode.equals("\"italic\"")) {
-                return "if (" + id + ".getFont() !=3D null) " + id + ".setFo=
nt(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.ITA=
LIC));";
-            }
-            if (valueCode.equals("\"normal\"")) {
-                return "if (" + id + ".getFont() !=3D null) " + id + ".setFo=
nt(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.IT=
ALIC));";
-            }
-            if (!valueCode.startsWith("\"")) {
-                return "if (" + id + ".getFont() !=3D null) { if ((" + value=
Code + ").equals(\"italic\")) " +
-                        id + ".setFont(" + id + ".getFont().deriveFont(" + i=
d + ".getFont().getStyle() | Font.ITALIC)); else " +
-                        id + ".setFont(" + id + ".getFont().deriveFont(" + i=
d + ".getFont().getStyle() & ~Font.ITALIC)); }";
-            }
-            compiler.reportError("font-style must be either \"normal\" or \"=
italic\", found " + valueCode);
-            return "";
-        }
-        if (ClassDescriptorLoader.getClassDescriptor(Container.class).isAssi=
gnableFrom(getBeanClass()) && name.equals("layout")) { // handle containerDel=
egate (e.g. contentPane on JFrame)
-            String containerDelegate =3D (String) getJAXXBeanInfo().getJAXXB=
eanDescriptor().getValue("containerDelegate");
-            if (containerDelegate !=3D null) {
-                return id + '.' + containerDelegate + "().setLayout(" + valu=
eCode + ");";
-            }
-        }
-        // ajout du support i18n
-        if (I18nHelper.isI18nableAttribute(name,compiler)) {
-            valueCode =3D I18nHelper.addI18nInvocation(id, name, valueCode, =
compiler);
-        }
-       =20
-        return super.getSetPropertyCode(id, name, valueCode, compiler);
-    }
-
-
-    /**
-     * Maps string values onto integers, so that int-valued enumeration prop=
erties can be specified by strings.  For
-     * example, when passed a key of 'alignment', this method should normall=
y map the values 'left', 'center', and
-     * 'right' onto SwingConstants.LEFT, SwingConstants.CENTER, and SwingCon=
stants.RIGHT respectively.
-     * <p/>
-     * You do not normally need to call this method yourself; it is invoked =
by {@link #convertFromString} when an
-     * int-valued property has a value which is not a valid number.  By defa=
ult, this method looks at the
-     * <code>enumerationValues</code> value of the <code>JAXXPropertyDescrip=
tor</code>.
-     *
-     * @param key   the name of the int-typed property
-     * @param value the non-numeric value that was specified for the property
-     * @throws IllegalArgumentException if the property is an enumeration, b=
ut the value is not valid
-     * @throws NumberFormatException    if the property is not an enumeration
-     */
-    protected int constantValue(String key, String value) {
-        if ((key.equals("mnemonic") || key.equals("displayedMnemonic"))) {
-            if (value.length() =3D=3D 1) {
-                return value.charAt(0);
-            }
-            try {
-                Field vk =3D java.awt.event.KeyEvent.class.getField(value);
-                return (Integer) vk.get(null);
-            } catch (NoSuchFieldException e) {
-                throw new IllegalArgumentException("mnemonics must be either=
 a single character or the name of a field in KeyEvent (found: '" + value + "=
')");
-            } catch (IllegalAccessException e) {
-                throw new RuntimeException(e);
-            }
-        }
-        return super.constantValue(key, value);
-    }
-
-
-    /**
-     * Returns <code>true</code> if this component can contain other compone=
nts.  For children to be
-     * allowed, the component must be a subclass of <code>Container</code> a=
nd its <code>JAXXBeanInfo</code>
-     * must not have the value <code>false</code> for its <code>isContainer<=
/code> value.
-     *
-     * @return <code>true</code> if children are allowed
-     */
-    public boolean isContainer() {
-        boolean container =3D ClassDescriptorLoader.getClassDescriptor(Conta=
iner.class).isAssignableFrom(getBeanClass());
-        if (container) {
-            try {
-                init();
-                if (Boolean.FALSE.equals(getJAXXBeanInfo().getJAXXBeanDescri=
ptor().getValue("isContainer"))) {
-                    container =3D false;
-                }
-            } catch (IntrospectionException e) {
-                throw new RuntimeException(e);
-            }
-        }
-        return container;
-    }
-
-
-    public String getContainerDelegate() {
-        try {
-            init();
-            return containerDelegate;
-        } catch (IntrospectionException e) {
-            throw new RuntimeException(e);
-        }
-
-    }
-}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/DefaultComponent=
Handler.java (from rev 987, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags=
/DefaultComponentHandler.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/DefaultComponentHand=
ler.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/DefaultComponentHand=
ler.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,275 @@
+/*
+ * Copyright 2006 Ethan Nicholas. All rights reserved.
+ * Use is subject to license terms.
+ */
+package jaxx.tags;
+
+import jaxx.CompilerException;
+import jaxx.UnsupportedAttributeException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.I18nHelper;
+import jaxx.reflect.ClassDescriptor;
+import jaxx.reflect.ClassDescriptorLoader;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Element;
+
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.event.ComponentListener;
+import java.awt.event.ContainerListener;
+import java.awt.event.FocusListener;
+import java.beans.IntrospectionException;
+import java.io.IOException;
+import java.lang.reflect.Field;
+
+public class DefaultComponentHandler extends DefaultObjectHandler {
+    /** log */
+    protected static final Log log =3D LogFactory.getLog(DefaultComponentHan=
dler.class);
+
+    private String containerDelegate;
+
+    public DefaultComponentHandler(ClassDescriptor beanClass) {
+        super(beanClass);
+        ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, Compo=
nent.class);
+        /*if (!ClassDescriptorLoader.getClassDescriptor(Component.class).isA=
ssignableFrom(beanClass)) {
+            throw new IllegalArgumentException(getClass().getName() + " does=
 not support the class " + beanClass.getName());
+        }*/
+    }
+
+    @Override
+    protected void init() throws IntrospectionException {
+        if (jaxxBeanInfo =3D=3D null) {
+            super.init();
+
+            containerDelegate =3D (String) getJAXXBeanInfo().getJAXXBeanDesc=
riptor().getValue("containerDelegate");
+            if (containerDelegate =3D=3D null && ClassDescriptorLoader.getCl=
assDescriptor(Container.class).isAssignableFrom(getBeanClass().getSuperclass(=
))) {
+                DefaultObjectHandler tagHandler =3D TagManager.getTagHandler=
(getBeanClass().getSuperclass());
+                if (tagHandler instanceof DefaultComponentHandler) {
+                    containerDelegate =3D ((DefaultComponentHandler) tagHand=
ler).getContainerDelegate();
+                } else {
+                    /*tagHandler =3D TagManager.getTagHandler(getBeanClass()=
);
+                    if (tagHandler instanceof DefaultComponentHandler) {
+                        containerDelegate =3D ((DefaultComponentHandler) tag=
Handler).getContainerDelegate();
+                    } else {*/
+                    log.warn("could not find componentHandler for " + getBea=
nClass().getSuperclass());
+                    //}
+                }
+            }
+        }
+    }
+
+    @Override
+    protected void configureProxyEventInfo() {
+        super.configureProxyEventInfo();
+        addProxyEventInfo("hasFocus", FocusListener.class);
+        addProxyEventInfo("isVisible", ComponentListener.class);
+        addProxyEventInfo("getBounds", ComponentListener.class);
+        addProxyEventInfo("getLocation", ComponentListener.class);
+        addProxyEventInfo("getLocationOnScreen", ComponentListener.class);
+        addProxyEventInfo("getSize", ComponentListener.class);
+        addProxyEventInfo("getX", ComponentListener.class);
+        addProxyEventInfo("getY", ComponentListener.class);
+        addProxyEventInfo("getWidth", ComponentListener.class);
+        addProxyEventInfo("getHeight", ComponentListener.class);
+        if (ClassDescriptorLoader.getClassDescriptor(Container.class).isAssi=
gnableFrom(getBeanClass())) {
+            addProxyEventInfo("getComponentCount", ContainerListener.class);
+        }
+    }
+
+    @Override
+    protected void setDefaults(CompiledObject object, Element tag, JAXXCompi=
ler compiler) throws CompilerException {
+        super.setDefaults(object, tag, compiler);
+        setAttribute(object, "name", object.getId(), false, compiler);
+        openComponent(object, tag, compiler);
+    }
+
+    @Override
+    public void compileFirstPass(Element tag, JAXXCompiler compiler) throws =
CompilerException, IOException {
+        super.compileFirstPass(tag, compiler);
+    }
+
+    @Override
+    public void compileSecondPass(Element tag, JAXXCompiler compiler) throws=
 CompilerException, IOException {
+        super.compileSecondPass(tag, compiler);
+        closeComponent(compiler.getOpenComponent(), tag, compiler);
+    }
+
+
+    protected void openComponent(CompiledObject object, Element tag, JAXXCom=
piler compiler) throws CompilerException {
+        String constraints =3D tag.getAttribute("constraints");
+        if (constraints !=3D null && constraints.length() > 0) {
+            compiler.openComponent(object, constraints);
+        } else {
+            compiler.openComponent(object);
+        }
+    }
+
+    protected void closeComponent(CompiledObject object, Element tag, JAXXCo=
mpiler compiler) throws CompilerException {
+        compiler.closeComponent(object);
+    }
+
+    @Override
+    public boolean isPropertyInherited(String property) throws UnsupportedAt=
tributeException {
+        return property.equals("font") || property.startsWith("font-") || pr=
operty.equals("foreground") || property.equals("enabled");
+    }
+
+    @Override
+    public ClassDescriptor getPropertyType(CompiledObject object, String pro=
pertyName, JAXXCompiler compiler) throws CompilerException {
+        if (propertyName.equals("x") || propertyName.equals("y") || property=
Name.equals("width") || propertyName.equals("height") ||
+                "font-size".equals(propertyName))
+            return ClassDescriptorLoader.getClassDescriptor(Integer.class);
+        if (propertyName.equals("font-face") || propertyName.equals("font-st=
yle") || propertyName.equals("font-weight")) {
+            return ClassDescriptorLoader.getClassDescriptor(String.class);
+        }
+        return super.getPropertyType(object, propertyName, compiler);
+    }
+
+    @Override
+    public String getGetPropertyCode(String id, String name, JAXXCompiler co=
mpiler) throws CompilerException {
+        if (name.equals("font-face")) {
+            return id + ".getFont().getFontName()";
+        }
+        if (name.equals("font-size")) {
+            return id + ".getFont().getSize()";
+        }
+        if (name.equals("font-weight")) {
+            return "(" + id + ".getFont().getStyle() & Font.BOLD) !=3D 0 ? \=
"bold\" : \"normal\"";
+        }
+        if (name.equals("font-style")) {
+            return "(" + id + ".getFont().getStyle() & Font.ITALIC) !=3D 0 ?=
 \"italic\" : \"normal\"";
+        }
+        return super.getGetPropertyCode(id, name, compiler);
+    }
+
+    @Override
+    public String getSetPropertyCode(String id, String name, String valueCod=
e, JAXXCompiler compiler) throws CompilerException {
+        if (name.equals("x")) {
+            return id + ".setLocation(" + valueCode + ", " + id + ".getY());=
";
+        }
+        if (name.equals("y")) {
+            return id + ".setLocation(" + id + ".getX(), " + valueCode + ");=
";
+        }
+        if (name.equals("width")) { // need to optimize case when both width=
 and height are being assigned
+            return "jaxx.runtime.Util.setComponentWidth(" + id + "," + value=
Code + ");\n";
+        }
+        if (name.equals("height")) {
+            return "jaxx.runtime.Util.setComponentHeight(" + id + "," + valu=
eCode + ");\n";
+        }
+        if (name.equals("font-face")) {
+            return "if (" + id + ".getFont() !=3D null) " + id + ".setFont(n=
ew Font(" + valueCode + ", " + id + ".getFont().getStyle(), " + id + ".getFon=
t().getSize()));";
+        }
+        if (name.equals("font-size")) {
+            return "if (" + id + ".getFont() !=3D null) " + id + ".setFont("=
 + id + ".getFont().deriveFont((float) " + valueCode + "));";
+        }
+        if (name.equals("font-weight")) {
+            if (valueCode.equals("\"bold\"")) {
+                return "if (" + id + ".getFont() !=3D null) " + id + ".setFo=
nt(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.BOL=
D));";
+            }
+            if (valueCode.equals("\"normal\"")) {
+                return "if (" + id + ".getFont() !=3D null) " + id + ".setFo=
nt(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.BO=
LD));";
+            }
+            if (!valueCode.startsWith("\"")) {
+                return "if (" + id + ".getFont() !=3D null) { if ((" + value=
Code + ").equals(\"bold\")) " +
+                        id + ".setFont(" + id + ".getFont().deriveFont(" + i=
d + ".getFont().getStyle() | Font.BOLD)); else " +
+                        id + ".setFont(" + id + ".getFont().deriveFont(" + i=
d + ".getFont().getStyle() & ~Font.BOLD)); }";
+            }
+            compiler.reportError("font-weight must be either \"normal\" or \=
"bold\", found " + valueCode);
+            return "";
+        }
+        if (name.equals("font-style")) {
+            if (valueCode.equals("\"italic\"")) {
+                return "if (" + id + ".getFont() !=3D null) " + id + ".setFo=
nt(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() | Font.ITA=
LIC));";
+            }
+            if (valueCode.equals("\"normal\"")) {
+                return "if (" + id + ".getFont() !=3D null) " + id + ".setFo=
nt(" + id + ".getFont().deriveFont(" + id + ".getFont().getStyle() & ~Font.IT=
ALIC));";
+            }
+            if (!valueCode.startsWith("\"")) {
+                return "if (" + id + ".getFont() !=3D null) { if ((" + value=
Code + ").equals(\"italic\")) " +
+                        id + ".setFont(" + id + ".getFont().deriveFont(" + i=
d + ".getFont().getStyle() | Font.ITALIC)); else " +
+                        id + ".setFont(" + id + ".getFont().deriveFont(" + i=
d + ".getFont().getStyle() & ~Font.ITALIC)); }";
+            }
+            compiler.reportError("font-style must be either \"normal\" or \"=
italic\", found " + valueCode);
+            return "";
+        }
+        if (ClassDescriptorLoader.getClassDescriptor(Container.class).isAssi=
gnableFrom(getBeanClass()) && name.equals("layout")) { // handle containerDel=
egate (e.g. contentPane on JFrame)
+            String containerDelegate =3D (String) getJAXXBeanInfo().getJAXXB=
eanDescriptor().getValue("containerDelegate");
+            if (containerDelegate !=3D null) {
+                return id + '.' + containerDelegate + "().setLayout(" + valu=
eCode + ");";
+            }
+        }
+        // ajout du support i18n
+        if (I18nHelper.isI18nableAttribute(name,compiler)) {
+            valueCode =3D I18nHelper.addI18nInvocation(id, name, valueCode, =
compiler);
+        }
+       =20
+        return super.getSetPropertyCode(id, name, valueCode, compiler);
+    }
+
+
+    /**
+     * Maps string values onto integers, so that int-valued enumeration prop=
erties can be specified by strings.  For
+     * example, when passed a key of 'alignment', this method should normall=
y map the values 'left', 'center', and
+     * 'right' onto SwingConstants.LEFT, SwingConstants.CENTER, and SwingCon=
stants.RIGHT respectively.
+     * <p/>
+     * You do not normally need to call this method yourself; it is invoked =
by {@link #convertFromString} when an
+     * int-valued property has a value which is not a valid number.  By defa=
ult, this method looks at the
+     * <code>enumerationValues</code> value of the <code>JAXXPropertyDescrip=
tor</code>.
+     *
+     * @param key   the name of the int-typed property
+     * @param value the non-numeric value that was specified for the property
+     * @throws IllegalArgumentException if the property is an enumeration, b=
ut the value is not valid
+     * @throws NumberFormatException    if the property is not an enumeration
+     */
+    protected int constantValue(String key, String value) {
+        if ((key.equals("mnemonic") || key.equals("displayedMnemonic"))) {
+            if (value.length() =3D=3D 1) {
+                return value.charAt(0);
+            }
+            try {
+                Field vk =3D java.awt.event.KeyEvent.class.getField(value);
+                return (Integer) vk.get(null);
+            } catch (NoSuchFieldException e) {
+                throw new IllegalArgumentException("mnemonics must be either=
 a single character or the name of a field in KeyEvent (found: '" + value + "=
')");
+            } catch (IllegalAccessException e) {
+                throw new RuntimeException(e);
+            }
+        }
+        return super.constantValue(key, value);
+    }
+
+
+    /**
+     * Returns <code>true</code> if this component can contain other compone=
nts.  For children to be
+     * allowed, the component must be a subclass of <code>Container</code> a=
nd its <code>JAXXBeanInfo</code>
+     * must not have the value <code>false</code> for its <code>isContainer<=
/code> value.
+     *
+     * @return <code>true</code> if children are allowed
+     */
+    public boolean isContainer() {
+        boolean container =3D ClassDescriptorLoader.getClassDescriptor(Conta=
iner.class).isAssignableFrom(getBeanClass());
+        if (container) {
+            try {
+                init();
+                if (Boolean.FALSE.equals(getJAXXBeanInfo().getJAXXBeanDescri=
ptor().getValue("isContainer"))) {
+                    container =3D false;
+                }
+            } catch (IntrospectionException e) {
+                throw new RuntimeException(e);
+            }
+        }
+        return container;
+    }
+
+
+    public String getContainerDelegate() {
+        try {
+            init();
+            return containerDelegate;
+        } catch (IntrospectionException e) {
+            throw new RuntimeException(e);
+        }
+
+    }
+}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/DefaultObjectHa=
ndler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/DefaultObjectHandler.ja=
va	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/DefaultObjectHandler=
.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,1121 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.tags;
-
-import jaxx.CompilerException;
-import jaxx.UnsupportedAttributeException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.compiler.JavaArgument;
-import jaxx.compiler.JavaMethod;
-import jaxx.css.Stylesheet;
-import jaxx.introspection.JAXXBeanInfo;
-import jaxx.introspection.JAXXEventSetDescriptor;
-import jaxx.introspection.JAXXIntrospector;
-import jaxx.introspection.JAXXPropertyDescriptor;
-import jaxx.reflect.ClassDescriptor;
-import jaxx.reflect.ClassDescriptorLoader;
-import jaxx.reflect.FieldDescriptor;
-import jaxx.reflect.MethodDescriptor;
-import jaxx.runtime.ComponentDescriptor;
-import jaxx.runtime.JAXXObject;
-import jaxx.runtime.JAXXObjectDescriptor;
-import jaxx.types.TypeManager;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.beans.PropertyChangeListener;
-import java.io.IOException;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-/**
- * Default handler for class tags.  Class tags are tags which represent inst=
ances of Java classes,
- * such as <code>&lt;JButton label=3D'Close'/&gt;</code>.  <code>DefaultObje=
ctHandler</code>
- * provides support for attributes and events which adhere to JavaBeans nami=
ng conventions as
- * well as basic JAXX features like the <code>id</code> attribute and data b=
inding by means of
- * curly braces.
- * <p/>
- * Throughout this class, the word "member" refers to the name of a field or=
 method (e.g.
- * <code>"getDocument"</code>) and the word "property" refers to the JavaBea=
ns-style simple
- * name of a property (e.g. <code>"document"</code>).
- */
-public class DefaultObjectHandler implements TagHandler {
-    /** The class that this handler provides support for. */
-    private ClassDescriptor beanClass;
-
-    /** The JAXXBeanInfo for the beanClass. */
-    protected JAXXBeanInfo jaxxBeanInfo;
-
-    /** Maps property names to their respective JAXXPropertyDescriptors. */
-    private Map<String, JAXXPropertyDescriptor> properties;
-
-    /** Maps event names to their respective JAXXEventSetDescriptors. */
-    private Map<String, JAXXEventSetDescriptor> events;
-
-    /** Maps property names to their respective ProxyEventInfos. */
-    private Map<String, ProxyEventInfo> eventInfos;
-
-    /** Maps XML tags to the CompiledObjects created from them. */
-    protected static Map<Element, CompiledObject> objectMap =3D new WeakHash=
Map<Element, CompiledObject>();
-
-    /**
-     * Encapsulates information about a "proxy event handler", which is an e=
vent handler that
-     * fires PropertyChangeEvents when it is triggered.  ProxyEventInfos sim=
plify the data binding
-     * system by allowing all dependencies to fire the same kind of event ev=
en if they would
-     * normally throw something else, like <code>DocumentEvent</code>.
-     */
-    private class ProxyEventInfo {
-        /** The name of the method or field being proxied, e.g. "getText". */
-        String memberName;
-
-        /** The "actual" event listener for the property in question, e.g. D=
ocumentListener. */
-        ClassDescriptor listenerClass;
-
-        /**
-         * In cases where a different object (such as a model) is more direc=
tly responsible for
-         * managing the property, this is the name of the property where tha=
t object can be
-         * found, e.g. "document" (which is turned into a call to "getDocume=
nt()").  This property
-         * is also treated as a dependency of the data binding expression, a=
nd any updates to it
-         * (assuming it is bound) will cause the listener to be removed from=
 the old value and
-         * attached to the new value, and the data binding to be processed.
-         */
-        String modelName;
-
-        /** The name of the method used to add the "native" event listener, =
e.g. "addDocumentListener". */
-        String addMethod;
-
-        /** The name of the method used to remove the "native" event listene=
r, e.g. "removeDocumentListener". */
-        String removeMethod;
-    }
-
-
-    /**
-     * Creates a new <code>DefaultObjectHandler</code> which provides suppor=
t for the specified class.  The
-     * class is not actually introspected until the {@link #compileFirstPass=
} method is invoked.
-     *
-     * @param beanClass the class which this handler supports
-     */
-    public DefaultObjectHandler(ClassDescriptor beanClass) {
-        this.beanClass =3D beanClass;
-    }
-
-
-    /**
-     * Performs introspection on the beanClass and stores the results.
-     *
-     * @throws java.beans.IntrospectionException
-     *          TODO
-     */
-    protected void init() throws IntrospectionException {
-        if (jaxxBeanInfo =3D=3D null) {
-            // perform introspection & cache the results
-            jaxxBeanInfo =3D getJAXXBeanInfo(beanClass);
-
-            JAXXPropertyDescriptor[] propertiesArray =3D jaxxBeanInfo.getJAX=
XPropertyDescriptors();
-            properties =3D new HashMap<String, JAXXPropertyDescriptor>();
-            for (int i =3D propertiesArray.length - 1; i >=3D 0; i--) {
-                properties.put(propertiesArray[i].getName(), propertiesArray=
[i]);
-            }
-
-            JAXXEventSetDescriptor[] eventsArray =3D jaxxBeanInfo.getJAXXEve=
ntSetDescriptors();
-            events =3D new HashMap<String, JAXXEventSetDescriptor>();
-            for (int i =3D eventsArray.length - 1; i >=3D 0; i--) {
-                MethodDescriptor[] methods =3D eventsArray[i].getListenerMet=
hods();
-                for (MethodDescriptor method : methods) {
-                    events.put(method.getName(), eventsArray[i]);
-                }
-            }
-
-            configureProxyEventInfo();
-        }
-    }
-
-
-    /**
-     * Returns
-     *
-     * @return the class which this <code>DefaultObjectHandler</code> suppor=
ts.
-     */
-    public ClassDescriptor getBeanClass() {
-        return beanClass;
-    }
-
-
-    /**
-     * @return the <code>JAXXBeanInfo</code> for the class which this <code>=
DefaultObjectHandler</code>
-     *         supports.
-     */
-    public JAXXBeanInfo getJAXXBeanInfo() {
-        try {
-            init();
-        } catch (IntrospectionException e) {
-            throw new RuntimeException(e);
-        }
-        return jaxxBeanInfo;
-    }
-
-
-    /**
-     * Returns the <code>JAXXBeanInfo</code> for the specified class.
-     *
-     * @param beanClass the bean class for which to retrieve <code>JAXXBeanI=
nfo</code>
-     * @return the class' <code>JAXXBeanInfo</code>
-     * @throws java.beans.IntrospectionException
-     *          ?
-     */
-    public static JAXXBeanInfo getJAXXBeanInfo(ClassDescriptor beanClass) th=
rows IntrospectionException {
-        return JAXXIntrospector.getJAXXBeanInfo(beanClass);
-    }
-
-
-    /**
-     * Returns the type of the named property.  This is the return type of t=
he property's <code>get</code> method;
-     * for instance <code>JLabel</code>'s <code>text</code> property is a <c=
ode>String</code>.
-     *
-     * @param object       the object being compiled
-     * @param propertyName the simple JavaBeans-style name of the property
-     * @param compiler     the current <code>JAXXCompiler</code>
-     * @return the property's type
-     * @throws CompilerException if the type cannot be determined
-     */
-    public ClassDescriptor getPropertyType(CompiledObject object, String pro=
pertyName, JAXXCompiler compiler) {
-        try {
-            init();
-        } catch (IntrospectionException e) {
-            throw new RuntimeException(e);
-        }
-
-        JAXXPropertyDescriptor property =3D properties.get(propertyName);
-        if (property !=3D null) {
-            return property.getPropertyType();
-        }
-        throw new UnsupportedAttributeException("property '" + propertyName =
+ "' not found in " + object);
-    }
-
-
-    /**
-     * @param name ?
-     * @return <code>true</code> if the named member is <i>bound</i> (fires =
<code>PropertyChangeEvent</code>
-     *         when modified).  Members are either fields (represented by th=
e simple name of the field) or <code>get/is</code>
-     *         methods (represented by the simple name of the method, <b>not=
</b> the simplified JavaBeans-style name).
-     *         Methods which are not actually bound in their native class, b=
ut for which proxy events have been
-     *         configured (such as <code>JTextField.getText</code>, return <=
code>true</code>.
-     * @throws jaxx.UnsupportedAttributeException
-     *          ?
-     */
-    public boolean isMemberBound(String name) throws UnsupportedAttributeExc=
eption {
-        try {
-            init();
-        } catch (IntrospectionException e) {
-            throw new RuntimeException(e);
-        }
-
-        if (eventInfos !=3D null && eventInfos.containsKey(name)) {
-            return true;
-        }
-
-        if (name.equals("getClass")) {
-            return false;
-        }
-
-        String propertyName =3D null;
-        if (name.startsWith("get")) {
-            propertyName =3D Introspector.decapitalize(name.substring("get".=
length()));
-        } else if (name.startsWith("is")) {
-            propertyName =3D Introspector.decapitalize(name.substring("is".l=
ength()));
-        }
-        JAXXPropertyDescriptor property =3D propertyName !=3D null ? propert=
ies.get(propertyName) : null;
-        if (property !=3D null) {
-            return property.isBound();
-        }
-        try {
-            FieldDescriptor field =3D getBeanClass().getFieldDescriptor(name=
);
-            return Modifier.isFinal(field.getModifiers()); // final fields m=
ight as well be considered bound -- they can't be modified anyway
-        } catch (NoSuchFieldException e) {
-            throw new UnsupportedAttributeException("cannot find property '"=
 + name + "' of " + getBeanClass());
-        }
-    }
-
-
-    private static ClassDescriptor getEventClass(ClassDescriptor listenerCla=
ss) {
-        return listenerClass.getMethodDescriptors()[0].getParameterTypes()[0=
];
-    }
-
-
-    /**
-     * @param memberName name of the member
-     * @return an array of members on which the given property depends.  For
-     *         example, the JTextField.getText() member depends upon the get=
Model()
-     *         member.  Returns <code>null</code> if there are no dependenci=
es.
-     */
-    public String[] getMemberDependencies(String memberName) {
-        ProxyEventInfo eventInfo =3D eventInfos !=3D null ? eventInfos.get(m=
emberName) : null;
-        return eventInfo =3D=3D null ? null : new String[]{eventInfo.modelNa=
me};
-    }
-
-
-    /**
-     * Returns a snippet of Java code which will cause a <code>PropertyChang=
eListener</code> to be notified
-     * when the member's value changes.  The <code>PropertyChangeListener</c=
ode> is provided in the form
-     * of a Java code snippet that evaluates to a listener object.
-     * <p/>
-     * For ordinary bound JavaBeans properties, the Java code returned is a =
simple call to
-     * <code>addPropertyChangeListener</code>.  Fields and methods which do =
not actually fire
-     * <code>PropertyChangeEvents</code> when they change necessitate more c=
omplex code.
-     *
-     * @param objectCode                 Java code which evaluates to the ob=
ject to which to add the listener
-     *                                   *@param dataBinding the name of the=
 data binding this listener is a part of
-     * @param dataBinding databinding
-     * @param memberName                 the name of the field or method to =
listen to
-     * @param propertyChangeListenerCode Java code which evaluates to a <cod=
e>PropertyChangeListener</code>
-     * @param compiler                   the current <code>JAXXCompiler</cod=
e>
-     * @return Java code snippet which causes the listener to be added to th=
e object
-     */
-    public String getAddMemberListenerCode(String objectCode, String dataBin=
ding, String memberName, String propertyChangeListenerCode, JAXXCompiler comp=
iler) {
-        if ("getClass".equals(memberName)) {
-            return null;
-        }
-
-        ProxyEventInfo eventInfo =3D eventInfos !=3D null ? eventInfos.get(m=
emberName) : null;
-        if (eventInfo !=3D null) { // a "proxied" event is one that doesn't =
fire PropertyChangeEvent, so we need to convert its native event type into Pr=
opertyChangeEvents
-            StringBuffer result =3D new StringBuffer();
-            String methodName =3D "$pr" + compiler.getUniqueId(propertyChang=
eListenerCode);
-            boolean methodExists =3D false;
-            JavaMethod[] methods =3D compiler.getJavaFile().getMethods();
-            for (JavaMethod method : methods) {
-                if (method.getName().equals(methodName)) {
-                    methodExists =3D true;
-                    break;
-                }
-            }
-            ClassDescriptor eventClass =3D getEventClass(eventInfo.listenerC=
lass);
-            if (!methodExists) {
-                compiler.getJavaFile().addMethod(new JavaMethod(Modifier.PUB=
LIC, "void", methodName,
-                        new JavaArgument[]{new JavaArgument(JAXXCompiler.get=
CanonicalName(eventClass), "event")}, null,
-                        propertyChangeListenerCode + ".propertyChange(null);=
"));
-            }
-            String code =3D objectCode + (eventInfo.modelName !=3D null ? ".=
get" + JAXXCompiler.capitalize(eventInfo.modelName) + "()" : "");
-            result.append("$bindingSources.put(\"").append(code).append("\",=
 ").append(code).append(");").append(JAXXCompiler.getLineSeparator());
-            result.append(code).append('.').append(eventInfo.addMethod).appe=
nd("((").append(JAXXCompiler.getCanonicalName(eventInfo.listenerClass)).appen=
d(") jaxx.runtime.Util.getEventListener(").append(JAXXCompiler.getCanonicalNa=
me(eventInfo.listenerClass)).append(".class, ").append(compiler.getRootObject=
().getJavaCode()).append(", ").append(TypeManager.getJavaCode(methodName)).ap=
pend("));\n");
-            if (eventInfo.modelName !=3D null) {
-                result.append(getAddMemberListenerCode(objectCode, dataBindi=
ng, "get" + JAXXCompiler.capitalize(eventInfo.modelName),
-                        "jaxx.runtime.Util.getDataBindingUpdateListener(this=
 , \"" + dataBinding + "\")",
-                        compiler));
-            }
-            return result.toString();
-        } else {
-            String propertyName =3D null;
-            if (memberName.startsWith("get")) {
-                propertyName =3D Introspector.decapitalize(memberName.substr=
ing("get".length()));
-            } else if (memberName.startsWith("is")) {
-                propertyName =3D Introspector.decapitalize(memberName.substr=
ing("is".length()));
-            }
-            else {
-                try {
-                    getBeanClass().getFieldDescriptor(memberName);
-                    propertyName =3D memberName;
-                } catch (NoSuchFieldException e) {
-                    // ignore ?
-                }
-            }
-            if (propertyName !=3D null) {
-                try {
-                    // check for property-specific addPropertyChangeListener=
 method
-                    getBeanClass().getMethodDescriptor("addPropertyChangeLis=
tener", new ClassDescriptor[]{ClassDescriptorLoader.getClassDescriptor(String=
.class),
-                            ClassDescriptorLoader.getClassDescriptor(Propert=
yChangeListener.class)});
-                    return objectCode + ".addPropertyChangeListener(\"" + pr=
opertyName + "\", " + propertyChangeListenerCode + ");\n";
-                } catch (NoSuchMethodException e) {
-                    // no property-specific method, use general one=20
-                    return objectCode + ".addPropertyChangeListener(" + prop=
ertyChangeListenerCode + ");\n";
-                }
-            }
-            return null;
-        }
-    }
-
-
-    public String getRemoveMemberListenerCode(String objectCode, String data=
Binding, String memberName, String propertyChangeListenerCode, JAXXCompiler c=
ompiler) {
-        if ("getClass".equals(memberName)) {
-            return null;
-        }
-
-        ProxyEventInfo eventInfo =3D eventInfos !=3D null ? eventInfos.get(m=
emberName) : null;
-        if (eventInfo !=3D null) { // a "proxied" event is one that doesn't =
fire PropertyChangeEvent, so we need to convert its native event type into Pr=
opertyChangeEvents
-            StringBuffer result =3D new StringBuffer();
-            String methodName =3D "$pr" + compiler.getUniqueId(propertyChang=
eListenerCode);
-            boolean methodExists =3D false;
-            JavaMethod[] methods =3D compiler.getJavaFile().getMethods();
-            for (JavaMethod method : methods) {
-                if (method.getName().equals(methodName)) {
-                    methodExists =3D true;
-                    break;
-                }
-            }
-            ClassDescriptor eventClass =3D getEventClass(eventInfo.listenerC=
lass);
-            if (!methodExists) {
-                compiler.getJavaFile().addMethod(new JavaMethod(Modifier.PUB=
LIC, "void", methodName,
-                        new JavaArgument[]{new JavaArgument(JAXXCompiler.get=
CanonicalName(eventClass), "event")}, null,
-                        propertyChangeListenerCode + ".propertyChange(null);=
"));
-            }
-            try {
-                String modelMemberName =3D eventInfo.modelName !=3D null ? "=
get" + JAXXCompiler.capitalize(eventInfo.modelName) : null;
-                String modelClassName =3D modelMemberName !=3D null ? getBea=
nClass().getMethodDescriptor(modelMemberName, new ClassDescriptor[0]).getRetu=
rnType().getName() : JAXXCompiler.getCanonicalName(getBeanClass());
-                String code =3D objectCode + (eventInfo.modelName !=3D null =
? "." + modelMemberName + "()" : "");
-                result.append("((").append(modelClassName).append(") $bindin=
gSources.remove(\"").append(code).append("\")).").append(eventInfo.removeMeth=
od).append("((").append(JAXXCompiler.getCanonicalName(eventInfo.listenerClass=
)).append(") jaxx.runtime.Util.getEventListener(").append(JAXXCompiler.getCan=
onicalName(eventInfo.listenerClass)).append(".class, ").append(compiler.getRo=
otObject().getJavaCode()).append(", ").append(TypeManager.getJavaCode(methodN=
ame)).append("));\n");
-                if (eventInfo.modelName !=3D null) {
-                    result.append(getRemoveMemberListenerCode(objectCode, da=
taBinding, "get" + JAXXCompiler.capitalize(eventInfo.modelName),
-                            "jaxx.runtime.Util.getDataBindingUpdateListener(=
this, \"" + dataBinding + "\")",
-                            compiler));
-                }
-                return result.toString();
-            }
-            catch (NoSuchMethodException e) {
-                throw new CompilerException("Internal error: " + e);
-            }
-        } else {
-            String propertyName =3D null;
-            if (memberName.startsWith("get")) {
-                propertyName =3D Introspector.decapitalize(memberName.substr=
ing("get".length()));
-            } else if (memberName.startsWith("is")) {
-                propertyName =3D Introspector.decapitalize(memberName.substr=
ing("is".length()));
-            } else {
-                try {
-                    getBeanClass().getFieldDescriptor(memberName);
-                    propertyName =3D memberName;
-                } catch (NoSuchFieldException e) {
-                    // ignore ?
-                }
-            }
-            if (propertyName !=3D null) {
-                try {
-                    // check for property-specific removePropertyChangeListe=
ner method
-                    getBeanClass().getMethodDescriptor("removePropertyChange=
Listener", new ClassDescriptor[]{ClassDescriptorLoader.getClassDescriptor(Str=
ing.class),
-                            ClassDescriptorLoader.getClassDescriptor(Propert=
yChangeListener.class)});
-                    return objectCode + ".removePropertyChangeListener(\"" +=
 propertyName + "\", " + propertyChangeListenerCode + ");\n";
-                } catch (NoSuchMethodException e) {
-                    // no property-specific method, use general one=20
-                    return objectCode + ".removePropertyChangeListener(" + p=
ropertyChangeListenerCode + ");\n";
-                }
-            }
-            return null;
-        }
-    }
-
-
-    /**
-     * Configures the event handling for members which do not fire <code>Pro=
pertyChangeEvent</code> when
-     * modified.  The default implementation does nothing.  Subclasses shoul=
d override this method to call
-     * <code>addProxyEventInfo</code> for each member which requires special=
 handling.
-     */
-    protected void configureProxyEventInfo() {
-    }
-
-
-    /**
-     * Configures a proxy event handler which fires <code>PropertyChangeEven=
ts</code> when a non-bound
-     * member is updated.  This is necessary for all fields (which cannot be=
 bound) and for methods that are
-     * not bound property <code>get</code> methods.  The proxy event handler=
 will attach the specified kind
-     * of listener to the class and fire a <code>PropertyChangeEvent</code> =
whenever the listener receives
-     * any kind of event.
-     * <p/>
-     * Even though this method can theoretically be applied to fields (in ad=
dition to methods), it would be an
-     * unusual situation in which that would actually work -- as fields cann=
ot fire events when modified, it would
-     * be difficult to have a listener that was always notified when a field=
 value changed.
-     *
-     * @param memberName    the name of the field or method being proxied
-     * @param listenerClass the type of listener which receives events when =
the field or method is updated
-     */
-    public void addProxyEventInfo(String memberName, Class listenerClass) {
-        addProxyEventInfo(memberName, listenerClass, null);
-    }
-
-
-    /**
-     * Configures a proxy event handler which fires <code>PropertyChangeEven=
ts</code> when a non-bound
-     * member is updated.  This is necessary for all fields (which cannot be=
 bound) and for methods that are
-     * not bound property <code>get</code> methods.  This variant attaches a=
 listener to a property of the
-     * object (such as <code>model</code>) and not the object itself, which =
is useful when there is a model
-     * that is the "real" container of the information.  The proxy event han=
dler will attach the specified kind
-     * of listener to the property's value (retrieved using the property's <=
code>get</code> method) and fire
-     * a <code>PropertyChangeEvent</code> whenever the listener receives any=
 kind of event.
-     * <p/>
-     * If the property is itself bound (typically the case with models), any=
 updates to the property's value will
-     * cause the listener to be removed from the old property value and reat=
tached to the new property value,
-     * as well as cause a <code>PropertyChangeEvent</code> to be fired.
-     * <p/>
-     * Even though this method can theoretically be applied to fields (in ad=
dition to methods), it would be an
-     * unusual situation in which that would actually work -- as fields cann=
ot fire events when modified, it would
-     * be difficult to have a listener that was always notified when a field=
 value changed.
-     *
-     * @param memberName    the name of the field or method being proxied
-     * @param listenerClass the type of listener which receives events when =
the field or method is updated
-     * @param modelName     the JavaBeans-style name of the model property
-     */
-    public void addProxyEventInfo(String memberName, Class listenerClass, St=
ring modelName) {
-        String listenerName =3D listenerClass.getName();
-        listenerName =3D listenerName.substring(listenerName.lastIndexOf("."=
) + 1);
-        addProxyEventInfo(memberName, listenerClass, modelName, "add" + list=
enerName, "remove" + listenerName);
-    }
-
-
-    // TODO: remove this temporary method, complete switchover to ClassDescr=
iptors
-    public void addProxyEventInfo(String memberName, Class listenerClass,
-                                  String modelName, String addMethod, String=
 removeMethod) {
-        try {
-            addProxyEventInfo(memberName, ClassDescriptorLoader.getClassDesc=
riptor(listenerClass.getName()), modelName, addMethod, removeMethod);
-        }  catch (ClassNotFoundException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-
-    /**
-     * Configures a proxy event handler which fires <code>PropertyChangeEven=
ts</code> when a non-bound
-     * member is updated.  This is necessary for all fields (which cannot be=
 bound) and for methods that are
-     * not bound property <code>get</code> methods.  This variant attaches a=
 listener to a property of the
-     * object (such as <code>model</code>) and not the object itself, which =
is useful when there is a model
-     * that is the "real" container of the information.  The proxy event han=
dler will attach the specified kind
-     * of listener to the property's value (retrieved using the property's <=
code>get</code> method) and fire
-     * a <code>PropertyChangeEvent</code> whenever the listener receives any=
 kind of event.
-     * <p/>
-     * If the property is itself bound (typically the case with models), any=
 updates to the property's value will
-     * cause the listener to be removed from the old property value and reat=
tached to the new property value,
-     * as well as cause a <code>PropertyChangeEvent</code> to be fired.
-     * <p/>
-     * This variant of <code>addProxyEventInfo</code> allows the names of th=
e methods that add and remove
-     * the event listener to be specified, in cases where the names are not =
simply <code>add&lt;listenerClassName&gt;</code>
-     * and <code>remove&lt;listenerClassName&gt;</code>.
-     * <p/>
-     * Even though this method can theoretically be applied to fields (in ad=
dition to methods), it would be an
-     * unusual situation in which that would actually work -- as fields cann=
ot fire events when modified, it would
-     * be difficult to have a listener that was always notified when a field=
 value changed.
-     *
-     * @param memberName    the name of the field or method being proxied
-     * @param listenerClass the type of listener which receives events when =
the field or method is updated
-     * @param modelName     the JavaBeans-style name of the model property
-     * @param addMethod     add method name
-     * @param removeMethod  remove method name
-     */
-    public void addProxyEventInfo(String memberName, ClassDescriptor listene=
rClass,
-                                  String modelName, String addMethod, String=
 removeMethod) {
-        ProxyEventInfo info =3D new ProxyEventInfo();
-        info.memberName =3D memberName;
-        info.listenerClass =3D listenerClass;
-        info.modelName =3D modelName;
-        info.addMethod =3D addMethod;
-        info.removeMethod =3D removeMethod;
-        if (eventInfos =3D=3D null) {
-            eventInfos =3D new HashMap<String, ProxyEventInfo>();
-        }
-        eventInfos.put(memberName, info);
-    }
-
-
-    public void compileFirstPass(Element tag, JAXXCompiler compiler) throws =
CompilerException, IOException {
-        scanAttributesForDependencies(tag, compiler);
-        compileChildrenFirstPass(tag, compiler);
-    }
-
-
-    public void compileSecondPass(Element tag, JAXXCompiler compiler) throws=
 CompilerException, IOException {
-        try {
-            init();
-        } catch (IntrospectionException e) {
-            throw new RuntimeException(e);
-        }
-        CompiledObject object =3D objectMap.get(tag);
-        if (object =3D=3D null) {
-            throw new IllegalStateException("unable to find CompiledObject a=
ssociated with tag <" + tag.getTagName() + ">;  should have been registered b=
efore second pass");
-        }
-        compiler.checkOverride(object);
-        String constructorParams =3D tag.getAttribute("constructorParams");
-        if (constructorParams !=3D null && constructorParams.length() > 0) {
-            object.setConstructorParams(compiler.getScriptManager().trimScri=
pt(constructorParams));
-        }
-
-        setDefaults(object, tag, compiler);
-        setAttributes(object, tag, compiler);
-
-        compileChildrenSecondPass(tag, compiler);
-    }
-
-
-    public void registerCompiledObject(Element tag, JAXXCompiler compiler) {
-        String id =3D tag.getAttribute("id");
-        if (id =3D=3D null || id.length() =3D=3D 0) {
-            id =3D compiler.getAutoId(getBeanClass());
-        }
-        CompiledObject object =3D createCompiledObject(id, compiler);
-        objectMap.put(tag, object);
-        String styleClass =3D tag.getAttribute("styleClass").trim();
-        if (styleClass.length() > 0) {
-            object.setStyleClass(styleClass);
-        }
-        compiler.registerCompiledObject(object);
-    }
-
-
-    /**
-     * Creates the <code>CompiledObject</code> which will represent the obje=
ct created by this <code>TagHandler</code>.
-     *
-     * @param id       the <code>CompiledObject's</code> ID.
-     * @param compiler compiler to use
-     * @return the <code>CompiledObject</code> to use
-     */
-    protected CompiledObject createCompiledObject(String id, JAXXCompiler co=
mpiler) {
-        return new CompiledObject(id, getBeanClass(), compiler);
-    }
-
-
-    /**
-     * Initializes the default settings of the object, prior to setting its =
attribute values.  The default
-     * implementation does nothing.
-     *
-     * @param object   the object to initialize
-     * @param tag      the tag being compiled
-     * @param compiler the current <code>JAXXCompiler</code>
-     */
-    protected void setDefaults(CompiledObject object, Element tag, JAXXCompi=
ler compiler) {
-    }
-
-
-    /**
-     * @param property property name to test
-     * @return <code>true</code> if the specified property should be inherit=
ed by child components when specified
-     *         via CSS.
-     * @throws jaxx.UnsupportedAttributeException
-     *          ?
-     */
-    public boolean isPropertyInherited(String property) throws UnsupportedAt=
tributeException {
-        return false;
-    }
-
-
-    /**
-     * @param name name of event
-     * @return <code>true</code> if the specified name has the form of an ev=
ent handler attribute
-     *         (e.g. "onActionPerformed").
-     */
-    public boolean isEventHandlerName(String name) {
-        return name.length() > 2 && name.startsWith("on") && Character.isUpp=
erCase(name.charAt(2));
-    }
-
-
-    /**
-     * Scans all attributes for any dependency classes and adds them to the =
current compilation
-     * set.  Called by <code>compileFirstPass()</code> (it is an error to ad=
d dependencies after
-     * pass 1 is complete).
-     *
-     * @param tag      tag to scan
-     * @param compiler compiler to use
-     */
-    protected void scanAttributesForDependencies(Element tag, JAXXCompiler c=
ompiler) {
-        List<Attr> attributes =3D new ArrayList<Attr>();
-        NamedNodeMap children =3D tag.getAttributes();
-        for (int i =3D 0; i < children.getLength(); i++) {
-            attributes.add((Attr) children.item(i));
-        }
-        Collections.sort(attributes, getAttributeComparator());
-
-        for (Attr attribute : attributes) {
-            String name =3D attribute.getName();
-            String value =3D attribute.getValue();
-            if (name.equals("constraints") || isEventHandlerName(name)) {
-                compiler.preprocessScript(value); // adds dependencies as a =
side effect
-            } else if (name.equals("constructorParams")) {
-                for (String param : value.split("\\s*,\\s*")) {
-                    compiler.preprocessScript(param);
-                }
-            } else if (value.startsWith("{") && value.endsWith("}")) {
-                compiler.preprocessScript(value.substring(1, value.length() =
- 1));
-            }
-        }
-    }
-
-
-    /**
-     * Processes the attributes of an XML tag.  Four kinds of attributes are=
 supported: simple property values (of any
-     * datatype  supported by {@link #convertFromString}), data binding expr=
essions (attributes containing curly-brace
-     * pairs), event listeners (attributes starting with 'on', such as 'onAc=
tionPerformed'), and JAXX-defined properties
-     * such as 'id'.
-     *
-     * @param object   the object to be modified
-     * @param tag      the tag from which to pull attributes
-     * @param compiler the current <code>JAXXCompiler</code>
-     */
-    public void setAttributes(CompiledObject object, Element tag, JAXXCompil=
er compiler) {
-        List<Attr> attributes =3D new ArrayList<Attr>();
-        NamedNodeMap children =3D tag.getAttributes();
-        for (int i =3D 0; i < children.getLength(); i++) {
-            attributes.add((Attr) children.item(i));
-        }
-        Collections.sort(attributes, getAttributeComparator());
-
-        for (Attr attribute : attributes) {
-            String name =3D attribute.getName();
-            String value =3D attribute.getValue().trim();
-            if (name.equals("id") || name.equals("constraints") || name.equa=
ls("constructorParams") || name.equals("styleClass") ||
-                    name.startsWith("xmlns") || JAXXCompiler.JAXX_INTERNAL_N=
AMESPACE.equals(attribute.getNamespaceURI())) {
-                // ignore, already handled
-            } else if (isEventHandlerName(name)) {
-                if (!value.endsWith(";")) {
-                    value+=3D";";
-                }
-                addEventHandler(object, Introspector.decapitalize(name.subst=
ring(2)), value, compiler);
-            }  else {
-                setAttribute(object, name, value, true, compiler);
-            }
-        }
-    }
-
-
-    /**
-     * Returns a <code>Comparator</code> which defines the ordering in which=
 the tag's attributes should be processed.  The
-     * default implementation sorts the attributes according to the order de=
fined by the {@link #getAttributeOrdering} method.
-     *
-     * @return a <code>Comparator</code> defining the order of attribute pro=
cessing
-     */
-    protected Comparator<Attr> getAttributeComparator() {
-        return new Comparator<Attr>() {
-            public int compare(Attr a, Attr b) {
-                int aOrder =3D getAttributeOrdering(a);
-                int bOrder =3D getAttributeOrdering(b);
-
-                return aOrder - bOrder;
-            }
-        };
-    }
-
-
-    /**
-     * Returns the priority with which a particular attribute should be proc=
essed.  Lower numbers should be processed before
-     * higher numbers.  This value is used by the {@link #getAttributeCompar=
ator} method to define the sort ordering.
-     *
-     * @param attr the attribute to treate
-     * @return the attribute's priority
-     */
-    protected int getAttributeOrdering(Attr attr) {
-        if (attr.getName().equals("displayedMnemonicIndex") || attr.getName(=
).equals("displayedMnemonic") || attr.getName().equals("mnemonic")) {
-            return 1;
-        }
-        return 0;
-    }
-
-
-    public String getApplyPropertyOrDataBindingCode(CompiledObject object, S=
tring propertyName, String stringValue, JAXXCompiler compiler) {
-        ClassDescriptor type =3D getPropertyType(object, propertyName, compi=
ler);
-        String binding =3D compiler.processDataBindings(stringValue, type);
-        if (binding !=3D null) {
-            return "";
-        }
-        try {
-            Class typeClass =3D type !=3D null ? ClassDescriptorLoader.getCl=
ass(type.getName(), type.getClassLoader()) : null;
-            Object value =3D convertFromString(propertyName, stringValue, ty=
peClass);
-            return getSetPropertyCode(object.getJavaCode(), propertyName, Ty=
peManager.getJavaCode(value), compiler);
-        } catch (NumberFormatException e) {
-            compiler.reportError("could not convert literal string '" + stri=
ngValue + "' to type " + type.getName());
-        } catch (IllegalArgumentException e) {
-            compiler.reportError("could not convert literal string '" + stri=
ngValue + "' to type " + type.getName());
-        } catch (ClassNotFoundException e) {
-            compiler.reportError("could not find class " + type.getName());
-        }
-        return "";
-    }
-
-
-    /**
-     * Set a single property on an object.  The value may be either a simple=
 value or contain data binding expressions.
-     * Simple values are first converted to the property's type using {@link=
 #convertFromString}.
-     *
-     * @param object       the object on which to set the property
-     * @param propertyName the name of the property to set
-     * @param stringValue  the raw string value of the property from the XML
-     * @param inline       <code>true</code> if the value was directly speci=
fied as an inline class tag attribute, <code>false</code> otherwise (a defaul=
t value, specified in CSS, etc.)
-     * @param compiler     the current <code>JAXXCompiler</code>
-     */
-    public void setAttribute(CompiledObject object, String propertyName, Str=
ing stringValue, boolean inline, JAXXCompiler compiler) {
-        try {
-            if (ClassDescriptorLoader.getClassDescriptor(JAXXObject.class).i=
sAssignableFrom(object.getObjectClass())) {
-                // check for data binding & remove if found
-                JAXXObjectDescriptor jaxxObjectDescriptor =3D object.getObje=
ctClass().getJAXXObjectDescriptor();
-                ComponentDescriptor root =3D jaxxObjectDescriptor.getCompone=
ntDescriptors()[0];
-                object.appendInitializationCode(object.getJavaCode() + ".rem=
oveDataBinding(" + TypeManager.getJavaCode(root.getId() + "." + propertyName)=
 + ");" + JAXXCompiler.getLineSeparator());
-            }
-            object.addProperty(propertyName, stringValue);
-            ClassDescriptor type =3D getPropertyType(object, propertyName, c=
ompiler);
-            String binding =3D compiler.processDataBindings(stringValue, typ=
e);
-            if (binding !=3D null) {
-                if (inline) {
-                    compiler.addInlineStyle(object, propertyName, true);
-                }
-                ClassDescriptor propertyType =3D getPropertyType(object, pro=
pertyName, compiler);
-                if (propertyType !=3D null &&
-                        propertyType !=3D ClassDescriptorLoader.getClassDesc=
riptor(Boolean.class) &&
-                        propertyType !=3D ClassDescriptorLoader.getClassDesc=
riptor(Byte.class) &&
-                        propertyType !=3D ClassDescriptorLoader.getClassDesc=
riptor(Short.class) &&
-                        propertyType !=3D ClassDescriptorLoader.getClassDesc=
riptor(Integer.class) &&
-                        propertyType !=3D ClassDescriptorLoader.getClassDesc=
riptor(Float.class) &&
-                        propertyType !=3D ClassDescriptorLoader.getClassDesc=
riptor(Double.class) &&
-                        propertyType !=3D ClassDescriptorLoader.getClassDesc=
riptor(Character.class)) {
-                    //binding =3D "((" + propertyType.getName() + ") " + bin=
ding + ")";
-                }
-                if (propertyName.equals("layout")) { // handle containerDele=
gate (e.g. contentPane on JFrame)
-                    // have to set layout early, before children are added
-                    object.appendInitializationCode(getSetPropertyCode(objec=
t.getJavaCode(), propertyName, binding, compiler));
-                }
-                object.registerDataBinding(binding, propertyName, getSetProp=
ertyCode(object.getJavaCode(), propertyName, binding, compiler), compiler);
-            } else { // no bindings, convert from string
-                if (inline) {
-                    compiler.addInlineStyle(object, propertyName, false);
-                }
-                try {
-                    Class typeClass =3D type !=3D null ? ClassDescriptorLoad=
er.getClass(type.getName(), type.getClassLoader()) : null;
-                    Object value =3D convertFromString(propertyName, stringV=
alue, typeClass);
-                    setProperty(object, propertyName, value, compiler);
-                } catch (NumberFormatException e) {
-                    compiler.reportError("could not convert literal string '=
" + stringValue + "' to type " + type.getName());
-                } catch (IllegalArgumentException e) {
-                    compiler.reportError("could not convert literal string '=
" + stringValue + "' to type " + type.getName());
-                } catch (ClassNotFoundException e) {
-                    compiler.reportError("could not find class " + type.getN=
ame());
-                }
-            }
-        } catch (UnsupportedAttributeException e) {
-            compiler.reportError("class " + object.getObjectClass().getName(=
) + " does not support attribute '" + propertyName + "'");
-        }
-    }
-
-
-    public void applyStylesheets(CompiledObject object, JAXXCompiler compile=
r) {
-        applyStylesheets(object, compiler, null);
-    }
-
-
-    private void applyStylesheets(final CompiledObject object, JAXXCompiler =
compiler, Stylesheet overrides) {
-        applyStylesheets(object, compiler, overrides, true);
-    }
-
-
-    private void applyStylesheets(final CompiledObject object, JAXXCompiler =
compiler, Stylesheet overrides, boolean recurse) {
-        try {
-            Stylesheet stylesheet =3D compiler.getStylesheet();
-            ClassDescriptor objectClass =3D object.getObjectClass();
-            if (recurse && ClassDescriptorLoader.getClassDescriptor(JAXXObje=
ct.class).isAssignableFrom(objectClass)) {
-                JAXXObjectDescriptor jaxxObjectDescriptor =3D objectClass.ge=
tJAXXObjectDescriptor();
-                ComponentDescriptor[] descriptors =3D jaxxObjectDescriptor.g=
etComponentDescriptors();
-                for (ComponentDescriptor descriptor : descriptors) {
-                    ClassDescriptor classDescriptor =3D ClassDescriptorLoade=
r.getClassDescriptor(descriptor.getJavaClassName());
-                    boolean isRoot =3D classDescriptor !=3D objectClass;
-                    String id =3D isRoot ? object.getId() + ' ' + descriptor=
.getId() : "( " + object.getId() + " ) " + descriptor.getId();
-                    CompiledObject child =3D new CompiledObject(id,
-                            "((" + JAXXCompiler.getCanonicalName(classDescri=
ptor) + ") " +
-                                    object.getJavaCode() + ".getObjectById("=
 + TypeManager.getJavaCode(descriptor.getId()) + "))",
-                            classDescriptor,
-                            compiler,
-                            true);
-                    ComponentDescriptor parentDescriptor =3D descriptor.getP=
arent();
-                    CompiledObject currentObject =3D child;
-                    while (parentDescriptor !=3D null) {
-                        CompiledObject parent =3D new CompiledObject("intern=
al", ClassDescriptorLoader.getClassDescriptor(parentDescriptor.getJavaClassNa=
me()), compiler);
-                        currentObject.setParent(parent);
-                        currentObject =3D parent;
-                        parentDescriptor =3D parentDescriptor.getParent();
-                    }
-                    currentObject.setParent(object);
-                    String styleClass =3D object.getStyleClass();
-                    if (styleClass =3D=3D null) {
-                        styleClass =3D descriptor.getStyleClass();
-                    }
-                    child.setStyleClass(styleClass);
-                    Stylesheet mergedStylesheet =3D overrides;
-                    Stylesheet childOverrides =3D jaxxObjectDescriptor.getSt=
ylesheet();
-                    if (childOverrides !=3D null) {
-                        if (mergedStylesheet =3D=3D null) {
-                            mergedStylesheet =3D childOverrides;
-                        } else {
-                            mergedStylesheet.add(childOverrides.getRules());
-                        }
-                    }
-                    TagManager.getTagHandler(objectClass).applyStylesheets(c=
hild, compiler, mergedStylesheet, isRoot);
-                    object.appendInitializationCode(child.getInitializationC=
ode(compiler));
-                }
-            } else if (stylesheet !=3D null)
-                stylesheet.applyTo(object, compiler, overrides);
-        }
-        catch (ClassNotFoundException e) {
-            throw new CompilerException(e);
-        }
-    }
-
-
-    /**
-     * Adds the necessary Java code to a <code>CompiledObject</code> to add =
an event listener at runtime.
-     *
-     * @param object   the <code>CompiledObject</code> to which the event li=
stener should be added
-     * @param name     the name of the event listener, such as <code>"action=
Performed"</code>
-     * @param value    the Java code snippet to execute when the event is fi=
red
-     * @param compiler the current <code>JAXXCompiler</code>
-     */
-    public void addEventHandler(CompiledObject object, String name, String v=
alue, JAXXCompiler compiler) {
-        JAXXEventSetDescriptor JAXXEventSetDescriptor =3D events.get(name);
-        if (JAXXEventSetDescriptor !=3D null) {
-            MethodDescriptor[] listenerMethods =3D JAXXEventSetDescriptor.ge=
tListenerMethods();
-            MethodDescriptor listenerMethod =3D null;
-            for (MethodDescriptor listenerMethod1 : listenerMethods) {
-                if (listenerMethod1.getName().equals(name)) {
-                    listenerMethod =3D listenerMethod1;
-                    break;
-                }
-            }
-            if (listenerMethod =3D=3D null) {
-                throw new RuntimeException("expected to find method '" + nam=
e + "' in JAXXEventSetDescriptor.getListenerMethods()");
-            }
-            try {
-                value =3D compiler.preprocessScript(value);
-                object.addEventHandler(name, JAXXEventSetDescriptor.getAddLi=
stenerMethod(), listenerMethod, value, compiler);
-            } catch (CompilerException e) {
-                compiler.reportError("While parsing event handler for '" + n=
ame + "': " + e.getMessage());
-            }
-        } else
-            compiler.reportError("could not find event '" + name + "' for ob=
ject " + object);
-    }
-
-
-    /**
-     * Returns a snippet of Java code which will retrieve an object property=
 at runtime.  Typically the code is
-     * just a call to the property's <code>get</code> method, but it can be =
arbitrarily complex.
-     *
-     * @param javaCode Java code for the object whose property is being retr=
ieved
-     * @param name     the name of the property to retrieve
-     * @param compiler the current <code>JAXXCompiler</code>
-     * @return the snippet
-     * @throws CompilerException if a compilation error occurs
-     */
-    public String getGetPropertyCode(String javaCode, String name, JAXXCompi=
ler compiler) {
-        try {
-            init();
-        } catch (IntrospectionException e) {
-            throw new RuntimeException(e);
-        }
-
-        JAXXPropertyDescriptor property =3D properties.get(name);
-        if (property !=3D null) {
-            if (property.getReadMethodDescriptor() !=3D null) {
-                return javaCode + '.' + property.getReadMethodDescriptor().g=
etName() + "()";
-            }
-            throw new UnsupportedAttributeException("property '" + name + "'=
 of " + getBeanClass().getName() + " has no read method");
-        }
-        throw new UnsupportedAttributeException("property '" + name + "' cou=
ld not be found in class " + getBeanClass().getName());
-    }
-
-
-    /**
-     * Returns a snippet of Java code which will set an object property at r=
untime.  Typically the code is
-     * just a call to the property's <code>set</code> method, but it can be =
arbitrarily complex.
-     *
-     * @param javaCode  Java code for the object whose property is being set
-     * @param name      the name of the property to set
-     * @param valueCode Java expression representing the value to set the pr=
operty to
-     * @param compiler  the current <code>JAXXCompiler</code>
-     * @return the snippet
-     * @throws CompilerException if a compilation error occurs
-     */
-    public String getSetPropertyCode(String javaCode, String name, String va=
lueCode, JAXXCompiler compiler) {
-        JAXXPropertyDescriptor property =3D properties.get(name);
-        if (property !=3D null) {
-            if (property.getWriteMethodDescriptor() !=3D null) {
-                return javaCode + '.' + property.getWriteMethodDescriptor().=
getName() + '(' + valueCode + ");";
-            }
-            throw new UnsupportedAttributeException("property '" + name + "'=
 of " + getBeanClass().getName() + " is read-only");
-        }
-        throw new UnsupportedAttributeException("property '" + name + "' cou=
ld not be found in class " + getBeanClass().getName());
-    }
-
-
-    /**
-     * Appends Java code to a <code>CompiledObject</code> in order to implem=
ent a property assignment.
-     * <code>setProperty</code> is invoked in response to most XML attribute=
s (those which are not more
-     * complicated cases, like data bindings or event handlers).
-     * <p/>
-     * By the time it reaches this method, the <code>value</code> has alread=
y been converted from its XML
-     * string representation to the appropriate destination type for the pro=
perty (i.e. if
-     * <code>JLabel.foreground</code> is being set, <code>value</code> will =
be a <code>Color</code>).
-     *
-     * @param object   the object being modified
-     * @param name     the name of the property to set
-     * @param value    the value to set the property to
-     * @param compiler the current <code>JAXXCompiler</code>
-     * @throws CompilerException if a compilation error occurs
-     */
-    public void setProperty(CompiledObject object, String name, Object value=
, JAXXCompiler compiler) {
-        object.appendInitializationCode(getSetPropertyCode(object.getJavaCod=
e(), name, TypeManager.getJavaCode(value), compiler));
-    }
-
-
-    /**
-     * Maps string values onto integers, so that int-valued enumeration prop=
erties can be specified by strings.  For
-     * example, when passed a key of 'alignment', this method should normall=
y map the values 'left', 'center', and
-     * 'right' onto SwingConstants.LEFT, SwingConstants.CENTER, and SwingCon=
stants.RIGHT respectively.
-     * <p/>
-     * You do not normally need to call this method yourself; it is invoked =
by {@link #convertFromString} when an
-     * int-valued property has a value which is not a valid number.  By defa=
ult, this method looks at the
-     * <code>enumerationValues</code> value of the <code>JAXXPropertyDescrip=
tor</code>.
-     *
-     * @param key   the name of the int-typed property
-     * @param value the non-numeric value that was specified for the property
-     * @return the constant integer value
-     * @throws IllegalArgumentException if the property is an enumeration, b=
ut the value is not valid
-     * @throws NumberFormatException    if the property is not an enumeration
-     */
-    protected int constantValue(String key, String value) {
-        JAXXBeanInfo JAXXBeanInfo =3D getJAXXBeanInfo();
-        JAXXPropertyDescriptor[] properties =3D JAXXBeanInfo.getJAXXProperty=
Descriptors();
-        String lowercaseValue =3D value.toLowerCase();
-        for (JAXXPropertyDescriptor property : properties) {
-            if (property.getName().equals(key)) {
-                Object[] values =3D (Object[]) property.getValue("enumeratio=
nValues");
-                if (values !=3D null) {
-                    for (int j =3D 0; j < values.length - 2; j +=3D 3) {
-                        if (((String) values[j]).toLowerCase().equals(lowerc=
aseValue)) {
-                            return (Integer) values[j + 1];
-                        }
-                    }
-
-                    StringBuffer message =3D new StringBuffer("value of '" +=
 key + "' must be one of: [");
-                    for (int j =3D 0; j < values.length - 2; j +=3D 3) {
-                        if (j !=3D 0) {
-                            message.append(", ");
-                        }
-                        message.append(((String) values[j]).toLowerCase());
-                    }
-                    message.append("] (found '").append(value).append("')");
-                    throw new IllegalArgumentException(message.toString());
-                }
-            }
-        }
-        throw new NumberFormatException(value);
-    }
-
-
-    /**
-     * As {@link TypeManager#convertFromString(String, Class)}, except that =
it additionally supports constant names
-     * for <code>int</code>-valued types.
-     *
-     * @param key   the name of the property whose value is being converted
-     * @param value the raw string value of the property as it appears in th=
e XML
-     * @param type  the datatype to convert the string into
-     * @return the converted object
-     * @see #constantValue
-     */
-    protected Object convertFromString(String key, String value, Class type)=
 {
-        if (type =3D=3D null || type =3D=3D Object.class) {
-            return value;
-        }
-
-        try {
-            return TypeManager.convertFromString(value, type);
-        } catch (NumberFormatException e) {
-            if (type =3D=3D int.class || type =3D=3D Integer.class) {
-                return constantValue(key, value);
-            }
-            throw e;
-        }
-    }
-
-
-    /**
-     * Compiles the child tags of the current tag.  The default implementati=
on invokes {@link #compileChildTagFirstPass}
-     * for each child tag.
-     *
-     * @param tag      the tag whose children to compile
-     * @param compiler the current <code>JAXXCompiler</code>
-     * @throws CompilerException if a compilation error occurs
-     * @throws IOException       if an I/O error occurs
-     */
-    protected void compileChildrenFirstPass(Element tag, JAXXCompiler compil=
er) throws CompilerException, IOException {
-        NodeList children =3D tag.getChildNodes();
-        for (int i =3D 0; i < children.getLength(); i++) {
-            Node node =3D children.item(i);
-            int nodeType =3D node.getNodeType();
-            if (nodeType =3D=3D Node.ELEMENT_NODE) {
-                Element child =3D (Element) node;
-                compileChildTagFirstPass(child, compiler);
-            }
-        }
-    }
-
-
-    /**
-     * Compiles the child tags of the current tag.  The default implementati=
on invokes {@link #compileChildTagFirstPass}
-     * for each child tag.
-     *
-     * @param tag      the tag whose children to compile
-     * @param compiler the current <code>JAXXCompiler</code>
-     * @throws CompilerException if a compilation error occurs
-     * @throws IOException       if an I/O error occurs
-     */
-    protected void compileChildrenSecondPass(Element tag, JAXXCompiler compi=
ler) throws CompilerException, IOException {
-        NodeList children =3D tag.getChildNodes();
-        for (int i =3D 0; i < children.getLength(); i++) {
-            Node node =3D children.item(i);
-            int nodeType =3D node.getNodeType();
-            if (nodeType =3D=3D Node.ELEMENT_NODE) {
-                Element child =3D (Element) node;
-                compileChildTagSecondPass(child, compiler);
-            } else if (nodeType =3D=3D Node.TEXT_NODE || nodeType =3D=3D Nod=
e.CDATA_SECTION_NODE) {
-                String text =3D ((Text) node).getData().trim();
-                if (text.length() > 0) {
-                    compiler.reportError("tag '" + tag.getLocalName() + "' m=
ay not contain text ('" + ((Text) node).getData().trim() + "')");
-                }
-            }
-        }
-    }
-
-
-    /**
-     * Compiles a child of the current tag.  The default implementation call=
s {@link JAXXCompiler#compileFirstPass
-     * JAXXCompiler.compileFirstPass}.
-     *
-     * @param tag      the child tag to compile
-     * @param compiler the current <code>JAXXCompiler</code>
-     * @throws CompilerException if a compilation error occurs
-     * @throws IOException       if an I/O error occurs
-     */
-    protected void compileChildTagFirstPass(Element tag, JAXXCompiler compil=
er) throws CompilerException, IOException {
-        compiler.compileFirstPass(tag);
-    }
-
-
-    /**
-     * Compiles a child of the current tag.  The default implementation call=
s {@link JAXXCompiler#compileFirstPass
-     * JAXXCompiler.compileSecondPass}.
-     *
-     * @param tag      the child tag to compile
-     * @param compiler the current <code>JAXXCompiler</code>
-     * @throws CompilerException if a compilation error occurs
-     * @throws IOException       if an I/O error occurs
-     */
-    protected void compileChildTagSecondPass(Element tag, JAXXCompiler compi=
ler) throws CompilerException, IOException {
-        compiler.compileSecondPass(tag);
-    }
-
-    @Override
-    public String toString() {
-        return getClass().getName() + "[" + getBeanClass().getName() + "]";
-    }
-}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/DefaultObjectHan=
dler.java (from rev 977, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/De=
faultObjectHandler.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/DefaultObjectHandler=
.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/DefaultObjectHandler=
.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,1109 @@
+/*
+ * Copyright 2006 Ethan Nicholas. All rights reserved.
+ * Use is subject to license terms.
+ */
+package jaxx.tags;
+
+import jaxx.CompilerException;
+import jaxx.UnsupportedAttributeException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.JavaArgument;
+import jaxx.compiler.JavaMethod;
+import jaxx.css.Stylesheet;
+import jaxx.introspection.JAXXBeanInfo;
+import jaxx.introspection.JAXXEventSetDescriptor;
+import jaxx.introspection.JAXXIntrospector;
+import jaxx.introspection.JAXXPropertyDescriptor;
+import jaxx.reflect.ClassDescriptor;
+import jaxx.reflect.ClassDescriptorLoader;
+import jaxx.reflect.FieldDescriptor;
+import jaxx.reflect.MethodDescriptor;
+import jaxx.runtime.ComponentDescriptor;
+import jaxx.runtime.JAXXObject;
+import jaxx.runtime.JAXXObjectDescriptor;
+import jaxx.types.TypeManager;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.PropertyChangeListener;
+import java.io.IOException;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+/**
+ * Default handler for class tags.  Class tags are tags which represent inst=
ances of Java classes,
+ * such as <code>&lt;JButton label=3D'Close'/&gt;</code>.  <code>DefaultObje=
ctHandler</code>
+ * provides support for attributes and events which adhere to JavaBeans nami=
ng conventions as
+ * well as basic JAXX features like the <code>id</code> attribute and data b=
inding by means of
+ * curly braces.
+ * <p/>
+ * Throughout this class, the word "member" refers to the name of a field or=
 method (e.g.
+ * <code>"getDocument"</code>) and the word "property" refers to the JavaBea=
ns-style simple
+ * name of a property (e.g. <code>"document"</code>).
+ */
+public class DefaultObjectHandler implements TagHandler {
+    /** The class that this handler provides support for. */
+    private ClassDescriptor beanClass;
+
+    /** The JAXXBeanInfo for the beanClass. */
+    protected JAXXBeanInfo jaxxBeanInfo;
+
+    /** Maps property names to their respective JAXXPropertyDescriptors. */
+    private Map<String, JAXXPropertyDescriptor> properties;
+
+    /** Maps event names to their respective JAXXEventSetDescriptors. */
+    private Map<String, JAXXEventSetDescriptor> events;
+
+    /** Maps property names to their respective ProxyEventInfos. */
+    private Map<String, ProxyEventInfo> eventInfos;
+
+    /** Maps XML tags to the CompiledObjects created from them. */
+    protected static Map<Element, CompiledObject> objectMap =3D new WeakHash=
Map<Element, CompiledObject>();
+
+    /**
+     * Encapsulates information about a "proxy event handler", which is an e=
vent handler that
+     * fires PropertyChangeEvents when it is triggered.  ProxyEventInfos sim=
plify the data binding
+     * system by allowing all dependencies to fire the same kind of event ev=
en if they would
+     * normally throw something else, like <code>DocumentEvent</code>.
+     */
+    private class ProxyEventInfo {
+        /** The name of the method or field being proxied, e.g. "getText". */
+        String memberName;
+
+        /** The "actual" event listener for the property in question, e.g. D=
ocumentListener. */
+        ClassDescriptor listenerClass;
+
+        /**
+         * In cases where a different object (such as a model) is more direc=
tly responsible for
+         * managing the property, this is the name of the property where tha=
t object can be
+         * found, e.g. "document" (which is turned into a call to "getDocume=
nt()").  This property
+         * is also treated as a dependency of the data binding expression, a=
nd any updates to it
+         * (assuming it is bound) will cause the listener to be removed from=
 the old value and
+         * attached to the new value, and the data binding to be processed.
+         */
+        String modelName;
+
+        /** The name of the method used to add the "native" event listener, =
e.g. "addDocumentListener". */
+        String addMethod;
+
+        /** The name of the method used to remove the "native" event listene=
r, e.g. "removeDocumentListener". */
+        String removeMethod;
+    }
+
+
+    /**
+     * Creates a new <code>DefaultObjectHandler</code> which provides suppor=
t for the specified class.  The
+     * class is not actually introspected until the {@link #compileFirstPass=
} method is invoked.
+     *
+     * @param beanClass the class which this handler supports
+     */
+    public DefaultObjectHandler(ClassDescriptor beanClass) {
+        this.beanClass =3D beanClass;
+    }
+
+
+    /**
+     * Performs introspection on the beanClass and stores the results.
+     *
+     * @throws java.beans.IntrospectionException
+     *          TODO
+     */
+    protected void init() throws IntrospectionException {
+        if (jaxxBeanInfo =3D=3D null) {
+            // perform introspection & cache the results
+            jaxxBeanInfo =3D getJAXXBeanInfo(beanClass);
+
+            JAXXPropertyDescriptor[] propertiesArray =3D jaxxBeanInfo.getJAX=
XPropertyDescriptors();
+            properties =3D new HashMap<String, JAXXPropertyDescriptor>();
+            for (int i =3D propertiesArray.length - 1; i >=3D 0; i--) {
+                properties.put(propertiesArray[i].getName(), propertiesArray=
[i]);
+            }
+
+            JAXXEventSetDescriptor[] eventsArray =3D jaxxBeanInfo.getJAXXEve=
ntSetDescriptors();
+            events =3D new HashMap<String, JAXXEventSetDescriptor>();
+            for (int i =3D eventsArray.length - 1; i >=3D 0; i--) {
+                MethodDescriptor[] methods =3D eventsArray[i].getListenerMet=
hods();
+                for (MethodDescriptor method : methods) {
+                    events.put(method.getName(), eventsArray[i]);
+                }
+            }
+
+            configureProxyEventInfo();
+        }
+    }
+
+
+    /**
+     * Returns
+     *
+     * @return the class which this <code>DefaultObjectHandler</code> suppor=
ts.
+     */
+    public ClassDescriptor getBeanClass() {
+        return beanClass;
+    }
+
+
+    /**
+     * @return the <code>JAXXBeanInfo</code> for the class which this <code>=
DefaultObjectHandler</code>
+     *         supports.
+     */
+    public JAXXBeanInfo getJAXXBeanInfo() {
+        try {
+            init();
+        } catch (IntrospectionException e) {
+            throw new RuntimeException(e);
+        }
+        return jaxxBeanInfo;
+    }
+
+
+    /**
+     * Returns the <code>JAXXBeanInfo</code> for the specified class.
+     *
+     * @param beanClass the bean class for which to retrieve <code>JAXXBeanI=
nfo</code>
+     * @return the class' <code>JAXXBeanInfo</code>
+     * @throws java.beans.IntrospectionException
+     *          ?
+     */
+    public static JAXXBeanInfo getJAXXBeanInfo(ClassDescriptor beanClass) th=
rows IntrospectionException {
+        return JAXXIntrospector.getJAXXBeanInfo(beanClass);
+    }
+
+
+    /**
+     * Returns the type of the named property.  This is the return type of t=
he property's <code>get</code> method;
+     * for instance <code>JLabel</code>'s <code>text</code> property is a <c=
ode>String</code>.
+     *
+     * @param object       the object being compiled
+     * @param propertyName the simple JavaBeans-style name of the property
+     * @param compiler     the current <code>JAXXCompiler</code>
+     * @return the property's type
+     * @throws CompilerException if the type cannot be determined
+     */
+    public ClassDescriptor getPropertyType(CompiledObject object, String pro=
pertyName, JAXXCompiler compiler) {
+        try {
+            init();
+        } catch (IntrospectionException e) {
+            throw new RuntimeException(e);
+        }
+
+        JAXXPropertyDescriptor property =3D properties.get(propertyName);
+        if (property !=3D null) {
+            return property.getPropertyType();
+        }
+        throw new UnsupportedAttributeException("property '" + propertyName =
+ "' not found in " + object);
+    }
+
+
+    /**
+     * @param name ?
+     * @return <code>true</code> if the named member is <i>bound</i> (fires =
<code>PropertyChangeEvent</code>
+     *         when modified).  Members are either fields (represented by th=
e simple name of the field) or <code>get/is</code>
+     *         methods (represented by the simple name of the method, <b>not=
</b> the simplified JavaBeans-style name).
+     *         Methods which are not actually bound in their native class, b=
ut for which proxy events have been
+     *         configured (such as <code>JTextField.getText</code>, return <=
code>true</code>.
+     * @throws jaxx.UnsupportedAttributeException
+     *          ?
+     */
+    public boolean isMemberBound(String name) throws UnsupportedAttributeExc=
eption {
+        try {
+            init();
+        } catch (IntrospectionException e) {
+            throw new RuntimeException(e);
+        }
+
+        if (eventInfos !=3D null && eventInfos.containsKey(name)) {
+            return true;
+        }
+
+        if (name.equals("getClass")) {
+            return false;
+        }
+
+        String propertyName =3D null;
+        if (name.startsWith("get")) {
+            propertyName =3D Introspector.decapitalize(name.substring("get".=
length()));
+        } else if (name.startsWith("is")) {
+            propertyName =3D Introspector.decapitalize(name.substring("is".l=
ength()));
+        }
+        JAXXPropertyDescriptor property =3D propertyName !=3D null ? propert=
ies.get(propertyName) : null;
+        if (property !=3D null) {
+            return property.isBound();
+        }
+        try {
+            FieldDescriptor field =3D getBeanClass().getFieldDescriptor(name=
);
+            return Modifier.isFinal(field.getModifiers()); // final fields m=
ight as well be considered bound -- they can't be modified anyway
+        } catch (NoSuchFieldException e) {
+            throw new UnsupportedAttributeException("cannot find property '"=
 + name + "' of " + getBeanClass());
+        }
+    }
+
+
+    private static ClassDescriptor getEventClass(ClassDescriptor listenerCla=
ss) {
+        return listenerClass.getMethodDescriptors()[0].getParameterTypes()[0=
];
+    }
+
+
+    /**
+     * @param memberName name of the member
+     * @return an array of members on which the given property depends.  For
+     *         example, the JTextField.getText() member depends upon the get=
Model()
+     *         member.  Returns <code>null</code> if there are no dependenci=
es.
+     */
+    public String[] getMemberDependencies(String memberName) {
+        ProxyEventInfo eventInfo =3D eventInfos !=3D null ? eventInfos.get(m=
emberName) : null;
+        return eventInfo =3D=3D null ? null : new String[]{eventInfo.modelNa=
me};
+    }
+
+
+    /**
+     * Returns a snippet of Java code which will cause a <code>PropertyChang=
eListener</code> to be notified
+     * when the member's value changes.  The <code>PropertyChangeListener</c=
ode> is provided in the form
+     * of a Java code snippet that evaluates to a listener object.
+     * <p/>
+     * For ordinary bound JavaBeans properties, the Java code returned is a =
simple call to
+     * <code>addPropertyChangeListener</code>.  Fields and methods which do =
not actually fire
+     * <code>PropertyChangeEvents</code> when they change necessitate more c=
omplex code.
+     *
+     * @param objectCode                 Java code which evaluates to the ob=
ject to which to add the listener
+     *                                   *@param dataBinding the name of the=
 data binding this listener is a part of
+     * @param dataBinding databinding
+     * @param memberName                 the name of the field or method to =
listen to
+     * @param propertyChangeListenerCode Java code which evaluates to a <cod=
e>PropertyChangeListener</code>
+     * @param compiler                   the current <code>JAXXCompiler</cod=
e>
+     * @return Java code snippet which causes the listener to be added to th=
e object
+     */
+    public String getAddMemberListenerCode(String objectCode, String dataBin=
ding, String memberName, String propertyChangeListenerCode, JAXXCompiler comp=
iler) {
+        if ("getClass".equals(memberName)) {
+            return null;
+        }
+
+        ProxyEventInfo eventInfo =3D eventInfos !=3D null ? eventInfos.get(m=
emberName) : null;
+        if (eventInfo !=3D null) { // a "proxied" event is one that doesn't =
fire PropertyChangeEvent, so we need to convert its native event type into Pr=
opertyChangeEvents
+            StringBuffer result =3D new StringBuffer();
+            String methodName =3D "$pr" + compiler.getUniqueId(propertyChang=
eListenerCode);
+            boolean methodExists =3D compiler.hasMethod(methodName);
+            ClassDescriptor eventClass =3D getEventClass(eventInfo.listenerC=
lass);
+            if (!methodExists) {
+                compiler.addMethodToJavaFile(new JavaMethod(Modifier.PUBLIC,=
 "void", methodName,
+                        new JavaArgument[]{new JavaArgument(JAXXCompiler.get=
CanonicalName(eventClass), "event")}, null,
+                        propertyChangeListenerCode + ".propertyChange(null);=
"));
+            }
+            String code =3D objectCode + (eventInfo.modelName !=3D null ? ".=
get" + JAXXCompiler.capitalize(eventInfo.modelName) + "()" : "");
+            result.append("$bindingSources.put(\"").append(code).append("\",=
 ").append(code).append(");").append(JAXXCompiler.getLineSeparator());
+            result.append(code).append('.').append(eventInfo.addMethod).appe=
nd("((").append(JAXXCompiler.getCanonicalName(eventInfo.listenerClass)).appen=
d(") jaxx.runtime.Util.getEventListener(").append(JAXXCompiler.getCanonicalNa=
me(eventInfo.listenerClass)).append(".class, ").append(compiler.getRootObject=
().getJavaCode()).append(", ").append(TypeManager.getJavaCode(methodName)).ap=
pend("));\n");
+            if (eventInfo.modelName !=3D null) {
+                result.append(getAddMemberListenerCode(objectCode, dataBindi=
ng, "get" + JAXXCompiler.capitalize(eventInfo.modelName),
+                        "jaxx.runtime.Util.getDataBindingUpdateListener(this=
 , \"" + dataBinding + "\")",
+                        compiler));
+            }
+            return result.toString();
+        } else {
+            String propertyName =3D null;
+            if (memberName.startsWith("get")) {
+                propertyName =3D Introspector.decapitalize(memberName.substr=
ing("get".length()));
+            } else if (memberName.startsWith("is")) {
+                propertyName =3D Introspector.decapitalize(memberName.substr=
ing("is".length()));
+            }
+            else {
+                try {
+                    getBeanClass().getFieldDescriptor(memberName);
+                    propertyName =3D memberName;
+                } catch (NoSuchFieldException e) {
+                    // ignore ?
+                }
+            }
+            if (propertyName !=3D null) {
+                try {
+                    // check for property-specific addPropertyChangeListener=
 method
+                    getBeanClass().getMethodDescriptor("addPropertyChangeLis=
tener", new ClassDescriptor[]{ClassDescriptorLoader.getClassDescriptor(String=
.class),
+                            ClassDescriptorLoader.getClassDescriptor(Propert=
yChangeListener.class)});
+                    return objectCode + ".addPropertyChangeListener(\"" + pr=
opertyName + "\", " + propertyChangeListenerCode + ");\n";
+                } catch (NoSuchMethodException e) {
+                    // no property-specific method, use general one=20
+                    return objectCode + ".addPropertyChangeListener(" + prop=
ertyChangeListenerCode + ");\n";
+                }
+            }
+            return null;
+        }
+    }
+
+
+    public String getRemoveMemberListenerCode(String objectCode, String data=
Binding, String memberName, String propertyChangeListenerCode, JAXXCompiler c=
ompiler) {
+        if ("getClass".equals(memberName)) {
+            return null;
+        }
+
+        ProxyEventInfo eventInfo =3D eventInfos !=3D null ? eventInfos.get(m=
emberName) : null;
+        if (eventInfo !=3D null) { // a "proxied" event is one that doesn't =
fire PropertyChangeEvent, so we need to convert its native event type into Pr=
opertyChangeEvents
+            StringBuffer result =3D new StringBuffer();
+            String methodName =3D "$pr" + compiler.getUniqueId(propertyChang=
eListenerCode);
+            boolean methodExists =3D compiler.hasMethod(methodName);        =
   =20
+            if (!methodExists) {
+                ClassDescriptor eventClass =3D getEventClass(eventInfo.liste=
nerClass);
+                compiler.addMethodToJavaFile(new JavaMethod(Modifier.PUBLIC,=
 "void", methodName,
+                        new JavaArgument[]{new JavaArgument(JAXXCompiler.get=
CanonicalName(eventClass), "event")}, null,
+                        propertyChangeListenerCode + ".propertyChange(null);=
"));               =20
+            }
+            try {
+                String modelMemberName =3D eventInfo.modelName !=3D null ? "=
get" + JAXXCompiler.capitalize(eventInfo.modelName) : null;
+                String modelClassName =3D modelMemberName !=3D null ? getBea=
nClass().getMethodDescriptor(modelMemberName, new ClassDescriptor[0]).getRetu=
rnType().getName() : JAXXCompiler.getCanonicalName(getBeanClass());
+                String code =3D objectCode + (eventInfo.modelName !=3D null =
? "." + modelMemberName + "()" : "");
+                result.append("((").append(modelClassName).append(") $bindin=
gSources.remove(\"").append(code).append("\")).").append(eventInfo.removeMeth=
od).append("((").append(JAXXCompiler.getCanonicalName(eventInfo.listenerClass=
)).append(") jaxx.runtime.Util.getEventListener(").append(JAXXCompiler.getCan=
onicalName(eventInfo.listenerClass)).append(".class, ").append(compiler.getRo=
otObject().getJavaCode()).append(", ").append(TypeManager.getJavaCode(methodN=
ame)).append("));\n");
+                if (eventInfo.modelName !=3D null) {
+                    result.append(getRemoveMemberListenerCode(objectCode, da=
taBinding, "get" + JAXXCompiler.capitalize(eventInfo.modelName),
+                            "jaxx.runtime.Util.getDataBindingUpdateListener(=
this, \"" + dataBinding + "\")",
+                            compiler));
+                }
+                return result.toString();
+            }
+            catch (NoSuchMethodException e) {
+                throw new CompilerException("Internal error: " + e);
+            }
+        } else {
+            String propertyName =3D null;
+            if (memberName.startsWith("get")) {
+                propertyName =3D Introspector.decapitalize(memberName.substr=
ing("get".length()));
+            } else if (memberName.startsWith("is")) {
+                propertyName =3D Introspector.decapitalize(memberName.substr=
ing("is".length()));
+            } else {
+                try {
+                    getBeanClass().getFieldDescriptor(memberName);
+                    propertyName =3D memberName;
+                } catch (NoSuchFieldException e) {
+                    // ignore ?
+                }
+            }
+            if (propertyName !=3D null) {
+                try {
+                    // check for property-specific removePropertyChangeListe=
ner method
+                    getBeanClass().getMethodDescriptor("removePropertyChange=
Listener", new ClassDescriptor[]{ClassDescriptorLoader.getClassDescriptor(Str=
ing.class),
+                            ClassDescriptorLoader.getClassDescriptor(Propert=
yChangeListener.class)});
+                    return objectCode + ".removePropertyChangeListener(\"" +=
 propertyName + "\", " + propertyChangeListenerCode + ");\n";
+                } catch (NoSuchMethodException e) {
+                    // no property-specific method, use general one=20
+                    return objectCode + ".removePropertyChangeListener(" + p=
ropertyChangeListenerCode + ");\n";
+                }
+            }
+            return null;
+        }
+    }
+
+
+    /**
+     * Configures the event handling for members which do not fire <code>Pro=
pertyChangeEvent</code> when
+     * modified.  The default implementation does nothing.  Subclasses shoul=
d override this method to call
+     * <code>addProxyEventInfo</code> for each member which requires special=
 handling.
+     */
+    protected void configureProxyEventInfo() {
+    }
+
+
+    /**
+     * Configures a proxy event handler which fires <code>PropertyChangeEven=
ts</code> when a non-bound
+     * member is updated.  This is necessary for all fields (which cannot be=
 bound) and for methods that are
+     * not bound property <code>get</code> methods.  The proxy event handler=
 will attach the specified kind
+     * of listener to the class and fire a <code>PropertyChangeEvent</code> =
whenever the listener receives
+     * any kind of event.
+     * <p/>
+     * Even though this method can theoretically be applied to fields (in ad=
dition to methods), it would be an
+     * unusual situation in which that would actually work -- as fields cann=
ot fire events when modified, it would
+     * be difficult to have a listener that was always notified when a field=
 value changed.
+     *
+     * @param memberName    the name of the field or method being proxied
+     * @param listenerClass the type of listener which receives events when =
the field or method is updated
+     */
+    public void addProxyEventInfo(String memberName, Class listenerClass) {
+        addProxyEventInfo(memberName, listenerClass, null);
+    }
+
+
+    /**
+     * Configures a proxy event handler which fires <code>PropertyChangeEven=
ts</code> when a non-bound
+     * member is updated.  This is necessary for all fields (which cannot be=
 bound) and for methods that are
+     * not bound property <code>get</code> methods.  This variant attaches a=
 listener to a property of the
+     * object (such as <code>model</code>) and not the object itself, which =
is useful when there is a model
+     * that is the "real" container of the information.  The proxy event han=
dler will attach the specified kind
+     * of listener to the property's value (retrieved using the property's <=
code>get</code> method) and fire
+     * a <code>PropertyChangeEvent</code> whenever the listener receives any=
 kind of event.
+     * <p/>
+     * If the property is itself bound (typically the case with models), any=
 updates to the property's value will
+     * cause the listener to be removed from the old property value and reat=
tached to the new property value,
+     * as well as cause a <code>PropertyChangeEvent</code> to be fired.
+     * <p/>
+     * Even though this method can theoretically be applied to fields (in ad=
dition to methods), it would be an
+     * unusual situation in which that would actually work -- as fields cann=
ot fire events when modified, it would
+     * be difficult to have a listener that was always notified when a field=
 value changed.
+     *
+     * @param memberName    the name of the field or method being proxied
+     * @param listenerClass the type of listener which receives events when =
the field or method is updated
+     * @param modelName     the JavaBeans-style name of the model property
+     */
+    public void addProxyEventInfo(String memberName, Class listenerClass, St=
ring modelName) {
+        String listenerName =3D listenerClass.getName();
+        listenerName =3D listenerName.substring(listenerName.lastIndexOf("."=
) + 1);
+        addProxyEventInfo(memberName, listenerClass, modelName, "add" + list=
enerName, "remove" + listenerName);
+    }
+
+
+    // TODO: remove this temporary method, complete switchover to ClassDescr=
iptors
+    public void addProxyEventInfo(String memberName, Class listenerClass,
+                                  String modelName, String addMethod, String=
 removeMethod) {
+        try {
+            addProxyEventInfo(memberName, ClassDescriptorLoader.getClassDesc=
riptor(listenerClass.getName()), modelName, addMethod, removeMethod);
+        }  catch (ClassNotFoundException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+
+    /**
+     * Configures a proxy event handler which fires <code>PropertyChangeEven=
ts</code> when a non-bound
+     * member is updated.  This is necessary for all fields (which cannot be=
 bound) and for methods that are
+     * not bound property <code>get</code> methods.  This variant attaches a=
 listener to a property of the
+     * object (such as <code>model</code>) and not the object itself, which =
is useful when there is a model
+     * that is the "real" container of the information.  The proxy event han=
dler will attach the specified kind
+     * of listener to the property's value (retrieved using the property's <=
code>get</code> method) and fire
+     * a <code>PropertyChangeEvent</code> whenever the listener receives any=
 kind of event.
+     * <p/>
+     * If the property is itself bound (typically the case with models), any=
 updates to the property's value will
+     * cause the listener to be removed from the old property value and reat=
tached to the new property value,
+     * as well as cause a <code>PropertyChangeEvent</code> to be fired.
+     * <p/>
+     * This variant of <code>addProxyEventInfo</code> allows the names of th=
e methods that add and remove
+     * the event listener to be specified, in cases where the names are not =
simply <code>add&lt;listenerClassName&gt;</code>
+     * and <code>remove&lt;listenerClassName&gt;</code>.
+     * <p/>
+     * Even though this method can theoretically be applied to fields (in ad=
dition to methods), it would be an
+     * unusual situation in which that would actually work -- as fields cann=
ot fire events when modified, it would
+     * be difficult to have a listener that was always notified when a field=
 value changed.
+     *
+     * @param memberName    the name of the field or method being proxied
+     * @param listenerClass the type of listener which receives events when =
the field or method is updated
+     * @param modelName     the JavaBeans-style name of the model property
+     * @param addMethod     add method name
+     * @param removeMethod  remove method name
+     */
+    public void addProxyEventInfo(String memberName, ClassDescriptor listene=
rClass,
+                                  String modelName, String addMethod, String=
 removeMethod) {
+        ProxyEventInfo info =3D new ProxyEventInfo();
+        info.memberName =3D memberName;
+        info.listenerClass =3D listenerClass;
+        info.modelName =3D modelName;
+        info.addMethod =3D addMethod;
+        info.removeMethod =3D removeMethod;
+        if (eventInfos =3D=3D null) {
+            eventInfos =3D new HashMap<String, ProxyEventInfo>();
+        }
+        eventInfos.put(memberName, info);
+    }
+
+
+    public void compileFirstPass(Element tag, JAXXCompiler compiler) throws =
CompilerException, IOException {
+        scanAttributesForDependencies(tag, compiler);
+        compileChildrenFirstPass(tag, compiler);
+    }
+
+
+    public void compileSecondPass(Element tag, JAXXCompiler compiler) throws=
 CompilerException, IOException {
+        try {
+            init();
+        } catch (IntrospectionException e) {
+            throw new RuntimeException(e);
+        }
+        CompiledObject object =3D objectMap.get(tag);
+        if (object =3D=3D null) {
+            throw new IllegalStateException("unable to find CompiledObject a=
ssociated with tag <" + tag.getTagName() + ">;  should have been registered b=
efore second pass");
+        }
+        compiler.checkOverride(object);
+        String constructorParams =3D tag.getAttribute("constructorParams");
+        if (constructorParams !=3D null && constructorParams.length() > 0) {
+            object.setConstructorParams(compiler.getScriptManager().trimScri=
pt(constructorParams));
+        }
+
+        setDefaults(object, tag, compiler);
+        setAttributes(object, tag, compiler);
+
+        compileChildrenSecondPass(tag, compiler);
+    }
+
+
+    public void registerCompiledObject(Element tag, JAXXCompiler compiler) {
+        String id =3D tag.getAttribute("id");
+        if (id =3D=3D null || id.length() =3D=3D 0) {
+            id =3D compiler.getAutoId(getBeanClass());
+        }
+        CompiledObject object =3D createCompiledObject(id, compiler);
+        objectMap.put(tag, object);
+        String styleClass =3D tag.getAttribute("styleClass").trim();
+        if (styleClass.length() > 0) {
+            object.setStyleClass(styleClass);
+        }
+        compiler.registerCompiledObject(object);
+    }
+
+
+    /**
+     * Creates the <code>CompiledObject</code> which will represent the obje=
ct created by this <code>TagHandler</code>.
+     *
+     * @param id       the <code>CompiledObject's</code> ID.
+     * @param compiler compiler to use
+     * @return the <code>CompiledObject</code> to use
+     */
+    protected CompiledObject createCompiledObject(String id, JAXXCompiler co=
mpiler) {
+        return new CompiledObject(id, getBeanClass(), compiler);
+    }
+
+
+    /**
+     * Initializes the default settings of the object, prior to setting its =
attribute values.  The default
+     * implementation does nothing.
+     *
+     * @param object   the object to initialize
+     * @param tag      the tag being compiled
+     * @param compiler the current <code>JAXXCompiler</code>
+     */
+    protected void setDefaults(CompiledObject object, Element tag, JAXXCompi=
ler compiler) {
+    }
+
+
+    /**
+     * @param property property name to test
+     * @return <code>true</code> if the specified property should be inherit=
ed by child components when specified
+     *         via CSS.
+     * @throws jaxx.UnsupportedAttributeException
+     *          ?
+     */
+    public boolean isPropertyInherited(String property) throws UnsupportedAt=
tributeException {
+        return false;
+    }
+
+
+    /**
+     * @param name name of event
+     * @return <code>true</code> if the specified name has the form of an ev=
ent handler attribute
+     *         (e.g. "onActionPerformed").
+     */
+    public boolean isEventHandlerName(String name) {
+        return name.length() > 2 && name.startsWith("on") && Character.isUpp=
erCase(name.charAt(2));
+    }
+
+
+    /**
+     * Scans all attributes for any dependency classes and adds them to the =
current compilation
+     * set.  Called by <code>compileFirstPass()</code> (it is an error to ad=
d dependencies after
+     * pass 1 is complete).
+     *
+     * @param tag      tag to scan
+     * @param compiler compiler to use
+     */
+    protected void scanAttributesForDependencies(Element tag, JAXXCompiler c=
ompiler) {
+        List<Attr> attributes =3D new ArrayList<Attr>();
+        NamedNodeMap children =3D tag.getAttributes();
+        for (int i =3D 0; i < children.getLength(); i++) {
+            attributes.add((Attr) children.item(i));
+        }
+        Collections.sort(attributes, getAttributeComparator());
+
+        for (Attr attribute : attributes) {
+            String name =3D attribute.getName();
+            String value =3D attribute.getValue();
+            if (name.equals("constraints") || isEventHandlerName(name)) {
+                compiler.preprocessScript(value); // adds dependencies as a =
side effect
+            } else if (name.equals("constructorParams")) {
+                for (String param : value.split("\\s*,\\s*")) {
+                    compiler.preprocessScript(param);
+                }
+            } else if (value.startsWith("{") && value.endsWith("}")) {
+                compiler.preprocessScript(value.substring(1, value.length() =
- 1));
+            }
+        }
+    }
+
+
+    /**
+     * Processes the attributes of an XML tag.  Four kinds of attributes are=
 supported: simple property values (of any
+     * datatype  supported by {@link #convertFromString}), data binding expr=
essions (attributes containing curly-brace
+     * pairs), event listeners (attributes starting with 'on', such as 'onAc=
tionPerformed'), and JAXX-defined properties
+     * such as 'id'.
+     *
+     * @param object   the object to be modified
+     * @param tag      the tag from which to pull attributes
+     * @param compiler the current <code>JAXXCompiler</code>
+     */
+    public void setAttributes(CompiledObject object, Element tag, JAXXCompil=
er compiler) {
+        List<Attr> attributes =3D new ArrayList<Attr>();
+        NamedNodeMap children =3D tag.getAttributes();
+        for (int i =3D 0; i < children.getLength(); i++) {
+            attributes.add((Attr) children.item(i));
+        }
+        Collections.sort(attributes, getAttributeComparator());
+
+        for (Attr attribute : attributes) {
+            String name =3D attribute.getName();
+            String value =3D attribute.getValue().trim();
+            if (name.equals("id") || name.equals("constraints") || name.equa=
ls("constructorParams") || name.equals("styleClass") ||
+                    name.startsWith("xmlns") || JAXXCompiler.JAXX_INTERNAL_N=
AMESPACE.equals(attribute.getNamespaceURI())) {
+                // ignore, already handled
+            } else if (isEventHandlerName(name)) {
+                if (!value.endsWith(";")) {
+                    value+=3D";";
+                }
+                addEventHandler(object, Introspector.decapitalize(name.subst=
ring(2)), value, compiler);
+            }  else {
+                setAttribute(object, name, value, true, compiler);
+            }
+        }
+    }
+
+
+    /**
+     * Returns a <code>Comparator</code> which defines the ordering in which=
 the tag's attributes should be processed.  The
+     * default implementation sorts the attributes according to the order de=
fined by the {@link #getAttributeOrdering} method.
+     *
+     * @return a <code>Comparator</code> defining the order of attribute pro=
cessing
+     */
+    protected Comparator<Attr> getAttributeComparator() {
+        return new Comparator<Attr>() {
+            public int compare(Attr a, Attr b) {
+                int aOrder =3D getAttributeOrdering(a);
+                int bOrder =3D getAttributeOrdering(b);
+
+                return aOrder - bOrder;
+            }
+        };
+    }
+
+
+    /**
+     * Returns the priority with which a particular attribute should be proc=
essed.  Lower numbers should be processed before
+     * higher numbers.  This value is used by the {@link #getAttributeCompar=
ator} method to define the sort ordering.
+     *
+     * @param attr the attribute to treate
+     * @return the attribute's priority
+     */
+    protected int getAttributeOrdering(Attr attr) {
+        if (attr.getName().equals("displayedMnemonicIndex") || attr.getName(=
).equals("displayedMnemonic") || attr.getName().equals("mnemonic")) {
+            return 1;
+        }
+        return 0;
+    }
+
+
+    public String getApplyPropertyOrDataBindingCode(CompiledObject object, S=
tring propertyName, String stringValue, JAXXCompiler compiler) {
+        ClassDescriptor type =3D getPropertyType(object, propertyName, compi=
ler);
+        String binding =3D compiler.processDataBindings(stringValue, type);
+        if (binding !=3D null) {
+            return "";
+        }
+        try {
+            Class typeClass =3D type !=3D null ? ClassDescriptorLoader.getCl=
ass(type.getName(), type.getClassLoader()) : null;
+            Object value =3D convertFromString(propertyName, stringValue, ty=
peClass);
+            return getSetPropertyCode(object.getJavaCode(), propertyName, Ty=
peManager.getJavaCode(value), compiler);
+        } catch (NumberFormatException e) {
+            compiler.reportError("could not convert literal string '" + stri=
ngValue + "' to type " + type.getName());
+        } catch (IllegalArgumentException e) {
+            compiler.reportError("could not convert literal string '" + stri=
ngValue + "' to type " + type.getName());
+        } catch (ClassNotFoundException e) {
+            compiler.reportError("could not find class " + type.getName());
+        }
+        return "";
+    }
+
+
+    /**
+     * Set a single property on an object.  The value may be either a simple=
 value or contain data binding expressions.
+     * Simple values are first converted to the property's type using {@link=
 #convertFromString}.
+     *
+     * @param object       the object on which to set the property
+     * @param propertyName the name of the property to set
+     * @param stringValue  the raw string value of the property from the XML
+     * @param inline       <code>true</code> if the value was directly speci=
fied as an inline class tag attribute, <code>false</code> otherwise (a defaul=
t value, specified in CSS, etc.)
+     * @param compiler     the current <code>JAXXCompiler</code>
+     */
+    public void setAttribute(CompiledObject object, String propertyName, Str=
ing stringValue, boolean inline, JAXXCompiler compiler) {
+        try {
+            if (ClassDescriptorLoader.getClassDescriptor(JAXXObject.class).i=
sAssignableFrom(object.getObjectClass())) {
+                // check for data binding & remove if found
+                JAXXObjectDescriptor jaxxObjectDescriptor =3D object.getObje=
ctClass().getJAXXObjectDescriptor();
+                ComponentDescriptor root =3D jaxxObjectDescriptor.getCompone=
ntDescriptors()[0];
+                object.appendInitializationCode(object.getJavaCode() + ".rem=
oveDataBinding(" + TypeManager.getJavaCode(root.getId() + "." + propertyName)=
 + ");" + JAXXCompiler.getLineSeparator());
+            }
+            object.addProperty(propertyName, stringValue);
+            ClassDescriptor type =3D getPropertyType(object, propertyName, c=
ompiler);
+            String binding =3D compiler.processDataBindings(stringValue, typ=
e);
+            if (binding !=3D null) {
+                if (inline) {
+                    compiler.addInlineStyle(object, propertyName, true);
+                }
+                ClassDescriptor propertyType =3D getPropertyType(object, pro=
pertyName, compiler);
+                if (propertyType !=3D null &&
+                        propertyType !=3D ClassDescriptorLoader.getClassDesc=
riptor(Boolean.class) &&
+                        propertyType !=3D ClassDescriptorLoader.getClassDesc=
riptor(Byte.class) &&
+                        propertyType !=3D ClassDescriptorLoader.getClassDesc=
riptor(Short.class) &&
+                        propertyType !=3D ClassDescriptorLoader.getClassDesc=
riptor(Integer.class) &&
+                        propertyType !=3D ClassDescriptorLoader.getClassDesc=
riptor(Float.class) &&
+                        propertyType !=3D ClassDescriptorLoader.getClassDesc=
riptor(Double.class) &&
+                        propertyType !=3D ClassDescriptorLoader.getClassDesc=
riptor(Character.class)) {
+                    //binding =3D "((" + propertyType.getName() + ") " + bin=
ding + ")";
+                }
+                if (propertyName.equals("layout")) { // handle containerDele=
gate (e.g. contentPane on JFrame)
+                    // have to set layout early, before children are added
+                    object.appendInitializationCode(getSetPropertyCode(objec=
t.getJavaCode(), propertyName, binding, compiler));
+                }
+                object.registerDataBinding(binding, propertyName, getSetProp=
ertyCode(object.getJavaCode(), propertyName, binding, compiler), compiler);
+            } else { // no bindings, convert from string
+                if (inline) {
+                    compiler.addInlineStyle(object, propertyName, false);
+                }
+                try {
+                    Class typeClass =3D type !=3D null ? ClassDescriptorLoad=
er.getClass(type.getName(), type.getClassLoader()) : null;
+                    Object value =3D convertFromString(propertyName, stringV=
alue, typeClass);
+                    setProperty(object, propertyName, value, compiler);
+                } catch (NumberFormatException e) {
+                    compiler.reportError("could not convert literal string '=
" + stringValue + "' to type " + type.getName());
+                } catch (IllegalArgumentException e) {
+                    compiler.reportError("could not convert literal string '=
" + stringValue + "' to type " + type.getName());
+                } catch (ClassNotFoundException e) {
+                    compiler.reportError("could not find class " + type.getN=
ame());
+                }
+            }
+        } catch (UnsupportedAttributeException e) {
+            compiler.reportError("class " + object.getObjectClass().getName(=
) + " does not support attribute '" + propertyName + "'");
+        }
+    }
+
+
+    public void applyStylesheets(CompiledObject object, JAXXCompiler compile=
r) {
+        applyStylesheets(object, compiler, null);
+    }
+
+
+    private void applyStylesheets(final CompiledObject object, JAXXCompiler =
compiler, Stylesheet overrides) {
+        applyStylesheets(object, compiler, overrides, true);
+    }
+
+
+    private void applyStylesheets(final CompiledObject object, JAXXCompiler =
compiler, Stylesheet overrides, boolean recurse) {
+        try {
+            Stylesheet stylesheet =3D compiler.getStylesheet();
+            ClassDescriptor objectClass =3D object.getObjectClass();
+            if (recurse && ClassDescriptorLoader.getClassDescriptor(JAXXObje=
ct.class).isAssignableFrom(objectClass)) {
+                JAXXObjectDescriptor jaxxObjectDescriptor =3D objectClass.ge=
tJAXXObjectDescriptor();
+                ComponentDescriptor[] descriptors =3D jaxxObjectDescriptor.g=
etComponentDescriptors();
+                for (ComponentDescriptor descriptor : descriptors) {
+                    ClassDescriptor classDescriptor =3D ClassDescriptorLoade=
r.getClassDescriptor(descriptor.getJavaClassName());
+                    boolean isRoot =3D classDescriptor !=3D objectClass;
+                    String id =3D isRoot ? object.getId() + ' ' + descriptor=
.getId() : "( " + object.getId() + " ) " + descriptor.getId();
+                    CompiledObject child =3D new CompiledObject(id,
+                            "((" + JAXXCompiler.getCanonicalName(classDescri=
ptor) + ") " +
+                                    object.getJavaCode() + ".getObjectById("=
 + TypeManager.getJavaCode(descriptor.getId()) + "))",
+                            classDescriptor,
+                            compiler,
+                            true);
+                    ComponentDescriptor parentDescriptor =3D descriptor.getP=
arent();
+                    CompiledObject currentObject =3D child;
+                    while (parentDescriptor !=3D null) {
+                        CompiledObject parent =3D new CompiledObject("intern=
al", ClassDescriptorLoader.getClassDescriptor(parentDescriptor.getJavaClassNa=
me()), compiler);
+                        currentObject.setParent(parent);
+                        currentObject =3D parent;
+                        parentDescriptor =3D parentDescriptor.getParent();
+                    }
+                    currentObject.setParent(object);
+                    String styleClass =3D object.getStyleClass();
+                    if (styleClass =3D=3D null) {
+                        styleClass =3D descriptor.getStyleClass();
+                    }
+                    child.setStyleClass(styleClass);
+                    Stylesheet mergedStylesheet =3D overrides;
+                    Stylesheet childOverrides =3D jaxxObjectDescriptor.getSt=
ylesheet();
+                    if (childOverrides !=3D null) {
+                        if (mergedStylesheet =3D=3D null) {
+                            mergedStylesheet =3D childOverrides;
+                        } else {
+                            mergedStylesheet.add(childOverrides.getRules());
+                        }
+                    }
+                    TagManager.getTagHandler(objectClass).applyStylesheets(c=
hild, compiler, mergedStylesheet, isRoot);
+                    object.appendInitializationCode(child.getInitializationC=
ode(compiler));
+                }
+            } else if (stylesheet !=3D null)
+                stylesheet.applyTo(object, compiler, overrides);
+        }
+        catch (ClassNotFoundException e) {
+            throw new CompilerException(e);
+        } catch (IllegalArgumentException e) {
+            compiler.reportError(e.getMessage());
+        }
+    }
+
+
+    /**
+     * Adds the necessary Java code to a <code>CompiledObject</code> to add =
an event listener at runtime.
+     *
+     * @param object   the <code>CompiledObject</code> to which the event li=
stener should be added
+     * @param name     the name of the event listener, such as <code>"action=
Performed"</code>
+     * @param value    the Java code snippet to execute when the event is fi=
red
+     * @param compiler the current <code>JAXXCompiler</code>
+     */
+    public void addEventHandler(CompiledObject object, String name, String v=
alue, JAXXCompiler compiler) {
+        JAXXEventSetDescriptor JAXXEventSetDescriptor =3D events.get(name);
+        if (JAXXEventSetDescriptor !=3D null) {
+            MethodDescriptor[] listenerMethods =3D JAXXEventSetDescriptor.ge=
tListenerMethods();
+            MethodDescriptor listenerMethod =3D null;
+            for (MethodDescriptor listenerMethod1 : listenerMethods) {
+                if (listenerMethod1.getName().equals(name)) {
+                    listenerMethod =3D listenerMethod1;
+                    break;
+                }
+            }
+            if (listenerMethod =3D=3D null) {
+                throw new RuntimeException("expected to find method '" + nam=
e + "' in JAXXEventSetDescriptor.getListenerMethods()");
+            }
+            try {
+                value =3D compiler.preprocessScript(value);
+                object.addEventHandler(name, JAXXEventSetDescriptor.getAddLi=
stenerMethod(), listenerMethod, value, compiler);
+            } catch (CompilerException e) {
+                compiler.reportError("While parsing event handler for '" + n=
ame + "': " + e.getMessage());
+            }
+        } else
+            compiler.reportError("could not find event '" + name + "' for ob=
ject " + object);
+    }
+
+
+    /**
+     * Returns a snippet of Java code which will retrieve an object property=
 at runtime.  Typically the code is
+     * just a call to the property's <code>get</code> method, but it can be =
arbitrarily complex.
+     *
+     * @param javaCode Java code for the object whose property is being retr=
ieved
+     * @param name     the name of the property to retrieve
+     * @param compiler the current <code>JAXXCompiler</code>
+     * @return the snippet
+     * @throws CompilerException if a compilation error occurs
+     */
+    public String getGetPropertyCode(String javaCode, String name, JAXXCompi=
ler compiler) {
+        try {
+            init();
+        } catch (IntrospectionException e) {
+            throw new RuntimeException(e);
+        }
+
+        JAXXPropertyDescriptor property =3D properties.get(name);
+        if (property !=3D null) {
+            if (property.getReadMethodDescriptor() !=3D null) {
+                return javaCode + '.' + property.getReadMethodDescriptor().g=
etName() + "()";
+            }
+            throw new UnsupportedAttributeException("property '" + name + "'=
 of " + getBeanClass().getName() + " has no read method");
+        }
+        throw new UnsupportedAttributeException("property '" + name + "' cou=
ld not be found in class " + getBeanClass().getName());
+    }
+
+
+    /**
+     * Returns a snippet of Java code which will set an object property at r=
untime.  Typically the code is
+     * just a call to the property's <code>set</code> method, but it can be =
arbitrarily complex.
+     *
+     * @param javaCode  Java code for the object whose property is being set
+     * @param name      the name of the property to set
+     * @param valueCode Java expression representing the value to set the pr=
operty to
+     * @param compiler  the current <code>JAXXCompiler</code>
+     * @return the snippet
+     * @throws CompilerException if a compilation error occurs
+     */
+    public String getSetPropertyCode(String javaCode, String name, String va=
lueCode, JAXXCompiler compiler) {
+        JAXXPropertyDescriptor property =3D properties.get(name);
+        if (property !=3D null) {
+            if (property.getWriteMethodDescriptor() !=3D null) {
+                return javaCode + '.' + property.getWriteMethodDescriptor().=
getName() + '(' + valueCode + ");";
+            }
+            throw new UnsupportedAttributeException("property '" + name + "'=
 of " + getBeanClass().getName() + " is read-only");
+        }
+        throw new UnsupportedAttributeException("property '" + name + "' cou=
ld not be found in class " + getBeanClass().getName());
+    }
+
+
+    /**
+     * Appends Java code to a <code>CompiledObject</code> in order to implem=
ent a property assignment.
+     * <code>setProperty</code> is invoked in response to most XML attribute=
s (those which are not more
+     * complicated cases, like data bindings or event handlers).
+     * <p/>
+     * By the time it reaches this method, the <code>value</code> has alread=
y been converted from its XML
+     * string representation to the appropriate destination type for the pro=
perty (i.e. if
+     * <code>JLabel.foreground</code> is being set, <code>value</code> will =
be a <code>Color</code>).
+     *
+     * @param object   the object being modified
+     * @param name     the name of the property to set
+     * @param value    the value to set the property to
+     * @param compiler the current <code>JAXXCompiler</code>
+     * @throws CompilerException if a compilation error occurs
+     */
+    public void setProperty(CompiledObject object, String name, Object value=
, JAXXCompiler compiler) {
+        object.appendInitializationCode(getSetPropertyCode(object.getJavaCod=
e(), name, TypeManager.getJavaCode(value), compiler));
+    }
+
+
+    /**
+     * Maps string values onto integers, so that int-valued enumeration prop=
erties can be specified by strings.  For
+     * example, when passed a key of 'alignment', this method should normall=
y map the values 'left', 'center', and
+     * 'right' onto SwingConstants.LEFT, SwingConstants.CENTER, and SwingCon=
stants.RIGHT respectively.
+     * <p/>
+     * You do not normally need to call this method yourself; it is invoked =
by {@link #convertFromString} when an
+     * int-valued property has a value which is not a valid number.  By defa=
ult, this method looks at the
+     * <code>enumerationValues</code> value of the <code>JAXXPropertyDescrip=
tor</code>.
+     *
+     * @param key   the name of the int-typed property
+     * @param value the non-numeric value that was specified for the property
+     * @return the constant integer value
+     * @throws IllegalArgumentException if the property is an enumeration, b=
ut the value is not valid
+     * @throws NumberFormatException    if the property is not an enumeration
+     */
+    protected int constantValue(String key, String value) {
+        JAXXBeanInfo JAXXBeanInfo =3D getJAXXBeanInfo();
+        JAXXPropertyDescriptor[] properties =3D JAXXBeanInfo.getJAXXProperty=
Descriptors();
+        String lowercaseValue =3D value.toLowerCase();
+        for (JAXXPropertyDescriptor property : properties) {
+            if (property.getName().equals(key)) {
+                Object[] values =3D (Object[]) property.getValue("enumeratio=
nValues");
+                if (values !=3D null) {
+                    for (int j =3D 0; j < values.length - 2; j +=3D 3) {
+                        if (((String) values[j]).toLowerCase().equals(lowerc=
aseValue)) {
+                            return (Integer) values[j + 1];
+                        }
+                    }
+
+                    StringBuffer message =3D new StringBuffer("value of '" +=
 key + "' must be one of: [");
+                    for (int j =3D 0; j < values.length - 2; j +=3D 3) {
+                        if (j !=3D 0) {
+                            message.append(", ");
+                        }
+                        message.append(((String) values[j]).toLowerCase());
+                    }
+                    message.append("] (found '").append(value).append("')");
+                    throw new IllegalArgumentException(message.toString());
+                }
+            }
+        }
+        throw new NumberFormatException(value);
+    }
+
+
+    /**
+     * As {@link TypeManager#convertFromString(String, Class)}, except that =
it additionally supports constant names
+     * for <code>int</code>-valued types.
+     *
+     * @param key   the name of the property whose value is being converted
+     * @param value the raw string value of the property as it appears in th=
e XML
+     * @param type  the datatype to convert the string into
+     * @return the converted object
+     * @see #constantValue
+     */
+    protected Object convertFromString(String key, String value, Class type)=
 {
+        if (type =3D=3D null || type =3D=3D Object.class) {
+            return value;
+        }
+
+        try {
+            return TypeManager.convertFromString(value, type);
+        } catch (NumberFormatException e) {
+            if (type =3D=3D int.class || type =3D=3D Integer.class) {
+                return constantValue(key, value);
+            }
+            throw e;
+        }
+    }
+
+
+    /**
+     * Compiles the child tags of the current tag.  The default implementati=
on invokes {@link #compileChildTagFirstPass}
+     * for each child tag.
+     *
+     * @param tag      the tag whose children to compile
+     * @param compiler the current <code>JAXXCompiler</code>
+     * @throws CompilerException if a compilation error occurs
+     * @throws IOException       if an I/O error occurs
+     */
+    protected void compileChildrenFirstPass(Element tag, JAXXCompiler compil=
er) throws CompilerException, IOException {
+        NodeList children =3D tag.getChildNodes();
+        for (int i =3D 0; i < children.getLength(); i++) {
+            Node node =3D children.item(i);
+            int nodeType =3D node.getNodeType();
+            if (nodeType =3D=3D Node.ELEMENT_NODE) {
+                Element child =3D (Element) node;
+                compileChildTagFirstPass(child, compiler);
+            }
+        }
+    }
+
+
+    /**
+     * Compiles the child tags of the current tag.  The default implementati=
on invokes {@link #compileChildTagFirstPass}
+     * for each child tag.
+     *
+     * @param tag      the tag whose children to compile
+     * @param compiler the current <code>JAXXCompiler</code>
+     * @throws CompilerException if a compilation error occurs
+     * @throws IOException       if an I/O error occurs
+     */
+    protected void compileChildrenSecondPass(Element tag, JAXXCompiler compi=
ler) throws CompilerException, IOException {
+        NodeList children =3D tag.getChildNodes();
+        for (int i =3D 0; i < children.getLength(); i++) {
+            Node node =3D children.item(i);
+            int nodeType =3D node.getNodeType();
+            if (nodeType =3D=3D Node.ELEMENT_NODE) {
+                Element child =3D (Element) node;
+                compileChildTagSecondPass(child, compiler);
+            } else if (nodeType =3D=3D Node.TEXT_NODE || nodeType =3D=3D Nod=
e.CDATA_SECTION_NODE) {
+                String text =3D ((Text) node).getData().trim();
+                if (text.length() > 0) {
+                    compiler.reportError("tag '" + tag.getLocalName() + "' m=
ay not contain text ('" + ((Text) node).getData().trim() + "')");
+                }
+            }
+        }
+    }
+
+
+    /**
+     * Compiles a child of the current tag.  The default implementation call=
s {@link JAXXCompiler#compileFirstPass
+     * JAXXCompiler.compileFirstPass}.
+     *
+     * @param tag      the child tag to compile
+     * @param compiler the current <code>JAXXCompiler</code>
+     * @throws CompilerException if a compilation error occurs
+     * @throws IOException       if an I/O error occurs
+     */
+    protected void compileChildTagFirstPass(Element tag, JAXXCompiler compil=
er) throws CompilerException, IOException {
+        compiler.compileFirstPass(tag);
+    }
+
+
+    /**
+     * Compiles a child of the current tag.  The default implementation call=
s {@link JAXXCompiler#compileFirstPass
+     * JAXXCompiler.compileSecondPass}.
+     *
+     * @param tag      the child tag to compile
+     * @param compiler the current <code>JAXXCompiler</code>
+     * @throws CompilerException if a compilation error occurs
+     * @throws IOException       if an I/O error occurs
+     */
+    protected void compileChildTagSecondPass(Element tag, JAXXCompiler compi=
ler) throws CompilerException, IOException {
+        compiler.compileSecondPass(tag);
+    }
+
+    @Override
+    public String toString() {
+        return getClass().getName() + "[" + getBeanClass().getName() + "]";
+    }
+}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/StyleHandler.ja=
va
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/StyleHandler.java	2008-=
10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/StyleHandler.java	20=
08-10-21 07:31:05 UTC (rev 990)
@@ -1,175 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.tags;
-
-import jaxx.CompilerException;
-import jaxx.UnsupportedAttributeException;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.css.CSSParser;
-import jaxx.css.CSSParserConstants;
-import jaxx.css.CSSParserTreeConstants;
-import jaxx.css.Rule;
-import jaxx.css.Selector;
-import jaxx.css.SimpleNode;
-import jaxx.css.Stylesheet;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Handles the <code>&lt;style&gt;</code> tag.
- *
- * @author Ethan Nicholas
- */
-public class StyleHandler implements TagHandler {
-    public void compileFirstPass(Element tag, JAXXCompiler compiler) throws =
CompilerException, IOException {
-        boolean source =3D false;
-        NamedNodeMap attributes =3D tag.getAttributes();
-        for (int i =3D 0; i < attributes.getLength(); i++) {
-            Attr attribute =3D (Attr) attributes.item(i);
-            String name =3D attribute.getName();
-            String attrValue =3D attribute.getValue();
-            if (name.equals("source")) {
-                source =3D true;
-                File styleFile =3D new File(compiler.getBaseDir(), attrValue=
.replace('/', File.separatorChar));
-                StringWriter styleBuffer =3D new StringWriter();
-                try {
-                    FileReader in =3D new FileReader(styleFile);
-                    char[] readBuffer =3D new char[2048];
-                    int c;
-                    while ((c =3D in.read(readBuffer)) > 0)
-                        styleBuffer.write(readBuffer, 0, c);
-                }
-                catch (FileNotFoundException e) {
-                    compiler.reportError("stylesheet file not found: " + sty=
leFile);
-                }
-                compiler.getSourceFiles().push(styleFile);
-                compiler.registerStylesheet(processStylesheet(styleBuffer.to=
String()));
-                compiler.getSourceFiles().pop();
-            } else
-            if (!name.startsWith("xmlns") && !JAXXCompiler.JAXX_INTERNAL_NAM=
ESPACE.equals(attribute.getNamespaceURI()))
-                throw new UnsupportedAttributeException(name);
-        }
-
-        StringBuffer style =3D new StringBuffer();
-        NodeList children =3D tag.getChildNodes();
-        for (int i =3D 0; i < children.getLength(); i++) {
-            Node child =3D children.item(i);
-            switch (child.getNodeType()) {
-                case Node.ELEMENT_NODE:
-                    compiler.reportError("<style> tag may not contain child =
elements: " + tag);
-                case Node.TEXT_NODE: // fall through
-                case Node.CDATA_SECTION_NODE:
-                    style.append(((Text) child).getData());
-            }
-        }
-
-        String styleString =3D style.toString().trim();
-        if (styleString.length() > 0) {
-            if (source)
-                compiler.reportError("<style> tag has both a source attribut=
e and an inline stylesheet");
-            compiler.registerStylesheet(processStylesheet(style.toString()));
-        }
-    }
-
-
-    public void compileSecondPass(Element tag, JAXXCompiler compiler) throws=
 CompilerException, IOException {
-    }
-
-
-    protected Selector processSelector(SimpleNode selector) {
-        if (selector.getId() !=3D CSSParserTreeConstants.JJTSELECTOR)
-            throw new IllegalArgumentException("argument node is not a Selec=
tor");
-        String javaClassName =3D null;
-        String styleClass =3D null;
-        String pseudoClass =3D null;
-        String id =3D null;
-
-        for (int i =3D 0; i < selector.jjtGetNumChildren(); i++) {
-            SimpleNode child =3D selector.getChild(i);
-            switch (child.getId()) {
-                case CSSParserTreeConstants.JJTJAVACLASS:
-                    if (!child.getText().trim().equals("*"))
-                        javaClassName =3D child.getText();
-                    break;
-                case CSSParserTreeConstants.JJTCLASS:
-                    styleClass =3D child.getText().substring(1);
-                    break;
-                case CSSParserTreeConstants.JJTPSEUDOCLASS:
-                    pseudoClass =3D child.getText().substring(1);
-                    break;
-                case CSSParserTreeConstants.JJTID:
-                    id =3D child.getText().substring(1);
-                    break;
-
-                default:
-                    throw new IllegalStateException("unexpected child of Sel=
ector node, type=3D" + child.getId());
-            }
-        }
-
-        return new Selector(javaClassName, styleClass, pseudoClass, id);
-    }
-
-
-    protected Rule processRule(SimpleNode ruleNode) {
-        if (ruleNode.getId() !=3D CSSParserTreeConstants.JJTRULE) {
-            throw new IllegalArgumentException("argument node is not a Rule"=
);
-        }
-        SimpleNode selectorsNode =3D ruleNode.getChild(0);
-        assert selectorsNode.getId() =3D=3D CSSParserTreeConstants.JJTSELECT=
ORS : "expected node to be of type Selectors";
-
-        List<Selector> selectors =3D new ArrayList<Selector>();
-        for (int i =3D 0; i < selectorsNode.jjtGetNumChildren(); i++) {
-            SimpleNode selectorNode =3D selectorsNode.getChild(i);
-            selectors.add(processSelector(selectorNode));
-        }
-
-        Map<String, String> properties =3D new HashMap<String, String>();
-        for (int i =3D 1; i < ruleNode.jjtGetNumChildren(); i++) {
-            SimpleNode declarationNode =3D ruleNode.getChild(i);
-            if (declarationNode.getId() =3D=3D CSSParserTreeConstants.JJTDEC=
LARATION) {
-                String key =3D declarationNode.getChild(0).getText();
-                SimpleNode valueNode =3D declarationNode.getChild(1);
-                String value =3D valueNode.getText();
-                if (valueNode.firstToken.kind =3D=3D CSSParserConstants.STRI=
NG) {
-                    value =3D value.substring(1, value.length() - 1);
-                }
-                properties.put(key, value);
-            }
-        }
-        Rule rule;
-        rule =3D new Rule(selectors.toArray(new Selector[selectors.size()]),=
 properties);
-        return rule;
-    }
-
-
-    protected Stylesheet processStylesheet(String stylesheetText) throws Com=
pilerException {
-        CSSParser p =3D new CSSParser(new StringReader(stylesheetText));
-        SimpleNode node =3D p.Stylesheet();
-        List<Rule> rules =3D new ArrayList<Rule>();
-        for (int i =3D 0; i < node.jjtGetNumChildren(); i++) {
-            SimpleNode ruleNode =3D node.getChild(i);
-            Rule rule =3D processRule(ruleNode);
-            rules.add(rule);
-        }
-        Stylesheet stylesheet;
-        stylesheet =3D new Stylesheet(rules.toArray(new Rule[rules.size()]));
-        return stylesheet;
-    }
-}

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/StyleHandler.jav=
a (from rev 965, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/StyleHandl=
er.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/StyleHandler.java	  =
                      (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/StyleHandler.java	20=
08-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,181 @@
+/*
+ * Copyright 2006 Ethan Nicholas. All rights reserved.
+ * Use is subject to license terms.
+ */
+package jaxx.tags;
+
+import jaxx.CompilerException;
+import jaxx.UnsupportedAttributeException;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.css.CSSParser;
+import jaxx.css.CSSParserConstants;
+import jaxx.css.CSSParserTreeConstants;
+import jaxx.css.Rule;
+import jaxx.css.Selector;
+import jaxx.css.SimpleNode;
+import jaxx.css.Stylesheet;
+import jaxx.css.ParseException;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Handles the <code>&lt;style&gt;</code> tag.
+ *
+ * @author Ethan Nicholas
+ */
+public class StyleHandler implements TagHandler {
+    public void compileFirstPass(Element tag, JAXXCompiler compiler) throws =
CompilerException, IOException {
+        boolean source =3D false;
+        NamedNodeMap attributes =3D tag.getAttributes();
+        for (int i =3D 0; i < attributes.getLength(); i++) {
+            Attr attribute =3D (Attr) attributes.item(i);
+            String name =3D attribute.getName();
+            String attrValue =3D attribute.getValue();
+            if (name.equals("source")) {
+                source =3D true;
+                File styleFile =3D new File(compiler.getBaseDir(), attrValue=
.replace('/', File.separatorChar));
+                StringWriter styleBuffer =3D new StringWriter();
+                try {
+                    FileReader in =3D new FileReader(styleFile);
+                    char[] readBuffer =3D new char[2048];
+                    int c;
+                    while ((c =3D in.read(readBuffer)) > 0)
+                        styleBuffer.write(readBuffer, 0, c);
+                }
+                catch (FileNotFoundException e) {
+                    compiler.reportError("stylesheet file not found: " + sty=
leFile);
+                }
+                compiler.getSourceFiles().push(styleFile);
+                compiler.registerStylesheet(processStylesheet(styleBuffer.to=
String()));
+                compiler.getSourceFiles().pop();
+            } else
+            if (!name.startsWith("xmlns") && !JAXXCompiler.JAXX_INTERNAL_NAM=
ESPACE.equals(attribute.getNamespaceURI()))
+                throw new UnsupportedAttributeException(name);
+        }
+
+        StringBuffer style =3D new StringBuffer();
+        NodeList children =3D tag.getChildNodes();
+        for (int i =3D 0; i < children.getLength(); i++) {
+            Node child =3D children.item(i);
+            switch (child.getNodeType()) {
+                case Node.ELEMENT_NODE:
+                    compiler.reportError("<style> tag may not contain child =
elements: " + tag);
+                case Node.TEXT_NODE: // fall through
+                case Node.CDATA_SECTION_NODE:
+                    style.append(((Text) child).getData());
+            }
+        }
+
+        String styleString =3D style.toString().trim();
+        if (styleString.length() > 0) {
+            if (source)
+                compiler.reportError("<style> tag has both a source attribut=
e and an inline stylesheet");
+            compiler.registerStylesheet(processStylesheet(style.toString()));
+        }
+    }
+
+
+    public void compileSecondPass(Element tag, JAXXCompiler compiler) throws=
 CompilerException, IOException {
+    }
+
+
+    protected Selector processSelector(SimpleNode selector) {
+        if (selector.getId() !=3D CSSParserTreeConstants.JJTSELECTOR)
+            throw new IllegalArgumentException("argument node is not a Selec=
tor");
+        String javaClassName =3D null;
+        String styleClass =3D null;
+        String pseudoClass =3D null;
+        String id =3D null;
+
+        for (int i =3D 0; i < selector.jjtGetNumChildren(); i++) {
+            SimpleNode child =3D selector.getChild(i);
+            switch (child.getId()) {
+                case CSSParserTreeConstants.JJTJAVACLASS:
+                    if (!child.getText().trim().equals("*"))
+                        javaClassName =3D child.getText();
+                    break;
+                case CSSParserTreeConstants.JJTCLASS:
+                    styleClass =3D child.getText().substring(1);
+                    break;
+                case CSSParserTreeConstants.JJTPSEUDOCLASS:
+                    pseudoClass =3D child.getText().substring(1);
+                    break;
+                case CSSParserTreeConstants.JJTID:
+                    id =3D child.getText().substring(1);
+                    break;
+
+                default:
+                    throw new IllegalStateException("unexpected child of Sel=
ector node, type=3D" + child.getId());
+            }
+        }
+
+        return new Selector(javaClassName, styleClass, pseudoClass, id);
+    }
+
+
+    protected Rule processRule(SimpleNode ruleNode) {
+        if (ruleNode.getId() !=3D CSSParserTreeConstants.JJTRULE) {
+            throw new IllegalArgumentException("argument node is not a Rule"=
);
+        }
+        SimpleNode selectorsNode =3D ruleNode.getChild(0);
+        assert selectorsNode.getId() =3D=3D CSSParserTreeConstants.JJTSELECT=
ORS : "expected node to be of type Selectors";
+
+        List<Selector> selectors =3D new ArrayList<Selector>();
+        for (int i =3D 0; i < selectorsNode.jjtGetNumChildren(); i++) {
+            SimpleNode selectorNode =3D selectorsNode.getChild(i);
+            selectors.add(processSelector(selectorNode));
+        }
+
+        Map<String, String> properties =3D new HashMap<String, String>();
+        for (int i =3D 1; i < ruleNode.jjtGetNumChildren(); i++) {
+            SimpleNode declarationNode =3D ruleNode.getChild(i);
+            if (declarationNode.getId() =3D=3D CSSParserTreeConstants.JJTDEC=
LARATION) {
+                String key =3D declarationNode.getChild(0).getText();
+                SimpleNode valueNode =3D declarationNode.getChild(1);
+                String value =3D valueNode.getText();
+                if (valueNode.firstToken.kind =3D=3D CSSParserConstants.STRI=
NG) {
+                    value =3D value.substring(1, value.length() - 1);
+                }
+                properties.put(key, value);
+            }
+        }
+        Rule rule;
+        rule =3D new Rule(selectors.toArray(new Selector[selectors.size()]),=
 properties);
+        return rule;
+    }
+
+
+    protected Stylesheet processStylesheet(String stylesheetText) throws Com=
pilerException {
+        CSSParser p =3D new CSSParser(new StringReader(stylesheetText));
+        SimpleNode node;
+        try {
+            node =3D p.Stylesheet();
+        } catch (Error e) {
+            throw new CompilerException(e);
+        }
+        List<Rule> rules =3D new ArrayList<Rule>();
+        for (int i =3D 0; i < node.jjtGetNumChildren(); i++) {
+            SimpleNode ruleNode =3D node.getChild(i);
+            Rule rule =3D processRule(ruleNode);
+            rules.add(rule);
+        }
+        Stylesheet stylesheet;
+        stylesheet =3D new Stylesheet(rules.toArray(new Rule[rules.size()]));
+        return stylesheet;
+    }
+}

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/Applicati=
onHandler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/ApplicationHandle=
r.java	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/ApplicationHan=
dler.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,41 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.tags.swing;
-
-import jaxx.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.reflect.ClassDescriptor;
-import jaxx.reflect.ClassDescriptorLoader;
-import jaxx.runtime.swing.Application;
-import jaxx.types.TypeManager;
-import org.w3c.dom.Element;
-
-import javax.swing.WindowConstants;
-
-public class ApplicationHandler extends JWindowHandler {
-
-    public ApplicationHandler(ClassDescriptor beanClass) {
-        super(beanClass);
-        ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, Appli=
cation.class);
-    }
-
-
-    @Override
-    public void setAttribute(CompiledObject object, String propertyName, Str=
ing stringValue, boolean inline, JAXXCompiler compiler) throws CompilerExcept=
ion {
-        if (propertyName.equals("lookAndFeel") && stringValue !=3D null && !=
stringValue.trim().startsWith("{")) {
-            compiler.bodyCode.append("{ ").append(object.getJavaCode()).appe=
nd(".setLookAndFeel(").append(TypeManager.getJavaCode(stringValue)).append(")=
; }").append(JAXXCompiler.getLineSeparator());
-        } else {
-            super.setAttribute(object, propertyName, stringValue, inline, co=
mpiler);
-        }
-    }
-
-
-    @Override
-    protected void setDefaults(CompiledObject object, Element tag, JAXXCompi=
ler compiler) throws CompilerException {
-        super.setDefaults(object, tag, compiler);
-        setAttribute(object, "defaultCloseOperation", String.valueOf(WindowC=
onstants.EXIT_ON_CLOSE), false, compiler);
-    }
-}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/Applicatio=
nHandler.java (from rev 977, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tag=
s/swing/ApplicationHandler.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/ApplicationHan=
dler.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/ApplicationHan=
dler.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2006 Ethan Nicholas. All rights reserved.
+ * Use is subject to license terms.
+ */
+package jaxx.tags.swing;
+
+import jaxx.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.reflect.ClassDescriptor;
+import jaxx.reflect.ClassDescriptorLoader;
+import jaxx.runtime.swing.Application;
+import jaxx.types.TypeManager;
+import org.w3c.dom.Element;
+
+import javax.swing.WindowConstants;
+
+public class ApplicationHandler extends JWindowHandler {
+
+    public ApplicationHandler(ClassDescriptor beanClass) {
+        super(beanClass);
+        ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, Appli=
cation.class);
+    }
+
+
+    @Override
+    public void setAttribute(CompiledObject object, String propertyName, Str=
ing stringValue, boolean inline, JAXXCompiler compiler) throws CompilerExcept=
ion {
+        if (propertyName.equals("lookAndFeel") && stringValue !=3D null && !=
stringValue.trim().startsWith("{")) {
+            compiler.appendBodyCode("{ " + object.getJavaCode() + ".setLookA=
ndFeel(" + TypeManager.getJavaCode(stringValue) + "); }" + JAXXCompiler.getLi=
neSeparator());
+        } else {
+            super.setAttribute(object, propertyName, stringValue, inline, co=
mpiler);
+        }
+    }
+
+
+    @Override
+    protected void setDefaults(CompiledObject object, Element tag, JAXXCompi=
ler compiler) throws CompilerException {
+        super.setDefaults(object, tag, compiler);
+        setAttribute(object, "defaultCloseOperation", String.valueOf(WindowC=
onstants.EXIT_ON_CLOSE), false, compiler);
+    }
+}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/BeanValid=
atorHandler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/BeanValidatorHand=
ler.java	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/BeanValidatorH=
andler.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,275 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.tags.swing;
-
-import jaxx.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.introspection.JAXXBeanInfo;
-import jaxx.introspection.JAXXPropertyDescriptor;
-import jaxx.reflect.ClassDescriptor;
-import jaxx.reflect.ClassDescriptorLoader;
-import jaxx.runtime.BeanValidator;
-import jaxx.tags.DefaultObjectHandler;
-import jaxx.types.TypeManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.w3c.dom.Element;
-
-import java.beans.IntrospectionException;
-import java.io.IOException;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.TreeMap;
-
-public class BeanValidatorHandler extends DefaultObjectHandler {
-
-    public static final String BEAN_VALIDATOR_TAG =3D BeanValidator.class.ge=
tSimpleName();
-    public static final String BEAN_ATTRIBUTE =3D "bean";
-    public static final String ERROR_LIST_MODEL_ATTRIBUTE =3D "errorListMode=
l";
-    public static final String AUTOFIELD_ATTRIBUTE =3D "autoField";
-    public static final String STRICT_MODE_ATTRIBUTE =3D "strictMode";
-
-    /** to use log facility, just put in your code: log.info(\"...\"); */
-    static Log log =3D LogFactory.getLog(BeanValidatorHandler.class);
-
-    /**
-     * Creates a new <code>DefaultObjectHandler</code> which provides suppor=
t for the specified class.  The
-     * class is not actually introspected until the {@link #compileFirstPass=
} method is invoked.
-     *
-     * @param beanClass the class which this handler supports
-     */
-    public BeanValidatorHandler(ClassDescriptor beanClass) {
-        super(beanClass);
-        ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, BeanV=
alidator.class);
-    }
-
-    @Override
-    protected CompiledObject createCompiledObject(String id, JAXXCompiler co=
mpiler) {
-        return new CompiledBeanValidator(id, getBeanClass(), compiler);
-    }
-
-    @Override
-    protected void compileChildTagFirstPass(Element tag, JAXXCompiler compil=
er) throws CompilerException, IOException {
-        log.info(tag);
-        if (!tag.getLocalName().equals(FieldValidatorHandler.FIELD_VALIDATOR=
_TAG)) {
-            compiler.reportError("tag '" + tag.getParentNode().getLocalName(=
) + "' may only contain " + FieldValidatorHandler.FIELD_VALIDATOR_TAG + " as =
children, but found : " + tag.getLocalName());
-        } else {
-            compiler.compileFirstPass(tag);
-        }
-    }
-
-    @Override
-    public void compileSecondPass(Element tag, JAXXCompiler compiler) throws=
 CompilerException, IOException {
-
-        super.compileSecondPass(tag, compiler);
-
-        CompiledBeanValidator info =3D (CompiledBeanValidator) objectMap.get=
(tag);
-
-        String tmp =3D info.getErrorListModel();
-
-        if (tmp !=3D null) {
-            if (compiler.checkReference(tag, tmp, true, ERROR_LIST_MODEL_ATT=
RIBUTE)) {
-                String code =3D getSetPropertyCode(info.getJavaCode(), ERROR=
_LIST_MODEL_ATTRIBUTE, tmp, compiler);
-                info.appendAdditionCode(code);
-            }
-        }
-        String bean =3D info.getBean();
-        if (bean !=3D null) {
-            if (compiler.checkReference(tag, bean, true, BEAN_ATTRIBUTE)) {
-                String code =3D getSetPropertyCode(info.getJavaCode(), BEAN_=
ATTRIBUTE, bean, compiler);
-                info.appendAdditionCode(code);
-            }
-        }
-
-        if (info.getAutoField()) {
-            if (bean =3D=3D null) {
-                compiler.reportError("tag '" + tag.getLocalName() + "' need =
a " + BEAN_ATTRIBUTE + " attribute to use autofield mode");
-            } else {
-                registerAutoFieldBean(tag, compiler, info);
-            }
-        }
-
-        // add fieldrepresentation invocations
-        addFieldRepresentations(tag, compiler, info);
-
-        // register the validator in compiler
-        compiler.registerValidator(info);
-
-        // close the compiled object
-        compiler.closeComponent(info);
-    }
-
-    @Override
-    protected void setDefaults(CompiledObject object, Element tag, JAXXCompi=
ler compiler) {
-        // open the compiled object
-        compiler.openInvisibleComponent(object);
-    }
-
-    @Override
-    public void setAttribute(CompiledObject object, String propertyName, Str=
ing stringValue, boolean inline, JAXXCompiler compiler) {
-        if (compiler.getOptions().isVerbose()) {
-            log.info(propertyName + " : " + stringValue + " for " + object);
-        }
-        object.addProperty(propertyName, stringValue);
-    }
-
-    protected void registerAutoFieldBean(Element tag, JAXXCompiler compiler,=
 CompiledBeanValidator info) {
-        for (JAXXPropertyDescriptor beanProperty : info.getBeanDescriptor(co=
mpiler).getJAXXPropertyDescriptors()) {
-            String descriptionName =3D beanProperty.getName();
-            log.info("doAutoField on property " + descriptionName);
-            if (beanProperty.getWriteMethodDescriptor() =3D=3D null) {
-                // read-only property
-                continue;
-            }
-            if (info.getFields().containsKey(descriptionName)) {
-                // already defined in field
-                continue;
-            }
-            if (!compiler.checkReference(tag, descriptionName, info.getStric=
tMode(), null)) {
-                // no editor component found
-                continue;
-            }
-            // ok add the field mapping
-            info.addField(descriptionName, descriptionName, compiler);
-        }
-    }
-
-    protected void addFieldRepresentations(Element tag, JAXXCompiler compile=
r, CompiledBeanValidator info) {
-        for (Entry<String, String> entry : info.getFields().entrySet()) {
-            String propertyName =3D entry.getKey();
-            String component =3D entry.getValue();
-            if (!checkBeanProperty(compiler, info, propertyName)) {
-                // property not find on bean
-                continue;
-            }
-            if (!compiler.checkReference(tag, component, true, null)) {
-                // editor component not find on ui
-                continue;
-            }
-            String keyCode =3D TypeManager.getJavaCode(propertyName);
-            info.appendAdditionCode(info.getJavaCode() + ".setFieldRepresent=
ation(" + keyCode + ", " + component + ");");
-
-        }
-    }
-
-    protected boolean checkBeanProperty(JAXXCompiler compiler, CompiledBeanV=
alidator info, String propertyName) {
-
-        for (JAXXPropertyDescriptor beanProperty : info.getBeanDescriptor(co=
mpiler).getJAXXPropertyDescriptors()) {
-            if (beanProperty.getName().equals(propertyName)) {
-                if (beanProperty.getWriteMethodDescriptor() =3D=3D null) {
-                    // read-onlyproperty
-                    compiler.reportError("could not bind the readonly proper=
ty '" + propertyName + "' on bean [" + info.getBean() + "] ");
-                    return false;
-                }
-                return true;
-            }
-        }
-        compiler.reportError("could not find the property '" + propertyName =
+ "' on bean [" + info.getBean() + "] ");
-        return false;
-    }
-
-    /** @author chemit */
-    public static class CompiledBeanValidator extends CompiledObject {
-
-        protected Map<String, String> fields;
-        protected String bean;
-        protected String errorListModel;
-        protected Boolean autoField;
-        protected Boolean strictMode;
-        protected JAXXBeanInfo beanDescriptor;
-
-        public CompiledBeanValidator(String id, ClassDescriptor objectClass,=
 JAXXCompiler compiler) {
-            super(id, objectClass, compiler);
-            fields =3D new TreeMap<String, String>();
-        }
-
-        public Map<String, String> getFields() {
-            return fields;
-        }
-
-        public void setFields(Map<String, String> fields) {
-            this.fields =3D fields;
-        }
-
-        @Override
-        public void addProperty(String property, String value) {
-
-            if (BEAN_ATTRIBUTE.equals(property)) {
-                if (value !=3D null && !value.trim().isEmpty()) {
-                    bean =3D value;
-                }
-                return;
-            }
-            if (ERROR_LIST_MODEL_ATTRIBUTE.equals(property)) {
-                if (value !=3D null && !value.trim().isEmpty()) {
-                    errorListModel =3D value;
-                }
-                return;
-            }
-            if (AUTOFIELD_ATTRIBUTE.equals(property)) {
-                if (value !=3D null && !value.trim().isEmpty()) {
-
-                    autoField =3D (Boolean) TypeManager.convertFromString(va=
lue, Boolean.class);
-                }
-                return;
-            }
-            if (STRICT_MODE_ATTRIBUTE.equals(property)) {
-                if (value !=3D null && !value.trim().isEmpty()) {
-
-                    strictMode =3D (Boolean) TypeManager.convertFromString(v=
alue, Boolean.class);
-                }
-                return;
-            }
-            //todo should not allowed to find other attributes
-            super.addProperty(property, value);
-        }
-
-        public void addField(String id, String component, JAXXCompiler compi=
ler) {
-            if (fields.containsKey(id)) {
-                compiler.reportError("duplicate field '" + id + "' for valid=
ator " + this);
-            } else {
-                log.info("add field <" + id + ":" + component + ">");
-                fields.put(id, component);
-            }
-        }
-
-        public String getBean() {
-            return bean;
-        }
-
-        public String getErrorListModel() {
-            return errorListModel;
-        }
-
-        public boolean getAutoField() {
-            return autoField !=3D null && autoField;
-        }
-
-        public boolean getStrictMode() {
-            return strictMode !=3D null && strictMode;
-        }
-
-        public JAXXBeanInfo getBeanDescriptor(JAXXCompiler compiler) {
-            if (beanDescriptor =3D=3D null && bean !=3D null) {
-                try {
-                    ClassDescriptor beanClassDescriptor =3D ClassDescriptorL=
oader.getClassDescriptor(compiler.getSymbolTable().getClassTagIds().get(bean)=
);
-                    beanDescriptor =3D getJAXXBeanInfo(beanClassDescriptor);
-                } catch (ClassNotFoundException e) {
-                    compiler.reportError("could not load class " + bean);
-                } catch (IntrospectionException e) {
-                    compiler.reportError("could not load class " + bean);
-                }
-            }
-            return beanDescriptor;
-        }
-
-        @Override
-        public void addChild(CompiledObject child, String constraints, JAXXC=
ompiler compiler) throws CompilerException {
-            // do nothing
-            compiler.reportError("can not add CompiledObject in the tag '" +=
 BEAN_VALIDATOR_TAG + " (only field tags)");
-        }
-    }
-}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/FieldVali=
datorHandler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/FieldValidatorHan=
dler.java	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/FieldValidator=
Handler.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,73 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.tags.swing;
-
-import jaxx.CompilerException;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.reflect.ClassDescriptorLoader;
-import jaxx.runtime.BeanValidator;
-import jaxx.tags.TagHandler;
-import jaxx.tags.swing.BeanValidatorHandler.CompiledBeanValidator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.w3c.dom.Element;
-
-import java.io.IOException;
-
-public class FieldValidatorHandler implements TagHandler {
-
-    public static final String FIELD_VALIDATOR_TAG =3D "field";
-    public static final String NAME_ATTRIBUTE =3D "name";
-    public static final String COMPONENT_ATTRIBUTE =3D "component";
-
-    /** to use log facility, just put in your code: log.info(\"...\"); */
-    static private Log log =3D LogFactory.getLog(FieldValidatorHandler.class=
);
-
-    public void compileFirstPass(Element tag, JAXXCompiler compiler) throws =
CompilerException, IOException {
-        if (compiler.getOptions().isVerbose()) {
-            log.info(tag);
-        }
-        //todo check there is no child
-    }
-
-    public void compileSecondPass(Element tag, JAXXCompiler compiler) throws=
 CompilerException, IOException {
-        if (compiler.getOptions().isVerbose()) {
-            log.info(tag);
-        }
-
-        if (!ClassDescriptorLoader.getClassDescriptor(BeanValidator.class).i=
sAssignableFrom(compiler.getOpenComponent().getObjectClass())) {
-            compiler.reportError(FIELD_VALIDATOR_TAG + " tag may only appear=
 within " + BeanValidatorHandler.BEAN_VALIDATOR_TAG + " tag but was " + tag);
-            return;
-        }
-
-        CompiledBeanValidator validator =3D (CompiledBeanValidator) compiler=
.getOpenComponent();
-
-        String name =3D tag.getAttribute(NAME_ATTRIBUTE);
-        String component =3D tag.getAttribute(COMPONENT_ATTRIBUTE);
-        if (name =3D=3D null || name.trim().isEmpty()) {
-            compiler.reportError(FIELD_VALIDATOR_TAG + " tag requires a " + =
NAME_ATTRIBUTE + " attribute");
-            return;
-        }
-        name =3D name.trim();
-        if (component =3D=3D null || component.trim().isEmpty()) {
-            // try to use the name as component
-            if (!compiler.checkReference(tag, name, false, name)) {
-                compiler.reportError(FIELD_VALIDATOR_TAG + " tag requires a =
" + COMPONENT_ATTRIBUTE + " attribute, try to use the name attribute ["+name+=
"] for the component, but no such component found");
-                return;
-            }
-            component =3D name;
-        }
-        component =3D component.trim();
-
-        // check component exist (again perharps, but if error will known ex=
actly which tag failed...) =20
-        if (compiler.checkReference(tag, component, true, component)) {
-            // add a field
-            validator.addField(name, component, compiler);
-        }
-
-
-    }
-
-}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/JInternal=
FrameHandler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/JInternalFrameHan=
dler.java	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/JInternalFrame=
Handler.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,53 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.tags.swing;
-
-import jaxx.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.reflect.ClassDescriptor;
-import jaxx.reflect.ClassDescriptorLoader;
-import jaxx.tags.DefaultComponentHandler;
-import org.w3c.dom.Element;
-
-import javax.swing.JInternalFrame;
-import javax.swing.JMenuBar;
-import javax.swing.WindowConstants;
-
-public class JInternalFrameHandler extends DefaultComponentHandler {
-
-    public JInternalFrameHandler(ClassDescriptor beanClass) {
-        super(beanClass);
-        ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JInte=
rnalFrame.class);
-    }
-
-    @Override
-    public CompiledObject createCompiledObject(String id, JAXXCompiler compi=
ler) throws CompilerException {
-        return new CompiledObject(id, getBeanClass(), compiler) {
-            @Override
-            public void addChild(CompiledObject child, String constraints, J=
AXXCompiler compiler) throws CompilerException {
-                if (ClassDescriptorLoader.getClassDescriptor(JMenuBar.class)=
.isAssignableFrom(child.getObjectClass()))
-                    appendAdditionCode(getId() + ".setJMenuBar(" + child.get=
Id() + ");");
-                else
-                    super.addChild(child, constraints, compiler);
-            }
-        };
-    }
-
-    @Override
-    protected void setDefaults(CompiledObject object, Element tag, JAXXCompi=
ler compiler) throws CompilerException {
-        super.setDefaults(object, tag, compiler);
-        setAttribute(object, "visible", "true", false, compiler);
-        setAttribute(object, "closable", "true", false, compiler);
-        setAttribute(object, "defaultCloseOperation", String.valueOf(WindowC=
onstants.DISPOSE_ON_CLOSE), false, compiler);
-    }
-
-
-    @Override
-    public void setAttributes(CompiledObject object, Element tag, JAXXCompil=
er compiler) throws CompilerException {
-        super.setAttributes(object, tag, compiler);
-        compiler.initializer.append(object.getId()).append(".pack();\n");
-    }
-}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/JInternalF=
rameHandler.java (from rev 977, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/=
tags/swing/JInternalFrameHandler.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/JInternalFrame=
Handler.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/JInternalFrame=
Handler.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2006 Ethan Nicholas. All rights reserved.
+ * Use is subject to license terms.
+ */
+package jaxx.tags.swing;
+
+import jaxx.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.reflect.ClassDescriptor;
+import jaxx.reflect.ClassDescriptorLoader;
+import jaxx.tags.DefaultComponentHandler;
+import org.w3c.dom.Element;
+
+import javax.swing.JInternalFrame;
+import javax.swing.JMenuBar;
+import javax.swing.WindowConstants;
+
+public class JInternalFrameHandler extends DefaultComponentHandler {
+
+    public JInternalFrameHandler(ClassDescriptor beanClass) {
+        super(beanClass);
+        ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JInte=
rnalFrame.class);
+    }
+
+    @Override
+    public CompiledObject createCompiledObject(String id, JAXXCompiler compi=
ler) throws CompilerException {
+        return new CompiledObject(id, getBeanClass(), compiler) {
+            @Override
+            public void addChild(CompiledObject child, String constraints, J=
AXXCompiler compiler) throws CompilerException {
+                if (ClassDescriptorLoader.getClassDescriptor(JMenuBar.class)=
.isAssignableFrom(child.getObjectClass()))
+                    appendAdditionCode(getId() + ".setJMenuBar(" + child.get=
Id() + ");");
+                else
+                    super.addChild(child, constraints, compiler);
+            }
+        };
+    }
+
+    @Override
+    protected void setDefaults(CompiledObject object, Element tag, JAXXCompi=
ler compiler) throws CompilerException {
+        super.setDefaults(object, tag, compiler);
+        setAttribute(object, "visible", "true", false, compiler);
+        setAttribute(object, "closable", "true", false, compiler);
+        setAttribute(object, "defaultCloseOperation", String.valueOf(WindowC=
onstants.DISPOSE_ON_CLOSE), false, compiler);
+    }
+
+
+    @Override
+    public void setAttributes(CompiledObject object, Element tag, JAXXCompil=
er compiler) throws CompilerException {
+        super.setAttributes(object, tag, compiler);
+        compiler.appendInitializerCode(object.getId() + ".pack();\n");
+    }
+}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/JWindowHa=
ndler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/JWindowHandler.ja=
va	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/JWindowHandler=
.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,58 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.tags.swing;
-
-import jaxx.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.reflect.ClassDescriptor;
-import jaxx.reflect.ClassDescriptorLoader;
-import jaxx.tags.DefaultComponentHandler;
-import org.w3c.dom.Element;
-
-import javax.swing.JDialog;
-import javax.swing.JFrame;
-import javax.swing.JMenuBar;
-import javax.swing.JWindow;
-import java.io.IOException;
-import java.util.Map;
-
-public class JWindowHandler extends DefaultComponentHandler {
-
-    public JWindowHandler(ClassDescriptor beanClass) {
-        super(beanClass);
-        ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JWind=
ow.class, JFrame.class, JDialog.class);
-    }
-
-    @Override
-    public CompiledObject createCompiledObject(String id, JAXXCompiler compi=
ler) throws CompilerException {
-        return new CompiledObject(id, getBeanClass(), compiler) {
-            @Override
-            public void addChild(CompiledObject child, String constraints, J=
AXXCompiler compiler) throws CompilerException {
-                if (ClassDescriptorLoader.getClassDescriptor(JMenuBar.class)=
.isAssignableFrom(child.getObjectClass()))
-                    appendAdditionCode(getId() + ".setJMenuBar(" + child.get=
Id() + ");");
-                else
-                    super.addChild(child, constraints, compiler);
-            }
-        };
-    }
-
-    @Override
-    protected void openComponent(CompiledObject object, Element tag, JAXXCom=
piler compiler) throws CompilerException {
-        if (compiler.getOpenComponent() !=3D null)
-            compiler.openInvisibleComponent(object);
-        else
-            super.openComponent(object, tag, compiler);
-    }
-
-    @Override
-    public void compileSecondPass(Element tag, JAXXCompiler compiler) throws=
 CompilerException, IOException {
-        super.compileSecondPass(tag, compiler);
-        CompiledObject object =3D (CompiledObject) objectMap.get(tag);
-        Map properties =3D object.getProperties();
-        if (!properties.containsKey("width") && !properties.containsKey("hei=
ght"))
-            compiler.lateInitializer.append(object.getId()).append(".pack();=
\n");
-    }
-}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/JWindowHan=
dler.java (from rev 977, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/sw=
ing/JWindowHandler.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/JWindowHandler=
.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/JWindowHandler=
.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2006 Ethan Nicholas. All rights reserved.
+ * Use is subject to license terms.
+ */
+package jaxx.tags.swing;
+
+import jaxx.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.reflect.ClassDescriptor;
+import jaxx.reflect.ClassDescriptorLoader;
+import jaxx.tags.DefaultComponentHandler;
+import org.w3c.dom.Element;
+
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JMenuBar;
+import javax.swing.JWindow;
+import java.io.IOException;
+import java.util.Map;
+
+public class JWindowHandler extends DefaultComponentHandler {
+
+    public JWindowHandler(ClassDescriptor beanClass) {
+        super(beanClass);
+        ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, JWind=
ow.class, JFrame.class, JDialog.class);
+    }
+
+    @Override
+    public CompiledObject createCompiledObject(String id, JAXXCompiler compi=
ler) throws CompilerException {
+        return new CompiledObject(id, getBeanClass(), compiler) {
+            @Override
+            public void addChild(CompiledObject child, String constraints, J=
AXXCompiler compiler) throws CompilerException {
+                if (ClassDescriptorLoader.getClassDescriptor(JMenuBar.class)=
.isAssignableFrom(child.getObjectClass()))
+                    appendAdditionCode(getId() + ".setJMenuBar(" + child.get=
Id() + ");");
+                else
+                    super.addChild(child, constraints, compiler);
+            }
+        };
+    }
+
+    @Override
+    protected void openComponent(CompiledObject object, Element tag, JAXXCom=
piler compiler) throws CompilerException {
+        if (compiler.getOpenComponent() !=3D null)
+            compiler.openInvisibleComponent(object);
+        else
+            super.openComponent(object, tag, compiler);
+    }
+
+    @Override
+    public void compileSecondPass(Element tag, JAXXCompiler compiler) throws=
 CompilerException, IOException {
+        super.compileSecondPass(tag, compiler);
+        CompiledObject object =3D objectMap.get(tag);
+        Map properties =3D object.getProperties();
+        if (!properties.containsKey("width") && !properties.containsKey("hei=
ght")) {
+            compiler.appendLateInitializer(object.getId() + ".pack();\n");
+        }
+    }
+}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/SwingInit=
ializer.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/SwingInitializer.=
java	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/SwingInitializ=
er.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,95 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.tags.swing;
-
-import jaxx.compiler.JAXXCompiler;
-import jaxx.reflect.ClassDescriptorLoader;
-import jaxx.runtime.swing.Application;
-import jaxx.runtime.swing.JAXXButtonGroup;
-import jaxx.runtime.swing.JAXXComboBox;
-import jaxx.runtime.swing.JAXXList;
-import jaxx.runtime.swing.JAXXTab;
-import jaxx.runtime.swing.JAXXTree;
-import jaxx.runtime.swing.Table;
-import jaxx.runtime.BeanValidator;
-import jaxx.spi.Initializer;
-import jaxx.tags.DefaultComponentHandler;
-import jaxx.tags.DefaultObjectHandler;
-import jaxx.tags.TagManager;
-import jaxx.tags.swing.BeanValidatorHandler;
-import jaxx.tags.swing.FieldValidatorHandler;
-import jaxx.types.KeyStrokeConverter;
-import jaxx.types.TypeManager;
-
-import javax.swing.*;
-import javax.swing.text.JTextComponent;
-import java.beans.Introspector;
-
-public class SwingInitializer implements Initializer {
-
-    public void initialize() {
-        String[] searchPath =3D Introspector.getBeanInfoSearchPath();
-        String[] newSearchPath =3D new String[searchPath.length + 1];
-        System.arraycopy(searchPath, 0, newSearchPath, 0, searchPath.length);
-        newSearchPath[newSearchPath.length - 1] =3D "jaxx.beaninfos";
-        Introspector.setBeanInfoSearchPath(newSearchPath);
-
-        TagManager.registerTag("java.awt.*", "ButtonGroup", new DefaultObjec=
tHandler(ClassDescriptorLoader.getClassDescriptor(JAXXButtonGroup.class)));
-
-        // Begin Try to fix bug when component handler is not found, but thi=
s is not this...
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JBu=
tton.class), DefaultComponentHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JTe=
xtField.class), JTextComponentHandler.class);
-        // End Try to fix bug when component handler is not found, but this =
is not this...
-
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(App=
lication.class), ApplicationHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JCh=
eckBox.class), JCheckBoxHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JCh=
eckBoxMenuItem.class), JCheckBoxHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JAX=
XComboBox.class), JComboBoxHandler.class);
-        TagManager.registerTag("javax.swing.*", "JComboBox", new JComboBoxHa=
ndler(ClassDescriptorLoader.getClassDescriptor(JAXXComboBox.class)));
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JDi=
alog.class), JWindowHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JFr=
ame.class), JWindowHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JIn=
ternalFrame.class), JInternalFrameHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JAX=
XList.class), JListHandler.class);
-        TagManager.registerTag("javax.swing.*", "JList", new JListHandler(Cl=
assDescriptorLoader.getClassDescriptor(JAXXList.class)));
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JMe=
nu.class), JMenuHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JPa=
sswordField.class), JPasswordFieldHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JPo=
pupMenu.class), JPopupMenuHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JPr=
ogressBar.class), JProgressBarHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JRa=
dioButton.class), JRadioButtonHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JRa=
dioButtonMenuItem.class), JRadioButtonHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JSc=
rollPane.class), JScrollPaneHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JSl=
ider.class), JSliderHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JSp=
inner.class), JSpinnerHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JSp=
litPane.class), JSplitPaneHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JTa=
bbedPane.class), JTabbedPaneHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JTe=
xtComponent.class), JTextComponentHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JTo=
ggleButton.class), JRadioButtonHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JTo=
olBar.class), JToolBarHandler.class);
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JAX=
XTree.class), JTreeHandler.class);
-        TagManager.registerTag("javax.swing.*", "JTree", new JTreeHandler(Cl=
assDescriptorLoader.getClassDescriptor(JAXXTree.class)));
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JWi=
ndow.class), JWindowHandler.class);
-
-        TagManager.registerDefaultNamespace("JEditorPane", "javax.swing.*");
-        TagManager.registerDefaultNamespace("JFormattedTextField", "javax.sw=
ing.*");
-        TagManager.registerDefaultNamespace("JPasswordField", "javax.swing.*=
");
-        TagManager.registerDefaultNamespace("JTextArea", "javax.swing.*");
-        TagManager.registerDefaultNamespace("JTextField", "javax.swing.*");
-        TagManager.registerDefaultNamespace("JTextPane", "javax.swing.*");
-
-        TagManager.registerTag(JAXXCompiler.JAXX_NAMESPACE, "tab", new TabHa=
ndler());
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(Tab=
le.class), TableHandler.class);
-        TagManager.registerTag(JAXXCompiler.JAXX_NAMESPACE, "row", new RowHa=
ndler());
-        TagManager.registerTag(JAXXCompiler.JAXX_NAMESPACE, "cell", new Cell=
Handler());
-        TagManager.registerTag(JAXXCompiler.JAXX_NAMESPACE, "item", new Item=
Handler());
-
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JAX=
XTab.class), JAXXTabHandler.class);
-
-        TypeManager.registerTypeConverter(KeyStroke.class, new KeyStrokeConv=
erter());
-
-        // validator
-        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(Bea=
nValidator.class), BeanValidatorHandler.class);
-        TagManager.registerTag(JAXXCompiler.JAXX_NAMESPACE, FieldValidatorHa=
ndler.FIELD_VALIDATOR_TAG, new FieldValidatorHandler());
-    }
-}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/SwingIniti=
alizer.java (from rev 958, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/=
swing/SwingInitializer.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/SwingInitializ=
er.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/swing/SwingInitializ=
er.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2006 Ethan Nicholas. All rights reserved.
+ * Use is subject to license terms.
+ */
+package jaxx.tags.swing;
+
+import jaxx.compiler.JAXXCompiler;
+import jaxx.reflect.ClassDescriptorLoader;
+import jaxx.runtime.swing.Application;
+import jaxx.runtime.swing.JAXXButtonGroup;
+import jaxx.runtime.swing.JAXXComboBox;
+import jaxx.runtime.swing.JAXXList;
+import jaxx.runtime.swing.JAXXTab;
+import jaxx.runtime.swing.JAXXTree;
+import jaxx.runtime.swing.Table;
+import jaxx.runtime.validator.BeanValidator;
+import jaxx.spi.Initializer;
+import jaxx.tags.DefaultComponentHandler;
+import jaxx.tags.DefaultObjectHandler;
+import jaxx.tags.TagManager;
+import jaxx.tags.validator.BeanValidatorHandler;
+import jaxx.tags.validator.FieldValidatorHandler;
+import jaxx.types.KeyStrokeConverter;
+import jaxx.types.TypeManager;
+
+import javax.swing.*;
+import javax.swing.text.JTextComponent;
+import java.beans.Introspector;
+
+public class SwingInitializer implements Initializer {
+
+    public void initialize() {
+        String[] searchPath =3D Introspector.getBeanInfoSearchPath();
+        String[] newSearchPath =3D new String[searchPath.length + 1];
+        System.arraycopy(searchPath, 0, newSearchPath, 0, searchPath.length);
+        newSearchPath[newSearchPath.length - 1] =3D "jaxx.beaninfos";
+        Introspector.setBeanInfoSearchPath(newSearchPath);
+
+        TagManager.registerTag("java.awt.*", "ButtonGroup", new DefaultObjec=
tHandler(ClassDescriptorLoader.getClassDescriptor(JAXXButtonGroup.class)));
+
+        // Begin Try to fix bug when component handler is not found, but thi=
s is not this...
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JBu=
tton.class), DefaultComponentHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JTe=
xtField.class), JTextComponentHandler.class);
+        // End Try to fix bug when component handler is not found, but this =
is not this...
+
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(App=
lication.class), ApplicationHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JCh=
eckBox.class), JCheckBoxHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JCh=
eckBoxMenuItem.class), JCheckBoxHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JAX=
XComboBox.class), JComboBoxHandler.class);
+        TagManager.registerTag("javax.swing.*", "JComboBox", new JComboBoxHa=
ndler(ClassDescriptorLoader.getClassDescriptor(JAXXComboBox.class)));
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JDi=
alog.class), JWindowHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JFr=
ame.class), JWindowHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JIn=
ternalFrame.class), JInternalFrameHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JAX=
XList.class), JListHandler.class);
+        TagManager.registerTag("javax.swing.*", "JList", new JListHandler(Cl=
assDescriptorLoader.getClassDescriptor(JAXXList.class)));
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JMe=
nu.class), JMenuHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JPa=
sswordField.class), JPasswordFieldHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JPo=
pupMenu.class), JPopupMenuHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JPr=
ogressBar.class), JProgressBarHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JRa=
dioButton.class), JRadioButtonHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JRa=
dioButtonMenuItem.class), JRadioButtonHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JSc=
rollPane.class), JScrollPaneHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JSl=
ider.class), JSliderHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JSp=
inner.class), JSpinnerHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JSp=
litPane.class), JSplitPaneHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JTa=
bbedPane.class), JTabbedPaneHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JTe=
xtComponent.class), JTextComponentHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JTo=
ggleButton.class), JRadioButtonHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JTo=
olBar.class), JToolBarHandler.class);
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JAX=
XTree.class), JTreeHandler.class);
+        TagManager.registerTag("javax.swing.*", "JTree", new JTreeHandler(Cl=
assDescriptorLoader.getClassDescriptor(JAXXTree.class)));
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JWi=
ndow.class), JWindowHandler.class);
+
+        TagManager.registerDefaultNamespace("JEditorPane", "javax.swing.*");
+        TagManager.registerDefaultNamespace("JFormattedTextField", "javax.sw=
ing.*");
+        TagManager.registerDefaultNamespace("JPasswordField", "javax.swing.*=
");
+        TagManager.registerDefaultNamespace("JTextArea", "javax.swing.*");
+        TagManager.registerDefaultNamespace("JTextField", "javax.swing.*");
+        TagManager.registerDefaultNamespace("JTextPane", "javax.swing.*");
+
+        TagManager.registerTag(JAXXCompiler.JAXX_NAMESPACE, "tab", new TabHa=
ndler());
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(Tab=
le.class), TableHandler.class);
+        TagManager.registerTag(JAXXCompiler.JAXX_NAMESPACE, "row", new RowHa=
ndler());
+        TagManager.registerTag(JAXXCompiler.JAXX_NAMESPACE, "cell", new Cell=
Handler());
+        TagManager.registerTag(JAXXCompiler.JAXX_NAMESPACE, "item", new Item=
Handler());
+
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(JAX=
XTab.class), JAXXTabHandler.class);
+
+        TypeManager.registerTypeConverter(KeyStroke.class, new KeyStrokeConv=
erter());
+
+        // validator
+        TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(Bea=
nValidator.class), BeanValidatorHandler.class);
+        TagManager.registerTag(JAXXCompiler.JAXX_NAMESPACE, FieldValidatorHa=
ndler.FIELD_VALIDATOR_TAG, new FieldValidatorHandler());
+    }
+}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/validator (from =
rev 958, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator)

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/validator/BeanV=
alidatorHandler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator/BeanValidator=
Handler.java	2008-10-17 20:55:15 UTC (rev 958)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/validator/BeanValida=
torHandler.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,312 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.tags.validator;
-
-import jaxx.CompilerException;
-import jaxx.compiler.CompiledObject;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.introspection.JAXXBeanInfo;
-import jaxx.introspection.JAXXPropertyDescriptor;
-import jaxx.reflect.ClassDescriptor;
-import jaxx.reflect.ClassDescriptorLoader;
-import jaxx.runtime.validator.BeanValidator;
-import jaxx.runtime.validator.ui.AbstractBeanValidatorUI;
-import jaxx.tags.DefaultObjectHandler;
-import jaxx.types.TypeManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.w3c.dom.Element;
-
-import java.beans.IntrospectionException;
-import java.io.IOException;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.TreeMap;
-
-public class BeanValidatorHandler extends DefaultObjectHandler {
-
-    public static final String BEAN_VALIDATOR_TAG =3D BeanValidator.class.ge=
tSimpleName();
-    public static final String BEAN_ATTRIBUTE =3D "bean";
-    public static final String ERROR_LIST_MODEL_ATTRIBUTE =3D "errorListMode=
l";
-    public static final String AUTOFIELD_ATTRIBUTE =3D "autoField";
-    public static final String UI_CLASS_ATTRIBUTE =3D "uiClass";
-    public static final String STRICT_MODE_ATTRIBUTE =3D "strictMode";
-
-    /** to use log facility, just put in your code: log.info(\"...\"); */
-    static Log log =3D LogFactory.getLog(BeanValidatorHandler.class);
-
-    /**
-     * Creates a new <code>DefaultObjectHandler</code> which provides suppor=
t for the specified class.  The
-     * class is not actually introspected until the {@link #compileFirstPass=
} method is invoked.
-     *
-     * @param beanClass the class which this handler supports
-     */
-    public BeanValidatorHandler(ClassDescriptor beanClass) {
-        super(beanClass);
-        ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, BeanV=
alidator.class);
-    }
-
-    @Override
-    protected CompiledObject createCompiledObject(String id, JAXXCompiler co=
mpiler) {
-        return new CompiledBeanValidator(id, getBeanClass(), compiler);
-    }
-
-    @Override
-    protected void compileChildTagFirstPass(Element tag, JAXXCompiler compil=
er) throws CompilerException, IOException {
-        if (compiler.getOptions().isVerbose()) {
-            log.info(tag);
-        }
-        if (!tag.getLocalName().equals(FieldValidatorHandler.FIELD_VALIDATOR=
_TAG)) {
-            compiler.reportError("tag '" + tag.getParentNode().getLocalName(=
) + "' may only contain " + FieldValidatorHandler.FIELD_VALIDATOR_TAG + " as =
children, but found : " + tag.getLocalName());
-        } else {
-            compiler.compileFirstPass(tag);
-        }
-    }
-
-    @Override
-    public void compileSecondPass(Element tag, JAXXCompiler compiler) throws=
 CompilerException, IOException {
-
-        super.compileSecondPass(tag, compiler);
-
-        CompiledBeanValidator info =3D (CompiledBeanValidator) objectMap.get=
(tag);
-
-        String tmp;
-
-        tmp =3D info.getErrorListModel();
-        if (tmp !=3D null) {
-            if (compiler.checkReference(tag, tmp, true, ERROR_LIST_MODEL_ATT=
RIBUTE)) {
-                String code =3D getSetPropertyCode(info.getJavaCode(), ERROR=
_LIST_MODEL_ATTRIBUTE, tmp, compiler);
-                info.appendAdditionCode(code);
-            }
-        }
-
-        tmp =3D info.getUiClass();
-        if (tmp !=3D null) {
-            try {
-                ClassDescriptor uiClass =3D ClassDescriptorLoader.getClassDe=
scriptor(tmp);
-                if (!ClassDescriptorLoader.getClassDescriptor(AbstractBeanVa=
lidatorUI.class).isAssignableFrom(uiClass)) {
-                    compiler.reportError("attribute 'ui'  :'" + tmp + "' is =
not assignable from class " + AbstractBeanValidatorUI.class);
-                } else {
-                    String code =3D getSetPropertyCode(info.getJavaCode(), U=
I_CLASS_ATTRIBUTE, uiClass.getName() + ".class", compiler);
-                    info.appendAdditionCode(code);
-                }
-            } catch (ClassNotFoundException e) {
-                compiler.reportError("class not found '" + tmp + "'");
-            }
-        }
-
-        String bean =3D info.getBean();
-        if (bean !=3D null) {
-            if (compiler.checkReference(tag, bean, true, BEAN_ATTRIBUTE)) {
-                String code =3D getSetPropertyCode(info.getJavaCode(), BEAN_=
ATTRIBUTE, bean, compiler);
-                info.appendAdditionCode(code);
-            }
-        }
-
-        if (info.getAutoField()) {
-            if (bean =3D=3D null) {
-                compiler.reportError("tag '" + tag.getLocalName() + "' need =
a " + BEAN_ATTRIBUTE + " attribute to use autofield mode");
-            } else {
-                registerAutoFieldBean(tag, compiler, info);
-            }
-        }
-
-        // add fieldrepresentation invocations
-        addFieldRepresentations(tag, compiler, info);
-
-        // register the validator in compiler
-        compiler.registerValidator(info);
-
-        // close the compiled object
-        compiler.closeComponent(info);
-    }
-
-    @Override
-    protected void setDefaults(CompiledObject object, Element tag, JAXXCompi=
ler compiler) {
-        // open the compiled object
-        compiler.openInvisibleComponent(object);
-    }
-
-    @Override
-    public void setAttribute(CompiledObject object, String propertyName, Str=
ing stringValue, boolean inline, JAXXCompiler compiler) {
-        if (compiler.getOptions().isVerbose()) {
-            log.info(propertyName + " : " + stringValue + " for " + object);
-        }
-        object.addProperty(propertyName, stringValue);
-    }
-
-    protected void registerAutoFieldBean(Element tag, JAXXCompiler compiler,=
 CompiledBeanValidator info) {
-        JAXXBeanInfo beanInfo =3D info.getBeanDescriptor(compiler);
-        for (JAXXPropertyDescriptor beanProperty : beanInfo.getJAXXPropertyD=
escriptors()) {
-            String descriptionName =3D beanProperty.getName();
-            if (compiler.getOptions().isVerbose()) {
-                log.info("try to bind on bean " + beanInfo.getJAXXBeanDescri=
ptor().getName() + " property " + descriptionName);
-            }
-            if (beanProperty.getWriteMethodDescriptor() =3D=3D null) {
-                // read-only property
-                continue;
-            }
-            if (info.getFields().containsKey(descriptionName)) {
-                // already defined in field
-                continue;
-            }
-            if (!compiler.checkReference(tag, descriptionName, info.getStric=
tMode(), null)) {
-                // no editor component found
-                continue;
-            }
-            // ok add the field mapping
-            info.addField(descriptionName, descriptionName, compiler);
-        }
-    }
-
-    protected void addFieldRepresentations(Element tag, JAXXCompiler compile=
r, CompiledBeanValidator info) {
-        for (Entry<String, String> entry : info.getFields().entrySet()) {
-            String propertyName =3D entry.getKey();
-            String component =3D entry.getValue();
-            if (!checkBeanProperty(compiler, info, propertyName)) {
-                // property not find on bean
-                continue;
-            }
-            if (!compiler.checkReference(tag, component, true, null)) {
-                // editor component not find on ui
-                continue;
-            }
-            String keyCode =3D TypeManager.getJavaCode(propertyName);
-            info.appendAdditionCode(info.getJavaCode() + ".setFieldRepresent=
ation(" + keyCode + ", " + component + ");");
-
-        }
-    }
-
-    protected boolean checkBeanProperty(JAXXCompiler compiler, CompiledBeanV=
alidator info, String propertyName) {
-
-        for (JAXXPropertyDescriptor beanProperty : info.getBeanDescriptor(co=
mpiler).getJAXXPropertyDescriptors()) {
-            if (beanProperty.getName().equals(propertyName)) {
-                if (beanProperty.getWriteMethodDescriptor() =3D=3D null) {
-                    // read-onlyproperty
-                    compiler.reportError("could not bind the readonly proper=
ty '" + propertyName + "' on bean [" + info.getBean() + "] ");
-                    return false;
-                }
-                return true;
-            }
-        }
-        compiler.reportError("could not find the property '" + propertyName =
+ "' on bean [" + info.getBean() + "] ");
-        return false;
-    }
-
-    /** @author chemit */
-    public static class CompiledBeanValidator extends CompiledObject {
-
-        protected Map<String, String> fields;
-        protected String bean;
-        protected String uiClass;
-        protected String errorListModel;
-        protected Boolean autoField;
-        protected Boolean strictMode;
-        protected JAXXBeanInfo beanDescriptor;
-
-        public CompiledBeanValidator(String id, ClassDescriptor objectClass,=
 JAXXCompiler compiler) {
-            super(id, objectClass, compiler);
-            fields =3D new TreeMap<String, String>();
-        }
-
-        public Map<String, String> getFields() {
-            return fields;
-        }
-
-        public void setFields(Map<String, String> fields) {
-            this.fields =3D fields;
-        }
-
-        @Override
-        public void addProperty(String property, String value) {
-
-            if (BEAN_ATTRIBUTE.equals(property)) {
-                if (value !=3D null && !value.trim().isEmpty()) {
-                    bean =3D value;
-                }
-                return;
-            }
-            if (ERROR_LIST_MODEL_ATTRIBUTE.equals(property)) {
-                if (value !=3D null && !value.trim().isEmpty()) {
-                    errorListModel =3D value;
-                }
-                return;
-            }
-            if (UI_CLASS_ATTRIBUTE.equals(property)) {
-                if (value !=3D null && !value.trim().isEmpty()) {
-                    uiClass =3D value;
-                }
-                return;
-            }
-            if (AUTOFIELD_ATTRIBUTE.equals(property)) {
-                if (value !=3D null && !value.trim().isEmpty()) {
-
-                    autoField =3D (Boolean) TypeManager.convertFromString(va=
lue, Boolean.class);
-                }
-                return;
-            }
-            if (STRICT_MODE_ATTRIBUTE.equals(property)) {
-                if (value !=3D null && !value.trim().isEmpty()) {
-
-                    strictMode =3D (Boolean) TypeManager.convertFromString(v=
alue, Boolean.class);
-                }
-                return;
-            }
-            //todo should not allowed to find other attributes
-            super.addProperty(property, value);
-        }
-
-        public void addField(String id, String component, JAXXCompiler compi=
ler) {
-            if (fields.containsKey(id)) {
-                compiler.reportError("duplicate field '" + id + "' for valid=
ator " + this);
-            } else {
-                if (compiler.getOptions().isVerbose()) {
-                    log.info("add field <" + id + ":" + component + ">");
-                }
-                fields.put(id, component);
-            }
-        }
-
-        public String getBean() {
-            return bean;
-        }
-
-        public String getErrorListModel() {
-            return errorListModel;
-        }
-
-        public boolean getAutoField() {
-            return autoField !=3D null && autoField;
-        }
-
-        public boolean getStrictMode() {
-            return strictMode !=3D null && strictMode;
-        }
-
-        public String getUiClass() {
-            return uiClass;
-        }
-
-        public JAXXBeanInfo getBeanDescriptor(JAXXCompiler compiler) {
-            if (beanDescriptor =3D=3D null && bean !=3D null) {
-                try {
-                    ClassDescriptor beanClassDescriptor =3D ClassDescriptorL=
oader.getClassDescriptor(compiler.getSymbolTable().getClassTagIds().get(bean)=
);
-                    beanDescriptor =3D getJAXXBeanInfo(beanClassDescriptor);
-                } catch (ClassNotFoundException e) {
-                    compiler.reportError("could not load class " + bean);
-                } catch (IntrospectionException e) {
-                    compiler.reportError("could not load class " + bean);
-                }
-            }
-            return beanDescriptor;
-        }
-
-        @Override
-        public void addChild(CompiledObject child, String constraints, JAXXC=
ompiler compiler) throws CompilerException {
-            // do nothing
-            compiler.reportError("can not add CompiledObject in the tag '" +=
 BEAN_VALIDATOR_TAG + " (only field tags)");
-        }
-    }
-}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/validator/BeanVa=
lidatorHandler.java (from rev 975, lutinjaxx/trunk/jaxx-core/src/main/java/ja=
xx/tags/validator/BeanValidatorHandler.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/validator/BeanValida=
torHandler.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/validator/BeanValida=
torHandler.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,340 @@
+/*
+ * Copyright 2006 Ethan Nicholas. All rights reserved.
+ * Use is subject to license terms.
+ */
+package jaxx.tags.validator;
+
+import jaxx.CompilerException;
+import jaxx.compiler.CompiledObject;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.introspection.JAXXBeanInfo;
+import jaxx.introspection.JAXXPropertyDescriptor;
+import jaxx.reflect.ClassDescriptor;
+import jaxx.reflect.ClassDescriptorLoader;
+import jaxx.runtime.validator.BeanValidator;
+import jaxx.runtime.validator.ui.AbstractBeanValidatorUI;
+import jaxx.tags.DefaultObjectHandler;
+import jaxx.types.TypeManager;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Element;
+
+import java.beans.IntrospectionException;
+import java.io.IOException;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.TreeMap;
+
+public class BeanValidatorHandler extends DefaultObjectHandler {
+
+    public static final String BEAN_VALIDATOR_TAG =3D BeanValidator.class.ge=
tSimpleName();
+    public static final String BEAN_ATTRIBUTE =3D "bean";
+    public static final String ERROR_LIST_MODEL_ATTRIBUTE =3D "errorListMode=
l";
+    public static final String AUTOFIELD_ATTRIBUTE =3D "autoField";
+    public static final String UI_CLASS_ATTRIBUTE =3D "uiClass";
+    public static final String STRICT_MODE_ATTRIBUTE =3D "strictMode";
+
+    /** to use log facility, just put in your code: log.info(\"...\"); */
+    static Log log =3D LogFactory.getLog(BeanValidatorHandler.class);
+
+    /**
+     * Creates a new <code>DefaultObjectHandler</code> which provides suppor=
t for the specified class.  The
+     * class is not actually introspected until the {@link #compileFirstPass=
} method is invoked.
+     *
+     * @param beanClass the class which this handler supports
+     */
+    public BeanValidatorHandler(ClassDescriptor beanClass) {
+        super(beanClass);
+        ClassDescriptorLoader.checkSupportClass(getClass(), beanClass, BeanV=
alidator.class);
+    }
+
+    @Override
+    protected CompiledObject createCompiledObject(String id, JAXXCompiler co=
mpiler) {
+        return new CompiledBeanValidator(id, getBeanClass(), compiler);
+    }
+
+    @Override
+    protected void compileChildTagFirstPass(Element tag, JAXXCompiler compil=
er) throws CompilerException, IOException {
+        if (compiler.getOptions().isVerbose()) {
+            log.info(tag);
+        }
+        if (!tag.getLocalName().equals(FieldValidatorHandler.FIELD_VALIDATOR=
_TAG)) {
+            compiler.reportError("tag '" + tag.getParentNode().getLocalName(=
) + "' may only contain " + FieldValidatorHandler.FIELD_VALIDATOR_TAG + " as =
children, but found : " + tag.getLocalName());
+        } else {
+            compiler.compileFirstPass(tag);
+        }
+    }
+
+    @Override
+    public void compileSecondPass(Element tag, JAXXCompiler compiler) throws=
 CompilerException, IOException {
+
+        super.compileSecondPass(tag, compiler);
+
+        CompiledBeanValidator info =3D (CompiledBeanValidator) objectMap.get=
(tag);
+
+        String tmp;
+
+        tmp =3D info.getErrorListModel();
+        if (tmp !=3D null) {
+            if (compiler.checkReference(tag, tmp, true, ERROR_LIST_MODEL_ATT=
RIBUTE)) {
+                String code =3D getSetPropertyCode(info.getJavaCode(), ERROR=
_LIST_MODEL_ATTRIBUTE, tmp, compiler);
+                info.appendAdditionCode(code);
+            }
+        }
+
+        tmp =3D info.getUiClass();
+        if (tmp !=3D null) {
+            try {
+                ClassDescriptor uiClass =3D ClassDescriptorLoader.getClassDe=
scriptor(tmp);
+                if (!ClassDescriptorLoader.getClassDescriptor(AbstractBeanVa=
lidatorUI.class).isAssignableFrom(uiClass)) {
+                    compiler.reportError("attribute 'ui'  :'" + tmp + "' is =
not assignable from class " + AbstractBeanValidatorUI.class);
+                } else {
+                    String code =3D getSetPropertyCode(info.getJavaCode(), U=
I_CLASS_ATTRIBUTE, uiClass.getName() + ".class", compiler);
+                    info.appendAdditionCode(code);
+                }
+            } catch (ClassNotFoundException e) {
+                compiler.reportError("class not found '" + tmp + "'");
+            }
+        }
+
+        String bean =3D info.getBean();
+        boolean error =3D false;
+        if (bean !=3D null) {
+            if (compiler.checkReference(tag, bean, true, BEAN_ATTRIBUTE)) {
+                String code =3D getSetPropertyCode(info.getJavaCode(), BEAN_=
ATTRIBUTE, bean, compiler);
+                info.appendAdditionCode(code);
+                // add generic type to validator
+                JAXXBeanInfo beanInfo =3D info.getBeanDescriptor(compiler);
+                info.setGenericTypes(new String[]{beanInfo.getJAXXBeanDescri=
ptor().getClassDescriptor().getName()});
+            } else {
+                error=3Dtrue;
+            }
+
+            //TODO: checkthe bean is not already used in another validator
+            if (!error && compiler.isBeanUsedByValidator(bean)) {
+                compiler.reportError("the bean '" + bean + "' is already use=
d in another the validator, can not used it in  '" + tag + "'");
+                error =3D true;
+            }
+
+            if (!error && info.getAutoField()) {
+                //if (bean =3D=3D null) {
+                //    compiler.reportError("tag '" + tag.getLocalName() + "'=
 need a " + BEAN_ATTRIBUTE + " attribute to use autofield mode");
+                //} else {
+                registerAutoFieldBean(tag, compiler, info);
+                // }
+            }
+
+            if (!error && info.getBeanDescriptor(compiler) !=3D null) {
+
+                // add fieldrepresentation invocations
+                addFieldRepresentations(tag, compiler, info);
+
+                // register the validator in compiler
+                compiler.registerValidator(info);
+            }
+
+        } else {
+            compiler.reportError("tag '" + tag + "' requires a bean attribut=
e");
+        }
+
+        // close the compiled object
+        compiler.closeComponent(info);
+    }
+
+    @Override
+    protected void setDefaults(CompiledObject object, Element tag, JAXXCompi=
ler compiler) {
+        // open the compiled object
+        compiler.openInvisibleComponent(object);
+    }
+
+    @Override
+    public void setAttribute(CompiledObject object, String propertyName, Str=
ing stringValue, boolean inline, JAXXCompiler compiler) {
+        if (compiler.getOptions().isVerbose()) {
+            log.info(propertyName + " : " + stringValue + " for " + object);
+        }
+        object.addProperty(propertyName, stringValue);
+    }
+
+    protected void registerAutoFieldBean(Element tag, JAXXCompiler compiler,=
 CompiledBeanValidator info) {
+        JAXXBeanInfo beanInfo =3D info.getBeanDescriptor(compiler);
+        for (JAXXPropertyDescriptor beanProperty : beanInfo.getJAXXPropertyD=
escriptors()) {
+            String descriptionName =3D beanProperty.getName();
+            if (compiler.getOptions().isVerbose()) {
+                log.info("try to bind on bean " + beanInfo.getJAXXBeanDescri=
ptor().getName() + " property " + descriptionName);
+            }
+            if (beanProperty.getWriteMethodDescriptor() =3D=3D null) {
+                // read-only property
+                continue;
+            }
+            if (info.getFields().containsKey(descriptionName)) {
+                // already defined in field
+                continue;
+            }
+            if (!compiler.checkReference(tag, descriptionName, info.getStric=
tMode(), null)) {
+                // no editor component found
+                continue;
+            }
+            // ok add the field mapping
+            info.addField(descriptionName, descriptionName, compiler);
+        }
+    }
+
+    protected void addFieldRepresentations(Element tag, JAXXCompiler compile=
r, CompiledBeanValidator info) {
+        for (Entry<String, String> entry : info.getFields().entrySet()) {
+            String propertyName =3D entry.getKey();
+            String component =3D entry.getValue();
+            if (!checkBeanProperty(compiler, info, propertyName)) {
+                // property not find on bean
+                continue;
+            }
+            if (!compiler.checkReference(tag, component, true, null)) {
+                // editor component not find on ui
+                continue;
+            }
+            if (compiler.isComponentUsedByValidator(component)) {
+                // component is already used by another validator
+                compiler.reportError("component '" + component + "' is alrea=
dy used by another validator.");
+                continue;
+            }
+            String keyCode =3D TypeManager.getJavaCode(propertyName);
+            info.appendAdditionCode(info.getJavaCode() + ".setFieldRepresent=
ation(" + keyCode + ", " + component + ");");
+
+        }
+    }
+
+    protected boolean checkBeanProperty(JAXXCompiler compiler, CompiledBeanV=
alidator info, String propertyName) {
+
+        for (JAXXPropertyDescriptor beanProperty : info.getBeanDescriptor(co=
mpiler).getJAXXPropertyDescriptors()) {
+            if (beanProperty.getName().equals(propertyName)) {
+                if (beanProperty.getWriteMethodDescriptor() =3D=3D null) {
+                    // read-onlyproperty
+                    compiler.reportError("could not bind the readonly proper=
ty '" + propertyName + "' on bean [" + info.getBean() + "] ");
+                    return false;
+                }
+                return true;
+            }
+        }
+        compiler.reportError("could not find the property '" + propertyName =
+ "' on bean [" + info.getBean() + "] ");
+        return false;
+    }
+
+    /** @author chemit */
+    public static class CompiledBeanValidator extends CompiledObject {
+
+        protected Map<String, String> fields;
+        protected String bean;
+        protected String uiClass;
+        protected String errorListModel;
+        protected Boolean autoField;
+        protected Boolean strictMode;
+        protected JAXXBeanInfo beanDescriptor;
+
+        public CompiledBeanValidator(String id, ClassDescriptor objectClass,=
 JAXXCompiler compiler) {
+            super(id, objectClass, compiler);
+            fields =3D new TreeMap<String, String>();
+        }
+
+        public Map<String, String> getFields() {
+            return fields;
+        }
+
+        public void setFields(Map<String, String> fields) {
+            this.fields =3D fields;
+        }
+
+        @Override
+        public void addProperty(String property, String value) {
+
+            if (BEAN_ATTRIBUTE.equals(property)) {
+                if (value !=3D null && !value.trim().isEmpty()) {
+                    bean =3D value;
+                }
+                return;
+            }
+            if (ERROR_LIST_MODEL_ATTRIBUTE.equals(property)) {
+                if (value !=3D null && !value.trim().isEmpty()) {
+                    errorListModel =3D value;
+                }
+                return;
+            }
+            if (UI_CLASS_ATTRIBUTE.equals(property)) {
+                if (value !=3D null && !value.trim().isEmpty()) {
+                    uiClass =3D value;
+                }
+                return;
+            }
+            if (AUTOFIELD_ATTRIBUTE.equals(property)) {
+                if (value !=3D null && !value.trim().isEmpty()) {
+
+                    autoField =3D (Boolean) TypeManager.convertFromString(va=
lue, Boolean.class);
+                }
+                return;
+            }
+            if (STRICT_MODE_ATTRIBUTE.equals(property)) {
+                if (value !=3D null && !value.trim().isEmpty()) {
+
+                    strictMode =3D (Boolean) TypeManager.convertFromString(v=
alue, Boolean.class);
+                }
+                return;
+            }
+            //todo should not allowed to find other attributes
+            super.addProperty(property, value);
+        }
+
+        public void addField(String id, String component, JAXXCompiler compi=
ler) {
+            if (fields.containsKey(id)) {
+                compiler.reportError("duplicate field '" + id + "' for valid=
ator " + this);
+            } else {
+                if (compiler.getOptions().isVerbose()) {
+                    log.info("add field <" + id + ":" + component + ">");
+                }
+                fields.put(id, component);
+            }
+        }
+
+        public String getBean() {
+            return bean;
+        }
+
+        public String getErrorListModel() {
+            return errorListModel;
+        }
+
+        public boolean getAutoField() {
+            return autoField !=3D null && autoField;
+        }
+
+        public boolean getStrictMode() {
+            return strictMode !=3D null && strictMode;
+        }
+
+        public String getUiClass() {
+            return uiClass;
+        }
+
+        public JAXXBeanInfo getBeanDescriptor(JAXXCompiler compiler) {
+            if (beanDescriptor =3D=3D null && bean !=3D null) {
+                try {
+                    String beanClassName =3D compiler.getSymbolTable().getCl=
assTagIds().get(bean);
+                    if (beanClassName =3D=3D null) {
+                        compiler.reportError("could not find class of the be=
an '" + bean + "'");
+                        return null;
+                    }
+                    ClassDescriptor beanClassDescriptor =3D ClassDescriptorL=
oader.getClassDescriptor(beanClassName);
+                    beanDescriptor =3D getJAXXBeanInfo(beanClassDescriptor);
+                } catch (ClassNotFoundException e) {
+                    compiler.reportError("could not load class " + bean);
+                } catch (IntrospectionException e) {
+                    compiler.reportError("could not load class " + bean);
+                }
+            }
+            return beanDescriptor;
+        }
+
+        @Override
+        public void addChild(CompiledObject child, String constraints, JAXXC=
ompiler compiler) throws CompilerException {
+            // do nothing
+            compiler.reportError("can not add CompiledObject in the tag '" +=
 BEAN_VALIDATOR_TAG + " (only field tags)");
+        }
+    }
+}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/validator/Field=
ValidatorHandler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator/FieldValidato=
rHandler.java	2008-10-17 20:55:15 UTC (rev 958)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/validator/FieldValid=
atorHandler.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,73 +0,0 @@
-/*
- * Copyright 2006 Ethan Nicholas. All rights reserved.
- * Use is subject to license terms.
- */
-package jaxx.tags.validator;
-
-import jaxx.CompilerException;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.reflect.ClassDescriptorLoader;
-import jaxx.runtime.validator.BeanValidator;
-import jaxx.tags.TagHandler;
-import jaxx.tags.validator.BeanValidatorHandler.CompiledBeanValidator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.w3c.dom.Element;
-
-import java.io.IOException;
-
-public class FieldValidatorHandler implements TagHandler {
-
-    public static final String FIELD_VALIDATOR_TAG =3D "field";
-    public static final String NAME_ATTRIBUTE =3D "name";
-    public static final String COMPONENT_ATTRIBUTE =3D "component";
-
-    /** to use log facility, just put in your code: log.info(\"...\"); */
-    static private Log log =3D LogFactory.getLog(FieldValidatorHandler.class=
);
-
-    public void compileFirstPass(Element tag, JAXXCompiler compiler) throws =
CompilerException, IOException {
-        if (compiler.getOptions().isVerbose()) {
-            log.info(tag);
-        }
-        //todo check there is no child
-    }
-
-    public void compileSecondPass(Element tag, JAXXCompiler compiler) throws=
 CompilerException, IOException {
-        if (compiler.getOptions().isVerbose()) {
-            log.info(tag);
-        }
-
-        if (!ClassDescriptorLoader.getClassDescriptor(BeanValidator.class).i=
sAssignableFrom(compiler.getOpenComponent().getObjectClass())) {
-            compiler.reportError(FIELD_VALIDATOR_TAG + " tag may only appear=
 within " + BeanValidatorHandler.BEAN_VALIDATOR_TAG + " tag but was " + tag);
-            return;
-        }
-
-        CompiledBeanValidator validator =3D (CompiledBeanValidator) compiler=
.getOpenComponent();
-
-        String name =3D tag.getAttribute(NAME_ATTRIBUTE);
-        String component =3D tag.getAttribute(COMPONENT_ATTRIBUTE);
-        if (name =3D=3D null || name.trim().isEmpty()) {
-            compiler.reportError(FIELD_VALIDATOR_TAG + " tag requires a " + =
NAME_ATTRIBUTE + " attribute");
-            return;
-        }
-        name =3D name.trim();
-        if (component =3D=3D null || component.trim().isEmpty()) {
-            // try to use the name as component
-            if (!compiler.checkReference(tag, name, false, name)) {
-                compiler.reportError(FIELD_VALIDATOR_TAG + " tag requires a =
" + COMPONENT_ATTRIBUTE + " attribute, try to use the name attribute ["+name+=
"] for the component, but no such component found");
-                return;
-            }
-            component =3D name;
-        }
-        component =3D component.trim();
-
-        // check component exist (again perharps, but if error will known ex=
actly which tag failed...) =20
-        if (compiler.checkReference(tag, component, true, component)) {
-            // add a field
-            validator.addField(name, component, compiler);
-        }
-
-
-    }
-
-}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/validator/FieldV=
alidatorHandler.java (from rev 974, lutinjaxx/trunk/jaxx-core/src/main/java/j=
axx/tags/validator/FieldValidatorHandler.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/validator/FieldValid=
atorHandler.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/java/jaxx/tags/validator/FieldValid=
atorHandler.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2006 Ethan Nicholas. All rights reserved.
+ * Use is subject to license terms.
+ */
+package jaxx.tags.validator;
+
+import jaxx.CompilerException;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.reflect.ClassDescriptorLoader;
+import jaxx.runtime.validator.BeanValidator;
+import jaxx.tags.TagHandler;
+import jaxx.tags.validator.BeanValidatorHandler.CompiledBeanValidator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Element;
+
+import java.io.IOException;
+
+public class FieldValidatorHandler implements TagHandler {
+
+    public static final String FIELD_VALIDATOR_TAG =3D "field";
+    public static final String NAME_ATTRIBUTE =3D "name";
+    public static final String COMPONENT_ATTRIBUTE =3D "component";
+
+    /** to use log facility, just put in your code: log.info(\"...\"); */
+    static private Log log =3D LogFactory.getLog(FieldValidatorHandler.class=
);
+
+    public void compileFirstPass(Element tag, JAXXCompiler compiler) throws =
CompilerException, IOException {
+        if (compiler.getOptions().isVerbose()) {
+            log.info(tag);
+        }
+        //todo check there is no child
+    }
+
+    public void compileSecondPass(Element tag, JAXXCompiler compiler) throws=
 CompilerException, IOException {
+        if (compiler.getOptions().isVerbose()) {
+            log.info(tag);
+        }
+
+        if (!ClassDescriptorLoader.getClassDescriptor(BeanValidator.class).i=
sAssignableFrom(compiler.getOpenComponent().getObjectClass())) {
+            compiler.reportError(FIELD_VALIDATOR_TAG + " tag may only appear=
 within " + BeanValidatorHandler.BEAN_VALIDATOR_TAG + " tag but was " + tag);
+            return;
+        }
+
+        CompiledBeanValidator validator =3D (CompiledBeanValidator) compiler=
.getOpenComponent();
+
+        String name =3D tag.getAttribute(NAME_ATTRIBUTE);
+        String component =3D tag.getAttribute(COMPONENT_ATTRIBUTE);
+        if (name =3D=3D null || name.trim().isEmpty()) {
+            compiler.reportError(FIELD_VALIDATOR_TAG + " tag requires a " + =
NAME_ATTRIBUTE + " attribute");
+            return;
+        }
+        name =3D name.trim();
+        if (component =3D=3D null || component.trim().isEmpty()) {
+            // try to use the name as component
+            if (!compiler.checkReference(tag, name, false, name)) {
+                compiler.reportError(FIELD_VALIDATOR_TAG + " tag requires a =
" + COMPONENT_ATTRIBUTE + " attribute, try to use the name attribute ["+name+=
"] for the component, but no such component found");
+                return;
+            }
+            component =3D name;
+        }
+        component =3D component.trim();
+
+        // check component is not already used by this validator
+        if (validator.getFields().containsValue(component)) {
+            compiler.reportError(FIELD_VALIDATOR_TAG + " tag found a attribu=
te " + COMPONENT_ATTRIBUTE + " ["+component+"] already used in this validator=
");
+            return;
+        }
+        // check component exist (again perharps, but if error will known ex=
actly which tag failed...) =20
+        if (compiler.checkReference(tag, component, true, COMPONENT_ATTRIBUT=
E)) {
+            // add a field
+            validator.addField(name, component, compiler);
+        }
+
+
+    }
+
+}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/resources/example.jnlp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/resources/example.jnlp	2008-10-17 16:4=
4:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/resources/example.jnlp	2008-10-21 0=
7:31:05 UTC (rev 990)
@@ -1,16 +0,0 @@
-<jnlp spec=3D"1.0+" codebase=3D"http://www.jaxxframework.org/examples/@name@=
" href=3D"@name@.jnlp">
-  <information>
-    <title>@name@.jaxx</title>
-    <vendor>jaxxframework.org</vendor>
-    <offline-allowed/>
-  </information>
-
-  <resources>
-    <j2se version=3D"1.4.0+" href=3D"http://java.sun.com/products/autodl/j2s=
e"/>=20
-    <jar href=3D"@name@.jar"/>
-    <jar href=3D"../jaxx-runtime.jar"/>
-  </resources>
-
-  <application-desc main-class=3D"examples.@name@.@name@"/>
-</jnlp>
-

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/main/resources/manifest.mf
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/main/resources/manifest.mf	2008-10-17 16:44=
:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/resources/manifest.mf	2008-10-21 07=
:31:05 UTC (rev 990)
@@ -1,4 +0,0 @@
-Manifest-Version: 1.0
-Class-Path: ../jaxx-runtime.jar
-Main-Class: @class@
-

Copied: lutinjaxx/tags/0.5/jaxx-core/src/main/resources/validators.xml (from =
rev 981, lutinjaxx/trunk/jaxx-core/src/main/resources/validators.xml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/main/resources/validators.xml	          =
              (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/main/resources/validators.xml	2008-10-21=
 07:31:05 UTC (rev 990)
@@ -0,0 +1,14 @@
+<?xml version=3D"1.0" encoding=3D"UTF-8"?>
+<!DOCTYPE validators PUBLIC
+        "-//OpenSymphony Group//XWork Validator Config 1.0//EN"
+        "http://www.opensymphony.com/xwork/xwork-validator-config-1.0.dtd">
+
+<!-- START SNIPPET: validators -->
+<validators>
+    <validator name=3D"requiredFile" class=3D"jaxx.runtime.validator.Require=
dFileFieldValidator"/>
+    <validator name=3D"existingFile" class=3D"jaxx.runtime.validator.Existin=
gFileFieldValidator"/>
+    <validator name=3D"notExistingFile" class=3D"jaxx.runtime.validator.NotE=
xistingFileFieldValidator"/>
+    <validator name=3D"existingDirectory" class=3D"jaxx.runtime.validator.Ex=
istingDirectoryFieldValidator"/>
+    <validator name=3D"notExistingDirectory" class=3D"jaxx.runtime.validator=
.NotExistingDirectoryFieldValidator"/>
+</validators>
+<!--  END SNIPPET: validators -->

Copied: lutinjaxx/tags/0.5/jaxx-core/src/test/java/jaxx/junit/ValidatorBean.j=
ava (from rev 981, lutinjaxx/trunk/jaxx-core/src/test/java/jaxx/junit/Validat=
orBean.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/test/java/jaxx/junit/ValidatorBean.java	=
                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/test/java/jaxx/junit/ValidatorBean.java	=
2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,79 @@
+package jaxx.junit;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.File;
+
+public class ValidatorBean {
+
+    protected File existingFile;
+    protected File notExistingFile;
+
+    protected File existingDirectory;
+        protected File notExistingDirectory;
+
+
+    PropertyChangeSupport p;
+
+    public ValidatorBean() {
+        p =3D new PropertyChangeSupport(this);
+    }
+
+    public void addPropertyChangeListener(PropertyChangeListener listener) {
+        p.addPropertyChangeListener(listener);
+    }
+
+    public void addPropertyChangeListener(String propertyName, PropertyChang=
eListener listener) {
+        p.addPropertyChangeListener(propertyName, listener);
+    }
+
+    public void removePropertyChangeListener(PropertyChangeListener listener=
) {
+        p.removePropertyChangeListener(listener);
+    }
+
+    public void removePropertyChangeListener(String propertyName, PropertyCh=
angeListener listener) {
+        p.removePropertyChangeListener(propertyName, listener);
+    }
+
+
+    public File getExistingFile() {
+        return existingFile;
+    }
+
+    public File getNotExistingFile() {
+        return notExistingFile;
+    }
+
+    public File getExistingDirectory() {
+        return existingDirectory;
+    }
+
+    public File getNotExistingDirectory() {
+        return notExistingDirectory;
+    }
+
+    public void setExistingFile(File existingFile) {
+        File old =3D this.existingFile;
+        this.existingFile =3D existingFile;
+        p.firePropertyChange("existingFile", old, existingFile);
+    }
+
+    public void setNotExistingFile(File notExistingFile) {
+        File old =3D this.notExistingFile;
+        this.notExistingFile =3D notExistingFile;
+     p.firePropertyChange("notExistingFile", old, notExistingFile);
+    }
+
+    public void setExistingDirectory(File existingDirectory) {
+        File old =3D this.existingDirectory;
+        this.existingDirectory =3D existingDirectory;
+        p.firePropertyChange("existingDirectory", old, existingDirectory);
+    }
+
+    public void setNotExistingDirectory(File notExistingDirectory) {
+        File old =3D this.notExistingDirectory;
+        this.notExistingDirectory =3D notExistingDirectory;
+        p.firePropertyChange("notExistingDirectory", old, notExistingDirecto=
ry);
+    }
+
+}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-core/src/test/java/jaxx/junit/ValidatorTest.j=
ava (from rev 981, lutinjaxx/trunk/jaxx-core/src/test/java/jaxx/junit/Validat=
orTest.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/test/java/jaxx/junit/ValidatorTest.java	=
                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/test/java/jaxx/junit/ValidatorTest.java	=
2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,167 @@
+package jaxx.junit;
+
+import jaxx.runtime.validator.BeanValidator;
+import jaxx.runtime.validator.BeanValidatorError;
+import jaxx.runtime.validator.BeanValidatorErrorListModel;
+import junit.framework.TestCase;
+
+import javax.swing.JLabel;
+import java.io.File;
+import java.util.Enumeration;
+
+/** @author chemit */
+public class ValidatorTest extends TestCase {
+
+    ValidatorBean bean;
+
+    static protected Boolean init =3D null;
+
+
+    static protected BeanValidator<ValidatorBean> validator;
+
+    static protected BeanValidatorErrorListModel errors;
+
+    static protected File basedir;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        if (init =3D=3D null) {
+            String b =3D System.getenv("basedir");
+            if (b =3D=3D null) {
+                b =3D new File("").getAbsolutePath();
+            }
+            basedir =3D new File(b);
+            validator =3D new BeanValidator<ValidatorBean>();
+            validator.setErrorListModel(errors =3D new BeanValidatorErrorLis=
tModel());
+            JLabel label =3D new JLabel();
+            validator.setFieldRepresentation("existingFile", label);
+            validator.setFieldRepresentation("existingDirectory", label);
+            validator.setFieldRepresentation("notExistingFile", label);
+            validator.setFieldRepresentation("notExistingDirectory", label);
+            init =3D true;
+        }
+        validator.setBean(bean =3D new ValidatorBean());
+    }
+
+    public void testRequiredFileFieldValidator() throws Exception {
+
+        assertNull(bean.getExistingFile());
+        assertFieldInError("existingFile", "existingFile.required", true);
+
+        bean.setExistingFile(new File(""));
+        assertFieldInError("existingFile", "existingFile.required", true);
+
+        bean.setExistingFile(basedir);
+        assertFieldInError("existingFile", "existingFile.required", false);
+
+        assertFieldInError("existingFile", "existingFile.not.exist", true);
+
+        bean.setExistingFile(new File(basedir, "pom.xml"));
+        assertFieldInError("existingFile", "existingFile.required", false);
+        assertFieldInError("existingFile", "existingFile.not.exist", false);
+
+    }
+
+    public void testExistingFileFieldValidator() throws Exception {
+
+        assertNull(bean.getExistingFile());
+        assertFieldInError("existingFile", "existingFile.required", true);
+
+        bean.setExistingFile(new File(""));
+        assertFieldInError("existingFile", "existingFile.required", true);
+
+        // existing directory
+        bean.setExistingFile(basedir);
+        assertFieldInError("existingFile", "existingFile.required", false);
+        assertFieldInError("existingFile", "existingFile.not.exist", true);
+
+        // existing file
+        bean.setExistingFile(new File(basedir, "pom.xml"));
+        assertFieldInError("existingFile", "existingFile.required", false);
+        assertFieldInError("existingFile", "existingFile.not.exist", false);
+
+    }
+
+    public void testNotExistingFileFieldValidator() throws Exception {
+
+        assertNull(bean.getNotExistingFile());
+        assertFieldInError("notExistingFile", "notExistingFile.required", tr=
ue);
+
+        bean.setNotExistingFile(new File(""));
+        assertFieldInError("notExistingFile", "notExistingFile.required", tr=
ue);
+
+        // existing directory
+        bean.setNotExistingFile(basedir);
+        assertFieldInError("notExistingFile", "notExistingFile.required", fa=
lse);
+        assertFieldInError("notExistingFile", "notExistingFile.exist", true);
+
+        // existing file
+        bean.setNotExistingFile(new File(basedir, "pom.xml"));
+        assertFieldInError("notExistingFile", "notExistingFile.required", fa=
lse);
+        assertFieldInError("notExistingFile", "notExistingFile.exist", true);
+
+        // none existing file
+        bean.setNotExistingFile(new File(basedir, "pom.xml-" + System.curren=
tTimeMillis()));
+        assertFieldInError("notExistingFile", "notEexistingFile.required", f=
alse);
+        assertFieldInError("notExistingFile", "notExistingFile.exist", false=
);
+
+
+    }
+
+    public void testExistingDirectoryFieldValidator() throws Exception {
+
+        assertNull(bean.getExistingDirectory());
+        assertFieldInError("existingDirectory", "existingDirectory.required"=
, true);
+
+        bean.setExistingDirectory(new File(""));
+        assertFieldInError("existingDirectory", "existingDirectory.required"=
, true);
+
+        // existing file
+        bean.setExistingDirectory(new File(basedir, "pom.xml"));
+        assertFieldInError("existingDirectory", "existingDirectory.required"=
, false);
+        assertFieldInError("existingDirectory", "existingDirectory.not.exist=
", true);
+
+        // existing directory
+        bean.setExistingDirectory(basedir);
+        assertFieldInError("existingDirectory", "existingDirectory.required"=
, false);
+        assertFieldInError("existingDirectory", "existingDirectory.not.exist=
", false);
+
+    }
+
+    public void testNotExistingDirectoryFieldValidator() throws Exception {
+        assertNull(bean.getNotExistingDirectory());
+        assertFieldInError("notExistingDirectory", "notExistingDirectory.req=
uired", true);
+
+        bean.setNotExistingDirectory(new File(""));
+        assertFieldInError("notExistingDirectory", "notExistingDirectory.req=
uired", true);
+
+        // existing directory
+        bean.setNotExistingDirectory(basedir);
+        assertFieldInError("notExistingDirectory", "notExistingDirectory.req=
uired", false);
+        assertFieldInError("notExistingDirectory", "notExistingDirectory.exi=
st", true);
+
+        // existing file
+        bean.setNotExistingDirectory(new File(basedir, "pom.xml"));
+        assertFieldInError("notExistingDirectory", "notExistingDirectory.req=
uired", false);
+        assertFieldInError("notExistingDirectory", "notExistingDirectory.exi=
st", true);
+
+        // none existing directory
+        bean.setNotExistingDirectory(new File(basedir, "pom.xml-" + System.c=
urrentTimeMillis()));
+        assertFieldInError("notExistingDirectory", "notEexistingFile.require=
d", false);
+        assertFieldInError("notExistingDirectory", "notExistingDirectory.exi=
st", false);
+    }
+
+    protected void assertFieldInError(String s, String error, boolean requir=
ed) {
+        Enumeration<?> myErrors =3D errors.elements();
+        while (myErrors.hasMoreElements()) {
+            BeanValidatorError o =3D (BeanValidatorError) myErrors.nextEleme=
nt();
+            if (o.getFieldName().equals(s) && o.getError().equals(error)) {
+                assertTrue(required);
+                return;
+            }
+        }
+        // error was not found
+        assertFalse(required);
+    }
+}

Copied: lutinjaxx/tags/0.5/jaxx-core/src/test/resources/jaxx (from rev 981, l=
utinjaxx/trunk/jaxx-core/src/test/resources/jaxx)

Deleted: lutinjaxx/tags/0.5/jaxx-core/src/test/resources/log4j.properties
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-core/src/test/resources/log4j.properties	2008-10-17 =
16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-core/src/test/resources/log4j.properties	2008-10-=
21 07:31:05 UTC (rev 990)
@@ -1,9 +0,0 @@
-# Global logging configuration
-log4j.rootLogger=3DINFO, stdout
-# Console output...
-log4j.appender.stdout=3Dorg.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=3Dorg.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=3D%5p [%t] (%F:%L) %M - %m%n
-
-#log4j.logger.org.codelutin.jaxx=3DDEBUG
-#log4j.logger.jaxx=3DDEBUG

Copied: lutinjaxx/tags/0.5/jaxx-core/src/test/resources/log4j.properties (fro=
m rev 981, lutinjaxx/trunk/jaxx-core/src/test/resources/log4j.properties)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-core/src/test/resources/log4j.properties	        =
                (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-core/src/test/resources/log4j.properties	2008-10-=
21 07:31:05 UTC (rev 990)
@@ -0,0 +1,9 @@
+# Global logging configuration
+log4j.rootLogger=3DERROR, stdout
+# Console output...
+log4j.appender.stdout=3Dorg.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=3Dorg.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=3D%5p [%t] (%F:%L) %M - %m%n
+
+#log4j.logger.org.codelutin.jaxx=3DDEBUG
+#log4j.logger.jaxx=3DDEBUG

Deleted: lutinjaxx/tags/0.5/jaxx-example/Calculator/pom.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-example/Calculator/pom.xml	2008-10-17 16:44:54 UTC (=
rev 948)
+++ lutinjaxx/tags/0.5/jaxx-example/Calculator/pom.xml	2008-10-21 07:31:05 UT=
C (rev 990)
@@ -1,51 +0,0 @@
-<?xml version=3D"1.0" encoding=3D"UTF-8"?>
-<project xmlns=3D"http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mave=
n.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <!-- ************************************************************* -->
-    <!-- *** POM Relationships *************************************** -->
-    <!-- ************************************************************* -->
-
-    <parent>
-        <groupId>org.codelutin</groupId>
-        <artifactId>jaxx-example</artifactId>
-        <version>0.5-SNAPSHOT</version>
-    </parent>
-
-    <groupId>org.codelutin.jaxx-example</groupId>
-    <artifactId>Calculator</artifactId>
-
-    <!-- ************************************************************* -->
-    <!-- *** Project Information ************************************* -->
-    <!-- ************************************************************* -->
-    <name>Calculator example</name>
-    <description>Jaxx Calculator example</description>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Settings ****************************************** -->
-    <!-- ************************************************************* -->
-
-    <packaging>jar</packaging>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.codehaus.mojo.webstart</groupId>
-                <artifactId>webstart-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Environment  ************************************** -->
-    <!-- ************************************************************* -->
-    <scm>
-        <connection>${scm.connection.example}</connection>
-        <developerConnection>${scm.developerConnection.example}</developerCo=
nnection>
-        <url>${scm.url.example}</url>
-    </scm>
-
-</project>
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-example/Calculator/pom.xml (from rev 989, lut=
injaxx/trunk/jaxx-example/Calculator/pom.xml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-example/Calculator/pom.xml	                      =
  (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-example/Calculator/pom.xml	2008-10-21 07:31:05 UT=
C (rev 990)
@@ -0,0 +1,39 @@
+<project xmlns=3D"http://maven.apache.org/POM/4.0.0" xmlns:xsi=3D"http://www=
.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D"http://maven.apache.or=
g/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- ************************************************************* -->
+    <!-- *** POM Relationships *************************************** -->
+    <!-- ************************************************************* -->
+
+    <parent>
+        <groupId>org.codelutin</groupId>
+        <artifactId>jaxx-example</artifactId>
+        <version>0.5</version>
+    </parent>
+
+    <groupId>org.codelutin.jaxx-example</groupId>
+    <artifactId>Calculator</artifactId>
+
+    <!-- ************************************************************* -->
+    <!-- *** Project Information ************************************* -->
+    <!-- ************************************************************* -->
+    <name>Calculator example</name>
+    <description>Jaxx Calculator example</description>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Settings ****************************************** -->
+    <!-- ************************************************************* -->
+
+    <packaging>jar</packaging>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Environment  ************************************** -->
+    <!-- ************************************************************* -->
+    <scm>
+        <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroo=
t/buix/lutinjaxx/tags/0.5/jaxx-example/Calculator</connection>
+        <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise=
.org/svnroot/buix/lutinjaxx/tags/0.5/jaxx-example/Calculator</developerConnec=
tion>
+        <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/lut=
injaxx/tags/0.5/jaxx-example/Calculator?root=3Dbuix</url>
+    </scm>
+
+</project>
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-example/Components/pom.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-example/Components/pom.xml	2008-10-17 16:44:54 UTC (=
rev 948)
+++ lutinjaxx/tags/0.5/jaxx-example/Components/pom.xml	2008-10-21 07:31:05 UT=
C (rev 990)
@@ -1,43 +0,0 @@
-<?xml version=3D"1.0" encoding=3D"UTF-8"?>
-<project xmlns=3D"http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mave=
n.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <!-- ************************************************************* -->
-    <!-- *** POM Relationships *************************************** -->
-    <!-- ************************************************************* -->
-
-    <parent>
-        <groupId>org.codelutin</groupId>
-        <artifactId>jaxx-example</artifactId>
-        <version>0.5-SNAPSHOT</version>
-    </parent>
-
-    <groupId>org.codelutin.jaxx-example</groupId>
-    <artifactId>Components</artifactId>
-
-    <!-- ************************************************************* -->
-    <!-- *** Project Information ************************************* -->
-    <!-- ************************************************************* -->
-    <name>Components example</name>
-    <version>0.5-SNAPSHOT</version>
-    <inceptionYear>2008</inceptionYear>
-    <description>Jaxx Components example</description>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Settings ****************************************** -->
-    <!-- ************************************************************* -->
-
-    <packaging>jar</packaging>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.codehaus.mojo.webstart</groupId>
-                <artifactId>webstart-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-</project>
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-example/Components/pom.xml (from rev 964, lut=
injaxx/trunk/jaxx-example/Components/pom.xml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-example/Components/pom.xml	                      =
  (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-example/Components/pom.xml	2008-10-21 07:31:05 UT=
C (rev 990)
@@ -0,0 +1,41 @@
+<?xml version=3D"1.0" encoding=3D"UTF-8"?>
+<project xmlns=3D"http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mave=
n.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- ************************************************************* -->
+    <!-- *** POM Relationships *************************************** -->
+    <!-- ************************************************************* -->
+
+    <parent>
+        <groupId>org.codelutin</groupId>
+        <artifactId>jaxx-example</artifactId>
+        <version>0.5-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.codelutin.jaxx-example</groupId>
+    <artifactId>Components</artifactId>
+
+    <!-- ************************************************************* -->
+    <!-- *** Project Information ************************************* -->
+    <!-- ************************************************************* -->
+    <name>Components example</name>
+    <description>Jaxx Components example</description>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Settings ****************************************** -->
+    <!-- ************************************************************* -->
+
+    <packaging>jar</packaging>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Environment  ************************************** -->
+    <!-- ************************************************************* -->
+    <scm>
+        <connection>${scm.connection.example}</connection>
+        <developerConnection>${scm.developerConnection.example}</developerCo=
nnection>
+        <url>${scm.url.example}</url>
+    </scm>
+</project>
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-example/Counter/pom.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-example/Counter/pom.xml	2008-10-17 16:44:54 UTC (rev=
 948)
+++ lutinjaxx/tags/0.5/jaxx-example/Counter/pom.xml	2008-10-21 07:31:05 UTC (=
rev 990)
@@ -1,50 +0,0 @@
-<?xml version=3D"1.0" encoding=3D"UTF-8"?>
-<project xmlns=3D"http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mave=
n.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <!-- ************************************************************* -->
-    <!-- *** POM Relationships *************************************** -->
-    <!-- ************************************************************* -->
-
-    <parent>
-        <groupId>org.codelutin</groupId>
-        <artifactId>jaxx-example</artifactId>
-        <version>0.5-SNAPSHOT</version>
-    </parent>
-
-    <groupId>org.codelutin.jaxx-example</groupId>
-    <artifactId>Counter</artifactId>
-
-    <!-- ************************************************************* -->
-    <!-- *** Project Information ************************************* -->
-    <!-- ************************************************************* -->
-    <name>Counter example</name>
-    <description>Jaxx Counter example</description>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Settings ****************************************** -->
-    <!-- ************************************************************* -->
-
-    <packaging>jar</packaging>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.codehaus.mojo.webstart</groupId>
-                <artifactId>webstart-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Environment  ************************************** -->
-    <!-- ************************************************************* -->
-    <scm>
-        <connection>${scm.connection.example}</connection>
-        <developerConnection>${scm.developerConnection.example}</developerCo=
nnection>
-        <url>${scm.url.example}</url>
-    </scm>
-</project>
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-example/Counter/pom.xml (from rev 989, lutinj=
axx/trunk/jaxx-example/Counter/pom.xml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-example/Counter/pom.xml	                        (=
rev 0)
+++ lutinjaxx/tags/0.5/jaxx-example/Counter/pom.xml	2008-10-21 07:31:05 UTC (=
rev 990)
@@ -0,0 +1,38 @@
+<project xmlns=3D"http://maven.apache.org/POM/4.0.0" xmlns:xsi=3D"http://www=
.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D"http://maven.apache.or=
g/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- ************************************************************* -->
+    <!-- *** POM Relationships *************************************** -->
+    <!-- ************************************************************* -->
+
+    <parent>
+        <groupId>org.codelutin</groupId>
+        <artifactId>jaxx-example</artifactId>
+        <version>0.5</version>
+    </parent>
+
+    <groupId>org.codelutin.jaxx-example</groupId>
+    <artifactId>Counter</artifactId>
+
+    <!-- ************************************************************* -->
+    <!-- *** Project Information ************************************* -->
+    <!-- ************************************************************* -->
+    <name>Counter example</name>
+    <description>Jaxx Counter example</description>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Settings ****************************************** -->
+    <!-- ************************************************************* -->
+
+    <packaging>jar</packaging>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Environment  ************************************** -->
+    <!-- ************************************************************* -->
+    <scm>
+        <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroo=
t/buix/lutinjaxx/tags/0.5/jaxx-example/Counter</connection>
+        <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise=
.org/svnroot/buix/lutinjaxx/tags/0.5/jaxx-example/Counter</developerConnectio=
n>
+        <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/lut=
injaxx/tags/0.5/jaxx-example/Counter?root=3Dbuix</url>
+    </scm>
+</project>
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-example/LabelStyle/pom.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-example/LabelStyle/pom.xml	2008-10-17 16:44:54 UTC (=
rev 948)
+++ lutinjaxx/tags/0.5/jaxx-example/LabelStyle/pom.xml	2008-10-21 07:31:05 UT=
C (rev 990)
@@ -1,50 +0,0 @@
-<?xml version=3D"1.0" encoding=3D"UTF-8"?>
-<project xmlns=3D"http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mave=
n.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <!-- ************************************************************* -->
-    <!-- *** POM Relationships *************************************** -->
-    <!-- ************************************************************* -->
-
-    <parent>
-        <groupId>org.codelutin</groupId>
-        <artifactId>jaxx-example</artifactId>
-        <version>0.5-SNAPSHOT</version>
-    </parent>
-
-    <groupId>org.codelutin.jaxx-example</groupId>
-    <artifactId>LabelStyle</artifactId>
-
-    <!-- ************************************************************* -->
-    <!-- *** Project Information ************************************* -->
-    <!-- ************************************************************* -->
-    <name>LabelStyle example</name>
-    <description>Jaxx LabelStyle example</description>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Settings ****************************************** -->
-    <!-- ************************************************************* -->
-
-    <packaging>jar</packaging>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.codehaus.mojo.webstart</groupId>
-                <artifactId>webstart-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Environment  ************************************** -->
-    <!-- ************************************************************* -->
-    <scm>
-        <connection>${scm.connection.example}</connection>
-        <developerConnection>${scm.developerConnection.example}</developerCo=
nnection>
-        <url>${scm.url.example}</url>
-    </scm>
-</project>
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-example/LabelStyle/pom.xml (from rev 989, lut=
injaxx/trunk/jaxx-example/LabelStyle/pom.xml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-example/LabelStyle/pom.xml	                      =
  (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-example/LabelStyle/pom.xml	2008-10-21 07:31:05 UT=
C (rev 990)
@@ -0,0 +1,38 @@
+<project xmlns=3D"http://maven.apache.org/POM/4.0.0" xmlns:xsi=3D"http://www=
.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D"http://maven.apache.or=
g/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- ************************************************************* -->
+    <!-- *** POM Relationships *************************************** -->
+    <!-- ************************************************************* -->
+
+    <parent>
+        <groupId>org.codelutin</groupId>
+        <artifactId>jaxx-example</artifactId>
+        <version>0.5</version>
+    </parent>
+
+    <groupId>org.codelutin.jaxx-example</groupId>
+    <artifactId>LabelStyle</artifactId>
+
+    <!-- ************************************************************* -->
+    <!-- *** Project Information ************************************* -->
+    <!-- ************************************************************* -->
+    <name>LabelStyle example</name>
+    <description>Jaxx LabelStyle example</description>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Settings ****************************************** -->
+    <!-- ************************************************************* -->
+
+    <packaging>jar</packaging>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Environment  ************************************** -->
+    <!-- ************************************************************* -->
+    <scm>
+        <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroo=
t/buix/lutinjaxx/tags/0.5/jaxx-example/LabelStyle</connection>
+        <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise=
.org/svnroot/buix/lutinjaxx/tags/0.5/jaxx-example/LabelStyle</developerConnec=
tion>
+        <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/lut=
injaxx/tags/0.5/jaxx-example/LabelStyle?root=3Dbuix</url>
+    </scm>
+</project>
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-example/Validation/pom.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-example/Validation/pom.xml	2008-10-17 16:44:54 UTC (=
rev 948)
+++ lutinjaxx/tags/0.5/jaxx-example/Validation/pom.xml	2008-10-21 07:31:05 UT=
C (rev 990)
@@ -1,50 +0,0 @@
-<?xml version=3D"1.0" encoding=3D"UTF-8"?>
-<project xmlns=3D"http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mave=
n.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <!-- ************************************************************* -->
-    <!-- *** POM Relationships *************************************** -->
-    <!-- ************************************************************* -->
-
-    <parent>
-        <groupId>org.codelutin</groupId>
-        <artifactId>jaxx-example</artifactId>
-        <version>0.5-SNAPSHOT</version>
-    </parent>
-
-    <groupId>org.codelutin.jaxx-example</groupId>
-    <artifactId>Validation</artifactId>
-
-    <!-- ************************************************************* -->
-    <!-- *** Project Information ************************************* -->
-    <!-- ************************************************************* -->
-    <name>Validation example</name>
-    <description>Jaxx Validation (with xwork validation) example</descriptio=
n>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Settings ****************************************** -->
-    <!-- ************************************************************* -->
-
-    <packaging>jar</packaging>
-
-    <build>
-        <plugins>
-             <plugin>
-                <groupId>org.codehaus.mojo.webstart</groupId>
-                <artifactId>webstart-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Environment  ************************************** -->
-    <!-- ************************************************************* -->
-    <scm>
-        <connection>${scm.connection.example}</connection>
-        <developerConnection>${scm.developerConnection.example}</developerCo=
nnection>
-        <url>${scm.url.example}</url>
-    </scm>
-</project>
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-example/Validation/pom.xml (from rev 989, lut=
injaxx/trunk/jaxx-example/Validation/pom.xml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-example/Validation/pom.xml	                      =
  (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-example/Validation/pom.xml	2008-10-21 07:31:05 UT=
C (rev 990)
@@ -0,0 +1,38 @@
+<project xmlns=3D"http://maven.apache.org/POM/4.0.0" xmlns:xsi=3D"http://www=
.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D"http://maven.apache.or=
g/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- ************************************************************* -->
+    <!-- *** POM Relationships *************************************** -->
+    <!-- ************************************************************* -->
+
+    <parent>
+        <groupId>org.codelutin</groupId>
+        <artifactId>jaxx-example</artifactId>
+        <version>0.5</version>
+    </parent>
+
+    <groupId>org.codelutin.jaxx-example</groupId>
+    <artifactId>Validation</artifactId>
+
+    <!-- ************************************************************* -->
+    <!-- *** Project Information ************************************* -->
+    <!-- ************************************************************* -->
+    <name>Validation example</name>
+    <description>Jaxx Validation (with xwork validation) example</descriptio=
n>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Settings ****************************************** -->
+    <!-- ************************************************************* -->
+
+    <packaging>jar</packaging>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Environment  ************************************** -->
+    <!-- ************************************************************* -->
+    <scm>
+        <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroo=
t/buix/lutinjaxx/tags/0.5/jaxx-example/Validation</connection>
+        <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise=
.org/svnroot/buix/lutinjaxx/tags/0.5/jaxx-example/Validation</developerConnec=
tion>
+        <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/lut=
injaxx/tags/0.5/jaxx-example/Validation?root=3Dbuix</url>
+    </scm>
+</project>
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Va=
lidation/Identity.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-example/Validation/src/main/java/examples/Validation=
/Identity.java	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Validat=
ion/Identity.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,79 +0,0 @@
-package examples.Validation;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-
-public class Identity {
-
-    protected String firstName =3D "";
-
-    protected String lastName =3D "";
-
-    protected String email =3D "dummy@codelutin.com";
-
-    protected int age =3D 51;
-
-
-    PropertyChangeSupport p;
-
-    public Identity() {
-        p =3D new PropertyChangeSupport(this);
-    }
-
-    public void addPropertyChangeListener(PropertyChangeListener listener) {
-        p.addPropertyChangeListener(listener);
-    }
-
-    public void addPropertyChangeListener(String propertyName, PropertyChang=
eListener listener) {
-        p.addPropertyChangeListener(propertyName, listener);
-    }
-
-    public void removePropertyChangeListener(PropertyChangeListener listener=
) {
-        p.removePropertyChangeListener(listener);
-    }
-
-    public void removePropertyChangeListener(String propertyName, PropertyCh=
angeListener listener) {
-        p.removePropertyChangeListener(propertyName, listener);
-    }
-
-
-    public String getFirstName() {
-        return firstName;
-    }
-
-    public String getLastName() {
-        return lastName;
-    }
-
-    public String getEmail() {
-        return email;
-    }
-
-    public int getAge() {
-        return age;
-    }
-
-    public void setFirstName(String firstName) {
-        String oldFirstName =3D this.firstName;
-        this.firstName =3D firstName;
-        p.firePropertyChange("firstName", oldFirstName, firstName);
-    }
-
-    public void setLastName(String lastName) {
-        String oldLastName =3D this.lastName;
-        this.lastName =3D lastName;
-        p.firePropertyChange("lastName", oldLastName, lastName);
-    }
-
-    public void setEmail(String email) {
-        String oldEmail =3Dthis.email;
-        this.email =3D email;
-        p.firePropertyChange("email", oldEmail, email);
-    }
-
-    public void setAge(int age) {
-        int oldAge =3D this.age;
-        this.age =3D age;
-        p.firePropertyChange("age", oldAge, age);
-    }
-}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Val=
idation/Identity.java (from rev 979, lutinjaxx/trunk/jaxx-example/Validation/=
src/main/java/examples/Validation/Identity.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Validat=
ion/Identity.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Validat=
ion/Identity.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,103 @@
+package examples.Validation;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.File;
+
+public class Identity {
+
+    protected String firstName =3D "";
+
+    protected String lastName =3D "";
+
+    protected String email =3D "dummy@codelutin.com";
+
+    protected int age =3D 51;
+
+    protected File config =3D new File("/tmp");
+
+    protected File dir =3D new File("/tmp");
+
+    PropertyChangeSupport p;
+
+    public Identity() {
+        p =3D new PropertyChangeSupport(this);
+    }
+
+    public void addPropertyChangeListener(PropertyChangeListener listener) {
+        p.addPropertyChangeListener(listener);
+    }
+
+    public void addPropertyChangeListener(String propertyName, PropertyChang=
eListener listener) {
+        p.addPropertyChangeListener(propertyName, listener);
+    }
+
+    public void removePropertyChangeListener(PropertyChangeListener listener=
) {
+        p.removePropertyChangeListener(listener);
+    }
+
+    public void removePropertyChangeListener(String propertyName, PropertyCh=
angeListener listener) {
+        p.removePropertyChangeListener(propertyName, listener);
+    }
+
+
+    public String getFirstName() {
+        return firstName;
+    }
+
+    public String getLastName() {
+        return lastName;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public int getAge() {
+        return age;
+    }
+
+    public File getConfig() {
+        return config;
+    }
+
+    public File getDir() {
+        return dir;
+    }
+
+    public void setFirstName(String firstName) {
+        String oldFirstName =3D this.firstName;
+        this.firstName =3D firstName;
+        p.firePropertyChange("firstName", oldFirstName, firstName);
+    }
+
+    public void setLastName(String lastName) {
+        String oldLastName =3D this.lastName;
+        this.lastName =3D lastName;
+        p.firePropertyChange("lastName", oldLastName, lastName);
+    }
+
+    public void setEmail(String email) {
+        String oldEmail =3D this.email;
+        this.email =3D email;
+        p.firePropertyChange("email", oldEmail, email);
+    }
+
+    public void setAge(int age) {
+        int oldAge =3D this.age;
+        this.age =3D age;
+        p.firePropertyChange("age", oldAge, age);
+    }
+
+    public void setConfig(File config) {
+        File oldConfig =3D this.config;
+        this.config =3D config;
+        p.firePropertyChange("config", oldConfig, config);
+    }
+
+    public void setDir(File dir) {
+        File oldDir =3D this.dir;
+        this.dir =3D dir;
+        p.firePropertyChange("dir", oldDir, dir);
+    }
+}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Va=
lidation/Validation.css
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-example/Validation/src/main/java/examples/Validation=
/Validation.css	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Validat=
ion/Validation.css	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,8 +0,0 @@
-JSlider {
-    paintTicks: true;
-}
-
-JSlider#ratio {
-    minorTickSpacing: 5;
-    majorTickSpacing: 10;
-}

Copied: lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Val=
idation/Validation.css (from rev 956, lutinjaxx/trunk/jaxx-example/Validation=
/src/main/java/examples/Validation/Validation.css)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Validat=
ion/Validation.css	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Validat=
ion/Validation.css	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,5 @@
+JSlider {
+    paintTicks: true;
+    minorTickSpacing: 5;
+    majorTickSpacing: 10;
+}

Deleted: lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Va=
lidation/Validation.jaxx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-example/Validation/src/main/java/examples/Validation=
/Validation.jaxx	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Validat=
ion/Validation.jaxx	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,292 +0,0 @@
-<Application title=3D"Validation.jaxx">
-    <style source=3D"Validation.css"/>
-
-    <!-- models -->
-    <Model id=3D'model'/>
-    <Model id=3D'model2'/>
-    <Identity id=3D'identity'/>
-
-    <!-- errors model -->
-    <DefaultListModel id=3D'errors' onIntervalAdded=3D'ok.setEnabled(errors.=
size()=3D=3D0)' onIntervalRemoved=3D'ok.setEnabled(errors.size()=3D=3D0)'/>
-
-    <!-- validators -->
-    <BeanValidator id=3D'validator' bean=3D'model' errorListModel=3D'errors'>
-        <field name=3D"text"/>
-        <field name=3D"text2"/>
-        <field name=3D"ratio"/>
-    </BeanValidator>
-    <BeanValidator id=3D'validator2' bean=3D'model2' errorListModel=3D'error=
s'>
-        <field name=3D"text" component=3D"_text"/>
-        <field name=3D"text2" component=3D"_text2"/>
-        <field name=3D"ratio" component=3D"_ratio"/>
-    </BeanValidator>
-    <BeanValidator id=3D'validator3' autoField=3D'true' bean=3D'identity' er=
rorListModel=3D'errors'>
-        <field name=3D"email" component=3D"email2"/>
-        <field name=3D"email" component=3D"email2"/>
-    </BeanValidator>
-
-    <Table fill=3D'both'>
-        <row>
-            <cell weightx=3D'1' weighty=3D'1' insets=3D'6, 3, 0, 0'>
-                <JPanel border=3D'{BorderFactory.createTitledBorder("Form")}'
-                        layout=3D'{new GridLayout()}' width=3D'250' height=
=3D'120'>
-                    <Table anchor=3D'west' fill=3D'both'>
-                        <row>
-                            <cell>
-                                <JLabel text=3D'Text:'/>
-                            </cell>
-                            <cell weightx=3D'1'>
-                                <org.jdesktop.jxlayer.JXLayer>
-                                    <JTextField id=3D'text' text=3D'{model.g=
etText()}'
-                                                onKeyReleased=3D'model.setTe=
xt(text.getText())'/>
-                                </org.jdesktop.jxlayer.JXLayer>
-                            </cell>
-                        </row>
-                        <row>
-                            <cell>
-                                <JLabel text=3D'Text2:'/>
-                            </cell>
-                            <cell weightx=3D'1'>
-                                <org.jdesktop.jxlayer.JXLayer>
-                                    <JTextField id=3D'text2' text=3D'{model.=
getText2()}'
-                                                onKeyReleased=3D'model.setTe=
xt2(text2.getText())'/>
-                                </org.jdesktop.jxlayer.JXLayer>
-                            </cell>
-                        </row>
-
-                        <row>
-                            <cell>
-                                <JLabel text=3D'Ratio:'/>
-                            </cell>
-                            <cell>
-                                <org.jdesktop.jxlayer.JXLayer>
-                                    <JSlider id=3D'ratio' minimum=3D'0' maxi=
mum=3D'100' value=3D'{model.getRatio()}'
-                                             onStateChanged=3D'model.setRati=
o(ratio.getValue())'/>
-                                </org.jdesktop.jxlayer.JXLayer>
-                            </cell>
-                        </row>
-                    </Table>
-                </JPanel>
-            </cell>
-            <cell weightx=3D'1' weighty=3D'1' insets=3D'6, 3, 0, 0'>
-                <JPanel border=3D'{BorderFactory.createTitledBorder("Model")=
}'
-                        layout=3D'{new GridLayout()}' width=3D'250'  height=
=3D'120'>
-                     <Table anchor=3D'west' fill=3D'both'>
-                        <row>
-                            <cell>
-                                <JLabel text=3D'Text:'/>
-                            </cell>
-                            <cell weightx=3D'1'>
-                                <JLabel text=3D'{model.getText()}'/>
-                            </cell>
-                        </row>
-                        <row>
-                            <cell>
-                                <JLabel text=3D'Text2:'/>
-                            </cell>
-                            <cell weightx=3D'1'>
-                                <JLabel text=3D'{model.getText2()}'/>
-                            </cell>
-                        </row>
-
-                        <row>
-                            <cell>
-                                <JLabel text=3D'Ratio:'/>
-                            </cell>
-                            <cell>
-                                <JLabel text=3D'{model.getRatio()}'/>
-                            </cell>
-                        </row>
-                    </Table>                   =20
-                </JPanel>
-            </cell>
-        </row>
-        <row>
-            <cell weightx=3D'1' weighty=3D'1' insets=3D'6, 3, 0, 0'>
-                <JPanel border=3D'{BorderFactory.createTitledBorder("Form2")=
}'
-                        layout=3D'{new GridLayout()}' width=3D'250' height=
=3D'120'>
-                    <Table anchor=3D'west' fill=3D'both'>
-                        <row>
-                            <cell>
-                                <JLabel text=3D'Text:'/>
-                            </cell>
-                            <cell weightx=3D'1'>
-                                <org.jdesktop.jxlayer.JXLayer>
-                                    <JTextField id=3D'_text' text=3D'{model2=
.getText()}'
-                                                onKeyReleased=3D'model2.setT=
ext(_text.getText())'/>
-                                </org.jdesktop.jxlayer.JXLayer>
-                            </cell>
-                        </row>
-                        <row>
-                            <cell>
-                                <JLabel text=3D'Text2:'/>
-                            </cell>
-                            <cell weightx=3D'1'>
-                                <org.jdesktop.jxlayer.JXLayer>
-                                    <JTextField id=3D'_text2' text=3D'{model=
2.getText2()}'
-                                                onKeyReleased=3D'model2.setT=
ext2(_text2.getText())'/>
-                                </org.jdesktop.jxlayer.JXLayer>
-                            </cell>
-                        </row>
-
-                        <row>
-                            <cell>
-                                <JLabel text=3D'Ratio:'/>
-                            </cell>
-                            <cell>
-                                <org.jdesktop.jxlayer.JXLayer>
-                                    <JSlider id=3D'_ratio' minimum=3D'0' max=
imum=3D'100' value=3D'{model2.getRatio()}'
-                                             onStateChanged=3D'model2.setRat=
io(_ratio.getValue())'/>
-                                </org.jdesktop.jxlayer.JXLayer>
-                            </cell>
-                        </row>
-                    </Table>
-                </JPanel>
-            </cell>
-            <cell weightx=3D'1' weighty=3D'1' insets=3D'6, 3, 0, 0'>
-                <JPanel border=3D'{BorderFactory.createTitledBorder("Model2"=
)}'
-                        layout=3D'{new GridLayout()}' width=3D'250'  height=
=3D'120'>
-                     <Table anchor=3D'west' fill=3D'both'>
-                        <row>
-                            <cell>
-                                <JLabel text=3D'Text:'/>
-                            </cell>
-                            <cell weightx=3D'1'>
-                                <JLabel text=3D'{model2.getText()}'/>
-                            </cell>
-                        </row>
-                        <row>
-                            <cell>
-                                <JLabel text=3D'Text2:'/>
-                            </cell>
-                            <cell weightx=3D'1'>
-                                <JLabel text=3D'{model2.getText2()}'/>
-                            </cell>
-                        </row>
-
-                        <row>
-                            <cell>
-                                <JLabel text=3D'Ratio:'/>
-                            </cell>
-                            <cell>
-                                <JLabel text=3D'{model2.getRatio()}'/>
-                            </cell>
-                        </row>
-                    </Table>
-                </JPanel>
-            </cell>
-        </row>
-        <row>
-            <cell weightx=3D'1' weighty=3D'1' insets=3D'6, 3, 0, 0'>
-                <JPanel border=3D'{BorderFactory.createTitledBorder("Identif=
y Form")}'
-                        layout=3D'{new GridLayout()}' width=3D'250' height=
=3D'140'>
-                    <Table anchor=3D'west' fill=3D'both'>
-                        <row>
-                            <cell>
-                                <JLabel text=3D'FirstName:'/>
-                            </cell>
-                            <cell weightx=3D'1'>
-                                <org.jdesktop.jxlayer.JXLayer>
-                                    <JTextField id=3D'firstName' text=3D'{id=
entity.getFirstName()}'
-                                                onKeyReleased=3D'identity.se=
tFirstName(firstName.getText())'/>
-                                </org.jdesktop.jxlayer.JXLayer>
-                            </cell>
-                        </row>
-                        <row>
-                            <cell>
-                                <JLabel text=3D'LastName:'/>
-                            </cell>
-                            <cell weightx=3D'1'>
-                                <org.jdesktop.jxlayer.JXLayer>
-                                    <JTextField id=3D'lastName' text=3D'{ide=
ntity.getLastName()}'
-                                                onKeyReleased=3D'identity.se=
tLastName(lastName.getText())'/>
-                                </org.jdesktop.jxlayer.JXLayer>
-                            </cell>
-                        </row>
-                        <row>
-                            <cell>
-                                <JLabel text=3D'Email:'/>
-                            </cell>
-                            <cell weightx=3D'1'>
-                                <org.jdesktop.jxlayer.JXLayer>
-                                    <JTextField id=3D'email2' text=3D'{ident=
ity.getEmail()}'
-                                                onKeyReleased=3D'identity.se=
tEmail(email2.getText())'/>
-                                </org.jdesktop.jxlayer.JXLayer>
-                            </cell>
-                        </row>
-
-                        <row>
-                            <cell>
-                                <JLabel text=3D'Age:'/>
-                            </cell>
-                            <cell>
-                                <org.jdesktop.jxlayer.JXLayer>
-                                    <JSlider id=3D'age' minimum=3D'0' maximu=
m=3D'100' value=3D'{identity.getAge()}'
-                                             onStateChanged=3D'identity.setA=
ge(age.getValue())'/>
-                                </org.jdesktop.jxlayer.JXLayer>
-                            </cell>
-                        </row>
-                    </Table>
-                </JPanel>
-            </cell>
-            <cell weightx=3D'1' weighty=3D'1' insets=3D'6, 3, 0, 0'>
-                <JPanel border=3D'{BorderFactory.createTitledBorder("Identit=
y Model")}'
-                        layout=3D'{new GridLayout()}' width=3D'250'  height=
=3D'120'>
-                     <Table anchor=3D'west' fill=3D'both'>
-                        <row>
-                            <cell>
-                                <JLabel text=3D'FirstName:'/>
-                            </cell>
-                            <cell weightx=3D'1'>
-                                <JLabel text=3D'{identity.getFirstName()}'/>
-                            </cell>
-                        </row>
-                        <row>
-                            <cell>
-                                <JLabel text=3D'LastName:'/>
-                            </cell>
-                            <cell weightx=3D'1'>
-                                <JLabel text=3D'{identity.getLastName()}'/>
-                            </cell>
-                        </row>
-                         <row>
-                             <cell>
-                                <JLabel text=3D'Email:'/>
-                            </cell>
-                            <cell weightx=3D'1'>
-                                <JLabel text=3D'{identity.getEmail()}'/>
-                            </cell>
-                        </row>
-
-                        <row>
-                            <cell>
-                                <JLabel text=3D'Age:'/>
-                            </cell>
-                            <cell>
-                                <JLabel text=3D'{identity.getAge()}'/>
-                            </cell>
-                        </row>
-                    </Table>
-                </JPanel>
-            </cell>
-        </row>
-        <row>
-            <cell columns=3D'2' fill=3D"both">
-                <JPanel border=3D'{BorderFactory.createTitledBorder("Errors"=
)}' layout=3D'{new GridLayout()}' height=3D'200' width=3D'500'>
-                    <JScrollPane>
-                        <JList model=3D'{errors}'/>
-                    </JScrollPane>
-                </JPanel>
-            </cell>
-        </row>
-        <row>
-            <cell columns=3D'2' fill=3D"both">
-                <JPanel layout=3D'{new GridLayout(1,2,0,0)}'>
-                    <JButton text=3D'cancel' onActionPerformed=3D'dispose()'=
/>
-                    <JButton id=3D'ok' text=3D'valid' onActionPerformed=3D'd=
ispose()'/>
-                </JPanel>
-            </cell>
-        </row>
-
-    </Table>
-</Application>

Copied: lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Val=
idation/Validation.jaxx (from rev 979, lutinjaxx/trunk/jaxx-example/Validatio=
n/src/main/java/examples/Validation/Validation.jaxx)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Validat=
ion/Validation.jaxx	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/java/examples/Validat=
ion/Validation.jaxx	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,304 @@
+<Application title=3D"Validation.jaxx">
+    <style source=3D"Validation.css"/>
+
+    <!-- models -->
+    <Model id=3D'model'/>
+    <Model id=3D'model2'/>
+    <Identity id=3D'identity'/>
+
+    <!-- errors model -->
+    <jaxx.runtime.validator.BeanValidatorErrorListModel id=3D'errors' onCont=
entsChanged=3D'ok.setEnabled(errors.size()=3D=3D0)'/>
+
+    <!-- validators -->
+    <BeanValidator id=3D'validator' bean=3D'model' errorListModel=3D'errors'>
+        <field name=3D"text"/>
+        <field name=3D"text2"/>
+        <field name=3D"ratio"/>
+    </BeanValidator>
+    <BeanValidator id=3D'validator2' bean=3D'model2' errorListModel=3D'error=
s' uiClass=3D"jaxx.runtime.validator.ui.IconValidationUI">
+        <field name=3D"text" component=3D"_text"/>
+        <field name=3D"text2" component=3D"_text2"/>
+        <field name=3D"ratio" component=3D"_ratio"/>
+    </BeanValidator>
+    <BeanValidator id=3D'validator3' autoField=3D'true' bean=3D'identity' er=
rorListModel=3D'errors' uiClass=3D"jaxx.runtime.validator.ui.TranslucentValid=
ationUI">
+        <field name=3D"email" component=3D"email2"/>
+    </BeanValidator>
+
+    <Table fill=3D'both'>
+        <row>
+            <cell weightx=3D'1' weighty=3D'1' insets=3D'6, 3, 0, 0'>
+                <JPanel border=3D'{BorderFactory.createTitledBorder("Form")}'
+                        layout=3D'{new GridLayout()}' width=3D'250' height=
=3D'120'>
+                    <Table anchor=3D'west' fill=3D'both'>
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Text:'/>
+                            </cell>
+                            <cell weightx=3D'1'>
+                                    <JTextField id=3D'text' text=3D'{model.g=
etText()}'
+                                                onKeyReleased=3D'model.setTe=
xt(text.getText())'/>
+                            </cell>
+                        </row>
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Text2:'/>
+                            </cell>
+                            <cell weightx=3D'1'>
+                                    <JTextField id=3D'text2' text=3D'{model.=
getText2()}'
+                                                onKeyReleased=3D'model.setTe=
xt2(text2.getText())'/>
+                            </cell>
+                        </row>
+
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Ratio:'/>
+                            </cell>
+                            <cell>
+                                    <JSlider id=3D'ratio' minimum=3D'0' maxi=
mum=3D'100' value=3D'{model.getRatio()}'
+                                             onStateChanged=3D'model.setRati=
o(ratio.getValue())'/>
+                            </cell>
+                        </row>
+                    </Table>
+                </JPanel>
+            </cell>
+            <cell weightx=3D'1' weighty=3D'1' insets=3D'6, 3, 0, 0'>
+                <JPanel border=3D'{BorderFactory.createTitledBorder("Model")=
}'
+                        layout=3D'{new GridLayout()}' width=3D'250'  height=
=3D'120'>
+                     <Table anchor=3D'west' fill=3D'both'>
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Text:'/>
+                            </cell>
+                            <cell weightx=3D'1'>
+                                <JLabel text=3D'{model.getText()}'/>
+                            </cell>
+                        </row>
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Text2:'/>
+                            </cell>
+                            <cell weightx=3D'1'>
+                                <JLabel text=3D'{model.getText2()}'/>
+                            </cell>
+                        </row>
+
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Ratio:'/>
+                            </cell>
+                            <cell>
+                                <JLabel text=3D'{model.getRatio()}'/>
+                            </cell>
+                        </row>
+                    </Table>                   =20
+                </JPanel>
+            </cell>
+        </row>
+        <row>
+            <cell weightx=3D'1' weighty=3D'1' insets=3D'6, 3, 0, 0'>
+                <JPanel border=3D'{BorderFactory.createTitledBorder("Form2")=
}'
+                        layout=3D'{new GridLayout()}' width=3D'250' height=
=3D'120'>
+                    <Table anchor=3D'west' fill=3D'both'>
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Text:'/>
+                            </cell>
+                            <cell weightx=3D'1'>
+                                    <JTextField id=3D'_text' text=3D'{model2=
.getText()}'
+                                                onKeyReleased=3D'model2.setT=
ext(_text.getText())'/>
+                            </cell>
+                        </row>
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Text2:'/>
+                            </cell>
+                            <cell weightx=3D'1'>
+                                    <JTextField id=3D'_text2' text=3D'{model=
2.getText2()}'
+                                                onKeyReleased=3D'model2.setT=
ext2(_text2.getText())'/>
+                            </cell>
+                        </row>
+
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Ratio:'/>
+                            </cell>
+                            <cell>
+                                    <JSlider id=3D'_ratio' minimum=3D'0' max=
imum=3D'100' value=3D'{model2.getRatio()}'
+                                             onStateChanged=3D'model2.setRat=
io(_ratio.getValue())'/>
+                            </cell>
+                        </row>
+                    </Table>
+                </JPanel>
+            </cell>
+            <cell weightx=3D'1' weighty=3D'1' insets=3D'6, 3, 0, 0'>
+                <JPanel border=3D'{BorderFactory.createTitledBorder("Model2"=
)}'
+                        layout=3D'{new GridLayout()}' width=3D'250'  height=
=3D'120'>
+                     <Table anchor=3D'west' fill=3D'both'>
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Text:'/>
+                            </cell>
+                            <cell weightx=3D'1'>
+                                <JLabel text=3D'{model2.getText()}'/>
+                            </cell>
+                        </row>
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Text2:'/>
+                            </cell>
+                            <cell weightx=3D'1'>
+                                <JLabel text=3D'{model2.getText2()}'/>
+                            </cell>
+                        </row>
+
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Ratio:'/>
+                            </cell>
+                            <cell>
+                                <JLabel text=3D'{model2.getRatio()}'/>
+                            </cell>
+                        </row>
+                    </Table>
+                </JPanel>
+            </cell>
+        </row>
+        <row>
+            <cell weightx=3D'1' weighty=3D'1' insets=3D'6, 3, 0, 0'>
+                <JPanel border=3D'{BorderFactory.createTitledBorder("Identif=
y Form")}'
+                        layout=3D'{new GridLayout()}' width=3D'250' height=
=3D'180'>
+                    <Table anchor=3D'west' fill=3D'both'>
+                        <row>
+                            <cell>
+                                <JLabel text=3D'FirstName:'/>
+                            </cell>
+                            <cell weightx=3D'1'>
+                                    <JTextField id=3D'firstName' text=3D'{id=
entity.getFirstName()}'
+                                                onKeyReleased=3D'identity.se=
tFirstName(firstName.getText())'/>
+                            </cell>
+                        </row>
+                        <row>
+                            <cell>
+                                <JLabel text=3D'LastName:'/>
+                            </cell>
+                            <cell weightx=3D'1'>
+                                    <JTextField id=3D'lastName' text=3D'{ide=
ntity.getLastName()}'
+                                                onKeyReleased=3D'identity.se=
tLastName(lastName.getText())'/>
+                            </cell>
+                        </row>
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Email:'/>
+                            </cell>
+                            <cell weightx=3D'1'>
+                                    <JTextField id=3D'email2' text=3D'{ident=
ity.getEmail()}'
+                                                onKeyReleased=3D'identity.se=
tEmail(email2.getText())'/>
+                            </cell>
+                        </row>
+
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Age:'/>
+                            </cell>
+                            <cell>
+                                    <JSlider id=3D'age' minimum=3D'0' maximu=
m=3D'100' value=3D'{identity.getAge()}'
+                                             onStateChanged=3D'identity.setA=
ge(age.getValue())'/>
+                            </cell>
+                        </row>
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Config file :'/>
+                            </cell>
+                            <cell>
+                                    <JTextField id=3D'config' text=3D'{ident=
ity.getConfig()}'
+                                                onKeyReleased=3D'identity.se=
tConfig(new java.io.File(config.getText()))'/>
+                            </cell>
+                        </row>
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Working directory:'/>
+                            </cell>
+                            <cell>
+                                    <JTextField id=3D'dir' text=3D'{identity=
.getDir()}'
+                                                onKeyReleased=3D'identity.se=
tDir(new java.io.File(dir.getText()))'/>
+                            </cell>
+                        </row>
+                    </Table>
+                </JPanel>
+            </cell>
+            <cell weightx=3D'1' weighty=3D'1' insets=3D'6, 3, 0, 0'>
+                <JPanel border=3D'{BorderFactory.createTitledBorder("Identit=
y Model")}'
+                        layout=3D'{new GridLayout()}' width=3D'250'  height=
=3D'120'>
+                     <Table anchor=3D'west' fill=3D'both'>
+                        <row>
+                            <cell>
+                                <JLabel text=3D'FirstName:'/>
+                            </cell>
+                            <cell weightx=3D'1'>
+                                <JLabel text=3D'{identity.getFirstName()}'/>
+                            </cell>
+                        </row>
+                        <row>
+                            <cell>
+                                <JLabel text=3D'LastName:'/>
+                            </cell>
+                            <cell weightx=3D'1'>
+                                <JLabel text=3D'{identity.getLastName()}'/>
+                            </cell>
+                        </row>
+                         <row>
+                             <cell>
+                                <JLabel text=3D'Email:'/>
+                            </cell>
+                            <cell weightx=3D'1'>
+                                <JLabel text=3D'{identity.getEmail()}'/>
+                            </cell>
+                        </row>
+                        <row>
+                            <cell>
+                                <JLabel text=3D'Age:'/>
+                            </cell>
+                            <cell>
+                                <JLabel text=3D'{identity.getAge()}'/>
+                            </cell>
+                        </row>
+                         <row>
+                            <cell>
+                                <JLabel text=3D'Config file:'/>
+                            </cell>
+                            <cell>
+                                <JLabel text=3D'{identity.getConfig()}'/>
+                            </cell>
+                        </row>
+                         <row>
+                            <cell>
+                                <JLabel text=3D'Directory file:'/>
+                            </cell>
+                            <cell>
+                                <JLabel text=3D'{identity.getDir()}'/>
+                            </cell>
+                        </row>
+                    </Table>
+                </JPanel>
+            </cell>
+        </row>
+        <row>
+            <cell columns=3D'2' fill=3D"both">
+                <JPanel border=3D'{BorderFactory.createTitledBorder("Errors"=
)}' layout=3D'{new GridLayout()}' height=3D'200' width=3D'500'>
+                    <JScrollPane>
+                        <JList model=3D'{errors}'/>
+                    </JScrollPane>
+                </JPanel>
+            </cell>
+        </row>
+        <row>
+            <cell columns=3D'2' fill=3D"both">
+                <JPanel layout=3D'{new GridLayout(1,2,0,0)}'>
+                    <JButton text=3D'cancel' onActionPerformed=3D'dispose()'=
/>
+                    <JButton id=3D'ok' text=3D'valid' onActionPerformed=3D'd=
ispose()'/>
+                </JPanel>
+            </cell>
+        </row>
+
+    </Table>
+</Application>

Deleted: lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/resources/exampl=
es/Validation/Identity-validation.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-example/Validation/src/main/resources/examples/Valid=
ation/Identity-validation.xml	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/resources/examples/Va=
lidation/Identity-validation.xml	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,32 +0,0 @@
-<!DOCTYPE validators PUBLIC
-        "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
-        "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
-<validators>
-    <field name=3D"firstName">
-        <field-validator type=3D"requiredstring" short-circuit=3D"true">
-            <message>You must enter a firstName.</message>
-        </field-validator>       =20
-    </field>
-    <field name=3D"lastName">
-        <field-validator type=3D"requiredstring" short-circuit=3D"true">
-            <message>You must enter a lastName.</message>
-        </field-validator>
-    </field>
-
-    <field name=3D"email">
-        <field-validator type=3D"requiredstring" short-circuit=3D"true">
-            <message>You must enter a value for email.</message>
-        </field-validator>
-        <field-validator type=3D"email" short-circuit=3D"true">
-            <message>Not a valid e-mail.</message>
-        </field-validator>
-    </field>
-
-    <field name=3D"age">
-        <field-validator type=3D"int">
-            <param name=3D"min">18</param>
-            <param name=3D"max">88</param>
-            <message>Age needs to be between ${min} and ${max}</message>
-        </field-validator>
-    </field>   =20
-</validators>
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/resources/example=
s/Validation/Identity-validation.xml (from rev 983, lutinjaxx/trunk/jaxx-exam=
ple/Validation/src/main/resources/examples/Validation/Identity-validation.xml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/resources/examples/Va=
lidation/Identity-validation.xml	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-example/Validation/src/main/resources/examples/Va=
lidation/Identity-validation.xml	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,50 @@
+<!DOCTYPE validators PUBLIC
+        "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+        "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+    <field name=3D"firstName">
+        <field-validator type=3D"requiredstring" short-circuit=3D"true">
+            <message>You must enter a firstName.</message>
+        </field-validator>       =20
+    </field>
+    <field name=3D"lastName">
+        <field-validator type=3D"requiredstring" short-circuit=3D"true">
+            <message>You must enter a lastName.</message>
+        </field-validator>
+    </field>
+
+    <field name=3D"email">
+        <field-validator type=3D"requiredstring" short-circuit=3D"true">
+            <message>You must enter a value for email.</message>
+        </field-validator>
+        <field-validator type=3D"email" short-circuit=3D"true">
+            <message>Not a valid e-mail.</message>
+        </field-validator>
+    </field>
+
+    <field name=3D"config">
+        <field-validator type=3D"requiredFile" short-circuit=3D"true">
+            <message>You must enter a value for config.</message>
+        </field-validator>
+        <field-validator type=3D"existingFile" short-circuit=3D"true">
+            <message>The configuration file ${config} does not exist.</messa=
ge>
+        </field-validator>
+    </field>
+
+    <field name=3D"dir">
+        <field-validator type=3D"requiredFile" short-circuit=3D"true">
+            <message>You must enter a value for dir.</message>
+        </field-validator>
+        <field-validator type=3D"existingDirectory" short-circuit=3D"true">
+            <message>The directory ${dir} does not exist.</message>
+        </field-validator>
+    </field>
+
+    <field name=3D"age">
+        <field-validator type=3D"int">
+            <param name=3D"min">18</param>
+            <param name=3D"max">88</param>
+            <message>Age needs to be between ${min} and ${max}</message>
+        </field-validator>
+    </field>   =20
+</validators>
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-example/pom.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-example/pom.xml	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-example/pom.xml	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,268 +0,0 @@
-<?xml version=3D"1.0" encoding=3D"UTF-8"?>
-<project xmlns=3D"http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mave=
n.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <!-- ************************************************************* -->
-    <!-- *** POM Relationships *************************************** -->
-    <!-- ************************************************************* -->
-
-    <parent>
-        <groupId>org.codelutin</groupId>
-        <artifactId>lutinjaxx</artifactId>
-        <version>0.5-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>jaxx-example</artifactId>
-
-    <dependencies>
-
-        <dependency>
-            <groupId>org.codelutin</groupId>
-            <artifactId>jaxx-core</artifactId>
-            <scope>compile</scope>
-        </dependency>
-
-    </dependencies>
-
-    <modules>
-        <module>Calculator</module>
-        <!--module>Components</module-->
-        <module>Counter</module>
-        <module>LabelStyle</module>
-        <module>Validation</module>
-    </modules>
-
-    <!-- ************************************************************* -->
-    <!-- *** Project Information ************************************* -->
-    <!-- ************************************************************* -->
-    <name>jaxx-example</name>
-    <description>Jaxx Example super pom</description>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Settings ****************************************** -->
-    <!-- ************************************************************* -->
-
-    <packaging>pom</packaging>
-
-    <properties>
-
-        <!-- this property must be defined here, since it can be override by=
 a profile -->
-
-        <maven.jar.main.class>examples.${project.artifactId}.${project.artif=
actId}</maven.jar.main.class>
-
-        <!-- jnlp -->
-        <keystorepath>${codelutin.keystorepath}</keystorepath>
-        <keystorealias>CodeLutin</keystorealias>
-        <keystorepass>codelutin</keystorepass>
-
-        <jnlp.build.directory>${project.build.directory}/jnlp</jnlp.build.di=
rectory>
-
-        <!-- scm (for sons) -->
-        <scm.url.example>
-            http://${labs.host}/plugins/scmsvn/viewcvs.php/lutinjaxx/trunk/j=
axx-example/${pom.artifactId}/?root=3D${labs.project}
-        </scm.url.example>
-
-        <scm.developerConnection.example>
-            scm:svn:svn+ssh://${username}@${labs.host}/svnroot/${labs.projec=
t}/lutinjaxx/trunk/jaxx-example/${pom.artifactId}
-        </scm.developerConnection.example>
-
-        <scm.connection.example>
-            scm:svn:svn://anonymous@${labs.host}/svnroot/${labs.project}/lut=
injaxx/trunk/jaxx-example/${pom.artifactId}
-        </scm.connection.example>
-
-    </properties>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Environment  ************************************** -->
-    <!-- ************************************************************* -->
-    <scm>
-        <connection>${scm.connection.son}</connection>
-        <developerConnection>${scm.developerConnection.son}</developerConnec=
tion>
-        <url>${scm.url.son}</url>
-    </scm>
-
-    <build>
-        <pluginManagement>
-            <plugins>
-
-                <plugin>
-
-                    <artifactId>maven-antrun-plugin</artifactId>
-                    <executions>
-                        <!-- Ajout des libs signe par Sun dans un fichier jn=
lp separe -->
-                        <execution>
-                            <id>JnlpSun</id>
-                            <phase>compile</phase>
-                            <configuration>
-                                <tasks>
-                                    <mkdir dir=3D"${jnlp.build.directory}"/>
-                                    <copy file=3D"${project.basedir}/../src/=
main/jnlp/sun.jnlp"
-                                          verbose=3D"${maven.verbose}"
-                                          todir=3D"${jnlp.build.directory}" =
failonerror=3D"false">
-                                        <filterset>
-                                            <filter token=3D"lib" value=3D"j=
avahelp-2.0.02.jar"/>
-                                            <filter token=3D"url" value=3D"$=
{project.url}"/>
-                                        </filterset>
-                                    </copy>
-                                    <copy file=3D"${project.basedir}/../src/=
main/jnlp/jxlayer.jnlp"
-                                          verbose=3D"${maven.verbose}"
-                                          todir=3D"${jnlp.build.directory}" =
failonerror=3D"false">
-                                        <filterset>
-                                            <filter token=3D"lib" value=3D"j=
xlayer-3.0.1.jar"/>
-                                            <filter token=3D"url" value=3D"$=
{project.url}"/>
-                                        </filterset>
-                                    </copy>
-                                    <copy file=3D"${project.build.directory}=
/lib/javahelp-2.0.02.jar"
-                                          verbose=3D"${maven.verbose}"
-                                          todir=3D"${jnlp.build.directory}/l=
ib" failonerror=3D"false"/>
-                                    <copy file=3D"${project.build.directory}=
/lib/jxlayer-3.0.1.jar"
-                                          verbose=3D"${maven.verbose}"
-                                          todir=3D"${jnlp.build.directory}/l=
ib" failonerror=3D"false"/>
-                                </tasks>
-                            </configuration>
-                            <goals>
-                                <goal>run</goal>
-                            </goals>
-                        </execution>
-
-                        <execution>
-                            <id>JnlpToSite</id>
-                            <phase>pre-site</phase>
-                            <configuration>
-                                <tasks>
-                                    <mkdir dir=3D"${maven.site.gen.dir}/reso=
urces"/>
-                                    <copy todir=3D"${maven.site.gen.dir}/res=
ources" verbose=3D"${maven.verbose}"
-                                          failonerror=3D"false" overwrite=3D=
"false">
-                                        <fileset dir=3D"${jnlp.build.directo=
ry}">
-                                            <include name=3D"**"/>
-                                        </fileset>
-                                    </copy>
-                                </tasks>
-                            </configuration>
-                            <goals>
-                                <goal>run</goal>
-                            </goals>
-                        </execution>
-                    </executions>
-                </plugin>
-
-                <plugin>
-                    <groupId>org.codelutin</groupId>
-                    <artifactId>maven-jaxx-plugin</artifactId>
-                    <version>0.5-SNAPSHOT</version>
-                    <configuration>
-                        <src>${basedir}/src/main/java</src>
-                        <force>true</force>
-                    </configuration>
-                    <executions>
-                        <execution>
-                            <goals>
-                                <goal>generate</goal>
-                            </goals>
-                        </execution>
-                    </executions>
-                </plugin>
-
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-dependency-plugin</artifactId>
-                    <configuration>
-                        <outputDirectory>${project.build.directory}/lib</out=
putDirectory>
-                    </configuration>
-                </plugin>
-
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-jar-plugin</artifactId>
-                    <configuration>
-                        <archive>
-                            <manifest>
-                                <addClasspath>true</addClasspath>
-                                <mainClass>${maven.jar.main.class}</mainClas=
s>
-                                <classpathPrefix>lib/</classpathPrefix>
-                            </manifest>
-                        </archive>
-                    </configuration>
-                </plugin>
-
-
-                <plugin>
-                    <groupId>org.codehaus.mojo.webstart</groupId>
-                    <artifactId>webstart-maven-plugin</artifactId>
-                    <version>1.0-alpha-2-cl_20081016</version>
-                    <executions>
-                        <execution>
-                            <phase>package</phase>
-                            <goals>
-                                <goal>jnlp-inline</goal>
-                            </goals>
-                        </execution>
-                    </executions>
-                    <configuration>
-                        <dependencies>
-                            <excludes>
-                                <exclude>javax.help:javahelp</exclude>
-                                <exclude>org.swinglabs:jxlayer</exclude>
-                            </excludes>
-                        </dependencies>
-                        <libPath>lib</libPath>
-                        <extensions>
-                            <sun>sun.jnlp</sun>
-                            <jxlayer>jxlayer.jnlp</jxlayer>
-                        </extensions>
-                        <jnlp>
-                            <outputFile>launch-${project.artifactId}.jnlp</o=
utputFile>
-                            <mainClass>${maven.jar.main.class}</mainClass>
-                            <allPermissions>true</allPermissions>
-                            <offlineAllowed>true</offlineAllowed>
-                        </jnlp>
-
-                        <sign>
-                            <keystore>${keystorepath}</keystore>
-                            <keypass/>
-                            <storepass>${keystorepass}</storepass>
-                            <storetype/>
-                            <alias>${keystorealias}</alias>
-                            <validity/>
-                            <dnameCn/>
-                            <dnameOu/>
-                            <dnameO/>
-                            <dnameL/>
-                            <dnameSt/>
-                            <dnameC/>
-                            <verify>true</verify>
-                            <keystoreConfig>
-                                <delete>false</delete>
-                                <gen>false</gen>
-                            </keystoreConfig>
-                        </sign>
-
-
-                        <pack200>false</pack200>
-                        <gzip>true</gzip>
-                        <verbose>false</verbose>
-                    </configuration>
-                </plugin>
-
-            </plugins>
-           =20
-        </pluginManagement>
-
-        <plugins>
-
-            <plugin>
-                <groupId>org.codelutin</groupId>
-                <artifactId>maven-jaxx-plugin</artifactId>
-            </plugin>
-
-            <plugin>
-                <artifactId>maven-dependency-plugin</artifactId>
-            </plugin>
-
-        </plugins>
-    </build>
-
-</project>
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/jaxx-example/pom.xml (from rev 989, lutinjaxx/trun=
k/jaxx-example/pom.xml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-example/pom.xml	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-example/pom.xml	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,262 @@
+<project xmlns=3D"http://maven.apache.org/POM/4.0.0" xmlns:xsi=3D"http://www=
.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D"http://maven.apache.or=
g/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- ************************************************************* -->
+    <!-- *** POM Relationships *************************************** -->
+    <!-- ************************************************************* -->
+
+    <parent>
+        <groupId>org.codelutin</groupId>
+        <artifactId>lutinjaxx</artifactId>
+        <version>0.5</version>
+    </parent>
+
+    <artifactId>jaxx-example</artifactId>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.codelutin</groupId>
+            <artifactId>jaxx-core</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+    </dependencies>
+
+    <modules>
+        <module>Calculator</module>
+        <!--module>Components</module-->
+        <module>Counter</module>
+        <module>LabelStyle</module>
+        <module>Validation</module>
+    </modules>
+
+    <!-- ************************************************************* -->
+    <!-- *** Project Information ************************************* -->
+    <!-- ************************************************************* -->
+    <name>jaxx-example</name>
+    <description>Jaxx Example super pom</description>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Settings ****************************************** -->
+    <!-- ************************************************************* -->
+
+    <packaging>pom</packaging>
+
+    <properties>
+
+        <!-- this property must be defined here, since it can be override by=
 a profile -->
+
+        <maven.jar.main.class>examples.${project.artifactId}.${project.artif=
actId}</maven.jar.main.class>
+
+        <!-- jnlp -->
+        <keystorepath>${codelutin.keystorepath}</keystorepath>
+        <keystorealias>CodeLutin</keystorealias>
+        <keystorepass>codelutin</keystorepass>
+
+        <jnlp.build.directory>${project.build.directory}/jnlp</jnlp.build.di=
rectory>
+
+        <!-- scm (for sons) -->
+        <scm.url.example>
+            http://${labs.host}/plugins/scmsvn/viewcvs.php/lutinjaxx/trunk/j=
axx-example/${pom.artifactId}/?root=3D${labs.project}
+        </scm.url.example>
+
+        <scm.developerConnection.example>
+            scm:svn:svn+ssh://${username}@${labs.host}/svnroot/${labs.projec=
t}/lutinjaxx/trunk/jaxx-example/${pom.artifactId}
+        </scm.developerConnection.example>
+
+        <scm.connection.example>
+            scm:svn:svn://anonymous@${labs.host}/svnroot/${labs.project}/lut=
injaxx/trunk/jaxx-example/${pom.artifactId}
+        </scm.connection.example>
+
+    </properties>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Environment  ************************************** -->
+    <!-- ************************************************************* -->
+    <scm>
+        <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroo=
t/buix/lutinjaxx/tags/0.5/jaxx-example</connection>
+        <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise=
.org/svnroot/buix/lutinjaxx/tags/0.5/jaxx-example</developerConnection>
+        <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/lut=
injaxx/tags/0.5/jaxx-example?root=3Dbuix</url>
+    </scm>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+
+                <plugin>
+
+                    <artifactId>maven-antrun-plugin</artifactId>
+                    <executions>
+                        <!-- Ajout des libs signe par Sun dans un fichier jn=
lp separe -->
+                        <execution>
+                            <id>JnlpSun</id>
+                            <phase>compile</phase>
+                            <configuration>
+                                <tasks>
+                                    <mkdir dir=3D"${jnlp.build.directory}" />
+                                    <copy file=3D"${project.basedir}/../src/=
main/jnlp/sun.jnlp" verbose=3D"${maven.verbose}" todir=3D"${jnlp.build.direct=
ory}" failonerror=3D"false">
+                                        <filterset>
+                                            <filter token=3D"lib" value=3D"j=
avahelp-2.0.02.jar" />
+                                            <filter token=3D"url" value=3D"$=
{project.url}" />
+                                        </filterset>
+                                    </copy>
+                                    <copy file=3D"${project.basedir}/../src/=
main/jnlp/jxlayer.jnlp" verbose=3D"${maven.verbose}" todir=3D"${jnlp.build.di=
rectory}" failonerror=3D"false">
+                                        <filterset>
+                                            <filter token=3D"lib" value=3D"j=
xlayer-3.0.1.jar" />
+                                            <filter token=3D"url" value=3D"$=
{project.url}" />
+                                        </filterset>
+                                    </copy>
+                                    <copy file=3D"${project.build.directory}=
/lib/javahelp-2.0.02.jar" verbose=3D"${maven.verbose}" todir=3D"${jnlp.build.=
directory}/lib" failonerror=3D"false" />
+                                    <copy file=3D"${project.build.directory}=
/lib/jxlayer-3.0.1.jar" verbose=3D"${maven.verbose}" todir=3D"${jnlp.build.di=
rectory}/lib" failonerror=3D"false" />
+                                </tasks>
+                            </configuration>
+                            <goals>
+                                <goal>run</goal>
+                            </goals>
+                        </execution>
+
+                        <execution>
+                            <id>JnlpToSite</id>
+                            <phase>pre-site</phase>
+                            <configuration>
+                                <tasks>
+                                    <mkdir dir=3D"${maven.site.gen.dir}/reso=
urces" />
+                                    <copy todir=3D"${maven.site.gen.dir}/res=
ources" verbose=3D"${maven.verbose}" failonerror=3D"false" overwrite=3D"false=
">
+                                        <fileset dir=3D"${jnlp.build.directo=
ry}">
+                                            <include name=3D"**" />
+                                        </fileset>
+                                    </copy>
+                                </tasks>
+                            </configuration>
+                            <goals>
+                                <goal>run</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
+
+                <plugin>
+                    <groupId>org.codelutin</groupId>
+                    <artifactId>maven-jaxx-plugin</artifactId>
+                    <version>0.5</version>
+                    <configuration>
+                        <src>${basedir}/src/main/java</src>
+                        <force>true</force>
+                    </configuration>
+                    <executions>
+                        <execution>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
+
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-dependency-plugin</artifactId>
+                    <configuration>
+                        <outputDirectory>${project.build.directory}/lib</out=
putDirectory>
+                    </configuration>
+                </plugin>
+
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-jar-plugin</artifactId>
+                    <configuration>
+                        <archive>
+                            <manifest>
+                                <addClasspath>true</addClasspath>
+                                <mainClass>${maven.jar.main.class}</mainClas=
s>
+                                <classpathPrefix>lib/</classpathPrefix>
+                            </manifest>
+                        </archive>
+                    </configuration>
+                </plugin>
+
+
+                <plugin>
+                    <groupId>org.codehaus.mojo.webstart</groupId>
+                    <artifactId>webstart-maven-plugin</artifactId>
+                    <version>1.0-alpha-2-cl_20081018</version>
+                    <executions>
+                        <execution>
+                            <phase>package</phase>
+                            <goals>
+                                <goal>jnlp-inline</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <force>false</force>
+                        <dependencies>
+                            <excludes>
+                                <exclude>javax.help:javahelp</exclude>
+                                <exclude>org.swinglabs:jxlayer</exclude>
+                            </excludes>
+                        </dependencies>
+                        <libPath>lib</libPath>
+                        <extensions>
+                            <sun>sun.jnlp</sun>
+                            <jxlayer>jxlayer.jnlp</jxlayer>
+                        </extensions>
+                        <jnlp>
+                            <outputFile>launch-${project.artifactId}.jnlp</o=
utputFile>
+                            <mainClass>${maven.jar.main.class}</mainClass>
+                            <allPermissions>true</allPermissions>
+                            <offlineAllowed>true</offlineAllowed>
+                        </jnlp>
+
+                        <sign>
+                            <keystore>${keystorepath}</keystore>
+                            <keypass />
+                            <storepass>${keystorepass}</storepass>
+                            <storetype />
+                            <alias>${keystorealias}</alias>
+                            <validity />
+                            <dnameCn />
+                            <dnameOu />
+                            <dnameO />
+                            <dnameL />
+                            <dnameSt />
+                            <dnameC />
+                            <verify>true</verify>
+                            <keystoreConfig>
+                                <delete>false</delete>
+                                <gen>false</gen>
+                            </keystoreConfig>
+                        </sign>
+
+
+                        <pack200>false</pack200>
+                        <gzip>true</gzip>
+                        <verbose>false</verbose>
+                    </configuration>
+                </plugin>
+
+            </plugins>
+           =20
+        </pluginManagement>
+
+        <plugins>
+
+            <plugin>
+                <groupId>org.codelutin</groupId>
+                <artifactId>maven-jaxx-plugin</artifactId>
+            </plugin>
+
+            <plugin>
+                <artifactId>maven-dependency-plugin</artifactId>
+            </plugin>
+
+             <plugin>
+                <groupId>org.codehaus.mojo.webstart</groupId>
+                <artifactId>webstart-maven-plugin</artifactId>
+            </plugin>
+
+        </plugins>
+    </build>
+
+</project>
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/jaxx-swing-action/pom.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-swing-action/pom.xml	2008-10-17 16:44:54 UTC (rev 94=
8)
+++ lutinjaxx/tags/0.5/jaxx-swing-action/pom.xml	2008-10-21 07:31:05 UTC (rev=
 990)
@@ -1,75 +0,0 @@
-<?xml version=3D"1.0" encoding=3D"UTF-8"?>
-<project xmlns=3D"http://maven.apache.org/POM/4.0.0" xmlns:xsi=3D"http://www=
.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mave=
n.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-
-    <!-- ************************************************************* -->
-    <!-- *** POM Relationships *************************************** -->
-    <!-- ************************************************************* -->
-
-    <parent>
-        <groupId>org.codelutin</groupId>
-        <artifactId>lutinjaxx</artifactId>
-        <version>0.5-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>jaxx-swing-action</artifactId>
-
-    <dependencies>
-
-        <dependency>
-            <groupId>org.codelutin</groupId>
-            <artifactId>jaxx-core</artifactId>
-            <scope>compile</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>jboss</groupId>
-            <artifactId>javassist</artifactId>
-            <version>3.7.ga</version>
-            <scope>compile</scope>
-        </dependency>
-
-    </dependencies>
-
-    <!-- ************************************************************* -->
-    <!-- *** Project Information ************************************* -->
-    <!-- ************************************************************* -->
-    <name>jaxx-swing-action</name>
-    <description>Jaxx lutin library swing extension (tabs and actions)</desc=
ription>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Settings ****************************************** -->
-    <!-- ************************************************************* -->
-    <packaging>jar</packaging>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <compilerArgument>-proc:none</compilerArgument>
-                </configuration>
-            </plugin>
-
-            <plugin>
-                <groupId>org.codelutin</groupId>
-                <artifactId>maven-i18n-plugin</artifactId>
-            </plugin>
-
-        </plugins>
-    </build>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Environment  ************************************** -->
-    <!-- ************************************************************* -->
-    <scm>
-        <connection>${scm.connection.son}</connection>
-        <developerConnection>${scm.developerConnection.son}</developerConnec=
tion>
-        <url>${scm.url.son}</url>
-    </scm>
-
-</project>

Copied: lutinjaxx/tags/0.5/jaxx-swing-action/pom.xml (from rev 989, lutinjaxx=
/trunk/jaxx-swing-action/pom.xml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-swing-action/pom.xml	                        (rev=
 0)
+++ lutinjaxx/tags/0.5/jaxx-swing-action/pom.xml	2008-10-21 07:31:05 UTC (rev=
 990)
@@ -0,0 +1,74 @@
+<?xml version=3D"1.0" encoding=3D"UTF-8"?>
+<project xmlns=3D"http://maven.apache.org/POM/4.0.0" xmlns:xsi=3D"http://www=
.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D"http://maven.apache.or=
g/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+
+    <!-- ************************************************************* -->
+    <!-- *** POM Relationships *************************************** -->
+    <!-- ************************************************************* -->
+
+    <parent>
+        <groupId>org.codelutin</groupId>
+        <artifactId>lutinjaxx</artifactId>
+        <version>0.5</version>
+    </parent>
+
+    <artifactId>jaxx-swing-action</artifactId>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.codelutin</groupId>
+            <artifactId>jaxx-core</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>jboss</groupId>
+            <artifactId>javassist</artifactId>
+            <version>3.7.ga</version>
+            <scope>compile</scope>
+        </dependency>
+
+    </dependencies>
+
+    <!-- ************************************************************* -->
+    <!-- *** Project Information ************************************* -->
+    <!-- ************************************************************* -->
+    <name>jaxx-swing-action</name>
+    <description>Jaxx lutin library swing extension (tabs and actions)</desc=
ription>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Settings ****************************************** -->
+    <!-- ************************************************************* -->
+    <packaging>jar</packaging>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <compilerArgument>-proc:none</compilerArgument>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.codelutin</groupId>
+                <artifactId>maven-i18n-plugin</artifactId>
+            </plugin>
+
+        </plugins>
+    </build>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Environment  ************************************** -->
+    <!-- ************************************************************* -->
+    <scm>
+        <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroo=
t/buix/lutinjaxx/tags/0.5/jaxx-swing-action</connection>
+        <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise=
.org/svnroot/buix/lutinjaxx/tags/0.5/jaxx-swing-action</developerConnection>
+        <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/lut=
injaxx/tags/0.5/jaxx-swing-action?root=3Dbuix</url>
+    </scm>
+
+</project>

Deleted: lutinjaxx/tags/0.5/jaxx-util/pom.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/jaxx-util/pom.xml	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/jaxx-util/pom.xml	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,46 +0,0 @@
-<?xml version=3D"1.0" encoding=3D"UTF-8"?>
-<project xmlns=3D"http://maven.apache.org/POM/4.0.0" xmlns:xsi=3D"http://www=
.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mave=
n.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <!-- ************************************************************* -->
-    <!-- *** POM Relationships *************************************** -->
-    <!-- ************************************************************* -->
-    <parent>
-        <groupId>org.codelutin</groupId>
-        <artifactId>lutinjaxx</artifactId>
-        <version>0.5-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>jaxx-util</artifactId>
-
-    <!-- ************************************************************* -->
-    <!-- *** Project Information ************************************* -->
-    <!-- ************************************************************* -->
-    <name>jaxx-util</name>
-    <description>Jaxx lutin library utility</description>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Settings ****************************************** -->
-    <!-- ************************************************************* -->
-    <packaging>jar</packaging>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.codelutin.plugin</groupId>
-                <artifactId>maven-i18n-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Environment  ************************************** -->
-    <!-- ************************************************************* -->
-    <scm>
-        <connection>${scm.connection.son}</connection>
-        <developerConnection>${scm.developerConnection.son}</developerConnec=
tion>
-        <url>${scm.url.son}</url>
-    </scm>
-</project>

Copied: lutinjaxx/tags/0.5/jaxx-util/pom.xml (from rev 989, lutinjaxx/trunk/j=
axx-util/pom.xml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/jaxx-util/pom.xml	                        (rev 0)
+++ lutinjaxx/tags/0.5/jaxx-util/pom.xml	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,45 @@
+<?xml version=3D"1.0" encoding=3D"UTF-8"?>
+<project xmlns=3D"http://maven.apache.org/POM/4.0.0" xmlns:xsi=3D"http://www=
.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D"http://maven.apache.or=
g/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- ************************************************************* -->
+    <!-- *** POM Relationships *************************************** -->
+    <!-- ************************************************************* -->
+    <parent>
+        <groupId>org.codelutin</groupId>
+        <artifactId>lutinjaxx</artifactId>
+        <version>0.5</version>
+    </parent>
+
+    <artifactId>jaxx-util</artifactId>
+
+    <!-- ************************************************************* -->
+    <!-- *** Project Information ************************************* -->
+    <!-- ************************************************************* -->
+    <name>jaxx-util</name>
+    <description>Jaxx lutin library utility</description>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Settings ****************************************** -->
+    <!-- ************************************************************* -->
+    <packaging>jar</packaging>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codelutin.plugin</groupId>
+                <artifactId>maven-i18n-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Environment  ************************************** -->
+    <!-- ************************************************************* -->
+    <scm>
+        <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroo=
t/buix/lutinjaxx/tags/0.5/jaxx-util</connection>
+        <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise=
.org/svnroot/buix/lutinjaxx/tags/0.5/jaxx-util</developerConnection>
+        <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/lut=
injaxx/tags/0.5/jaxx-util?root=3Dbuix</url>
+    </scm>
+</project>

Deleted: lutinjaxx/tags/0.5/maven-jaxx-plugin/pom.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/maven-jaxx-plugin/pom.xml	2008-10-17 16:44:54 UTC (rev 94=
8)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/pom.xml	2008-10-21 07:31:05 UTC (rev=
 990)
@@ -1,131 +0,0 @@
-<?xml version=3D"1.0" encoding=3D"UTF-8"?>
-<project xmlns=3D"http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mave=
n.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <!-- ************************************************************* -->
-    <!-- *** POM Relationships *************************************** -->
-    <!-- ************************************************************* -->
-
-    <parent>
-        <groupId>org.codelutin</groupId>
-        <artifactId>lutinjaxx</artifactId>
-        <version>0.5-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>maven-jaxx-plugin</artifactId>
-
-    <dependencies>
-
-        <dependency>
-            <groupId>org.codelutin</groupId>
-            <artifactId>lutinutil</artifactId>
-            <scope>compile</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.codelutin</groupId>
-            <artifactId>jaxx-core</artifactId>
-            <scope>compile</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.codelutin</groupId>
-            <artifactId>jaxx-swing-action</artifactId>
-            <scope>compile</scope>
-        </dependency>
-
-        <!-- maven plugin project dependencies -->
-        <dependency>
-            <groupId>org.apache.maven</groupId>
-            <artifactId>maven-plugin-api</artifactId>
-            <scope>compile</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.maven</groupId>
-            <artifactId>maven-project</artifactId>
-            <scope>compile</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.maven.shared</groupId>
-            <artifactId>maven-plugin-testing-harness</artifactId>
-            <version>1.1</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.maven.shared</groupId>
-            <artifactId>maven-verifier</artifactId>
-            <version>1.0</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.codelutin</groupId>
-            <artifactId>lutinpluginutil</artifactId>
-            <scope>compile</scope>
-        </dependency>
-
-    </dependencies>
-
-    <!-- ************************************************************* -->
-    <!-- *** Project Information ************************************* -->
-    <!-- ************************************************************* -->
-
-    <name>maven-jaxx-plugin</name>
-
-    <description>
-        Maven 2 plugin to generate java source from ui interface definitions
-        in jaxx format.
-    </description>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Settings ****************************************** -->
-    <!-- ************************************************************* -->
-
-    <packaging>maven-plugin</packaging>
-    <build>
-        <plugins>
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-plugin-plugin</artifactId>
-                <version>2.4.3</version>
-                <executions>
-                    <execution>
-                        <id>helpmojo</id>
-                        <goals>
-                            <goal>helpmojo</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-
-        </plugins>
-    </build>
-
-    <reporting>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-plugin-plugin</artifactId>
-                <version>2.4.3</version>
-            </plugin>
-        </plugins>
-    </reporting>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Environment  ************************************** -->
-    <!-- ************************************************************* -->
-    <scm>
-        <connection>${scm.connection.son}</connection>
-        <developerConnection>${scm.developerConnection.son}</developerConnec=
tion>
-        <url>${scm.url.son}</url>
-    </scm>
-
-  =20
-</project>

Copied: lutinjaxx/tags/0.5/maven-jaxx-plugin/pom.xml (from rev 989, lutinjaxx=
/trunk/maven-jaxx-plugin/pom.xml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/maven-jaxx-plugin/pom.xml	                        (rev=
 0)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/pom.xml	2008-10-21 07:31:05 UTC (rev=
 990)
@@ -0,0 +1,128 @@
+<project xmlns=3D"http://maven.apache.org/POM/4.0.0" xmlns:xsi=3D"http://www=
.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D"http://maven.apache.or=
g/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- ************************************************************* -->
+    <!-- *** POM Relationships *************************************** -->
+    <!-- ************************************************************* -->
+
+    <parent>
+        <groupId>org.codelutin</groupId>
+        <artifactId>lutinjaxx</artifactId>
+        <version>0.5</version>
+    </parent>
+
+    <artifactId>maven-jaxx-plugin</artifactId>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.codelutin</groupId>
+            <artifactId>lutinutil</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.codelutin</groupId>
+            <artifactId>jaxx-core</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.codelutin</groupId>
+            <artifactId>jaxx-swing-action</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+        <!-- maven plugin project dependencies -->
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-plugin-api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-project</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.maven.shared</groupId>
+            <artifactId>maven-plugin-testing-harness</artifactId>
+            <version>1.1</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.maven.shared</groupId>
+            <artifactId>maven-verifier</artifactId>
+            <version>1.0</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.codelutin</groupId>
+            <artifactId>lutinpluginutil</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+    </dependencies>
+
+    <!-- ************************************************************* -->
+    <!-- *** Project Information ************************************* -->
+    <!-- ************************************************************* -->
+
+    <name>maven-jaxx-plugin</name>
+
+    <description>
+        Maven 2 plugin to generate java source from ui interface definitions
+        in jaxx format.
+    </description>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Settings ****************************************** -->
+    <!-- ************************************************************* -->
+
+    <packaging>maven-plugin</packaging>
+    <build>
+        <plugins>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-plugin-plugin</artifactId>
+                <version>2.4.3</version>
+                <executions>
+                    <execution>
+                        <id>helpmojo</id>
+                        <goals>
+                            <goal>helpmojo</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+        </plugins>
+    </build>
+
+    <reporting>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-plugin-plugin</artifactId>
+                <version>2.4.3</version>
+            </plugin>
+        </plugins>
+    </reporting>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Environment  ************************************** -->
+    <!-- ************************************************************* -->
+    <scm>
+        <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroo=
t/buix/lutinjaxx/tags/0.5/maven-jaxx-plugin</connection>
+        <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise=
.org/svnroot/buix/lutinjaxx/tags/0.5/maven-jaxx-plugin</developerConnection>
+        <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/lut=
injaxx/tags/0.5/maven-jaxx-plugin?root=3Dbuix</url>
+    </scm>
+
+  =20
+</project>
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/main/java/org/codelutin/jax=
x/JaxxGeneratorMojo.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/maven-jaxx-plugin/src/main/java/org/codelutin/jaxx/JaxxGe=
neratorMojo.java	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/src/main/java/org/codelutin/jaxx/Jax=
xGeneratorMojo.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,448 +0,0 @@
-/* *##%
- * Copyright (C) 2007
- *     JaxxPlugin, Code Lutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, US=
A.
- *##%*/
-
-package org.codelutin.jaxx;
-
-import jaxx.compiler.CompilerOptions;
-import jaxx.compiler.JAXXCompiler;
-import jaxx.tags.TagManager;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.util.DirectoryScanner;
-import org.codelutin.util.FileUpdaterHelper;
-import org.codelutin.util.MirroredFileUpdater;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Classe permettant de transformer des sources jaxx vers du source java.
- *
- * @author chemit
- * @goal generate
- * @phase process-sources
- */
-public class JaxxGeneratorMojo extends AbstractMojo {
-
-    /**
-     * D=C3=A9pendance du projet.
-     *
-     * @parameter default-value=3D"${project}"
-     * @readonly
-     */
-    protected MavenProject project;
-
-    /**
-     * Repertoire de destination des fichiers java a generer.
-     *
-     * @parameter expression=3D"${jaxx.outJava}" default-value=3D"${basedir}=
/target/generated-sources/java"
-     */
-    protected File outJava;
-
-    /**
-     * chemin du repertoire de generation des resources.
-     *
-     * @parameter expression=3D"${jaxx.outResource}" default-value=3D"${base=
dir}/target/generated-sources/resources"
-     */
-    protected File outResource;
-
-    /**
-     * chemin du repertoire de compilation des resources.
-     *
-     * @parameter expression=3D"${jaxx.outClass}" default-value=3D"${basedir=
}/target/classes"
-     */
-    protected File outClass;
-
-    /**
-     * verbose flag
-     *
-     * @parameter expression=3D"${jaxx.verbose}" default-value=3D"false"
-     */
-    protected boolean verbose;
-
-    /**
-     * Repertoire sources des fichiers jaxx a generer.
-     *
-     * @parameter expression=3D"${jaxx.src}" default-value=3D"${maven.src.di=
r}/main/uimodel"
-     */
-    protected File src;
-
-    /**
-     * pour optimizer le code compile ou genere ?
-     *
-     * @parameter expression=3D"${jaxx.optimize}" default-value=3D"false"
-     */
-    protected boolean optimize;
-
-    /**
-     * les options de la compilation
-     *
-     * @parameter expression=3D"${jaxx.javaOpts}"
-     */
-    protected String javaOpts =3D null;
-
-    /**
-     * pour filter les fichiers a traiter
-     *
-     * @parameter expression=3D"${jaxx.includes}"
-     */
-    protected String[] includes;
-
-    /**
-     * to force generation of java source for any jaxx files with no timesta=
mp checking.
-     * <p/>
-     * By default, never force generation.
-     *
-     * @parameter expression=3D"${jaxx.force}" default-value=3D"false"
-     */
-    protected boolean force;
-
-    /**
-     * to make compiler i18nable, says add the {@link org.codelutin.i18n.I18=
n#_(String, Object[])} method
-     * invocation on {@link jaxx.compiler.I18nHelper#I18N_ATTRIBUTES} attrib=
utes.
-     *
-     * @parameter expression=3D"${jaxx.i18nable}" default-value=3D"true"
-     * @see jaxx.compiler.I18nHelper
-     */
-    protected boolean i18nable;
-
-
-    /**
-     * flag to add logger to each generated jaxx file.
-     * <p/>
-     * By default, always add it.
-     *
-     * @parameter expression=3D"${jaxx.addLogger}" default-value=3D"true"
-     */
-    protected boolean addLogger;
-
-    protected String[] files;
-
-    private static final String[] INCLUDES =3D {"**\\/*.jaxx"};
-
-    protected CompilerOptions options;
-
-    protected MirroredFileUpdater updater;
-
-    protected boolean skip =3D true;
-
-    protected void init() {
-
-        if (project!=3Dnull && ("pom".equals(project.getPackaging()) || "sit=
e".equals(project.getPackaging()))) {
-            // nothing to be done for this type of packaging
-            skip =3D true;
-            getLog().info("skip generate goal for packaging " + project.getP=
ackaging());
-            return;
-        }
-
-        skip=3Dfalse;
-
-        if (!outResource.exists()) {
-            outResource.mkdirs();
-        }
-
-        if (!outJava.exists()) {
-            outJava.mkdirs();
-        }
-
-        fixCompileSourceRoots();
-
-        DirectoryScanner ds;
-        ds =3D new DirectoryScanner();
-        ds.setBasedir(src);
-        boolean noIncludes =3D includes =3D=3D null || includes.length =3D=
=3D 0;
-        ds.setIncludes(noIncludes ? INCLUDES : includes);
-        ds.scan();
-        String[] files =3D ds.getIncludedFiles();
-        if (verbose) {
-            getLog().info("jaxx - discover " + files.length + " jaxx file(s)=
. ");
-        }
-
-        updater =3D (MirroredFileUpdater) FileUpdaterHelper.newJaxxFileUpdat=
er(src, outJava);
-
-        if (force) {
-            // we will regenerate all files
-            this.files =3D files;
-        } else {
-            // filter files
-            List<String> listFiles =3D new ArrayList<String>();
-
-            for (String file : files) {
-                if (updater.isFileUpToDate(new File(src, file))) {
-                    if (verbose) {
-                        getLog().info("jaxx - skip file [" + file + "].");
-                    }
-                } else {
-                    if (verbose) {
-                        getLog().info("jaxx - will generate file [" + file +=
 "].");
-                    }
-                    listFiles.add(file);
-                }
-            }
-            this.files =3D listFiles.toArray(new String[listFiles.size()]);
-        }
-
-
-        options =3D toCompilerOptions();
-
-        if (verbose) {
-            printInit();
-        }
-
-    }
-
-    public CompilerOptions toCompilerOptions() {
-        CompilerOptions result =3D new CompilerOptions();
-        result.setClassPath(src.getPath());
-        if (javaOpts !=3D null && !"".equals(javaOpts)) {
-            result.setJavacOpts(javaOpts);
-        }
-        result.setKeepJavaFiles(true);
-        result.setOptimize(optimize);
-        result.setJavacTargetDirectory(outClass);
-        result.setTargetDirectory(outJava);
-        result.setVerbose(verbose);
-        result.setI18nable(i18nable);
-        result.setAddLogger(addLogger);
-        return result;
-    }
-
-    public void execute() throws MojoExecutionException, MojoFailureExceptio=
n {
-
-        init();
-
-        if (skip) {
-            if (verbose) {
-                getLog().info("jaxx - skip!");
-            }
-            return;
-        }
-       =20
-        if (files.length =3D=3D 0) {
-            getLog().info("jaxx - no jaxx file to treate. ");
-            return;
-        }
-
-        getLog().info("jaxx - will generate " + this.files.length + " jaxx f=
ile(s). ");
-
-        try {
-
-            // force compiler init from here, not in a static block
-            TagManager.reset(verbose);
-
-            if (!JAXXCompiler.compile(src, files, options)) {
-                throw new MojoFailureException("Aborting due to errors repor=
ted by jaxxc");
-            }
-
-        } catch (Exception e) {
-            getLog().error(e);
-            Throwable e2 =3D e;
-            while (e2.getCause() !=3D null) {
-                e2 =3D e.getCause();
-            }
-            getLog().error(e2);
-
-            throw new MojoExecutionException(e.getMessage(), e);
-        }
-
-    }
-
-    protected void fixCompileSourceRoots() {
-        //fixme should remove this silly test when we will make real maven p=
lugin tests :)
-        if (project !=3D null) {
-            if (!project.getCompileSourceRoots().contains(outJava.getPath())=
) {
-                project.addCompileSourceRoot(outJava.getPath());
-            }
-        }
-    }
-
-    @SuppressWarnings({"unchecked"})
-    protected URLClassLoader initClassLoader(MavenProject project, Log log) {
-        URLClassLoader loader =3D null;
-        if (project !=3D null) {
-            URLClassLoader result;
-            try {
-                Set<Artifact> compileClasspathElements =3D project.getArtifa=
cts();
-                URL[] url =3D new URL[compileClasspathElements.size() + 1];
-                url[0] =3D outClass.toURI().toURL();
-                int i =3D 1;
-                for (Artifact artifact : compileClasspathElements) {
-                    File file =3D new File(artifact.getFile().getAbsolutePat=
h());
-                    if (file.getName().endsWith(".jar")) {
-                        url[i] =3D new URL("jar", "", file.toURI().toURL().t=
oString() + "!/");
-                    } else {
-                        url[i] =3D file.toURI().toURL();
-                    }
-                    i++;
-                }
-                //ClassLoader parent =3D Thread.currentThread().getContextCl=
assLoader();
-                if (compileClasspathElements.size() =3D=3D 0) {
-                    result =3D new URLClassLoader(url, getClass().getClassLo=
ader());
-                } else {
-                    result =3D new URLClassLoader(url, getClass().getClassLo=
ader());
-                }
-            } catch (MalformedURLException eee) {
-                throw new RuntimeException("Can't create ClassLoader for scr=
ipt, bad directory: " + outClass + " for reason " + eee.getMessage(), eee);
-            } catch (IOException e) {
-                throw new RuntimeException("Can't create ClassLoader for scr=
ipt, bad directory: " + outClass + " for reason " + e.getMessage(), e);
-            }
-            loader =3D result;
-        }
-        if (verbose && loader !=3D null) {
-            for (URL entry : loader.getURLs()) {
-                log.info("outClass url " + entry);
-            }
-        }
-        return loader;
-    }
-
-    protected void printInit() {
-        getLog().info(options.toString());
-        getLog().info("includes : " + Arrays.toString(includes));
-        for (String file : files) {
-            getLog().info("will generate " + file);
-        }
-
-        ClassLoader cl =3D Thread.currentThread().getContextClassLoader();
-        getLog().info(cl.toString());
-        if (cl.getClass().getSimpleName().equals("RealmClassLoader")) {
-            try {
-                java.lang.reflect.Method m =3D cl.getClass().getDeclaredMeth=
od("getURLs");
-                m.setAccessible(true);
-                URL[] urls =3D (URL[]) m.invoke(cl);
-
-                for (URL url : urls) {
-                    getLog().info("url in class loader " + url);
-                }
-            } catch (Exception e) {
-                getLog().warn("??? : " + e.getMessage(), e);
-            }
-        }
-
-        //fixme should remove this silly test when we will make real maven p=
lugin tests :)
-        if (getPluginContext() !=3D null) {
-            for (Object e : getPluginContext().keySet()) {
-                getLog().info("pluginContext " + e + " : " + getPluginContex=
t().get(e));
-            }
-        }
-    }
-
-    public File getOutJava() {
-        return outJava;
-    }
-
-    public void setOutJava(File outJava) {
-        this.outJava =3D outJava;
-    }
-
-    public File getOutResource() {
-        return outResource;
-    }
-
-    public void setOutResource(File outResource) {
-        this.outResource =3D outResource;
-    }
-
-    public File getOutClass() {
-        return outClass;
-    }
-
-    public void setOutClass(File outClass) {
-        this.outClass =3D outClass;
-    }
-
-    public boolean isVerbose() {
-        return verbose;
-    }
-
-    public void setVerbose(boolean verbose) {
-        this.verbose =3D verbose;
-    }
-
-    public File getSrc() {
-        return src;
-    }
-
-    public void setSrc(File src) {
-        this.src =3D src;
-    }
-
-    public boolean isOptimize() {
-        return optimize;
-    }
-
-    public void setOptimize(boolean optimize) {
-        this.optimize =3D optimize;
-    }
-
-    public String getJavaOpts() {
-        return javaOpts;
-    }
-
-    public void setJavaOpts(String javaOpts) {
-        this.javaOpts =3D javaOpts;
-    }
-
-    public String[] getIncludes() {
-        return includes;
-    }
-
-    public void setIncludes(String[] includes) {
-        this.includes =3D includes;
-    }
-
-    public String[] getFiles() {
-        return files;
-    }
-
-    public void setFiles(String[] files) {
-        this.files =3D files;
-    }
-
-    public boolean isForce() {
-        return force;
-    }
-
-    public void setForce(boolean force) {
-        this.force =3D force;
-    }
-
-    public boolean isI18nable() {
-        return i18nable;
-    }
-
-    public void setI18nable(boolean i18nable) {
-        this.i18nable =3D i18nable;
-    }
-
-    public MirroredFileUpdater getUpdater() {
-        return updater;
-    }
-}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/main/java/org/codelutin/jaxx=
/JaxxGeneratorMojo.java (from rev 971, lutinjaxx/trunk/maven-jaxx-plugin/src/=
main/java/org/codelutin/jaxx/JaxxGeneratorMojo.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/maven-jaxx-plugin/src/main/java/org/codelutin/jaxx/Jax=
xGeneratorMojo.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/src/main/java/org/codelutin/jaxx/Jax=
xGeneratorMojo.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,464 @@
+/* *##%
+ * Copyright (C) 2007
+ *     JaxxPlugin, Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, US=
A.
+ *##%*/
+
+package org.codelutin.jaxx;
+
+import jaxx.compiler.CompilerOptions;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.tags.TagManager;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.DirectoryScanner;
+import org.codelutin.util.FileUpdaterHelper;
+import org.codelutin.util.MirroredFileUpdater;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Classe permettant de transformer des sources jaxx vers du source java.
+ *
+ * @author chemit
+ * @goal generate
+ * @phase process-sources
+ */
+public class JaxxGeneratorMojo extends AbstractMojo {
+
+    /**
+     * D=C3=A9pendance du projet.
+     *
+     * @parameter default-value=3D"${project}"
+     * @readonly
+     */
+    protected MavenProject project;
+
+    /**
+     * Repertoire de destination des fichiers java a generer.
+     *
+     * @parameter expression=3D"${jaxx.outJava}" default-value=3D"${basedir}=
/target/generated-sources/java"
+     */
+    protected File outJava;
+
+    /**
+     * chemin du repertoire de generation des resources.
+     *
+     * @parameter expression=3D"${jaxx.outResource}" default-value=3D"${base=
dir}/target/generated-sources/resources"
+     */
+    protected File outResource;
+
+    /**
+     * chemin du repertoire de compilation des resources.
+     *
+     * @parameter expression=3D"${jaxx.outClass}" default-value=3D"${basedir=
}/target/classes"
+     */
+    protected File outClass;
+
+    /**
+     * verbose flag
+     *
+     * @parameter expression=3D"${jaxx.verbose}" default-value=3D"false"
+     */
+    protected boolean verbose;
+
+    /**
+     * Repertoire sources des fichiers jaxx a generer.
+     *
+     * @parameter expression=3D"${jaxx.src}" default-value=3D"${maven.src.di=
r}/main/uimodel"
+     */
+    protected File src;
+
+    /**
+     * pour optimizer le code compile ou genere ?
+     *
+     * @parameter expression=3D"${jaxx.optimize}" default-value=3D"false"
+     */
+    protected boolean optimize;
+
+    /**
+     * les options de la compilation
+     *
+     * @parameter expression=3D"${jaxx.javaOpts}"
+     */
+    protected String javaOpts =3D null;
+
+    /**
+     * pour filter les fichiers a traiter
+     *
+     * @parameter expression=3D"${jaxx.includes}"
+     */
+    protected String[] includes;
+
+    /**
+     * pour filter les fichiers a ne pas traiter
+     *
+     * @parameter expression=3D"${jaxx.excludes}"
+     */
+    protected String[] excludes;
+
+    /**
+     * to force generation of java source for any jaxx files with no timesta=
mp checking.
+     * <p/>
+     * By default, never force generation.
+     *
+     * @parameter expression=3D"${jaxx.force}" default-value=3D"false"
+     */
+    protected boolean force;
+
+    /**
+     * to make compiler i18nable, says add the {@link org.codelutin.i18n.I18=
n#_(String, Object[])} method
+     * invocation on {@link jaxx.compiler.I18nHelper#I18N_ATTRIBUTES} attrib=
utes.
+     *
+     * @parameter expression=3D"${jaxx.i18nable}" default-value=3D"true"
+     * @see jaxx.compiler.I18nHelper
+     */
+    protected boolean i18nable;
+
+
+    /**
+     * flag to add logger to each generated jaxx file.
+     * <p/>
+     * By default, always add it.
+     *
+     * @parameter expression=3D"${jaxx.addLogger}" default-value=3D"true"
+     */
+    protected boolean addLogger;
+
+    protected String[] files;
+
+    private static final String[] INCLUDES =3D {"**\\/*.jaxx"};
+
+    protected CompilerOptions options;
+
+    protected MirroredFileUpdater updater;
+
+    protected boolean skip =3D true;
+
+    protected void init() {
+
+        if (project!=3Dnull && ("pom".equals(project.getPackaging()) || "sit=
e".equals(project.getPackaging()))) {
+            // nothing to be done for this type of packaging
+            skip =3D true;
+            getLog().info("skip generate goal for packaging " + project.getP=
ackaging());
+            return;
+        }
+
+        skip=3Dfalse;
+
+        if (!outResource.exists()) {
+            outResource.mkdirs();
+        }
+
+        if (!outJava.exists()) {
+            outJava.mkdirs();
+        }
+
+        fixCompileSourceRoots();
+
+        DirectoryScanner ds;
+        ds =3D new DirectoryScanner();
+        ds.setBasedir(src);
+        boolean noIncludes =3D includes =3D=3D null || includes.length =3D=
=3D 0;
+        ds.setIncludes(noIncludes ? INCLUDES : includes);
+
+        if (excludes!=3Dnull && excludes.length>0) {
+            ds.setExcludes(excludes);
+        }
+       =20
+        ds.scan();
+        String[] files =3D ds.getIncludedFiles();
+        if (verbose) {
+            getLog().info("jaxx - discover " + files.length + " jaxx file(s)=
. ");
+        }
+
+        updater =3D (MirroredFileUpdater) FileUpdaterHelper.newJaxxFileUpdat=
er(src, outJava);
+
+        if (force) {
+            // we will regenerate all files
+            this.files =3D files;
+        } else {
+            // filter files
+            List<String> listFiles =3D new ArrayList<String>();
+
+            for (String file : files) {
+                if (updater.isFileUpToDate(new File(src, file))) {
+                    if (verbose) {
+                        getLog().info("jaxx - skip file [" + file + "].");
+                    }
+                } else {
+                    if (verbose) {
+                        getLog().info("jaxx - will generate file [" + file +=
 "].");
+                    }
+                    listFiles.add(file);
+                }
+            }
+            this.files =3D listFiles.toArray(new String[listFiles.size()]);
+        }
+
+
+        options =3D toCompilerOptions();
+
+        if (verbose) {
+            printInit();
+        }
+
+    }
+
+    public CompilerOptions toCompilerOptions() {
+        CompilerOptions result =3D new CompilerOptions();
+        result.setClassPath(src.getPath());
+        if (javaOpts !=3D null && !"".equals(javaOpts)) {
+            result.setJavacOpts(javaOpts);
+        }
+        result.setKeepJavaFiles(true);
+        result.setOptimize(optimize);
+        result.setJavacTargetDirectory(outClass);
+        result.setTargetDirectory(outJava);
+        result.setVerbose(verbose);
+        result.setI18nable(i18nable);
+        result.setAddLogger(addLogger);
+        return result;
+    }
+
+    public void execute() throws MojoExecutionException, MojoFailureExceptio=
n {
+
+        init();
+
+        if (skip) {
+            if (verbose) {
+                getLog().info("jaxx - skip!");
+            }
+            return;
+        }
+       =20
+        if (files.length =3D=3D 0) {
+            getLog().info("jaxx - no jaxx file to treate. ");
+            return;
+        }
+
+        doAction();
+
+    }
+
+    public void doAction() throws MojoExecutionException {
+        getLog().info("jaxx - will generate " + this.files.length + " jaxx f=
ile(s). ");
+
+        try {
+
+            // force compiler init from here, not in a static block
+            TagManager.reset(verbose);
+
+            if (!JAXXCompiler.compile(src, files, options)) {
+                throw new MojoFailureException("Aborting due to errors repor=
ted by jaxxc");
+            }
+
+        } catch (Exception e) {
+            getLog().error(e);
+            Throwable e2 =3D e;
+            while (e2.getCause() !=3D null) {
+                e2 =3D e.getCause();
+            }
+            getLog().error(e2);
+
+            throw new MojoExecutionException(e.getMessage(), e);
+        }
+    }
+
+    protected void fixCompileSourceRoots() {
+        //fixme should remove this silly test when we will make real maven p=
lugin tests :)
+        if (project !=3D null) {
+            if (!project.getCompileSourceRoots().contains(outJava.getPath())=
) {
+                project.addCompileSourceRoot(outJava.getPath());
+            }
+        }
+    }
+
+    @SuppressWarnings({"unchecked"})
+    protected URLClassLoader initClassLoader(MavenProject project, Log log) {
+        URLClassLoader loader =3D null;
+        if (project !=3D null) {
+            URLClassLoader result;
+            try {
+                Set<Artifact> compileClasspathElements =3D project.getArtifa=
cts();
+                URL[] url =3D new URL[compileClasspathElements.size() + 1];
+                url[0] =3D outClass.toURI().toURL();
+                int i =3D 1;
+                for (Artifact artifact : compileClasspathElements) {
+                    File file =3D new File(artifact.getFile().getAbsolutePat=
h());
+                    if (file.getName().endsWith(".jar")) {
+                        url[i] =3D new URL("jar", "", file.toURI().toURL().t=
oString() + "!/");
+                    } else {
+                        url[i] =3D file.toURI().toURL();
+                    }
+                    i++;
+                }
+                //ClassLoader parent =3D Thread.currentThread().getContextCl=
assLoader();
+                if (compileClasspathElements.size() =3D=3D 0) {
+                    result =3D new URLClassLoader(url, getClass().getClassLo=
ader());
+                } else {
+                    result =3D new URLClassLoader(url, getClass().getClassLo=
ader());
+                }
+            } catch (MalformedURLException eee) {
+                throw new RuntimeException("Can't create ClassLoader for scr=
ipt, bad directory: " + outClass + " for reason " + eee.getMessage(), eee);
+            } catch (IOException e) {
+                throw new RuntimeException("Can't create ClassLoader for scr=
ipt, bad directory: " + outClass + " for reason " + e.getMessage(), e);
+            }
+            loader =3D result;
+        }
+        if (verbose && loader !=3D null) {
+            for (URL entry : loader.getURLs()) {
+                log.info("outClass url " + entry);
+            }
+        }
+        return loader;
+    }
+
+    protected void printInit() {
+        getLog().info(options.toString());
+        getLog().info("includes : " + Arrays.toString(includes));
+        for (String file : files) {
+            getLog().info("will generate " + file);
+        }
+
+        ClassLoader cl =3D Thread.currentThread().getContextClassLoader();
+        getLog().info(cl.toString());
+        if (cl.getClass().getSimpleName().equals("RealmClassLoader")) {
+            try {
+                java.lang.reflect.Method m =3D cl.getClass().getDeclaredMeth=
od("getURLs");
+                m.setAccessible(true);
+                URL[] urls =3D (URL[]) m.invoke(cl);
+
+                for (URL url : urls) {
+                    getLog().info("url in class loader " + url);
+                }
+            } catch (Exception e) {
+                getLog().warn("??? : " + e.getMessage(), e);
+            }
+        }
+
+        //fixme should remove this silly test when we will make real maven p=
lugin tests :)
+        if (getPluginContext() !=3D null) {
+            for (Object e : getPluginContext().keySet()) {
+                getLog().info("pluginContext " + e + " : " + getPluginContex=
t().get(e));
+            }
+        }
+    }
+
+    public File getOutJava() {
+        return outJava;
+    }
+
+    public void setOutJava(File outJava) {
+        this.outJava =3D outJava;
+    }
+
+    public File getOutResource() {
+        return outResource;
+    }
+
+    public void setOutResource(File outResource) {
+        this.outResource =3D outResource;
+    }
+
+    public File getOutClass() {
+        return outClass;
+    }
+
+    public void setOutClass(File outClass) {
+        this.outClass =3D outClass;
+    }
+
+    public boolean isVerbose() {
+        return verbose;
+    }
+
+    public void setVerbose(boolean verbose) {
+        this.verbose =3D verbose;
+    }
+
+    public File getSrc() {
+        return src;
+    }
+
+    public void setSrc(File src) {
+        this.src =3D src;
+    }
+
+    public boolean isOptimize() {
+        return optimize;
+    }
+
+    public void setOptimize(boolean optimize) {
+        this.optimize =3D optimize;
+    }
+
+    public String getJavaOpts() {
+        return javaOpts;
+    }
+
+    public void setJavaOpts(String javaOpts) {
+        this.javaOpts =3D javaOpts;
+    }
+
+    public String[] getIncludes() {
+        return includes;
+    }
+
+    public void setIncludes(String[] includes) {
+        this.includes =3D includes;
+    }
+
+    public String[] getFiles() {
+        return files;
+    }
+
+    public void setFiles(String[] files) {
+        this.files =3D files;
+    }
+
+    public boolean isForce() {
+        return force;
+    }
+
+    public void setForce(boolean force) {
+        this.force =3D force;
+    }
+
+    public boolean isI18nable() {
+        return i18nable;
+    }
+
+    public void setI18nable(boolean i18nable) {
+        this.i18nable =3D i18nable;
+    }
+
+    public MirroredFileUpdater getUpdater() {
+        return updater;
+    }
+}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/java/org/codelutin/jax=
x/BuildExamples.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/BuildE=
xamples.java	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Bui=
ldExamples.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,103 +0,0 @@
-package org.codelutin.jaxx;
-
-import junit.framework.TestCase;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.VerificationException;
-import org.codehaus.plexus.util.FileUtils;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-/** @author chemit */
-public class BuildExamples extends TestCase {
-
-    protected static final Log log =3D LogFactory.getLog(BuildExamples.class=
);
-
-    protected File srcDir;
-
-    protected File destDir;
-
-    protected File siteDir;
-    protected File siteDestDir;
-
-    protected Verifier verifier;
-
-    protected File getBasedir() {
-        String b =3D System.getenv("basedir");
-        if (b =3D=3D null) {
-            b =3D new File("").getAbsolutePath();
-        }
-        return new File(b);
-    }
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        log.info("start " + getName());
-        String dirname =3D getName().substring(4);
-
-        srcDir =3D new File(getBasedir(), "src" + File.separator + "examples=
" + File.separator + dirname);
-        destDir =3D new File(getBasedir(), "target" + File.separator + "exam=
ples" + File.separator + dirname);
-        siteDestDir =3D new File(getBasedir(), "target" + File.separator + "=
generated-site" + File.separator + "resources" + File.separator + "examples");
-        siteDir =3D new File(destDir, "target" + File.separator + "jnlp");
-
-        destDir.mkdirs();
-
-        FileUtils.copyDirectoryStructure(srcDir, destDir);
-
-        verifier =3D new Verifier(destDir.getAbsolutePath(), true);
-
-        List<String> cliOptions =3D new ArrayList<String>();
-        cliOptions.add("-Dmaven.verbose=3Dtrue");
-        verifier.setCliOptions(cliOptions);
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        srcDir =3D destDir =3D null;
-        if (verifier !=3D null) {
-            verifier.resetStreams();
-            verifier =3D null;
-        }
-    }
-
-    /**
-     * fixme : make this test works again.
-     *
-     * @throws Exception if any
-     */
-    public void estComponents() throws Exception {
-        buildExample();
-    }
-
-    public void testCalculator() throws Exception {
-        buildExample();
-    }
-
-    public void testCounter() throws Exception {
-        buildExample();
-    }
-
-    public void testLabelStyle() throws Exception {
-        buildExample();
-    }
-
-    public void testValidation() throws Exception {
-        buildExample();
-    }
-
-    protected void buildExample() throws VerificationException, IOException {
-        verifier.executeGoals(Arrays.asList("jaxx:generate", "package"));
-        verifier.verifyErrorFreeLog();
-        FileUtils.copyDirectory(new File(siteDir, "lib"), new File(siteDestD=
ir,"lib"));
-        FileUtils.copyDirectory(siteDir, siteDestDir,"*.jnlp","");
-    }
-
-
-}

Copied: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx=
/BuildExamples.java (from rev 969, lutinjaxx/trunk/maven-jaxx-plugin/src/test=
/java/org/codelutin/jaxx/BuildExamples.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Bui=
ldExamples.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Bui=
ldExamples.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,106 @@
+package org.codelutin.jaxx;
+
+import junit.framework.TestCase;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.maven.it.VerificationException;
+import org.apache.maven.it.Verifier;
+import org.codehaus.plexus.util.FileUtils;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author chemit
+ * @deprecated This goal is not ny longer used : we have specific maven modu=
les to build examples...
+ */
+public abstract class BuildExamples extends TestCase {
+
+    protected static final Log log =3D LogFactory.getLog(BuildExamples.class=
);
+
+    protected File srcDir;
+
+    protected File destDir;
+
+    protected File siteDir;
+    protected File siteDestDir;
+
+    protected Verifier verifier;
+
+    protected File getBasedir() {
+        String b =3D System.getenv("basedir");
+        if (b =3D=3D null) {
+            b =3D new File("").getAbsolutePath();
+        }
+        return new File(b);
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        log.info("start " + getName());
+        String dirname =3D getName().substring(4);
+
+        srcDir =3D new File(getBasedir(), "src" + File.separator + "examples=
" + File.separator + dirname);
+        destDir =3D new File(getBasedir(), "target" + File.separator + "exam=
ples" + File.separator + dirname);
+        siteDestDir =3D new File(getBasedir(), "target" + File.separator + "=
generated-site" + File.separator + "resources" + File.separator + "examples");
+        siteDir =3D new File(destDir, "target" + File.separator + "jnlp");
+
+        destDir.mkdirs();
+
+        FileUtils.copyDirectoryStructure(srcDir, destDir);
+
+        verifier =3D new Verifier(destDir.getAbsolutePath(), true);
+
+        List<String> cliOptions =3D new ArrayList<String>();
+        cliOptions.add("-Dmaven.verbose=3Dtrue");
+        verifier.setCliOptions(cliOptions);
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        super.tearDown();
+        srcDir =3D destDir =3D null;
+        if (verifier !=3D null) {
+            verifier.resetStreams();
+            verifier =3D null;
+        }
+    }
+
+    /**
+     * fixme : make this test works again.
+     *
+     * @throws Exception if any
+     */
+    public void estComponents() throws Exception {
+        buildExample();
+    }
+
+    public void testCalculator() throws Exception {
+        buildExample();
+    }
+
+    public void testCounter() throws Exception {
+        buildExample();
+    }
+
+    public void testLabelStyle() throws Exception {
+        buildExample();
+    }
+
+    public void testValidation() throws Exception {
+        buildExample();
+    }
+
+    protected void buildExample() throws VerificationException, IOException {
+        verifier.executeGoals(Arrays.asList("jaxx:generate", "package"));
+        verifier.verifyErrorFreeLog();
+        FileUtils.copyDirectory(new File(siteDir, "lib"), new File(siteDestD=
ir, "lib"));
+        FileUtils.copyDirectory(siteDir, siteDestDir, "*.jnlp", "");
+    }
+
+
+}

Deleted: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/java/org/codelutin/jax=
x/CompilerTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Compil=
erTest.java	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Com=
pilerTest.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,142 +0,0 @@
-package org.codelutin.jaxx;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-
-import java.io.File;
-
-public class CompilerTest extends JaxxBaseTest {
-
-     protected String prefix =3D "src" + File.separator + "test" + File.sepa=
rator + "resources" + File.separator + "testcases" + File.separator;
-
-      public String getPrefix() {
-        return prefix;
-    }
-
-    public void testInnerClasses() throws Exception {
-        mojo.execute();
-        assertEquals(1, mojo.getFiles().length);
-    }
-
-    public void testSpecialSubclassing() throws Exception {
-        mojo.execute();
-        assertEquals(7, mojo.getFiles().length);
-    }
-
-    public void testCSSTests() throws Exception {
-        mojo.execute();
-        assertEquals(7, mojo.getFiles().length);
-    }
-
-    public void testWithLog() throws Exception {
-        mojo.execute();
-        String[] files =3D mojo.getFiles();
-        assertEquals(2, files.length);
-
-        String withLogFile;
-        String withnoLogFile;
-        if (files[0].endsWith("WithLog.jaxx")) {
-            withLogFile =3D files[0];
-            withnoLogFile =3D files[1];
-        } else {
-            withLogFile =3D files[1];
-            withnoLogFile =3D files[0];
-        }
-        checkPattern(mojo, "Log log =3D LogFactory.getLog(", true, withLogFi=
le);
-        checkPattern(mojo, "import org.apache.commons.logging.Log;", true, w=
ithLogFile);
-        checkPattern(mojo, "import org.apache.commons.logging.LogFactory;", =
true, withLogFile);
-
-        checkPattern(mojo, "Log log =3D LogFactory.getLog(", false, withnoLo=
gFile);
-        checkPattern(mojo, "import org.apache.commons.logging.Log;", false, =
withnoLogFile);
-        checkPattern(mojo, "import org.apache.commons.logging.LogFactory;", =
false, withnoLogFile);
-    }
-
-    public void testNoLog() throws Exception {
-        mojo.execute();
-        String[] files =3D mojo.getFiles();
-        assertEquals(2, files.length);
-        checkPattern(mojo, "Log log =3D LogFactory.getLog(", false, files);
-        checkPattern(mojo, "import org.apache.commons.logging.Log;", false, =
files);
-        checkPattern(mojo, "import org.apache.commons.logging.LogFactory;", =
false, files);
-    }
-
-    public void testErrors() throws Exception {
-        // init mojo to get alls files to treate
-        mojo.init();
-        String[] files =3D mojo.getFiles();
-        // execute mjo on each jaxx file to produce the error
-        for (String file : files) {
-            mojo.setFiles(new String[]{file});
-            try {
-                mojo.execute();
-                // should never pass
-                fail();
-            } catch (MojoExecutionException e) {
-                // ok jaxx compiler failed
-                assertTrue(true);
-            } catch (MojoFailureException e) {
-                // this exception should not appear
-                fail();
-            }
-        }
-    }
-
-    public void testInitializers() throws Exception {
-        mojo.execute();
-        assertEquals(1, mojo.getFiles().length);
-    }
-
-    public void testScript() throws Exception {
-        mojo.execute();
-        assertEquals(1, mojo.getFiles().length);
-    }
-
-    public void testOverridingDataBindings() throws Exception {
-        mojo.execute();
-        assertEquals(3, mojo.getFiles().length);
-    }
-
-    public void testClassReferences() throws Exception {
-        mojo.execute();
-        assertEquals(6, mojo.getFiles().length);
-    }
-
-    public void testForce() throws Exception {
-
-        // first round, with force option so will generate theonly JButton.j=
axx file
-        mojo.execute();
-        String[] files =3D mojo.getFiles();
-        assertEquals(1, files.length);
-
-        File srcFile =3D new File(mojo.getSrc(), files[0]);
-
-        File dstFile =3D mojo.getUpdater().getMirrorFile(srcFile);
-
-        long oldTime =3D dstFile.lastModified();
-        // second round, no force so will not the file
-        mojo.setForce(false);
-        mojo.execute();
-        files =3D mojo.getFiles();
-        assertEquals(0, files.length);
-
-        Thread.sleep(1000);
-
-        assertEquals(oldTime, mojo.getUpdater().getMirrorFile(srcFile).lastM=
odified());
-
-        // three round : modify a source with no force option
-        srcFile.setLastModified(System.currentTimeMillis());
-
-        mojo.execute();
-        files =3D mojo.getFiles();
-        assertEquals(1, files.length);
-
-        assertTrue(mojo.getUpdater().getMirrorFile(srcFile).lastModified() >=
 oldTime);
-
-        // last round, reforce file generation for an no modify source
-        mojo.setForce(true);
-        mojo.execute();
-        files =3D mojo.getFiles();
-        assertEquals(1, files.length);
-        assertTrue(mojo.getUpdater().getMirrorFile(srcFile).lastModified() >=
 oldTime);
-    }
-}
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx=
/CompilerTest.java (from rev 977, lutinjaxx/trunk/maven-jaxx-plugin/src/test/=
java/org/codelutin/jaxx/CompilerTest.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Com=
pilerTest.java	                        (rev 0)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Com=
pilerTest.java	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,238 @@
+package org.codelutin.jaxx;
+
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.JAXXCompilerHelper;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.SystemStreamLog;
+
+import java.io.File;
+import java.lang.reflect.Field;
+import java.util.Map;
+
+public class CompilerTest extends JaxxBaseTest {
+
+    protected String prefix =3D "src" + File.separator + "test" + File.separ=
ator + "resources" + File.separator + "testcases" + File.separator;
+
+    public String getPrefix() {
+        return prefix;
+    }
+
+    public void testInnerClasses() throws Exception {
+        mojo.execute();
+        assertEquals(1, mojo.getFiles().length);
+    }
+
+    public void testSpecialSubclassing() throws Exception {
+        mojo.execute();
+        assertEquals(7, mojo.getFiles().length);
+    }
+
+    public void testCSSTests() throws Exception {
+        mojo.execute();
+        assertEquals(7, mojo.getFiles().length);
+    }
+
+    public void testWithLog() throws Exception {
+        mojo.execute();
+        String[] files =3D mojo.getFiles();
+        assertEquals(2, files.length);
+
+        String withLogFile;
+        String withnoLogFile;
+        if (files[0].endsWith("WithLog.jaxx")) {
+            withLogFile =3D files[0];
+            withnoLogFile =3D files[1];
+        } else {
+            withLogFile =3D files[1];
+            withnoLogFile =3D files[0];
+        }
+        checkPattern(mojo, "Log log =3D LogFactory.getLog(", true, withLogFi=
le);
+        checkPattern(mojo, "import org.apache.commons.logging.Log;", true, w=
ithLogFile);
+        checkPattern(mojo, "import org.apache.commons.logging.LogFactory;", =
true, withLogFile);
+
+        checkPattern(mojo, "Log log =3D LogFactory.getLog(", false, withnoLo=
gFile);
+        checkPattern(mojo, "import org.apache.commons.logging.Log;", false, =
withnoLogFile);
+        checkPattern(mojo, "import org.apache.commons.logging.LogFactory;", =
false, withnoLogFile);
+    }
+
+    public void testNoLog() throws Exception {
+        mojo.execute();
+        String[] files =3D mojo.getFiles();
+        assertEquals(2, files.length);
+        checkPattern(mojo, "Log log =3D LogFactory.getLog(", false, files);
+        checkPattern(mojo, "import org.apache.commons.logging.Log;", false, =
files);
+        checkPattern(mojo, "import org.apache.commons.logging.LogFactory;", =
false, files);
+    }
+
+    public void testErrors() throws Exception {
+        // init mojo to get alls files to treate
+        mojo.init();
+        String[] files =3D mojo.getFiles();
+        assertEquals(34, mojo.getFiles().length);
+        mojo.setLog(new SystemStreamLog() {
+            @Override
+            public boolean isErrorEnabled() {
+                return false;
+            }
+
+            @Override
+            public void error(Throwable error) {
+                //do nothing
+            }
+
+            @Override
+            public void error(CharSequence content) {
+                //do nothing
+            }
+
+            @Override
+            public void error(CharSequence content, Throwable error) {
+                //do nothing
+            }
+        });
+        Field fieldCompilers =3D JAXXCompilerHelper.class.getDeclaredField("=
compilers");
+        Field fieldErrorCount =3D JAXXCompilerHelper.class.getDeclaredField(=
"errorCount");
+
+        fieldCompilers.setAccessible(true);
+        fieldErrorCount.setAccessible(true);
+
+        // execute mjo on each jaxx file to produce the error
+        for (String file : files) {
+            getLog().info("test bad file " + file);
+            mojo.setFiles(new String[]{file});
+            try {
+                mojo.doAction();
+                // should never pass
+                fail();
+            } catch (MojoExecutionException e) {
+                // ok jaxx compiler failed
+                assertTrue(true);
+
+                Map<String, JAXXCompiler> compilers =3D (Map<String, JAXXCom=
piler>) fieldCompilers.get(null);
+                assertEquals(1, compilers.size());
+                JAXXCompiler compiler =3D compilers.values().iterator().next=
();
+                Integer nberrors =3D (Integer) fieldErrorCount.get(compiler);
+                assertTrue(nberrors > 0);
+            }
+        }
+    }
+
+    public void testInitializers() throws Exception {
+        mojo.execute();
+        assertEquals(1, mojo.getFiles().length);
+    }
+
+    public void testScript() throws Exception {
+        mojo.execute();
+        assertEquals(1, mojo.getFiles().length);
+    }
+
+    public void testOverridingDataBindings() throws Exception {
+        mojo.execute();
+        assertEquals(3, mojo.getFiles().length);
+    }
+
+    public void testClassReferences() throws Exception {
+        mojo.execute();
+        assertEquals(6, mojo.getFiles().length);
+    }
+
+    public void testForce() throws Exception {
+
+        // first round, with force option so will generate theonly JButton.j=
axx file
+        mojo.execute();
+        String[] files =3D mojo.getFiles();
+        assertEquals(1, files.length);
+
+        File srcFile =3D new File(mojo.getSrc(), files[0]);
+
+        File dstFile =3D mojo.getUpdater().getMirrorFile(srcFile);
+
+        long oldTime =3D dstFile.lastModified();
+        // second round, no force so will not the file
+        mojo.setForce(false);
+        mojo.execute();
+        files =3D mojo.getFiles();
+        assertEquals(0, files.length);
+
+        Thread.sleep(1000);
+
+        assertEquals(oldTime, mojo.getUpdater().getMirrorFile(srcFile).lastM=
odified());
+
+        // three round : modify a source with no force option
+        srcFile.setLastModified(System.currentTimeMillis());
+
+        mojo.execute();
+        files =3D mojo.getFiles();
+        assertEquals(1, files.length);
+
+        assertTrue(mojo.getUpdater().getMirrorFile(srcFile).lastModified() >=
 oldTime);
+
+        // last round, reforce file generation for an no modify source
+        mojo.setForce(true);
+        mojo.execute();
+        files =3D mojo.getFiles();
+        assertEquals(1, files.length);
+        assertTrue(mojo.getUpdater().getMirrorFile(srcFile).lastModified() >=
 oldTime);
+    }
+
+    public void testValidatorOk() throws Exception {
+        mojo.execute();
+        assertEquals(1, mojo.getFiles().length);
+
+    }
+
+    public void testValidatorErrors() throws Exception {
+        // init mojo to get alls files to treate
+        mojo.init();
+        String[] files =3D mojo.getFiles();
+        assertEquals(16, mojo.getFiles().length);
+        mojo.setLog(new SystemStreamLog() {
+            @Override
+            public boolean isErrorEnabled() {
+                return false;
+            }
+
+            @Override
+            public void error(Throwable error) {
+                //do nothing
+            }
+
+            @Override
+            public void error(CharSequence content) {
+                //do nothing
+            }
+
+            @Override
+            public void error(CharSequence content, Throwable error) {
+                //do nothing
+            }
+        });
+        Field fieldCompilers =3D JAXXCompilerHelper.class.getDeclaredField("=
compilers");
+        Field fieldErrorCount =3D JAXXCompilerHelper.class.getDeclaredField(=
"errorCount");
+
+        fieldCompilers.setAccessible(true);
+        fieldErrorCount.setAccessible(true);
+
+        // execute mjo on each jaxx file to produce the error
+        for (String file : files) {
+            getLog().info("test bad file " + file);
+            mojo.setFiles(new String[]{file});
+            try {
+                mojo.doAction();
+                // should never pass
+                fail();
+            } catch (MojoExecutionException e) {
+                // ok jaxx compiler failed
+                assertTrue(true);
+
+                Map<String, JAXXCompiler> compilers =3D (Map<String, JAXXCom=
piler>) fieldCompilers.get(null);
+                assertEquals(1, compilers.size());
+                JAXXCompiler compiler =3D compilers.values().iterator().next=
();
+                Integer nberrors =3D (Integer) fieldErrorCount.get(compiler);
+                assertEquals(1, nberrors.intValue());
+            }
+        }
+    }
+
+}
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/Er=
rors.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/testcases/Errors.xml=
	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/Errors.=
xml	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,22 +0,0 @@
-<?xml version=3D"1.0" encoding=3D"UTF-8"?>
-<project xmlns=3D"http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mave=
n.apache.org/maven-v4_0_0.xsd">
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.codelutin</groupId>
-                <artifactId>maven-jaxx-plugin</artifactId>
-                <configuration>
-                    <src>${basedir}/src/test/resources</src>
-                    <outJava>${basedir}/target/it-generated-source/java</out=
Java>
-                    <outResource>${basedir}/target/it-generated-source/resou=
rces</outResource>
-                    <force>true</force>
-                    <includes>
-                        <value>**/errors/*.jaxx</value>
-                    </includes>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/Err=
ors.xml (from rev 968, lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/t=
estcases/Errors.xml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/Errors.=
xml	                        (rev 0)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/Errors.=
xml	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,25 @@
+<?xml version=3D"1.0" encoding=3D"UTF-8"?>
+<project xmlns=3D"http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mave=
n.apache.org/maven-v4_0_0.xsd">
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codelutin</groupId>
+                <artifactId>maven-jaxx-plugin</artifactId>
+                <configuration>
+                    <src>${basedir}/src/test/resources</src>
+                    <outJava>${basedir}/target/it-generated-source/java</out=
Java>
+                    <outResource>${basedir}/target/it-generated-source/resou=
rces</outResource>
+                    <force>true</force>
+                    <includes>
+                        <value>**/errors/*.jaxx</value>
+                    </includes>
+                    <excludes>
+                        <value>**/validator/errors/*.jaxx</value>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/Val=
idatorErrors.xml (from rev 968, lutinjaxx/trunk/maven-jaxx-plugin/src/test/re=
sources/testcases/ValidatorErrors.xml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/Validat=
orErrors.xml	                        (rev 0)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/Validat=
orErrors.xml	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,22 @@
+<?xml version=3D"1.0" encoding=3D"UTF-8"?>
+<project xmlns=3D"http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mave=
n.apache.org/maven-v4_0_0.xsd">
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codelutin</groupId>
+                <artifactId>maven-jaxx-plugin</artifactId>
+                <configuration>
+                    <src>${basedir}/src/test/resources</src>
+                    <outJava>${basedir}/target/it-generated-source/java</out=
Java>
+                    <outResource>${basedir}/target/it-generated-source/resou=
rces</outResource>
+                    <force>true</force>
+                    <includes>
+                        <value>**/validator/errors/*.jaxx</value>
+                    </includes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/Val=
idatorOk.xml (from rev 968, lutinjaxx/trunk/maven-jaxx-plugin/src/test/resour=
ces/testcases/ValidatorOk.xml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/Validat=
orOk.xml	                        (rev 0)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/Validat=
orOk.xml	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,22 @@
+<?xml version=3D"1.0" encoding=3D"UTF-8"?>
+<project xmlns=3D"http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mave=
n.apache.org/maven-v4_0_0.xsd">
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codelutin</groupId>
+                <artifactId>maven-jaxx-plugin</artifactId>
+                <configuration>
+                    <src>${basedir}/src/test/resources</src>
+                    <outJava>${basedir}/target/it-generated-source/java</out=
Java>
+                    <outResource>${basedir}/target/it-generated-source/resou=
rces</outResource>
+                    <force>true</force>
+                    <includes>
+                        <value>**/validator/ok/*.jaxx</value>
+                    </includes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/fo=
rce/JButton.jaxx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/testcases/force/JBut=
ton.jaxx	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/force/J=
Button.jaxx	2008-10-21 07:31:05 UTC (rev 990)
@@ -1 +0,0 @@
-<JButton id=3D'testId' text=3D'test.text'/>
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/for=
ce/JButton.jaxx (from rev 986, lutinjaxx/trunk/maven-jaxx-plugin/src/test/res=
ources/testcases/force/JButton.jaxx)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/force/J=
Button.jaxx	                        (rev 0)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/force/J=
Button.jaxx	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1 @@
+<javax.swing.JButton id=3D'testId' text=3D'test.text'/>
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/i1=
8n/text/JButton.jaxx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/testcases/i18n/text/=
JButton.jaxx	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/i18n/te=
xt/JButton.jaxx	2008-10-21 07:31:05 UTC (rev 990)
@@ -1 +0,0 @@
-<JButton id=3D'testId' text=3D'test.text'/>
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/i18=
n/text/JButton.jaxx (from rev 986, lutinjaxx/trunk/maven-jaxx-plugin/src/test=
/resources/testcases/i18n/text/JButton.jaxx)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/i18n/te=
xt/JButton.jaxx	                        (rev 0)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/i18n/te=
xt/JButton.jaxx	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1 @@
+<javax.swing.JButton id=3D'testId' text=3D'test.text'/>
\ No newline at end of file

Deleted: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/i1=
8n/tooltiptext/JButton.jaxx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/testcases/i18n/toolt=
iptext/JButton.jaxx	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/i18n/to=
oltiptext/JButton.jaxx	2008-10-21 07:31:05 UTC (rev 990)
@@ -1 +0,0 @@
-<JButton id=3D'testId' toolTipText=3D'test.toolTipText'/>
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/i18=
n/tooltiptext/JButton.jaxx (from rev 986, lutinjaxx/trunk/maven-jaxx-plugin/s=
rc/test/resources/testcases/i18n/tooltiptext/JButton.jaxx)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/i18n/to=
oltiptext/JButton.jaxx	                        (rev 0)
+++ lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/i18n/to=
oltiptext/JButton.jaxx	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1 @@
+<javax.swing.JButton id=3D'testId' toolTipText=3D'test.toolTipText'/>
\ No newline at end of file

Copied: lutinjaxx/tags/0.5/maven-jaxx-plugin/src/test/resources/testcases/val=
idator (from rev 968, lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/te=
stcases/validator)

Deleted: lutinjaxx/tags/0.5/pom.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/trunk/pom.xml	2008-10-17 16:44:54 UTC (rev 948)
+++ lutinjaxx/tags/0.5/pom.xml	2008-10-21 07:31:05 UTC (rev 990)
@@ -1,213 +0,0 @@
-<?xml version=3D"1.0" encoding=3D"UTF-8"?>
-<project xmlns=3D"http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://mave=
n.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <!-- ************************************************************* -->
-    <!-- *** POM Relationships *************************************** -->
-    <!-- ************************************************************* -->
-
-    <parent>
-        <groupId>org.codelutin</groupId>
-        <artifactId>lutinproject</artifactId>
-        <version>3.0</version>
-    </parent>
-
-    <artifactId>lutinjaxx</artifactId>
-
-    <modules>
-        <module>jaxx-util</module>
-        <module>jaxx-core</module>
-        <module>jaxx-swing-action</module>
-        <module>maven-jaxx-plugin</module>
-        <!--module>jaxx-example</module-->
-    </modules>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.codelutin</groupId>
-            <artifactId>lutinutil</artifactId>
-        </dependency>
-    </dependencies>
-
-    <!-- ************************************************************* -->
-    <!-- *** Project Information ************************************* -->
-    <!-- ************************************************************* -->
-    <name>lutinjaxx</name>
-    <version>0.5-SNAPSHOT</version>
-    <description>Jaxx lutin library main pom</description>
-    <inceptionYear>2008</inceptionYear>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Settings ****************************************** -->
-    <!-- ************************************************************* -->
-
-    <packaging>pom</packaging>
-
-    <properties>
-
-        <license-switcher.version>0.5-SNAPSHOT</license-switcher.version>
-
-        <!-- current version -->
-        <current.version>0.5-SNAPSHOT</current.version>
-
-        <!-- id du projet du labs -->
-        <labs.id>38</labs.id>
-
-        <labs.project>buix</labs.project>
-
-        <!-- override this property to define scm url property -->
-        <scm.url.son>
-            http://${labs.host}/plugins/scmsvn/viewcvs.php/lutinjaxx/trunk/$=
{pom.artifactId}/?root=3D${labs.project}
-        </scm.url.son>
-
-        <!-- BEWARE, will be suffixed by /${pom.artifactId} by inheritance  =
-->
-        <scm.developerConnection.son>
-            scm:svn:svn+ssh://${username}@${labs.host}/svnroot/${labs.projec=
t}/lutinjaxx/trunk/${pom.artifactId}
-        </scm.developerConnection.son>
-
-        <!-- BEWARE, will be suffixed by /${pom.artifactId} by inheritance  =
-->
-        <scm.connection.son>
-            scm:svn:svn://anonymous@${labs.host}/svnroot/${labs.project}/lut=
injaxx/trunk/${pom.artifactId}
-        </scm.connection.son>
-
-    </properties>
-
-    <build>
-
-        <pluginManagement>
-            <plugins>
-                <plugin>
-                    <groupId>org.codelutin</groupId>
-                    <artifactId>maven-i18n-plugin</artifactId>
-                    <executions>
-                        <execution>
-                            <goals>
-                                <goal>parserJava</goal>
-                                <goal>gen</goal>
-                            </goals>
-                        </execution>
-                    </executions>
-                </plugin>
-            </plugins>
-        </pluginManagement>
-
-        <plugins>
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-javadoc-plugin</artifactId>
-                <executions>
-
-                    <execution>
-                        <phase>pre-site</phase>
-                    </execution>
-                </executions>
-            </plugin>
-
-        </plugins>
-
-    </build>
-
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>org.codelutin</groupId>
-                <artifactId>lutinutil</artifactId>
-                <version>0.31</version>
-            </dependency>
-
-            <dependency>
-                <groupId>org.codelutin</groupId>
-                <artifactId>jaxx-util</artifactId>
-                <version>${current.version}</version>
-            </dependency>
-
-            <dependency>
-                <groupId>org.codelutin</groupId>
-                <artifactId>jaxx-core</artifactId>
-                <version>${current.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.codelutin</groupId>
-                <artifactId>jaxx-swing-action</artifactId>
-                <version>${current.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.codelutin</groupId>
-                <artifactId>jaxx-example</artifactId>
-                <version>${current.version}</version>
-            </dependency>
-
-            <dependency>
-                <groupId>com.sun</groupId>
-                <artifactId>dt</artifactId>
-                <version>${java.version}</version>
-                <scope>system</scope>
-                <systemPath>${java.home}/../lib/dt.jar</systemPath>
-            </dependency>
-
-            <dependency>
-                <groupId>javax.help</groupId>
-                <artifactId>javahelp</artifactId>
-                <version>2.0.02</version>
-            </dependency>
-
-            <dependency>
-                <groupId>org.apache.maven</groupId>
-                <artifactId>maven-plugin-api</artifactId>
-                <version>2.0.4</version>
-                <scope>compile</scope>
-            </dependency>
-
-            <dependency>
-                <groupId>org.apache.maven</groupId>
-                <artifactId>maven-project</artifactId>
-                <version>2.0.4</version>
-                <scope>compile</scope>
-            </dependency>
-
-            <dependency>
-                <groupId>org.codelutin</groupId>
-                <artifactId>lutinpluginutil</artifactId>
-                <version>0.2</version>
-                <scope>compile</scope>
-            </dependency>
-
-            <dependency>
-                <groupId>com.opensymphony</groupId>
-                <artifactId>xwork</artifactId>
-                <version>2.1.1-cl_20081015</version>
-                <!--version>2.1.1</version-->
-            </dependency>
-
-            <dependency>
-                <groupId>org.swinglabs</groupId>
-                <artifactId>jxlayer</artifactId>
-                <version>3.0.1</version>
-            </dependency>
-
-        </dependencies>
-    </dependencyManagement>
-
-    <!-- ************************************************************* -->
-    <!-- *** Build Environment  ************************************** -->
-    <!-- ************************************************************* -->
-    <scm>
-        <connection>${maven.scm.connection}</connection>
-        <developerConnection>${maven.scm.developerConnection}</developerConn=
ection>
-        <url>${maven.scm.url}</url>
-    </scm>
-
-    <profiles>
-        <profile>
-            <id>example</id>
-            <modules>
-                <module>jaxx-example</module>
-            </modules>
-        </profile>
-    </profiles>
-
-</project>

Copied: lutinjaxx/tags/0.5/pom.xml (from rev 989, lutinjaxx/trunk/pom.xml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lutinjaxx/tags/0.5/pom.xml	                        (rev 0)
+++ lutinjaxx/tags/0.5/pom.xml	2008-10-21 07:31:05 UTC (rev 990)
@@ -0,0 +1,216 @@
+<project xmlns=3D"http://maven.apache.org/POM/4.0.0" xmlns:xsi=3D"http://www=
.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D"http://maven.apache.or=
g/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- ************************************************************* -->
+    <!-- *** POM Relationships *************************************** -->
+    <!-- ************************************************************* -->
+
+    <parent>
+        <groupId>org.codelutin</groupId>
+        <artifactId>lutinproject</artifactId>
+        <version>3.0</version>
+    </parent>
+
+    <artifactId>lutinjaxx</artifactId>
+
+    <modules>
+        <module>jaxx-util</module>
+        <module>jaxx-core</module>
+        <module>jaxx-swing-action</module>
+        <module>maven-jaxx-plugin</module>
+        <!--module>jaxx-example</module-->
+    </modules>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.codelutin</groupId>
+            <artifactId>lutinutil</artifactId>
+        </dependency>
+    </dependencies>
+
+    <!-- ************************************************************* -->
+    <!-- *** Project Information ************************************* -->
+    <!-- ************************************************************* -->
+    <name>lutinjaxx</name>
+    <version>0.5</version>
+    <description>Jaxx lutin library main pom</description>
+    <inceptionYear>2008</inceptionYear>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Settings ****************************************** -->
+    <!-- ************************************************************* -->
+
+    <packaging>pom</packaging>
+
+    <properties>
+
+        <!--license-switcher.version>0.5-SNAPSHOT</license-switcher.version-=
->
+
+        <!-- current version -->
+        <current.version>0.5-SNAPSHOT</current.version>
+
+        <!-- id du projet du labs -->
+        <labs.id>38</labs.id>
+
+        <labs.project>buix</labs.project>
+
+        <!-- override this property to define scm url property -->
+        <scm.url.son>
+            http://${labs.host}/plugins/scmsvn/viewcvs.php/lutinjaxx/trunk/$=
{pom.artifactId}/?root=3D${labs.project}
+        </scm.url.son>
+
+        <!-- BEWARE, will be suffixed by /${pom.artifactId} by inheritance  =
-->
+        <scm.developerConnection.son>
+            scm:svn:svn+ssh://${username}@${labs.host}/svnroot/${labs.projec=
t}/lutinjaxx/trunk/${pom.artifactId}
+        </scm.developerConnection.son>
+
+        <!-- BEWARE, will be suffixed by /${pom.artifactId} by inheritance  =
-->
+        <scm.connection.son>
+            scm:svn:svn://anonymous@${labs.host}/svnroot/${labs.project}/lut=
injaxx/trunk/${pom.artifactId}
+        </scm.connection.son>
+
+    </properties>
+
+    <build>
+
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.codelutin</groupId>
+                    <artifactId>maven-i18n-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <goals>
+                                <goal>parserJava</goal>
+                                <goal>gen</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+
+        <plugins>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <executions>
+
+                    <execution>
+                        <phase>pre-site</phase>
+                    </execution>
+                </executions>
+            </plugin>
+
+        </plugins>
+
+    </build>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.codelutin</groupId>
+                <artifactId>lutinutil</artifactId>
+                <version>0.31</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.codelutin</groupId>
+                <artifactId>jaxx-util</artifactId>
+                <version>0.5</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.codelutin</groupId>
+                <artifactId>jaxx-core</artifactId>
+                <version>0.5</version>
+            </dependency>
+            <dependency>
+                <groupId>org.codelutin</groupId>
+                <artifactId>jaxx-swing-action</artifactId>
+                <version>0.5</version>
+            </dependency>
+            <dependency>
+                <groupId>org.codelutin</groupId>
+                <artifactId>jaxx-example</artifactId>
+                <version>0.5</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.sun</groupId>
+                <artifactId>dt</artifactId>
+                <version>${java.version}</version>
+                <scope>system</scope>
+                <systemPath>${java.home}/../lib/dt.jar</systemPath>
+            </dependency>
+
+            <dependency>
+                <groupId>javax.help</groupId>
+                <artifactId>javahelp</artifactId>
+                <version>2.0.02</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.maven</groupId>
+                <artifactId>maven-plugin-api</artifactId>
+                <version>2.0.4</version>
+                <scope>compile</scope>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.maven</groupId>
+                <artifactId>maven-project</artifactId>
+                <version>2.0.4</version>
+                <scope>compile</scope>
+            </dependency>
+
+            <dependency>
+                <groupId>org.codelutin</groupId>
+                <artifactId>lutinpluginutil</artifactId>
+                <version>0.2</version>
+                <scope>compile</scope>
+            </dependency>
+
+            <dependency>
+                <groupId>com.opensymphony</groupId>
+                <artifactId>xwork</artifactId>
+                <version>2.1.1-cl_20081015</version>
+                <!--version>2.1.1</version-->
+            </dependency>
+
+            <dependency>
+                <groupId>org.swinglabs</groupId>
+                <artifactId>jxlayer</artifactId>
+                <version>3.0.1</version>
+            </dependency>
+
+        </dependencies>
+    </dependencyManagement>
+
+    <!-- ************************************************************* -->
+    <!-- *** Build Environment  ************************************** -->
+    <!-- ************************************************************* -->
+    <scm>
+        <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroo=
t/buix/lutinjaxx/tags/0.5</connection>
+        <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise=
.org/svnroot/buix/lutinjaxx/tags/0.5</developerConnection>
+        <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/lut=
injaxx/tags/0.5?root=3Dbuix</url>
+    </scm>
+
+    <profiles>
+        <!-- by default example are included, use -Ddoexample=3Dfalse to dis=
able examples -->
+        <profile>
+            <activation>
+                <property>
+                    <name>doexample</name>
+                    <value>!false</value>
+                </property>
+            </activation>
+            <modules>
+                <module>jaxx-example</module>
+            </modules>
+        </profile>
+    </profiles>
+
+</project>
\ No newline at end of file


--===============5572478069805335687==--


