Jaxx-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
January 2009
- 2 participants
- 81 discussions
05 Jan '09
Author: tchemit
Date: 2009-01-05 09:07:21 +0000 (Mon, 05 Jan 2009)
New Revision: 1121
Added:
jaxx-trash/jaxx/
Removed:
jaxx/
Log:
mise en quarantaine en cours des vieux codes avec un nom explicite pour ne pas choquer...
Copied: jaxx-trash/jaxx (from rev 1120, jaxx)
1
0
Author: tchemit
Date: 2009-01-05 09:06:39 +0000 (Mon, 05 Jan 2009)
New Revision: 1120
Added:
jaxx-trash/
Log:
mise en quarantaine en cours des vieux codes avec un nom explicite pour ne pas choquer...
1
0
[Buix-commits] r1119 - lutinjaxx/branches/storm_1/src/site/fr/rst
by tchemit@users.labs.libre-entreprise.org 05 Jan '09
by tchemit@users.labs.libre-entreprise.org 05 Jan '09
05 Jan '09
Author: tchemit
Date: 2009-01-05 08:52:06 +0000 (Mon, 05 Jan 2009)
New Revision: 1119
Modified:
lutinjaxx/branches/storm_1/src/site/fr/rst/NavigationTreeModel.rst
Log:
orthographe
Modified: lutinjaxx/branches/storm_1/src/site/fr/rst/NavigationTreeModel.rst
===================================================================
--- lutinjaxx/branches/storm_1/src/site/fr/rst/NavigationTreeModel.rst 2009-01-05 08:43:05 UTC (rev 1118)
+++ lutinjaxx/branches/storm_1/src/site/fr/rst/NavigationTreeModel.rst 2009-01-05 08:52:06 UTC (rev 1119)
@@ -22,7 +22,7 @@
Les noeuds présents dans ce modèle sont aussi typés en *jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode*.
-L'idée principale est de pouvoir associé à un noeud précis un chemin depuis la racine, ce que l'on appele *chemin de navigation*.
+L'idée principale est de pouvoir associer à un noeud précis un chemin depuis la racine, ce que l'on appele *chemin de navigation*.
Pour obtenir le chemin de navigation d'un noeud donné, on récupère l'enmseble des neoud depuis la racine vers ce noeud
et les concatène en suffixant par le caractère séparateur défini.
1
0
[Buix-commits] r1118 - in lutinjaxx/branches/storm_1: jaxx-compiler-swing/src/main/java/jaxx/tags/swing jaxx-runtime-swing jaxx-runtime-swing/src/main/java/jaxx/runtime/swing
by tchemit@users.labs.libre-entreprise.org 05 Jan '09
by tchemit@users.labs.libre-entreprise.org 05 Jan '09
05 Jan '09
Author: tchemit
Date: 2009-01-05 08:43:05 +0000 (Mon, 05 Jan 2009)
New Revision: 1118
Modified:
lutinjaxx/branches/storm_1/jaxx-compiler-swing/src/main/java/jaxx/tags/swing/CellHandler.java
lutinjaxx/branches/storm_1/jaxx-runtime-swing/changelog.txt
lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/CardLayout2.java
Log:
improve CardLayout2
reformat code in CellHandler
Modified: lutinjaxx/branches/storm_1/jaxx-compiler-swing/src/main/java/jaxx/tags/swing/CellHandler.java
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-compiler-swing/src/main/java/jaxx/tags/swing/CellHandler.java 2009-01-02 11:02:06 UTC (rev 1117)
+++ lutinjaxx/branches/storm_1/jaxx-compiler-swing/src/main/java/jaxx/tags/swing/CellHandler.java 2009-01-05 08:43:05 UTC (rev 1118)
@@ -21,12 +21,12 @@
import java.io.IOException;
public class CellHandler implements TagHandler {
- public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ public void compileFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
compileChildrenFirstPass(tag, compiler);
}
- public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
Node parent = tag.getParentNode();
if (parent.getNodeType() != Node.ELEMENT_NODE || !parent.getLocalName().equals("row")) {
compiler.reportError("cell tag may only appear within row tag");
@@ -43,50 +43,54 @@
public static void setAttribute(GridBagConstraints c, String name, String value) throws CompilerException {
value = value.trim();
- if (name.equals("insets"))
+ if (name.equals("insets")) {
c.insets = (Insets) TypeManager.convertFromString(value, Insets.class);
- else if (name.equals("weightx"))
+ } else if (name.equals("weightx")) {
c.weightx = Double.parseDouble(value);
- else if (name.equals("weighty"))
+ } else if (name.equals("weighty")) {
c.weighty = Double.parseDouble(value);
- else if (name.equals("columns"))
+ } else if (name.equals("columns")) {
c.gridwidth = Integer.parseInt(value);
- else if (name.equals("rows"))
+ } else if (name.equals("rows")) {
c.gridheight = Integer.parseInt(value);
- else if (name.equals("fill")) {
- if (value.equals("none"))
+ } else if (name.equals("fill")) {
+ if (value.equals("none")) {
c.fill = GridBagConstraints.NONE;
- else if (value.equals("horizontal"))
+ } else if (value.equals("horizontal")) {
c.fill = GridBagConstraints.HORIZONTAL;
- else if (value.equals("vertical"))
+ } else if (value.equals("vertical")) {
c.fill = GridBagConstraints.VERTICAL;
- else if (value.equals("both"))
+ } else if (value.equals("both")) {
c.fill = GridBagConstraints.BOTH;
- else
+ } else {
throw new IllegalArgumentException("invalid value for fill attribute: '" + value + "'");
+ }
} else if (name.equals("anchor")) {
- if (value.equals("north"))
+ //todo use a converter
+ if (value.equals("north")) {
c.anchor = GridBagConstraints.NORTH;
- else if (value.equals("northeast"))
+ } else if (value.equals("northeast")) {
c.anchor = GridBagConstraints.NORTHEAST;
- else if (value.equals("east"))
+ } else if (value.equals("east")) {
c.anchor = GridBagConstraints.EAST;
- else if (value.equals("southeast"))
+ } else if (value.equals("southeast")) {
c.anchor = GridBagConstraints.SOUTHEAST;
- else if (value.equals("south"))
+ } else if (value.equals("south")) {
c.anchor = GridBagConstraints.SOUTH;
- else if (value.equals("southwest"))
+ } else if (value.equals("southwest")) {
c.anchor = GridBagConstraints.SOUTHWEST;
- else if (value.equals("west"))
+ } else if (value.equals("west")) {
c.anchor = GridBagConstraints.WEST;
- else if (value.equals("northwest"))
+ } else if (value.equals("northwest")) {
c.anchor = GridBagConstraints.NORTHWEST;
- else if (value.equals("center"))
+ } else if (value.equals("center")) {
c.anchor = GridBagConstraints.CENTER;
- else
+ } else {
throw new IllegalArgumentException("invalid value for anchor attribute: '" + value + "'");
- } else
+ }
+ } else {
throw new UnsupportedAttributeException(name);
+ }
}
@@ -96,13 +100,14 @@
Attr attribute = (Attr) children.item(i);
String name = attribute.getName();
String value = attribute.getValue();
- if (!name.startsWith("xmlns") && !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI()))
+ if (!name.startsWith("xmlns") && !JAXXCompiler.JAXX_INTERNAL_NAMESPACE.equals(attribute.getNamespaceURI())) {
setAttribute(c, name, value);
+ }
}
}
- protected void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ protected void compileChildrenFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
NodeList children = tag.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node node = children.item(i);
@@ -110,17 +115,17 @@
if (nodeType == Node.ELEMENT_NODE) {
Element child = (Element) node;
compileChildTagFirstPass(child, compiler);
- } else
- if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
+ } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
String text = ((Text) node).getData().trim();
- if (text.length() > 0)
+ if (text.length() > 0) {
compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
+ }
}
}
}
- protected void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ protected void compileChildrenSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
NodeList children = tag.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node node = children.item(i);
@@ -128,22 +133,22 @@
if (nodeType == Node.ELEMENT_NODE) {
Element child = (Element) node;
compileChildTagSecondPass(child, compiler);
- } else
- if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
+ } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
String text = ((Text) node).getData().trim();
- if (text.length() > 0)
+ if (text.length() > 0) {
compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')");
+ }
}
}
}
- protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ protected void compileChildTagFirstPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
compiler.compileFirstPass(tag);
}
- protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
+ protected void compileChildTagSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException {
compiler.compileSecondPass(tag);
}
}
\ No newline at end of file
Modified: lutinjaxx/branches/storm_1/jaxx-runtime-swing/changelog.txt
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-runtime-swing/changelog.txt 2009-01-02 11:02:06 UTC (rev 1117)
+++ lutinjaxx/branches/storm_1/jaxx-runtime-swing/changelog.txt 2009-01-05 08:43:05 UTC (rev 1118)
@@ -1,5 +1,5 @@
-1.0 ???? 200812??
-
+1.0 ???? 2009012??
+ * 20090105 [chemit] - improve CardLayout2
0.8 ??? 200812??
* 20081228 [chemit] - generify ClassDescriptor
- introduce StylesheetHelper helper class to detach Stylesheet, Rule and Selector classes from
Modified: lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/CardLayout2.java
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/CardLayout2.java 2009-01-02 11:02:06 UTC (rev 1117)
+++ lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/CardLayout2.java 2009-01-05 08:43:05 UTC (rev 1118)
@@ -6,6 +6,8 @@
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Insets;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
@@ -34,6 +36,13 @@
/** list of already loaded context (since the {@link #vector} attribute is package visible... */
protected List<Serializable> contexts = new LinkedList<Serializable>();
+ /**
+ * A flag to compute dimension only on visible component.
+ * <p/>
+ * This is usefull when we only care of the visible component.
+ */
+ protected boolean useOnlyVisibleComponentDimension;
+
@Override
public void addLayoutComponent(Component comp, Object constraints) {
super.addLayoutComponent(comp, constraints);
@@ -83,5 +92,113 @@
return container.getComponents()[index];
}
+ /**
+ * Determines the preferred size of the container argument using
+ * this card layout.
+ *
+ * @param parent the parent container in which to do the layout
+ * @return the preferred dimensions to lay out the subcomponents
+ * of the specified container
+ * @see java.awt.Container#getPreferredSize
+ * @see java.awt.CardLayout#minimumLayoutSize
+ */
+ @Override
+ public Dimension preferredLayoutSize(Container parent) {
+ Dimension dimension = null;
+ if (useOnlyVisibleComponentDimension) {
+ Component comp = getVisibleComponent(parent);
+ if (comp != null) {
+ dimension = comp.getPreferredSize();
+ }
+ }
+ if (dimension == null) {
+ dimension = super.preferredLayoutSize(parent);
+ }
+ return dimension;
+ }
+ /**
+ * Calculates the minimum size for the specified panel.
+ *
+ * @param parent the parent container in which to do the layout
+ * @return the minimum dimensions required to lay out the
+ * subcomponents of the specified container
+ * @see java.awt.Container#doLayout
+ * @see java.awt.CardLayout#preferredLayoutSize
+ */
+ @Override
+ public Dimension minimumLayoutSize(Container parent) {
+ Dimension dimension = null;
+ if (useOnlyVisibleComponentDimension) {
+ Component comp = getVisibleComponent(parent);
+ if (comp != null) {
+ dimension = comp.getMinimumSize();
+ }
+ }
+ if (dimension == null) {
+ dimension = super.minimumLayoutSize(parent);
+ }
+ return dimension;
+ }
+
+ /**
+ * Returns the maximum dimensions for this layout given the components
+ * in the specified target container.
+ *
+ * @param target the component which needs to be laid out
+ * @see java.awt.Container
+ * @see #minimumLayoutSize
+ * @see #preferredLayoutSize
+ */
+ @Override
+ public Dimension maximumLayoutSize(Container target) {
+ Dimension dimension = null;
+ if (useOnlyVisibleComponentDimension) {
+ Component comp = getVisibleComponent(target);
+ if (comp != null) {
+ dimension = comp.getMaximumSize();
+ }
+ }
+ if (dimension == null) {
+ dimension = super.maximumLayoutSize(target);
+ }
+ return dimension;
+ }
+
+ /**
+ * Lays out the specified container using this card layout.
+ * <p/>
+ * Each component in the <code>parent</code> container is reshaped
+ * to be the size of the container, minus space for surrounding
+ * insets, horizontal gaps, and vertical gaps.
+ *
+ * @param parent the parent container in which to do the layout
+ * @see java.awt.Container#doLayout
+ */
+ @Override
+ public void layoutContainer(Container parent) {
+ Dimension dimension = null;
+ if (useOnlyVisibleComponentDimension) {
+ Component comp = getVisibleComponent(parent);
+ if (comp != null) {
+ //dimension = comp.getMinimumSize();
+ Insets insets = parent.getInsets();
+ comp.setBounds(getHgap() + insets.left, getVgap() + insets.top,
+ parent.getWidth() - (getHgap() * 2 + insets.left + insets.right),
+ parent.getHeight() - (getVgap() * 2 + insets.top + insets.bottom));
+ } else {
+ super.layoutContainer(parent);
+ }
+ } else {
+ super.layoutContainer(parent);
+ }
+ }
+
+ public boolean isUseOnlyVisibleComponentDimension() {
+ return useOnlyVisibleComponentDimension;
+ }
+
+ public void setUseOnlyVisibleComponentDimension(boolean useOnlyVisibleComponentDimension) {
+ this.useOnlyVisibleComponentDimension = useOnlyVisibleComponentDimension;
+ }
}
1
0
[Buix-commits] r1117 - lutinjaxx/branches/storm_1/jaxx-compiler-swing/src/main/java/jaxx/tags
by tchemit@users.labs.libre-entreprise.org 02 Jan '09
by tchemit@users.labs.libre-entreprise.org 02 Jan '09
02 Jan '09
Author: tchemit
Date: 2009-01-02 11:02:06 +0000 (Fri, 02 Jan 2009)
New Revision: 1117
Removed:
lutinjaxx/branches/storm_1/jaxx-compiler-swing/src/main/java/jaxx/tags/validator/
Log:
unused here
1
0
[Buix-commits] r1116 - in lutinjaxx/branches/storm_1/jaxx-example: . src/main src/main/java src/main/java/examples/Components src/main/resources src/main/resources/i18n src/site/fr/rst
by tchemit@users.labs.libre-entreprise.org 02 Jan '09
by tchemit@users.labs.libre-entreprise.org 02 Jan '09
02 Jan '09
Author: tchemit
Date: 2009-01-02 11:01:42 +0000 (Fri, 02 Jan 2009)
New Revision: 1116
Added:
lutinjaxx/branches/storm_1/jaxx-example/src/main/java/
lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/
lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Calculator.css
lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CalculatorDemo.jaxx
lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CalculatorEngine.java
lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Components.jaxx
lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CounterDemo.jaxx
lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/
lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/examples/
lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/
lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-en_GB.properties
lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-fr_FR.properties
lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/log4j.properties
lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/images/
lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst
Removed:
lutinjaxx/branches/storm_1/jaxx-example/Components/
lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Components.jaxx
lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-en_GB.properties
lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-fr_FR.properties
lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst
Modified:
lutinjaxx/branches/storm_1/jaxx-example/pom.xml
Log:
1 seul module d'exemple :)
Modified: lutinjaxx/branches/storm_1/jaxx-example/pom.xml
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-example/pom.xml 2009-01-02 08:27:33 UTC (rev 1115)
+++ lutinjaxx/branches/storm_1/jaxx-example/pom.xml 2009-01-02 11:01:42 UTC (rev 1116)
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -21,30 +22,31 @@
<artifactId>jaxx-runtime-swing</artifactId>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>org.codelutin</groupId>
+ <artifactId>jaxx-runtime-validator</artifactId>
+ <scope>compile</scope>
+ </dependency>
</dependencies>
- <modules>
- <module>Components</module>
- </modules>
-
<!-- ************************************************************* -->
<!-- *** Project Information ************************************* -->
<!-- ************************************************************* -->
<name>jaxx-example</name>
- <description>Jaxx Example super pom</description>
+ <description>Jaxx Examples</description>
<!-- ************************************************************* -->
<!-- *** Build Settings ****************************************** -->
<!-- ************************************************************* -->
- <packaging>pom</packaging>
+ <packaging>jar</packaging>
<properties>
<!-- this property must be defined here, since it can be override by a profile -->
- <maven.jar.main.class>examples.${project.artifactId}.${project.artifactId}</maven.jar.main.class>
+ <maven.jar.main.class>examples.Components.Components</maven.jar.main.class>
<!-- jnlp -->
<keystorepath>${codelutin.keystorepath}</keystorepath>
@@ -65,6 +67,22 @@
</scm>
<build>
+
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.jaxx</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ </resources>
+
<pluginManagement>
<plugins>
@@ -86,6 +104,29 @@
</plugin>
<plugin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-i18n-plugin</artifactId>
+ <configuration>
+ <entries>
+ <entry>
+ <basedir>${maven.gen.dir}/java/</basedir>
+ <includes>
+ <param>**\/**.java</param>
+ </includes>
+ </entry>
+ </entries>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>parserJava</goal>
+ <goal>gen</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
@@ -144,21 +185,29 @@
<phase>compile</phase>
<configuration>
<tasks>
- <mkdir dir="${jnlp.build.directory}" />
- <copy file="${project.basedir}/../src/main/jnlp/sun.jnlp" verbose="${maven.verbose}" todir="${jnlp.build.directory}" failonerror="false">
+ <mkdir dir="${jnlp.build.directory}"/>
+ <copy file="${project.basedir}/src/main/jnlp/sun.jnlp"
+ verbose="${maven.verbose}" todir="${jnlp.build.directory}"
+ failonerror="false">
<filterset>
- <filter token="lib" value="javahelp-2.0.02.jar" />
- <filter token="url" value="${project.url}" />
+ <filter token="lib" value="javahelp-2.0.02.jar"/>
+ <filter token="url" value="${project.url}"/>
</filterset>
</copy>
- <copy file="${project.basedir}/../src/main/jnlp/jxlayer.jnlp" verbose="${maven.verbose}" todir="${jnlp.build.directory}" failonerror="false">
+ <copy file="${project.basedir}/src/main/jnlp/jxlayer.jnlp"
+ verbose="${maven.verbose}" todir="${jnlp.build.directory}"
+ failonerror="false">
<filterset>
- <filter token="lib" value="jxlayer-3.0.1.jar" />
- <filter token="url" value="${project.url}" />
+ <filter token="lib" value="jxlayer-3.0.1.jar"/>
+ <filter token="url" value="${project.url}"/>
</filterset>
</copy>
- <copy file="${project.build.directory}/lib/javahelp-2.0.02.jar" verbose="${maven.verbose}" todir="${jnlp.build.directory}/lib" failonerror="false" />
- <copy file="${project.build.directory}/lib/jxlayer-3.0.1.jar" verbose="${maven.verbose}" todir="${jnlp.build.directory}/lib" failonerror="false" />
+ <copy file="${project.build.directory}/lib/javahelp-2.0.02.jar"
+ verbose="${maven.verbose}" todir="${jnlp.build.directory}/lib"
+ failonerror="false"/>
+ <copy file="${project.build.directory}/lib/jxlayer-3.0.1.jar"
+ verbose="${maven.verbose}" todir="${jnlp.build.directory}/lib"
+ failonerror="false"/>
</tasks>
</configuration>
<goals>
@@ -171,10 +220,11 @@
<phase>pre-site</phase>
<configuration>
<tasks>
- <mkdir dir="${maven.site.gen.dir}/resources" />
- <copy todir="${maven.site.gen.dir}/resources" verbose="${maven.verbose}" failonerror="false" overwrite="false">
+ <mkdir dir="${maven.site.gen.dir}/resources"/>
+ <copy todir="${maven.site.gen.dir}/resources" verbose="${maven.verbose}"
+ failonerror="false" overwrite="false">
<fileset dir="${jnlp.build.directory}">
- <include name="**" />
+ <include name="**"/>
</fileset>
</copy>
</tasks>
@@ -219,17 +269,17 @@
<sign>
<keystore>${keystorepath}</keystore>
- <keypass />
+ <keypass/>
<storepass>${keystorepass}</storepass>
- <storetype />
+ <storetype/>
<alias>${keystorealias}</alias>
- <validity />
- <dnameCn />
- <dnameOu />
- <dnameO />
- <dnameL />
- <dnameSt />
- <dnameC />
+ <validity/>
+ <dnameCn/>
+ <dnameOu/>
+ <dnameO/>
+ <dnameL/>
+ <dnameSt/>
+ <dnameC/>
<verify>true</verify>
<keystoreConfig>
<delete>false</delete>
Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples (from rev 1109, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/java/examples)
Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Calculator.css (from rev 1111, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/java/examples/Components/Calculator.css)
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Calculator.css (rev 0)
+++ lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Calculator.css 2009-01-02 11:01:42 UTC (rev 1116)
@@ -0,0 +1,49 @@
+
+#table {
+ border: {BorderFactory.createEmptyBorder(4, 4, 4, 4)};
+ font-face: "Trebuchet MS";
+}
+
+#display {
+ background: #BCE5AD;
+ opaque: true;
+ horizontalAlignment: right;
+ border: {BorderFactory.createBevelBorder(BevelBorder.LOWERED)};
+ font-size: 22;
+ font-weight: bold;
+}
+
+#display:{object.getText().startsWith("-")} {
+ foreground: red;
+}
+
+JButton {
+ font-size: 18;
+ width: 80;
+ height: 35;
+}
+
+JButton.digit {
+ foreground: blue;
+}
+
+JButton#dot {
+ font-size: 20;
+}
+
+JButton.operator {
+ font-size: 16;
+ foreground: #009900;
+}
+
+JButton.clear {
+ foreground: red;
+}
+
+JButton:mouseover {
+ font-weight: bold;
+}
+
+JButton.operator:mouseover {
+ font-weight: normal;
+}
\ No newline at end of file
Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CalculatorDemo.jaxx (from rev 1111, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/java/examples/Components/CalculatorDemo.jaxx)
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CalculatorDemo.jaxx (rev 0)
+++ lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CalculatorDemo.jaxx 2009-01-02 11:01:42 UTC (rev 1116)
@@ -0,0 +1,49 @@
+<DemoPanel>
+ <style source='Calculator.css'/>
+ <script><![CDATA[
+ plus.setText("+");
+ sign.setText("+/-");
+]]></script>
+ <!-- use fully-qualified name just in case this is compiled into a different package -->
+ <examples.Components.CalculatorEngine id='engine'/>
+
+ <Table id='demoPanel' fill='both'>
+ <row>
+ <cell columns='4'><JLabel id='display' text='{engine.getDisplayText()}'/></cell>
+ </row>
+
+ <row>
+ <cell columns='2'><JButton id='c' text='C' onActionPerformed='engine.clear()' styleClass='clear'/></cell>
+ <cell><JButton id='ce' text='CE' onActionPerformed='engine.clearEntry()' styleClass='clear'/></cell>
+ <cell><JButton id='equals' text='=' onActionPerformed='engine.equal()' styleClass='operator'/></cell>
+ </row>
+
+ <row>
+ <cell><JButton id='d7' text='7' onActionPerformed='engine.digit(7)' styleClass='digit'/></cell>
+ <cell><JButton id='d8' text='8' onActionPerformed='engine.digit(8)' styleClass='digit'/></cell>
+ <cell><JButton id='d9' text='9' onActionPerformed='engine.digit(9)' styleClass='digit'/></cell>
+ <cell><JButton id='plus' onActionPerformed='engine.add()' styleClass='operator'/></cell>
+ </row>
+
+ <row>
+ <cell><JButton id='d4' text='4' onActionPerformed='engine.digit(4)' styleClass='digit'/></cell>
+ <cell><JButton id='d5' text='5' onActionPerformed='engine.digit(5)' styleClass='digit'/></cell>
+ <cell><JButton id='d6' text='6' onActionPerformed='engine.digit(6)' styleClass='digit'/></cell>
+ <cell><JButton id='subtract' text='-' onActionPerformed='engine.subtract()' styleClass='operator'/></cell>
+ </row>
+
+ <row>
+ <cell><JButton id='d1' text='1' onActionPerformed='engine.digit(1)' styleClass='digit'/></cell>
+ <cell><JButton id='d2' text='2' onActionPerformed='engine.digit(2)' styleClass='digit'/></cell>
+ <cell><JButton id='d3' text='3' onActionPerformed='engine.digit(3)' styleClass='digit'/></cell>
+ <cell><JButton id='multiply' text='x' onActionPerformed='engine.multiply()' styleClass='operator'/></cell>
+ </row>
+
+ <row>
+ <cell><JButton id='d0' text='0' onActionPerformed='engine.digit(0)' styleClass='digit'/></cell>
+ <cell><JButton id='sign' onActionPerformed='engine.toggleSign()' styleClass='operator'/></cell>
+ <cell><JButton id='dot' text='.' onActionPerformed='engine.dot()' styleClass='digit'/></cell>
+ <cell><JButton id='divide' text='÷' onActionPerformed='engine.divide()' styleClass='operator'/></cell>
+ </row>
+ </Table>
+</DemoPanel>
\ No newline at end of file
Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CalculatorEngine.java (from rev 1111, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/java/examples/Components/CalculatorEngine.java)
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CalculatorEngine.java (rev 0)
+++ lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CalculatorEngine.java 2009-01-02 11:01:42 UTC (rev 1116)
@@ -0,0 +1,165 @@
+package examples.Components;
+
+import java.beans.*;
+import java.math.*;
+
+public class CalculatorEngine {
+ public static final String DISPLAY_TEXT_PROPERTY = "displayText";
+
+ public static final int ADD = 0;
+ public static final int SUBTRACT = 1;
+ public static final int MULTIPLY =2;
+ public static final int DIVIDE = 3;
+ public static final int RESULT = 4;
+
+ private int operation = -1;
+ private boolean clear = true; // true to clear on next key
+ private String displayText = "0";
+ private BigDecimal value;
+ private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
+
+
+ public String getDisplayText() {
+ return displayText;
+ }
+
+
+ public void setDisplayText(String displayText) {
+ String oldDisplayText = this.displayText;
+ this.displayText = displayText;
+ firePropertyChange(DISPLAY_TEXT_PROPERTY, oldDisplayText, displayText);
+ }
+
+
+ public void clear() {
+ clearEntry();
+ value = new BigDecimal(0);
+ operation = -1;
+ }
+
+
+ public void clearEntry() {
+ setDisplayText("0");
+ clear = true;
+ }
+
+
+ private void checkClear() {
+ if (clear) {
+ setDisplayText("");
+ clear = false;
+ }
+ }
+
+
+ public void digit(int digit) {
+ checkClear();
+ setDisplayText(getDisplayText() + String.valueOf(digit));
+ }
+
+
+ public void dot() {
+ checkClear();
+ if (getDisplayText().indexOf('.') == -1) {
+ if (getDisplayText().length() == 0)
+ setDisplayText("0.");
+ else
+ setDisplayText(getDisplayText() + '.');
+ }
+ }
+
+
+ public void toggleSign() {
+ String text = getDisplayText();
+ if (text.startsWith("-"))
+ text = text.substring(1);
+ else if (!text.equals("0"))
+ text = '-' + text;
+ setDisplayText(text);
+ }
+
+
+ public void equal() {
+ BigDecimal displayValue = new BigDecimal(getDisplayText());
+ BigDecimal newValue = displayValue;
+ switch (operation) {
+ case ADD: newValue = value.add(displayValue); break;
+ case SUBTRACT: newValue = value.subtract(displayValue); break;
+ case MULTIPLY: newValue = value.multiply(displayValue); break;
+ case DIVIDE: newValue = value.divide(displayValue, 8, BigDecimal.ROUND_HALF_UP); break;
+ }
+ value = newValue;
+ setDisplayText(toString(newValue));
+ clear = true;
+ operation = -1;
+ }
+
+
+ public static String toString(BigDecimal decimal) {
+ // can't use stripTrailingZeros, as it wasn't introduced until 1.5
+ String result = decimal.toString();
+ if (result.indexOf(".") != -1) {
+ while (result.endsWith("0"))
+ result = result.substring(0, result.length() - 1);
+ if (result.endsWith("."))
+ result = result.substring(0, result.length() - 1);
+ }
+ return result;
+ }
+
+
+ public void operation(int operation) {
+ if (this.operation != -1)
+ equal();
+ else {
+ value = new BigDecimal(getDisplayText());
+ clear = true;
+ }
+ this.operation = operation;
+ }
+
+
+ public void add() {
+ operation(ADD);
+ }
+
+
+ public void subtract() {
+ operation(SUBTRACT);
+ }
+
+
+ public void multiply() {
+ operation(MULTIPLY);
+ }
+
+
+ public void divide() {
+ operation(DIVIDE);
+ }
+
+
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(listener);
+ }
+
+
+ public void addPropertyChangeListener(String property, PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(property, listener);
+ }
+
+
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(listener);
+ }
+
+
+ public void removePropertyChangeListener(String property, PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(property, listener);
+ }
+
+
+ protected void firePropertyChange(String property, Object oldValue, Object newValue) {
+ propertyChangeSupport.firePropertyChange(property, oldValue, newValue);
+ }
+}
\ No newline at end of file
Deleted: lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Components.jaxx
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/java/examples/Components/Components.jaxx 2008-12-30 15:31:02 UTC (rev 1109)
+++ lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Components.jaxx 2009-01-02 11:01:42 UTC (rev 1116)
@@ -1,100 +0,0 @@
-<Application title="Component Demo" width='1024' height='800' defaultCloseOperation='exit_on_close'>
- <script><![CDATA[
-protected void changePanel() {
- Object value = list.getSelectionValue();
- if (value instanceof DemoPanel) {
- cardLayout.show(preview, ((DemoPanel) value).getLabel());
- }
-}
-
-// init i18n
-org.codelutin.i18n.I18n.init();
-
-]]></script>
- <JSplitPane>
- <!--JSplitPane dividerLocation='200'-->
- <JScrollPane>
- <JTree id='list' showsRootHandles='true' onValueChanged='changePanel()'
- cellRenderer='{new javax.swing.tree.DefaultTreeCellRenderer() {
- public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
- if (value instanceof DemoPanel)
- value = ((DemoPanel) value).getLabel();
- return super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
- }
- }
- }'>
- <item value='Buttons'>
- <item value='{buttonDemo}'/>
- <item value='{checkBoxDemo}'/>
- <item value='{radioButtonDemo}'/>
- <item value='{toggleButtonDemo}'/>
- </item>
-
- <item value='Form elements'>
- <item value='Text'>
- <item value='{passwordFieldDemo}'/>
- <item value='{textFieldDemo}'/>
- <item value='{textAreaDemo}'/>
- </item>
-
- <item value='{comboBoxDemo}'/>
- <item value='{listDemo}'/>
- <item value='{sliderDemo}'/>
- <item value='{spinnerDemo}'/>
- </item>
-
- <item value='Layout components'>
- <item value='{splitPaneDemo}'/>
- </item>
-
- <item value='Menus'>
- <item value='{menuItemDemo}'/>
- <item value='{checkBoxMenuItemDemo}'/>
- <item value='{radioButtonMenuItemDemo}'/>
- </item>
-
- <item value='Windows'>
- <item value='{dialogDemo}'/>
- </item>
-
- <item value='{progressBarDemo}'/>
-
- <item value='{labelStyleDemo}'/>
-
- <item value='New features'>
- <item value='Validation'>
- <item value='{validationDemo1}'/>
- <item value='{validationDemo2}'/>
- </item>
- <item value='{dataBindingDemo}'/>
- </item>
- </JTree>
- </JScrollPane>
-
- <java.awt.CardLayout id='cardLayout'/>
-
- <JPanel id='preview' layout='{cardLayout}'>
- <JButtonDemo id='buttonDemo' constraints='buttonDemo.getLabel()'/>
- <JCheckBoxDemo id='checkBoxDemo' constraints='checkBoxDemo.getLabel()'/>
- <JCheckBoxMenuItemDemo id='checkBoxMenuItemDemo' constraints='checkBoxMenuItemDemo.getLabel()'/>
- <JComboBoxDemo id='comboBoxDemo' constraints='comboBoxDemo.getLabel()'/>
- <JDialogDemo id='dialogDemo' constraints='dialogDemo.getLabel()'/>
- <JListDemo id='listDemo' constraints='listDemo.getLabel()'/>
- <JMenuItemDemo id='menuItemDemo' constraints='menuItemDemo.getLabel()'/>
- <JPasswordFieldDemo id='passwordFieldDemo' constraints='passwordFieldDemo.getLabel()'/>
- <JProgressBarDemo id='progressBarDemo' constraints='progressBarDemo.getLabel()'/>
- <JSliderDemo id='sliderDemo' constraints='sliderDemo.getLabel()'/>
- <JSpinnerDemo id='spinnerDemo' constraints='spinnerDemo.getLabel()'/>
- <JSplitPaneDemo id='splitPaneDemo' constraints='splitPaneDemo.getLabel()'/>
- <JRadioButtonDemo id='radioButtonDemo' constraints='radioButtonDemo.getLabel()'/>
- <JRadioButtonMenuItemDemo id='radioButtonMenuItemDemo' constraints='radioButtonMenuItemDemo.getLabel()'/>
- <JToggleButtonDemo id='toggleButtonDemo' constraints='toggleButtonDemo.getLabel()'/>
- <JTextFieldDemo id='textFieldDemo' constraints='textFieldDemo.getLabel()'/>
- <JTextAreaDemo id='textAreaDemo' constraints='textAreaDemo.getLabel()'/>
- <ValidationListDemo id='validationDemo1' constraints='validationDemo1.getLabel()'/>
- <ValidationTableDemo id='validationDemo2' constraints='validationDemo2.getLabel()'/>
- <BeanDataBindingDemo id='dataBindingDemo' constraints='dataBindingDemo.getLabel()'/>
- <LabelStyleDemo id='labelStyleDemo' constraints='labelStyleDemo.getLabel()'/>
- </JPanel>
- </JSplitPane>
-</Application>
\ No newline at end of file
Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Components.jaxx (from rev 1111, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/java/examples/Components/Components.jaxx)
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Components.jaxx (rev 0)
+++ lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Components.jaxx 2009-01-02 11:01:42 UTC (rev 1116)
@@ -0,0 +1,108 @@
+<Application title="Component Demo" width='1024' height='800' defaultCloseOperation='exit_on_close'>
+ <script><![CDATA[
+protected void changePanel() {
+ Object value = list.getSelectionValue();
+ if (value instanceof DemoPanel) {
+ cardLayout.show(preview, ((DemoPanel) value).getLabel());
+ }
+}
+
+// init i18n
+org.codelutin.i18n.I18n.init();
+
+]]></script>
+ <JSplitPane>
+ <!--JSplitPane dividerLocation='200'-->
+ <JScrollPane>
+ <JTree id='list' showsRootHandles='true' onValueChanged='changePanel()'
+ cellRenderer='{new javax.swing.tree.DefaultTreeCellRenderer() {
+ public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
+ if (value instanceof DemoPanel)
+ value = ((DemoPanel) value).getLabel();
+ return super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
+ }
+ }
+ }'>
+ <item value="Components">
+ <item value='Buttons'>
+ <item value='{buttonDemo}'/>
+ <item value='{checkBoxDemo}'/>
+ <item value='{radioButtonDemo}'/>
+ <item value='{toggleButtonDemo}'/>
+ </item>
+
+ <item value='Form elements'>
+ <item value='Text'>
+ <item value='{passwordFieldDemo}'/>
+ <item value='{textFieldDemo}'/>
+ <item value='{textAreaDemo}'/>
+ </item>
+
+ <item value='{comboBoxDemo}'/>
+ <item value='{listDemo}'/>
+ <item value='{sliderDemo}'/>
+ <item value='{spinnerDemo}'/>
+ </item>
+
+ <item value='Layout components'>
+ <item value='{splitPaneDemo}'/>
+ </item>
+
+ <item value='Menus'>
+ <item value='{menuItemDemo}'/>
+ <item value='{checkBoxMenuItemDemo}'/>
+ <item value='{radioButtonMenuItemDemo}'/>
+ </item>
+
+ <item value='Windows'>
+ <item value='{dialogDemo}'/>
+ </item>
+
+ <item value='{progressBarDemo}'/>
+
+ </item>
+
+ <item value='{labelStyleDemo}'/>
+
+ <item value='{counterDemo}'/>
+ <item value='{calculatorDemo}'/>
+
+ <item value='New features'>
+ <item value='Validation'>
+ <item value='{validationDemo1}'/>
+ <item value='{validationDemo2}'/>
+ </item>
+ <item value='{dataBindingDemo}'/>
+ </item>
+ </JTree>
+ </JScrollPane>
+
+ <java.awt.CardLayout id='cardLayout'/>
+
+ <JPanel id='preview' layout='{cardLayout}'>
+ <JButtonDemo id='buttonDemo' constraints='buttonDemo.getLabel()'/>
+ <JCheckBoxDemo id='checkBoxDemo' constraints='checkBoxDemo.getLabel()'/>
+ <JCheckBoxMenuItemDemo id='checkBoxMenuItemDemo' constraints='checkBoxMenuItemDemo.getLabel()'/>
+ <JComboBoxDemo id='comboBoxDemo' constraints='comboBoxDemo.getLabel()'/>
+ <JDialogDemo id='dialogDemo' constraints='dialogDemo.getLabel()'/>
+ <JListDemo id='listDemo' constraints='listDemo.getLabel()'/>
+ <JMenuItemDemo id='menuItemDemo' constraints='menuItemDemo.getLabel()'/>
+ <JPasswordFieldDemo id='passwordFieldDemo' constraints='passwordFieldDemo.getLabel()'/>
+ <JProgressBarDemo id='progressBarDemo' constraints='progressBarDemo.getLabel()'/>
+ <JSliderDemo id='sliderDemo' constraints='sliderDemo.getLabel()'/>
+ <JSpinnerDemo id='spinnerDemo' constraints='spinnerDemo.getLabel()'/>
+ <JSplitPaneDemo id='splitPaneDemo' constraints='splitPaneDemo.getLabel()'/>
+ <JRadioButtonDemo id='radioButtonDemo' constraints='radioButtonDemo.getLabel()'/>
+ <JRadioButtonMenuItemDemo id='radioButtonMenuItemDemo' constraints='radioButtonMenuItemDemo.getLabel()'/>
+ <JToggleButtonDemo id='toggleButtonDemo' constraints='toggleButtonDemo.getLabel()'/>
+ <JTextFieldDemo id='textFieldDemo' constraints='textFieldDemo.getLabel()'/>
+ <JTextAreaDemo id='textAreaDemo' constraints='textAreaDemo.getLabel()'/>
+ <ValidationListDemo id='validationDemo1' constraints='validationDemo1.getLabel()'/>
+ <ValidationTableDemo id='validationDemo2' constraints='validationDemo2.getLabel()'/>
+ <BeanDataBindingDemo id='dataBindingDemo' constraints='dataBindingDemo.getLabel()'/>
+ <LabelStyleDemo id='labelStyleDemo' constraints='labelStyleDemo.getLabel()'/>
+ <CounterDemo id='counterDemo' constraints='counterDemo.getLabel()'/>
+ <CalculatorDemo id='calculatorDemo' constraints='calculatorDemo.getLabel()'/>
+ </JPanel>
+ </JSplitPane>
+</Application>
\ No newline at end of file
Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CounterDemo.jaxx (from rev 1111, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/java/examples/Components/CounterDemo.jaxx)
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CounterDemo.jaxx (rev 0)
+++ lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CounterDemo.jaxx 2009-01-02 11:01:42 UTC (rev 1116)
@@ -0,0 +1,12 @@
+<DemoPanel>
+ <script>int count;</script>
+ <JPanel id='demoPanel'>
+ <JTextField text='{count}' constraints='BorderLayout.NORTH'/>
+ <HBox constraints='BorderLayout.SOUTH'>
+ <JButton text='Dec (-)' onActionPerformed='count--'/>
+ <JButton text='Reset' onActionPerformed='count = 0'/>
+ <JButton text='Inc (+)' onActionPerformed='count++'/>
+ </HBox>
+ </JPanel>
+
+</DemoPanel>
\ No newline at end of file
Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/examples (from rev 1109, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/resources/examples)
Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n (from rev 1109, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/resources/i18n)
Deleted: lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-en_GB.properties
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/resources/i18n/Components-en_GB.properties 2008-12-30 15:31:02 UTC (rev 1109)
+++ lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-en_GB.properties 2009-01-02 11:01:42 UTC (rev 1116)
@@ -1,83 +0,0 @@
-1=
-10=
-12=
-14=
-18=
-2=
-24=
-3=
-Age\:=
-Animal=
-Blue=
-Blue\:=
-Bold=
-Button\ label\:=
-Cancel=
-Comments\:=
-Component\ Demo=
-Config\ file\ \:=
-Config\ file\:=
-Cyan=
-Demo=
-Directory\ file\:=
-Editable=
-Email\ Address\:=
-Email\:=
-Enabled=
-Fancy\ Button=
-First\ Name\:=
-FirstName\:=
-Font\ size=
-Green=
-Green\:=
-Greet=
-Italic=
-JMenu\ demo=
-Last\ Name\:=
-LastName\:=
-Message\ Box=
-Mineral=
-Normal\ text\:=
-OK=
-Orange=
-Password\:=
-Purple=
-Ratio\:=
-Red=
-Red\:=
-Show\ Background=
-Show\ password\ dialog=
-Sign\ on=
-Simple\ Button=
-Size\:=
-Source=
-Spacing\:=
-Start=
-Stop=
-Supported\ Swing\ components\:=
-Text2\:=
-Text\:=
-Underline=
-Upper\ case\ text\:=
-Use\ the\ spinner\ to=
-Username\:=
-Vegetable=
-View=
-Welcome\ to\ the\ JAXX\ framework\!=
-Working\ directory\:=
-Yellow=
-Your\ name\:=
-adjust\ the\ spacing=
-between\ these\ lines=
-cancel=
-close=
-close2=
-close3=
-edit=
-edit2=
-edit3=
-ttt=
-valid=
-validator.field=Champ
-validator.message=Message
-validator.scope=...
Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-en_GB.properties (from rev 1111, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/resources/i18n/Components-en_GB.properties)
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-en_GB.properties (rev 0)
+++ lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-en_GB.properties 2009-01-02 11:01:42 UTC (rev 1116)
@@ -0,0 +1,99 @@
+-=
+.=
+0=
+1=
+10=
+12=
+14=
+18=
+2=
+24=
+3=
+4=
+5=
+6=
+7=
+8=
+9=
+Age\:=
+Animal=
+Blue=
+Blue\:=
+Bold=
+Button\ label\:=
+C=
+CE=
+Cancel=
+Comments\:=
+Component\ Demo=
+Config\ file\ \:=
+Config\ file\:=
+Cyan=
+Dec\ (-)=
+Demo=
+Directory\ file\:=
+Editable=
+Email\ Address\:=
+Email\:=
+Enabled=
+Fancy\ Button=
+First\ Name\:=
+FirstName\:=
+Font\ size=
+Green=
+Green\:=
+Greet=
+Inc\ (+)=
+Italic=
+JMenu\ demo=
+Last\ Name\:=
+LastName\:=
+Message\ Box=
+Mineral=
+Normal\ text\:=
+OK=
+Orange=
+Password\:=
+Purple=
+Ratio\:=
+Red=
+Red\:=
+Reset=
+Show\ Background=
+Show\ password\ dialog=
+Sign\ on=
+Simple\ Button=
+Size\:=
+Source=
+Spacing\:=
+Start=
+Stop=
+Supported\ Swing\ components\:=
+Text2\:=
+Text\:=
+Underline=
+Upper\ case\ text\:=
+Use\ the\ spinner\ to=
+Username\:=
+Vegetable=
+View=
+Welcome\ to\ the\ JAXX\ framework\!=
+Working\ directory\:=
+Yellow=
+Your\ name\:=
+\\u00f7=
+adjust\ the\ spacing=
+between\ these\ lines=
+cancel=
+close=
+close2=
+close3=
+edit=
+edit2=
+edit3=
+ttt=
+valid=
+validator.field=Champ
+validator.message=Message
+validator.scope=...
+x=
Deleted: lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-fr_FR.properties
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/resources/i18n/Components-fr_FR.properties 2008-12-30 15:31:02 UTC (rev 1109)
+++ lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-fr_FR.properties 2009-01-02 11:01:42 UTC (rev 1116)
@@ -1,83 +0,0 @@
-1=
-10=
-12=
-14=
-18=
-2=
-24=
-3=
-Age\:=
-Animal=
-Blue=
-Blue\:=
-Bold=
-Button\ label\:=
-Cancel=
-Comments\:=
-Component\ Demo=
-Config\ file\ \:=
-Config\ file\:=
-Cyan=
-Demo=
-Directory\ file\:=
-Editable=
-Email\ Address\:=
-Email\:=
-Enabled=
-Fancy\ Button=
-First\ Name\:=
-FirstName\:=
-Font\ size=
-Green=
-Green\:=
-Greet=
-Italic=
-JMenu\ demo=
-Last\ Name\:=
-LastName\:=
-Message\ Box=
-Mineral=
-Normal\ text\:=
-OK=
-Orange=
-Password\:=
-Purple=
-Ratio\:=
-Red=
-Red\:=
-Show\ Background=
-Show\ password\ dialog=
-Sign\ on=
-Simple\ Button=
-Size\:=
-Source=
-Spacing\:=
-Start=
-Stop=
-Supported\ Swing\ components\:=
-Text2\:=
-Text\:=
-Underline=
-Upper\ case\ text\:=
-Use\ the\ spinner\ to=
-Username\:=
-Vegetable=
-View=
-Welcome\ to\ the\ JAXX\ framework\!=
-Working\ directory\:=
-Yellow=
-Your\ name\:=
-adjust\ the\ spacing=
-between\ these\ lines=
-cancel=
-close=
-close2=
-close3=
-edit=
-edit2=
-edit3=
-ttt=
-valid=
-validator.field=Champ
-validator.message=Message
-validator.scope=...
Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-fr_FR.properties (from rev 1111, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/resources/i18n/Components-fr_FR.properties)
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-fr_FR.properties (rev 0)
+++ lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-fr_FR.properties 2009-01-02 11:01:42 UTC (rev 1116)
@@ -0,0 +1,99 @@
+-=
+.=
+0=
+1=
+10=
+12=
+14=
+18=
+2=
+24=
+3=
+4=
+5=
+6=
+7=
+8=
+9=
+Age\:=
+Animal=
+Blue=
+Blue\:=
+Bold=
+Button\ label\:=
+C=
+CE=
+Cancel=
+Comments\:=
+Component\ Demo=
+Config\ file\ \:=
+Config\ file\:=
+Cyan=
+Dec\ (-)=
+Demo=
+Directory\ file\:=
+Editable=
+Email\ Address\:=
+Email\:=
+Enabled=
+Fancy\ Button=
+First\ Name\:=
+FirstName\:=
+Font\ size=
+Green=
+Green\:=
+Greet=
+Inc\ (+)=
+Italic=
+JMenu\ demo=
+Last\ Name\:=
+LastName\:=
+Message\ Box=
+Mineral=
+Normal\ text\:=
+OK=
+Orange=
+Password\:=
+Purple=
+Ratio\:=
+Red=
+Red\:=
+Reset=
+Show\ Background=
+Show\ password\ dialog=
+Sign\ on=
+Simple\ Button=
+Size\:=
+Source=
+Spacing\:=
+Start=
+Stop=
+Supported\ Swing\ components\:=
+Text2\:=
+Text\:=
+Underline=
+Upper\ case\ text\:=
+Use\ the\ spinner\ to=
+Username\:=
+Vegetable=
+View=
+Welcome\ to\ the\ JAXX\ framework\!=
+Working\ directory\:=
+Yellow=
+Your\ name\:=
+\\u00f7=
+adjust\ the\ spacing=
+between\ these\ lines=
+cancel=
+close=
+close2=
+close3=
+edit=
+edit2=
+edit3=
+ttt=
+valid=
+validator.field=Champ
+validator.message=Message
+validator.scope=...
+x=
Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/log4j.properties (from rev 1109, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/resources/log4j.properties)
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/log4j.properties (rev 0)
+++ lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/log4j.properties 2009-01-02 11:01:42 UTC (rev 1116)
@@ -0,0 +1,9 @@
+# Global logging configuration
+log4j.rootLogger=INFO, stdout
+# Console output...
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) %M - %m%n
+
+#log4j.logger.org.codelutin.jaxx=DEBUG
+log4j.logger.examples=DEBUG
Property changes on: lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/log4j.properties
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/images (from rev 1109, lutinjaxx/branches/storm_1/jaxx-example/Components/src/site/fr/rst/images)
Deleted: lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst 2009-01-02 08:27:33 UTC (rev 1115)
+++ lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst 2009-01-02 11:01:42 UTC (rev 1116)
@@ -1,28 +0,0 @@
-========
-Exemples
-========
-
-Here are some simple example programs to give you an idea of what JAXX is all about:
-
- * JAXXEdit - A complete application written using JAXX for the GUI.
-
- * Components_
- Comprehensive demo which displays most of the Swing components. Demonstrates every major feature of JAXX, including data binding, scripting, and CSS stylesheets.
-
- * LabelStyles_ - Uses data binding to edit the appearance of a JLabel. Shows off the power and usefulness of data binding well.
-
- * Calculator_ - Four-function calculator. Based on the XUL Grand Coding Challenge.
-
- * Counter_ - simple data binding and scripting example. Based on the XUL Grand Coding Challenge.
-
- * Validation_ - simple data validation with xworks and jxlayer.
-
-.. _Components: Components/index.html
-
-.. _LabelStyles: LabelStyle/index.html
-
-.. _Calculator: Calculator/index.html
-
-.. _Counter: Counter/index.html
-
-.. _Validation: Validation/index.html
\ No newline at end of file
Copied: lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst (from rev 1111, lutinjaxx/branches/storm_1/jaxx-example/Components/src/site/fr/rst/index.rst)
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst (rev 0)
+++ lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst 2009-01-02 11:01:42 UTC (rev 1116)
@@ -0,0 +1,40 @@
+===================
+Examples/Components
+===================
+
+The Components demo displays many different Swing components being used in a variety of ways; it is JAXX's equivalent
+of the SwingSet demo. Various pages use advanced features such as data binding, scripting, event handling, and
+CSS stylesheets.
+
+Examples/Calculator
+===================
+
+This is an implementation of Challenge #2 from the `XUL Grand Coding Challenge 2004`_ . Because this example program
+has been implemented in so many different languages, you can easily compare JAXX's
+syntax against the competition and decide for yourself which you prefer.
+
+Screen shot
+-----------
+
+.. image:: images/Components-screenshot.gif
+
+Set it in action
+----------------
+
+|webstart|
+
+To run this example in `Java Web Start`_, click the `following link`_.
+
+
+Source code
+-----------
+
+Unlike the other examples, the source code for Components is too big to display here. You can view it yourself by
+downloading JAXX, and you can also view the source code for the individual demos by clicking the "Source" tabs.
+
+
+.. _Java Web Start: http://java.sun.com/products/javawebstart/
+
+.. |webstart| image:: images/webstart.gif
+
+.. _following link: ./launch-Components.jnlp
Property changes on: lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst
___________________________________________________________________
Name: svn:mergeinfo
+
1
0
[Buix-commits] r1115 - lutinjaxx/branches/storm_1
by tchemit@users.labs.libre-entreprise.org 02 Jan '09
by tchemit@users.labs.libre-entreprise.org 02 Jan '09
02 Jan '09
Author: tchemit
Date: 2009-01-02 08:27:33 +0000 (Fri, 02 Jan 2009)
New Revision: 1115
Modified:
lutinjaxx/branches/storm_1/pom.xml
Log:
suppression dependence jaxx-core
Modified: lutinjaxx/branches/storm_1/pom.xml
===================================================================
--- lutinjaxx/branches/storm_1/pom.xml 2009-01-02 08:27:12 UTC (rev 1114)
+++ lutinjaxx/branches/storm_1/pom.xml 2009-01-02 08:27:33 UTC (rev 1115)
@@ -134,10 +134,6 @@
<groupId>org.codelutin</groupId>
<artifactId>jaxx-compiler-api</artifactId>
<version>${project.version}</version>
- </dependency> <dependency>
- <groupId>org.codelutin</groupId>
- <artifactId>jaxx-core</artifactId>
- <version>${project.version}</version>
</dependency>
<!-- swing extension -->
@@ -163,7 +159,7 @@
<artifactId>jaxx-compiler-validator</artifactId>
<version>${project.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>jaxx-swing-action</artifactId>
1
0
[Buix-commits] r1114 - lutinjaxx/branches/storm_1/jaxx-runtime-validator/src/main/java/jaxx/runtime/validator
by tchemit@users.labs.libre-entreprise.org 02 Jan '09
by tchemit@users.labs.libre-entreprise.org 02 Jan '09
02 Jan '09
Author: tchemit
Date: 2009-01-02 08:27:12 +0000 (Fri, 02 Jan 2009)
New Revision: 1114
Modified:
lutinjaxx/branches/storm_1/jaxx-runtime-validator/src/main/java/jaxx/runtime/validator/BeanValidator.java
lutinjaxx/branches/storm_1/jaxx-runtime-validator/src/main/java/jaxx/runtime/validator/ErrorTableRenderer.java
Log:
ajout method isvalid sur le validator pour savoir de l'exterieur si un fieldName est en erreur ou pas sans a avoir a passer par les modeles d'erreurs
Modified: lutinjaxx/branches/storm_1/jaxx-runtime-validator/src/main/java/jaxx/runtime/validator/BeanValidator.java
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-runtime-validator/src/main/java/jaxx/runtime/validator/BeanValidator.java 2009-01-02 08:26:20 UTC (rev 1113)
+++ lutinjaxx/branches/storm_1/jaxx-runtime-validator/src/main/java/jaxx/runtime/validator/BeanValidator.java 2009-01-02 08:27:12 UTC (rev 1114)
@@ -525,6 +525,23 @@
return super.toString() + "<contextName:" + contextName + ">";
}
+ /**
+ * Test if a fieldName is valid for the validator
+ *
+ * @param fieldName the name of the field to test
+ * @return <code>true</code> if field is valid, <code>false</code> otherwise.
+ */
+ public boolean isValid(String fieldName) {
+ if (!isValid()) {
+ for (Object o : getFieldErrors().keySet()) {
+ if (fieldName.equals(o)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
/** @return <code>true</code> if validation is not active , <code>false</code> otherwise. */
protected boolean checkState() {
return bean == null || (getErrorListModel() == null && getErrorTableModel() == null) || fieldRepresentation.size() == 0;
@@ -565,7 +582,7 @@
// ajout du jxlayer sous ce composant
Container container = c.getParent();
if (container instanceof JXLayer) {
- Constructor<? extends AbstractBeanValidatorUI> cons = uiClass.getConstructor(String.class, String.class,Scope.class, ValidationAware.class);
+ Constructor<? extends AbstractBeanValidatorUI> cons = uiClass.getConstructor(String.class, String.class, Scope.class, ValidationAware.class);
AbstractBeanValidatorUI ui = cons.newInstance(fieldname, c.getName(), scope, validationSupport);
ui.setEnabled(true);
JXLayer<JComponent> jx = (JXLayer<JComponent>) container;
Modified: lutinjaxx/branches/storm_1/jaxx-runtime-validator/src/main/java/jaxx/runtime/validator/ErrorTableRenderer.java
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-runtime-validator/src/main/java/jaxx/runtime/validator/ErrorTableRenderer.java 2009-01-02 08:26:20 UTC (rev 1113)
+++ lutinjaxx/branches/storm_1/jaxx-runtime-validator/src/main/java/jaxx/runtime/validator/ErrorTableRenderer.java 2009-01-02 08:27:12 UTC (rev 1114)
@@ -50,7 +50,7 @@
while (stk.hasMoreTokens()) {
args.add(stk.nextToken());
}
- text = _(errorName, args.toArray(new String[args.size()]));
+ text = _(errorName, args.toArray());
}
} else {
// keep text rendered
1
0
[Buix-commits] r1113 - lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation
by tchemit@users.labs.libre-entreprise.org 02 Jan '09
by tchemit@users.labs.libre-entreprise.org 02 Jan '09
02 Jan '09
Author: tchemit
Date: 2009-01-02 08:26:20 +0000 (Fri, 02 Jan 2009)
New Revision: 1113
Modified:
lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeCellRenderer.java
lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModel.java
lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeSelectionAdapter.java
lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation/NavigationUtil.java
Log:
naivgation divers...
Modified: lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeCellRenderer.java
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeCellRenderer.java 2009-01-02 08:25:38 UTC (rev 1112)
+++ lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeCellRenderer.java 2009-01-02 08:26:20 UTC (rev 1113)
@@ -8,7 +8,9 @@
import org.codelutin.util.StringUtil;
import javax.swing.JTree;
+import javax.swing.UIManager;
import javax.swing.tree.DefaultTreeCellRenderer;
+import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreePath;
import java.awt.Component;
@@ -17,24 +19,33 @@
*
* @author chemit
*/
-public class NavigationTreeCellRenderer extends DefaultTreeCellRenderer {
+public class NavigationTreeCellRenderer implements TreeCellRenderer {
/** to use log facility, just put in your code: log.info(\"...\"); */
static private final Log log = LogFactory.getLog(NavigationTreeCellRenderer.class);
protected JAXXContext context;
+ protected DefaultTreeCellRenderer delegate;
+
protected static long t = 0;
public NavigationTreeCellRenderer(JAXXContext context) {
this.context = context;
+ UIManager.put("Tree.rendererFillBackground", false);
+ delegate = new DefaultTreeCellRenderer();
}
+ public NavigationTreeCellRenderer(JAXXContext context, DefaultTreeCellRenderer delegate) {
+ this.context = context;
+ this.delegate = delegate;
+ }
+
@Override
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
TreePath path = tree.getPathForRow(row);
if (path == null) {
- return this;
+ return delegate;
}
if (value != null) {
@@ -50,7 +61,7 @@
}
}
- return super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
+ return delegate.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
}
protected NodeRenderer getNodeRenderer(Object value) {
Modified: lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModel.java
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModel.java 2009-01-02 08:25:38 UTC (rev 1112)
+++ lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeModel.java 2009-01-02 08:26:20 UTC (rev 1113)
@@ -197,9 +197,20 @@
@Override
public void nodeChanged(TreeNode node) {
+ nodeChanged(node, false);
+ }
+
+ public void nodeChanged(TreeNode node, boolean deep) {
NavigationTreeNode n = (NavigationTreeNode) node;
- n.clearCache();
+ n.clearCache(!deep);
super.nodeChanged(node);
+ if (deep) {
+ Enumeration childs = node.children();
+ while (childs.hasMoreElements()) {
+ NavigationTreeNode o = (NavigationTreeNode) childs.nextElement();
+ nodeChanged(o, true);
+ }
+ }
}
/**
@@ -446,7 +457,7 @@
// save in cache
setCachedBean(result);
-
+
return result;
}
@@ -517,7 +528,11 @@
}
public void clearCache() {
+ clearCache(false);
+ }
+ public void clearCache(boolean deep) {
+
// clear bean cache
cachedBean = null;
@@ -526,11 +541,13 @@
renderer.setRendererCachedValue(null);
}
- // clear cache in childs
- Enumeration childs = this.children();
- while (childs.hasMoreElements()) {
- NavigationTreeNode o = (NavigationTreeNode) childs.nextElement();
- o.clearCache();
+ if (deep) {
+ // clear cache in childs
+ Enumeration childs = this.children();
+ while (childs.hasMoreElements()) {
+ NavigationTreeNode o = (NavigationTreeNode) childs.nextElement();
+ o.clearCache();
+ }
}
}
Modified: lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeSelectionAdapter.java
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeSelectionAdapter.java 2009-01-02 08:25:38 UTC (rev 1112)
+++ lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeSelectionAdapter.java 2009-01-02 08:26:20 UTC (rev 1113)
@@ -19,12 +19,16 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static private final Log log = LogFactory.getLog(NavigationTreeSelectionAdapter.class);
- static public final String NAVIGATION_CONTEXT_PATH = "navigation-context-path";
+ //static public final String NAVIGATION_CONTEXT_PATH = "navigation-context-path";
- static public final String NAVIGATION_SELECTED_NODE = "navigation-selected-node";
+ //static public final String NAVIGATION_SELECTED_NODE = "navigation-selected-node";
static public final String NAVIGATION_SELECTED_BEAN = "navigation-selected-bean";
+ static public final JAXXContextEntryDef<String> NAVIGATION_SELECTED_PATH_ENTRY_DEF = JAXXContextEntryDef.newDef("navigation-selected-path", String.class);
+
+ static public final JAXXContextEntryDef<NavigationTreeNode> NAVIGATION_SELECTED_NODE_ENTRY_DEF = JAXXContextEntryDef.newDef("navigation-selected-node", NavigationTreeNode.class);
+
static public final JAXXContextEntryDef<Boolean> GO_BACK_DEF = JAXXContextEntryDef.newDef("goBack", Boolean.class);
/** defined the stategy of instanciation of ui */
@@ -179,10 +183,10 @@
}
// save in context current node context path
- context.setContextValue(node.getContextPath(), NAVIGATION_CONTEXT_PATH);
+ NAVIGATION_SELECTED_PATH_ENTRY_DEF.setContextValue(context, node.getContextPath());
// save in context current node
- context.setContextValue(node, NAVIGATION_SELECTED_NODE);
+ NAVIGATION_SELECTED_NODE_ENTRY_DEF.setContextValue(context, node);
// really open the ui associated with the selected node
openUI(newUI, node);
Modified: lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation/NavigationUtil.java
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation/NavigationUtil.java 2009-01-02 08:25:38 UTC (rev 1112)
+++ lutinjaxx/branches/storm_1/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/navigation/NavigationUtil.java 2009-01-02 08:26:20 UTC (rev 1113)
@@ -23,11 +23,11 @@
static private final Log log = LogFactory.getLog(NavigationUtil.class);
public static String getCurrentNavigationNath(JAXXContext context) {
- return context.getContextValue(String.class, NavigationTreeSelectionAdapter.NAVIGATION_CONTEXT_PATH);
+ return NavigationTreeSelectionAdapter.NAVIGATION_SELECTED_PATH_ENTRY_DEF.getContextValue(context);
}
public static NavigationTreeNode getSelectedNode(JAXXContext context) {
- return context.getContextValue(NavigationTreeNode.class, NavigationTreeSelectionAdapter.NAVIGATION_SELECTED_NODE);
+ return NavigationTreeSelectionAdapter.NAVIGATION_SELECTED_NODE_ENTRY_DEF.getContextValue(context);
}
public static <O> O getSelectedBean(JAXXContext context, Class<O> clazz) {
1
0
[Buix-commits] r1112 - lutinjaxx/branches/storm_1/jaxx-compiler-api/src/main/java/jaxx/compiler
by tchemit@users.labs.libre-entreprise.org 02 Jan '09
by tchemit@users.labs.libre-entreprise.org 02 Jan '09
02 Jan '09
Author: tchemit
Date: 2009-01-02 08:25:38 +0000 (Fri, 02 Jan 2009)
New Revision: 1112
Modified:
lutinjaxx/branches/storm_1/jaxx-compiler-api/src/main/java/jaxx/compiler/JAXXCompiler.java
lutinjaxx/branches/storm_1/jaxx-compiler-api/src/main/java/jaxx/compiler/JAXXCompilerLaunchor.java
Log:
nettoyage code apres refactor + amelioration de la compile -utilisation d'une enum pour definir la phase en cours
Modified: lutinjaxx/branches/storm_1/jaxx-compiler-api/src/main/java/jaxx/compiler/JAXXCompiler.java
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-compiler-api/src/main/java/jaxx/compiler/JAXXCompiler.java 2009-01-02 08:23:35 UTC (rev 1111)
+++ lutinjaxx/branches/storm_1/jaxx-compiler-api/src/main/java/jaxx/compiler/JAXXCompiler.java 2009-01-02 08:25:38 UTC (rev 1112)
@@ -69,7 +69,7 @@
/**
* Compiles JAXX files into Java classes.
- * <p/>
+ * <p/>
* use {@link Generator} ... todo finish javadoc
*/
public class JAXXCompiler {
@@ -1090,7 +1090,7 @@
assert jaxxFile.getName().equalsIgnoreCase(className.substring(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 (JAXXCompilerLaunchor.get().currentPass == JAXXCompilerLaunchor.PASS_2) {
+ if (JAXXCompilerLaunchor.get().currentPass != JAXXCompilerLaunchor.LifeCycle.compile_first_pass) {
throw new AssertionError("Internal error: adding dependency class " + className + " during second compilation pass");
}
JAXXCompilerLaunchor.get().jaxxFileClassNames.add(className);
@@ -1319,170 +1319,6 @@
return System.getProperty("line.separator", "\n");
}
- /**
- * 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[] classNames, CompilerOptions options) {
- reset(); // just to be safe...
- jaxxFiles.addAll(Arrays.asList(files));
- jaxxFileClassNames.addAll(Arrays.asList(classNames));
- try {
- boolean success = true;
-
- // pass 1
- currentPass = PASS_1;
- boolean compiled;
- do {
- compiled = false;
- assert jaxxFiles.size() == jaxxFileClassNames.size();
- java.util.Iterator<File> filesIterator = new ArrayList<File>(jaxxFiles).iterator(); // clone it so it can safely be modified while we're iterating
- java.util.Iterator<String> classNamesIterator = new ArrayList<String>(jaxxFileClassNames).iterator();
- while (filesIterator.hasNext()) {
- File file = filesIterator.next();
- String className = classNamesIterator.next();
- if (options.isVerbose()) {
- log.info("compile first pass for " + className);
- }
- if (symbolTables.get(file) == null) {
- compiled = true;
- if (compilers.containsKey(className)) {
- throw new CompilerException("Internal error: " + className + " is already being compiled, attempting to compile it again");
- }
-
- File destDir = options.getTargetDirectory();
- if (destDir != null) {
- int dotPos = className.lastIndexOf(".");
- if (dotPos != -1) {
- destDir = new File(destDir, className.substring(0, dotPos).replace('.', File.separatorChar));
- }
- if (!destDir.exists() && !destDir.mkdirs()) {
- log.warn("could not create directory " + destDir);
- continue;
- }
- } else {
- //destDir = file.getParentFile();
- }
- Compiler compiler = new JAXXCompiler(file.getParentFile(), file, className, options);
- compilers.put(className, compiler);
- compiler.compileFirstPass();
- assert !symbolTables.values().contains(compiler.getSymbolTable()) : "symbolTable is already registered";
- symbolTables.put(file, compiler.getSymbolTable());
- if (compiler.isFailed()) {
- success = false;
- }
- }
- }
-
- } while (compiled);
-
- // pass 2
- currentPass = PASS_2;
- if (success) {
- assert jaxxFiles.size() == jaxxFileClassNames.size();
- List<File> jaxxFilesClone = new ArrayList<File>(jaxxFiles);
- for (String className : jaxxFileClassNames) {
- Compiler compiler = compilers.get(className);
- if (compiler == null) {
- throw new CompilerException("Internal error: could not find compiler for " + className + " during second pass");
- }
- if (options.isVerbose()) {
-
- log.info("runInitializers for " + className);
- }
- if (!compiler.isFailed()) {
- compiler.runInitializers();
- }
- if (options.isVerbose()) {
-
- log.info("compile second pass for " + className);
- }
- compiler.compileSecondPass();
- if (options.isVerbose()) {
-
- log.info("done with result [" + !compiler.isFailed() + "] for " + className);
- }
- if (!compiler.isFailed()) {
-
- } else {
- success = false;
- }
- }
- if (!jaxxFilesClone.equals(jaxxFiles)) {
- throw new AssertionError("Internal error: compilation set altered during pass 2 (was " + jaxxFilesClone + ", modified to " + jaxxFiles + ")");
- }
- }
-
- // stylesheet application
- if (success) {
- assert jaxxFiles.size() == jaxxFileClassNames.size();
- for (String className : jaxxFileClassNames) {
- Compiler compiler = compilers.get(className);
- if (compiler == null) {
- throw new CompilerException("Internal error: could not find compiler for " + className + " during stylesheet application");
- }
- compiler.applyStylesheets();
- if (compiler.isFailed()) {
- success = false;
- }
- }
- }
-
- // code generation
- if (success) {
- assert jaxxFiles.size() == jaxxFileClassNames.size();
- List<Generator> generators = new ArrayList<Generator>();
- for (Generator generator : ServiceLoader.load(Generator.class)) {
- generators.add(generator);
- }
- for (String className : jaxxFileClassNames) {
- Compiler compiler = compilers.get(className);
- if (compiler == null) {
- throw new CompilerException("Internal error: could not find compiler for " + className + " during code generation");
- }
- compiler.generateCode(generators);
- //compiler.generateCode();
- if (compiler.isFailed()) {
- success = false;
- }
- }
- }
-
- if (warningCount == 1) {
- System.err.println("1 warning");
- } else if (warningCount > 0) {
- System.err.println(warningCount + " warnings");
- }
- if (errorCount == 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 (options.isResetAfterCompile() && errorCount == 0) {
- reset();
- }
- }
- }*/
-
// 1.5 adds getCanonicalName; unfortunately we can't depend on 1.5 features yet
public static String getCanonicalName(Class clazz) {
if (clazz.isArray()) {
Modified: lutinjaxx/branches/storm_1/jaxx-compiler-api/src/main/java/jaxx/compiler/JAXXCompilerLaunchor.java
===================================================================
--- lutinjaxx/branches/storm_1/jaxx-compiler-api/src/main/java/jaxx/compiler/JAXXCompilerLaunchor.java 2009-01-02 08:23:35 UTC (rev 1111)
+++ lutinjaxx/branches/storm_1/jaxx-compiler-api/src/main/java/jaxx/compiler/JAXXCompilerLaunchor.java 2009-01-02 08:25:38 UTC (rev 1112)
@@ -1,14 +1,13 @@
package jaxx.compiler;
import jaxx.CompilerException;
+import jaxx.reflect.ClassDescriptorLoader;
import jaxx.spi.Initializer;
-import jaxx.reflect.ClassDescriptorLoader;
import jaxx.tags.DefaultObjectHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.io.File;
-import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
@@ -21,116 +20,122 @@
/** @author chemit */
public class JAXXCompilerLaunchor {
-
/** log */
protected static final Log log = LogFactory.getLog(JAXXCompilerLaunchor.class);
+ enum LifeCycle {
+ init,// state before compilation
+ compile_first_pass, // state when first pass of compilation
+ compile_second_pass, // state when second pass of compilation
+ stylesheet_pass, // state when applygin stylesheet phase after compilation
+ generate_pass // state when generation phase
+ }
+
protected static final int PASS_1 = 0;
protected static final int PASS_2 = 1;
+
+ /** shared instance of unique launchor at a givne time. */
protected static JAXXCompilerLaunchor singleton;
- protected CompilerOptions options;
-
- protected final File[] files;
- protected final String[] classNames;
-
- public JAXXCompilerLaunchor(File base, String[] relativePaths, CompilerOptions options) {
- this.options = options;
- files = new File[relativePaths.length];
- classNames = new String[relativePaths.length];
- for (int i = 0; i < files.length; i++) {
- files[i] = new File(base, relativePaths[i]);
- classNames[i] = relativePaths[i].substring(0, relativePaths[i].lastIndexOf("."));
- classNames[i] = classNames[i].replace(File.separatorChar, '.');
- classNames[i] = classNames[i].replace('/', '.');
- classNames[i] = classNames[i].replace('\\', '.');
- classNames[i] = classNames[i].replace(':', '.');
- }
- if (options.isVerbose()) {
- log.info("files : " + Arrays.toString(files));
- }
- }
-
- public JAXXCompilerLaunchor(File[] files, String[] classNames, CompilerOptions options) {
- this.options = options;
- this.files = files;
- this.classNames = classNames;
- if (options.isVerbose()) {
- log.info("files : " + Arrays.toString(files));
- }
- }
-
- public JAXXCompilerLaunchor() {
- this.options = new CompilerOptions();
- files = null;
- classNames = null;
- }
-
/**
- * Compiled a set of files, expressed as paths relative to a base directory. 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>.
+ * Create a new empty launchor and set it as current launchor accessible via method {@link #get()}
*
- * @return <code>true</code> if compilation succeeds, <code>false</code> otherwise
+ * @return the new instanciated launchor
*/
- public static JAXXCompilerLaunchor newLaunchor() {
- if (singleton != null) {
- //singleton.reset();
- }
- singleton = new JAXXCompilerLaunchor();
-
- return singleton;
+ public static synchronized JAXXCompilerLaunchor newLaunchor() {
+ return newLaunchor((File[]) null, null, null);
}
/**
- * Compiled a set of files, expressed as paths relative to a base directory. 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>.
+ * Create a new launchor and set it as current launchor accessible via method {@link #get()}.
+ * <p/>
+ * The launchor will be prepared to compile a set of files, expressed as paths relative to a base directory.
+ * 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").
*
* @param base the directory against which to resolve relative paths
* @param relativePaths a list of relative paths to .jaxx files being compiled
* @param options the compiler options to use
- * @return <code>true</code> if compilation succeeds, <code>false</code> otherwise
+ * @return the new instanciated launchor
*/
- public static JAXXCompilerLaunchor newLaunchor(File base, String[] relativePaths, CompilerOptions options) {
- if (singleton != null) {
- //singleton.reset();
+ public static synchronized JAXXCompilerLaunchor newLaunchor(File base, String[] relativePaths, CompilerOptions options) {
+ File[] files = new File[relativePaths.length];
+ String[] classNames = new String[relativePaths.length];
+ for (int i = 0; i < files.length; i++) {
+ files[i] = new File(base, relativePaths[i]);
+ classNames[i] = relativePaths[i].substring(0, relativePaths[i].lastIndexOf("."));
+ classNames[i] = classNames[i].replace(File.separatorChar, '.');
+ classNames[i] = classNames[i].replace('/', '.');
+ classNames[i] = classNames[i].replace('\\', '.');
+ classNames[i] = classNames[i].replace(':', '.');
}
- singleton = new JAXXCompilerLaunchor(base, relativePaths, options);
-
- return singleton;
+ return newLaunchor(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>.
+ * Create a new launchor and set it as current launchor accessible via method {@link #get()}.
+ * <p/>
+ * The launchor will be prepared to compile a set of files, with the class names specified explicitly.
+ * The class compiled from files[i] will be named classNames[i].
*
* @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
+ * @return the new instanciated launchor
*/
- public static JAXXCompilerLaunchor newLaunchor(File[] files, String[] classNames, CompilerOptions options) {
+ public static synchronized JAXXCompilerLaunchor newLaunchor(File[] files, String[] classNames, CompilerOptions options) {
if (singleton != null) {
- //singleton.reset();
+ singleton.reset();
}
singleton = new JAXXCompilerLaunchor(files, classNames, options);
return singleton;
}
- public static JAXXCompilerLaunchor get() {
+ /**
+ * @return the current launchor
+ * @throws NullPointerException if no launchor was registred via a <code>newLaunchor-like</code> method.
+ */
+ public static JAXXCompilerLaunchor get() throws NullPointerException {
if (singleton == null) {
throw new NullPointerException("no launchor was registred via newLaunchor method");
}
return singleton;
}
+ /** @return <code> if there is a launchor registred, <code>false</code> otherwise. */
public static boolean isRegistred() {
return singleton != null;
}
+ /**
+ * Load the {@link jaxx.spi.Initializer} services found via the{@link ServiceLoader} mecanism.
+ *
+ * @param verbose <ocde>true</code> to print initializers
+ */
+ public static void loadLibraries(boolean verbose) {
+ //BeanInfoUtil.reset();
+ ClassLoader classloader = Thread.currentThread().getContextClassLoader();
+ if (verbose) {
+ log.info("with cl " + classloader);
+ }
+ ServiceLoader<Initializer> loader = ServiceLoader.load(Initializer.class, classloader);
+ for (Initializer initializer : loader) {
+ if (verbose) {
+ log.info("load initializer " + initializer);
+ }
+ initializer.initialize();
+ }
+ }
+
+ /** options of the launchor and underlines compilers */
+ protected CompilerOptions options;
+ /** original list of files to compile */
+ protected final File[] files;
+ /** original list of classes to compile */
+ protected final String[] classNames;
+
+ /** Files to be treated while compilation. */
protected List<File> jaxxFiles = new ArrayList<File>();
/** Class names corresponding to the files in the jaxxFiles list. */
@@ -142,26 +147,22 @@
/** Maps the names of classes being compiled to their symbol tables (created after the first compiler pass). */
protected Map<File, SymbolTable> symbolTables = new HashMap<File, SymbolTable>();
- protected int currentPass;
+ protected LifeCycle currentPass;
+ //protected int currentPass;
protected int errorCount;
protected int warningCount;
- public static void loadLibraries(boolean verbose) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
- //BeanInfoUtil.reset();
- ClassLoader classloader = Thread.currentThread().getContextClassLoader();
- if (verbose) {
- log.info("with cl " + classloader);
+ protected JAXXCompilerLaunchor(File[] files, String[] classNames, CompilerOptions options) {
+ this.options = options == null ? new CompilerOptions() : options;
+ this.files = files;
+ this.classNames = classNames;
+ if (this.options.isVerbose()) {
+ log.info("files : " + Arrays.toString(files));
}
- ServiceLoader<Initializer> loader = ServiceLoader.load(Initializer.class, classloader);
- for (Initializer initializer : loader) {
- if (verbose) {
- log.info("load initializer " + initializer);
- }
- initializer.initialize();
- }
}
+
public void init() {
// forces static initializer to run if it hasn't yet
}
@@ -175,6 +176,7 @@
symbolTables.clear();
compilers.clear();
}
+
public String getVersion() {
return "1.0.4";
}
@@ -243,7 +245,7 @@
boolean success = true;
// pass 1
- currentPass = PASS_1;
+ currentPass = LifeCycle.compile_first_pass;
boolean compiled;
do {
compiled = false;
@@ -287,90 +289,84 @@
}
} while (compiled);
+ if (!success) {
+ return report(false);
+ }
// pass 2
- currentPass = PASS_2;
- if (success) {
- assert jaxxFiles.size() == jaxxFileClassNames.size();
- List<File> jaxxFilesClone = new ArrayList<File>(jaxxFiles);
- for (String className : jaxxFileClassNames) {
- JAXXCompiler compiler = compilers.get(className);
- if (compiler == null) {
- throw new CompilerException("Internal error: could not find compiler for " + className + " during second pass");
- }
- if (options.isVerbose()) {
+ currentPass = LifeCycle.compile_second_pass;
- log.info("runInitializers for " + className);
- }
- if (!compiler.isFailed()) {
- compiler.runInitializers();
- }
- if (options.isVerbose()) {
+ assert jaxxFiles.size() == jaxxFileClassNames.size();
+ List<File> jaxxFilesClone = new ArrayList<File>(jaxxFiles);
+ for (String className : jaxxFileClassNames) {
+ JAXXCompiler compiler = compilers.get(className);
+ if (compiler == null) {
+ throw new CompilerException("Internal error: could not find compiler for " + className + " during second pass");
+ }
+ if (options.isVerbose()) {
- log.info("compile second pass for " + className);
- }
- compiler.compileSecondPass();
- if (options.isVerbose()) {
+ log.info("runInitializers for " + className);
+ }
+ if (!compiler.isFailed()) {
+ compiler.runInitializers();
+ }
+ if (options.isVerbose()) {
- log.info("done with result [" + !compiler.isFailed() + "] for " + className);
- }
- if (!compiler.isFailed()) {
-
- } else {
- success = false;
- }
+ log.info("compile second pass for " + className);
}
- if (!jaxxFilesClone.equals(jaxxFiles)) {
- throw new AssertionError("Internal error: compilation set altered during pass 2 (was " + jaxxFilesClone + ", modified to " + jaxxFiles + ")");
+ compiler.compileSecondPass();
+ if (options.isVerbose()) {
+ log.info("done with result [" + !compiler.isFailed() + "] for " + className);
}
+ if (compiler.isFailed()) {
+ success = false;
+ }
}
+ if (!jaxxFilesClone.equals(jaxxFiles)) {
+ throw new AssertionError("Internal error: compilation set altered during pass 2 (was " + jaxxFilesClone + ", modified to " + jaxxFiles + ")");
+ }
+ if (!success) {
+ return report(false);
+ }
+
// stylesheet application
- if (success) {
- assert jaxxFiles.size() == jaxxFileClassNames.size();
- for (String className : jaxxFileClassNames) {
- JAXXCompiler compiler = compilers.get(className);
- if (compiler == null) {
- throw new CompilerException("Internal error: could not find compiler for " + className + " during stylesheet application");
- }
- compiler.applyStylesheets();
- if (compiler.isFailed()) {
- success = false;
- }
+ currentPass = LifeCycle.stylesheet_pass;
+ assert jaxxFiles.size() == jaxxFileClassNames.size();
+ for (String className : jaxxFileClassNames) {
+ JAXXCompiler compiler = compilers.get(className);
+ if (compiler == null) {
+ throw new CompilerException("Internal error: could not find compiler for " + className + " during stylesheet application");
}
+ compiler.applyStylesheets();
+ if (compiler.isFailed()) {
+ success = false;
+ }
}
+ if (!success) {
+ return report(false);
+ }
// code generation
- if (success) {
- assert jaxxFiles.size() == jaxxFileClassNames.size();
- List<Generator> generators = new ArrayList<Generator>();
- for (Generator generator : ServiceLoader.load(Generator.class)) {
- generators.add(generator);
+ currentPass = LifeCycle.generate_pass;
+ assert jaxxFiles.size() == jaxxFileClassNames.size();
+ List<Generator> generators = new ArrayList<Generator>();
+ for (Generator generator : ServiceLoader.load(Generator.class)) {
+ generators.add(generator);
+ }
+ for (String className : jaxxFileClassNames) {
+ JAXXCompiler compiler = compilers.get(className);
+ if (compiler == null) {
+ throw new CompilerException("Internal error: could not find compiler for " + className + " during code generation");
}
- for (String className : jaxxFileClassNames) {
- JAXXCompiler compiler = compilers.get(className);
- if (compiler == null) {
- throw new CompilerException("Internal error: could not find compiler for " + className + " during code generation");
- }
- compiler.generateCode(generators);
- //compiler.generateCode();
- if (compiler.isFailed()) {
- success = false;
- }
+ compiler.generateCode(generators);
+ //compiler.generateCode();
+ if (compiler.isFailed()) {
+ success = false;
}
}
- if (warningCount == 1) {
- System.err.println("1 warning");
- } else if (warningCount > 0) {
- System.err.println(warningCount + " warnings");
- }
- if (errorCount == 1) {
- System.err.println("1 error");
- } else if (errorCount > 0) {
- System.err.println(errorCount + " errors");
- }
- return success;
+ return report(success);
}
catch (CompilerException e) {
System.err.println(e.getMessage());
@@ -389,6 +385,20 @@
}
}
+ protected boolean report(boolean success) {
+ if (warningCount == 1) {
+ System.err.println("1 warning");
+ } else if (warningCount > 0) {
+ System.err.println(warningCount + " warnings");
+ }
+ if (errorCount == 1) {
+ System.err.println("1 error");
+ } else if (errorCount > 0) {
+ System.err.println(errorCount + " errors");
+ }
+ return success;
+ }
+
protected JAXXCompiler newCompiler(File parentFile, File file, String className) throws InvocationTargetException, IllegalAccessException, InstantiationException, NoSuchMethodException {
Constructor<? extends JAXXCompiler> cons = options.getCompilerClass().getConstructor(File.class, File.class, String.class, CompilerOptions.class);
return cons.newInstance(parentFile, file, className, options);
1
0