Buix-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
December 2008
- 2 participants
- 69 discussions
10 Dec '08
Author: tchemit
Date: 2008-12-10 09:04:11 +0000 (Wed, 10 Dec 2008)
New Revision: 1060
Added:
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/Base64Coder.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/MultiJXPathDecorator.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/I18nTableCellHeaderRenderer.java
lutinjaxx/trunk/jaxx-core/src/test/java/jaxx/runtime/MultiJXPathDecoratorTest.java
lutinjaxx/trunk/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Bug1750Test.java
lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/testcases/Bug_1750.xml
lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/testcases/bug_1750/
lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/testcases/bug_1750/ComboBox.jaxx
Modified:
lutinjaxx/trunk/jaxx-core/changelog.txt
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/CompiledObject.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/CompilerOptions.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXCompilerHelper.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXObjectGenerator.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/css/Rule.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/css/Stylesheet.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/ComponentDescriptor.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/JAXXObjectDescriptor.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/JXPathDecorator.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/Util.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/JAXXButtonGroup.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/DefaultObjectHandler.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/JRadioButtonHandler.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/SwingInitializer.java
lutinjaxx/trunk/jaxx-core/src/test/java/jaxx/runtime/JXPathDecoratorTest.java
lutinjaxx/trunk/maven-jaxx-plugin/changelog.txt
lutinjaxx/trunk/maven-jaxx-plugin/src/main/java/org/codelutin/jaxx/JaxxGeneratorMojo.java
Log:
- improve JAXXButtonGroup (add ActionChangeListener and toolTipText mecanism)
- javabBean attribute use to initialize bean
- introduce Base64Coder to fix bug 1750 and control serailVersionUI (put them to 1L for the moment)
- introduce MultiJXPathDecorator
- add a resetAfterCompile parameter toCompilerOption to keep in test used compilers
Modified: lutinjaxx/trunk/jaxx-core/changelog.txt
===================================================================
--- lutinjaxx/trunk/jaxx-core/changelog.txt 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/jaxx-core/changelog.txt 2008-12-10 09:04:11 UTC (rev 1060)
@@ -1,5 +1,10 @@
0.7 chemit 200812??
-
+* 20081210 [chemit] - improve JAXXButtonGroup (add ActionChangeListener and toolTipText mecanism)
+* 20081208 [chemit] - javabBean attribute use to initialize bean
+ - introduce Base64Coder to fix bug 1750 and control serailVersionUI (put them to 1L for the moment)
+ - introduce MultiJXPathDecorator
+ - add a resetAfterCompile parameter toCompilerOption to keep in test used compilers
+
* 20081207 [chemit] use lutinproject 3.1
- can exclude field from validator
* 20081202 [chemit] - add strategy for loading ui in NavigationTreeSelectionAdapter
Added: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/Base64Coder.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/Base64Coder.java (rev 0)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/Base64Coder.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -0,0 +1,240 @@
+package jaxx;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.zip.GZIPInputStream;
+import java.util.zip.GZIPOutputStream;
+
+/**
+ * A Base64 Encoder/Decoder.
+ * <p/>
+ * <p/>
+ * This class is used to encode and decode data in Base64 format as described in RFC 1521.
+ * <p/>
+ * <p/>
+ * This is "Open Source" software and released under the <a href="http://www.gnu.org/licenses/lgpl.html">GNU/LGPL</a> license.<br>
+ * It is provided "as is" without warranty of any kind.<br>
+ * Copyright 2003: Christian d'Heureuse, Inventec Informatik AG, Switzerland.<br>
+ * Home page: <a href="http://www.source-code.biz">www.source-code.biz</a><br>
+ * <p/>
+ * <p/>
+ * Version history:<br>
+ * 2003-07-22 Christian d'Heureuse (chdh): Module created.<br>
+ * 2005-08-11 chdh: Lincense changed from GPL to LGPL.<br>
+ * 2006-11-21 chdh:<br>
+ * Method encode(String) renamed to encodeString(String).<br>
+ * Method decode(String) renamed to decodeString(String).<br>
+ * New method encode(byte[],int) added.<br>
+ * New method decode(String) added.<br>
+ */
+
+public class Base64Coder {
+
+ // Mapping table from 6-bit nibbles to Base64 characters.
+ private static char[] map1 = new char[64];
+
+ static {
+ int i = 0;
+ for (char c = 'A'; c <= 'Z'; c++) {
+ map1[i++] = c;
+ }
+ for (char c = 'a'; c <= 'z'; c++) {
+ map1[i++] = c;
+ }
+ for (char c = '0'; c <= '9'; c++) {
+ map1[i++] = c;
+ }
+ map1[i++] = '+';
+ map1[i] = '/';
+ }
+
+ // Mapping table from Base64 characters to 6-bit nibbles.
+ private static byte[] map2 = new byte[128];
+
+ static {
+ for (int i = 0; i < map2.length; i++) {
+ map2[i] = -1;
+ }
+ for (int i = 0; i < 64; i++) {
+ map2[map1[i]] = (byte) i;
+ }
+ }
+
+ /**
+ * Read the object from Base64 string.
+ *
+ * @param s the string representation of serialized object.
+ * @param gzip if gzip stream
+ * @return the deserialize object
+ * @throws java.io.IOException if any io pb
+ * @throws ClassNotFoundException if class not found ?
+ */
+ public static Object deserialize(String s, boolean gzip) throws IOException,
+ ClassNotFoundException {
+ byte[] data = Base64Coder.decode(s);
+ InputStream stream = new ByteArrayInputStream(data);
+ if (gzip) {
+ stream = new GZIPInputStream(stream);
+ }
+ ObjectInputStream ois = new ObjectInputStream(stream);
+ Object o = ois.readObject();
+ ois.close();
+ return o;
+ }
+
+ /**
+ * Write the object to a Base64 string.
+ *
+ * @param o the object to serialize
+ * @param gzip if gzip stream
+ * @return the string representation
+ * @throws java.io.IOException if any io pb
+ */
+ public static String serialize(Object o, boolean gzip) throws IOException {
+ ByteArrayOutputStream stream = new ByteArrayOutputStream();
+ ObjectOutputStream oos;
+ if (gzip) {
+ oos = new ObjectOutputStream(new GZIPOutputStream(stream));
+ } else {
+ oos = new ObjectOutputStream(stream);
+ }
+ oos.writeObject(o);
+ oos.close();
+ return new String(Base64Coder.encode(stream.toByteArray()));
+ }
+
+ /**
+ * Encodes a string into Base64 format.
+ * No blanks or line breaks are inserted.
+ *
+ * @param s a String to be encoded.
+ * @return A String with the Base64 encoded data.
+ */
+ public static String encodeString(String s) {
+ return new String(encode(s.getBytes()));
+ }
+
+ /**
+ * Encodes a byte array into Base64 format.
+ * No blanks or line breaks are inserted.
+ *
+ * @param in an array containing the data bytes to be encoded.
+ * @return A character array with the Base64 encoded data.
+ */
+ public static char[] encode(byte[] in) {
+ return encode(in, in.length);
+ }
+
+ /**
+ * Encodes a byte array into Base64 format.
+ * No blanks or line breaks are inserted.
+ *
+ * @param in an array containing the data bytes to be encoded.
+ * @param iLen number of bytes to process in <code>in</code>.
+ * @return A character array with the Base64 encoded data.
+ */
+ public static char[] encode(byte[] in, int iLen) {
+ int oDataLen = (iLen * 4 + 2) / 3; // output length without padding
+ int oLen = ((iLen + 2) / 3) * 4; // output length including padding
+ char[] out = new char[oLen];
+ int ip = 0;
+ int op = 0;
+ while (ip < iLen) {
+ int i0 = in[ip++] & 0xff;
+ int i1 = ip < iLen ? in[ip++] & 0xff : 0;
+ int i2 = ip < iLen ? in[ip++] & 0xff : 0;
+ int o0 = i0 >>> 2;
+ int o1 = ((i0 & 3) << 4) | (i1 >>> 4);
+ int o2 = ((i1 & 0xf) << 2) | (i2 >>> 6);
+ int o3 = i2 & 0x3F;
+ out[op++] = map1[o0];
+ out[op++] = map1[o1];
+ out[op] = op < oDataLen ? map1[o2] : '=';
+ op++;
+ out[op] = op < oDataLen ? map1[o3] : '=';
+ op++;
+ }
+ return out;
+ }
+
+ /**
+ * Decodes a string from Base64 format.
+ *
+ * @param s a Base64 String to be decoded.
+ * @return A String containing the decoded data.
+ * @throws IllegalArgumentException if the input is not valid Base64 encoded data.
+ */
+ public static String decodeString(String s) {
+ return new String(decode(s));
+ }
+
+ /**
+ * Decodes a byte array from Base64 format.
+ *
+ * @param s a Base64 String to be decoded.
+ * @return An array containing the decoded data bytes.
+ * @throws IllegalArgumentException if the input is not valid Base64 encoded data.
+ */
+ public static byte[] decode(String s) {
+ return decode(s.toCharArray());
+ }
+
+ /**
+ * Decodes a byte array from Base64 format.
+ * No blanks or line breaks are allowed within the Base64 encoded data.
+ *
+ * @param in a character array containing the Base64 encoded data.
+ * @return An array containing the decoded data bytes.
+ * @throws IllegalArgumentException if the input is not valid Base64 encoded data.
+ */
+ public static byte[] decode(char[] in) {
+ int iLen = in.length;
+ if (iLen % 4 != 0) {
+ throw new IllegalArgumentException("Length of Base64 encoded input string is not a multiple of 4.");
+ }
+ while (iLen > 0 && in[iLen - 1] == '=') {
+ iLen--;
+ }
+ int oLen = (iLen * 3) / 4;
+ byte[] out = new byte[oLen];
+ int ip = 0;
+ int op = 0;
+ while (ip < iLen) {
+ int i0 = in[ip++];
+ int i1 = in[ip++];
+ int i2 = ip < iLen ? in[ip++] : 'A';
+ int i3 = ip < iLen ? in[ip++] : 'A';
+ if (i0 > 127 || i1 > 127 || i2 > 127 || i3 > 127) {
+ throw new IllegalArgumentException("Illegal character in Base64 encoded data.");
+ }
+ int b0 = map2[i0];
+ int b1 = map2[i1];
+ int b2 = map2[i2];
+ int b3 = map2[i3];
+ if (b0 < 0 || b1 < 0 || b2 < 0 || b3 < 0) {
+ throw new IllegalArgumentException("Illegal character in Base64 encoded data.");
+ }
+ int o0 = (b0 << 2) | (b1 >>> 4);
+ int o1 = ((b1 & 0xf) << 4) | (b2 >>> 2);
+ int o2 = ((b2 & 3) << 6) | b3;
+ out[op++] = (byte) o0;
+ if (op < oLen) {
+ out[op++] = (byte) o1;
+ }
+ if (op < oLen) {
+ out[op++] = (byte) o2;
+ }
+ }
+ return out;
+ }
+
+ // Dummy constructor.
+ private Base64Coder() {
+ }
+
+} // end class Base64Coder
+
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/CompiledObject.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/CompiledObject.java 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/CompiledObject.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -77,6 +77,9 @@
/** a flag to indicate if javaBean full support must be support for this object by root object */
private boolean javaBean;
+ /** code to initialize the bean (can be null) */
+ private String javaBeanInitCode;
+
/** the type of the override object (can be null if no oveeride) */
private ClassDescriptor overrideType;
@@ -561,4 +564,12 @@
public void setOverrideType(ClassDescriptor overrideType) {
this.overrideType = overrideType;
}
+
+ public String getJavaBeanInitCode() {
+ return javaBeanInitCode;
+ }
+
+ public void setJavaBeanInitCode(String javaBeanInitCode) {
+ this.javaBeanInitCode = javaBeanInitCode;
+ }
}
\ No newline at end of file
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/CompilerOptions.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/CompilerOptions.java 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/CompilerOptions.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -20,6 +20,9 @@
/** a flag to add or not logger on generated jaxx files */
private boolean addLogger;
+ /** a flag to not reset compiler after a compile */
+ private boolean resetAfterCompile;
+
/** the name of implementation of {@link jaxx.runtime.JAXXContext} to be used on {@link jaxx.runtime.JAXXObject}. */
protected String jaxxContextImplementorClass;
@@ -191,6 +194,14 @@
this.extraImports = extraImports;
}
+ public boolean isResetAfterCompile() {
+ return resetAfterCompile;
+ }
+
+ public void setResetAfterCompile(boolean resetAfterCompile) {
+ this.resetAfterCompile = resetAfterCompile;
+ }
+
@Override
public String toString() {
StringBuilder sb = new StringBuilder(super.toString());
@@ -202,6 +213,7 @@
sb.append("\noptiomize : ").append(getOptimize());
sb.append("\ni18nable : ").append(isI18nable());
sb.append("\naddLogger : ").append(isAddLogger());
+ sb.append("\nresetAfterCompile : ").append(isResetAfterCompile());
sb.append("\njaxxContextImplementorClass : ").append(getJaxxContextImplementorClass());
sb.append("\nextraImports : ").append(getExtraImports());
return sb.toString();
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXCompilerHelper.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXCompilerHelper.java 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXCompilerHelper.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -377,7 +377,7 @@
}
finally {
//TC - 20081018 only reset when no error was detected
- if (errorCount == 0) {
+ if (options.isResetAfterCompile() && errorCount == 0) {
reset();
}
}
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXObjectGenerator.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXObjectGenerator.java 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXObjectGenerator.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -1,5 +1,6 @@
package jaxx.compiler;
+import jaxx.Base64Coder;
import jaxx.CompilerException;
import jaxx.reflect.ClassDescriptor;
import jaxx.reflect.ClassDescriptorLoader;
@@ -13,19 +14,16 @@
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 static java.lang.reflect.Modifier.FINAL;
import static java.lang.reflect.Modifier.PROTECTED;
-import static java.lang.reflect.Modifier.FINAL;
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}.
@@ -159,7 +157,7 @@
// JAXXContext
- javaFile.addField(newField(PROTECTED| FINAL, "jaxx.runtime.JAXXContext", "delegateContext","new "+ jaxxContextImplementorClass+ "(this);"));
+ javaFile.addField(newField(PROTECTED | FINAL, "jaxx.runtime.JAXXContext", "delegateContext", "new " + jaxxContextImplementorClass + "(this);"));
javaFile.addMethod(SET_CONTEXT_VALUE_METHOD);
javaFile.addMethod(SET_CONTEXT_VALUE_NAMED_METHOD);
javaFile.addMethod(GET_CONTEXT_VALUE_METHOD);
@@ -267,7 +265,8 @@
protected JavaField createJAXXObjectDescriptorField() {
try {
JAXXObjectDescriptor descriptor = compiler.getJAXXObjectDescriptor();
- ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+ String data = Base64Coder.serialize(descriptor, true);
+ /*ByteArrayOutputStream buffer = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(new GZIPOutputStream(buffer));
out.writeObject(descriptor);
out.close();
@@ -277,7 +276,7 @@
// mapping between bytes and chars, with the high byte of the char set to zero. We can then safely
// reconstitute the original byte[] at a later date. This is unquestionably an abuse of the String
// type, but if we could efficiently store a byte[] we wouldn't have to do this.
- String data = new String(buffer.toByteArray(), 0);
+ String data = new String(buffer.toByteArray(), 0);*/
int sizeLimit = 65000; // constant strings are limited to 64K, and I'm not brave enough to push right up to the limit
if (data.length() < sizeLimit) {
@@ -552,14 +551,18 @@
StringBuffer result = new StringBuffer();
result.append(object.getId());
result.append(" = ");
- String constructorParams = object.getConstructorParams();
- if (constructorParams != null) {
- //TC - 20081017 compiledObject can have generics
- result.append(" new ").append(JAXXCompiler.getCanonicalName(object)).append("(").append(constructorParams).append(");");
- //result.append("(").append(getCanonicalName(object.getObjectClass())).append(") new ").append(getCanonicalName(object.getObjectClass())).append("(").append(constructorParams).append(");");
+ if (object.isJavaBean() && object.getJavaBeanInitCode() != null) {
+ result.append(object.getJavaBeanInitCode()).append(";");
} else {
- //TC - 20081017 compiledObject can have generics
- result.append("new ").append(JAXXCompiler.getCanonicalName(object)).append("();");
+ String constructorParams = object.getConstructorParams();
+ if (constructorParams != null) {
+ //TC - 20081017 compiledObject can have generics
+ result.append(" new ").append(JAXXCompiler.getCanonicalName(object)).append("(").append(constructorParams).append(");");
+ //result.append("(").append(getCanonicalName(object.getObjectClass())).append(") new ").append(getCanonicalName(object.getObjectClass())).append("(").append(constructorParams).append(");");
+ } else {
+ //TC - 20081017 compiledObject can have generics
+ result.append("new ").append(JAXXCompiler.getCanonicalName(object)).append("();");
+ }
}
result.append(JAXXCompiler.getLineSeparator());
String initCode = object.getInitializationCode(compiler);
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/css/Rule.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/css/Rule.java 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/css/Rule.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -18,7 +18,7 @@
private Selector[] selectors;
private Map<String, String> properties;
- private static final long serialVersionUID = -5314603817367239301L;
+ private static final long serialVersionUID = 1L;
public Rule(Selector[] selectors, Map<String, String> properties) {
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/css/Stylesheet.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/css/Stylesheet.java 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/css/Stylesheet.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -32,7 +32,7 @@
public class Stylesheet implements Serializable {
private Rule[] rules;
- private static final long serialVersionUID = 1135373056555320671L;
+ private static final long serialVersionUID = 1L;
public Stylesheet() {
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/ComponentDescriptor.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/ComponentDescriptor.java 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/ComponentDescriptor.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -11,7 +11,7 @@
String javaClassName;
String styleClass;
ComponentDescriptor parent;
- private static final long serialVersionUID = 3001121176691770788L;
+ private static final long serialVersionUID = 1L;
public ComponentDescriptor(String id, String javaClassName, String styleClass, ComponentDescriptor parent) {
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/JAXXObjectDescriptor.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/JAXXObjectDescriptor.java 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/JAXXObjectDescriptor.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -11,7 +11,7 @@
public class JAXXObjectDescriptor implements Serializable {
private ComponentDescriptor[] descriptors;
private Stylesheet stylesheet;
- private static final long serialVersionUID = -1706159556633801154L;
+ private static final long serialVersionUID = 1L;
public JAXXObjectDescriptor(ComponentDescriptor[] descriptors,
@@ -29,4 +29,14 @@
public Stylesheet getStylesheet() {
return stylesheet;
}
+
+ @Override
+ public String toString() {
+ StringBuilder buffer = new StringBuilder();
+ for (ComponentDescriptor descriptor : descriptors) {
+ buffer.append("\n").append(descriptor);
+ }
+ buffer.append("\n").append(stylesheet);
+ return buffer.toString();
+ }
}
\ No newline at end of file
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/JXPathDecorator.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/JXPathDecorator.java 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/JXPathDecorator.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -1,11 +1,17 @@
package jaxx.runtime;
+import org.apache.commons.beanutils.MethodUtils;
+import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.jxpath.JXPathContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import java.beans.PropertyDescriptor;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
/**
@@ -50,23 +56,192 @@
*/
public static <O> JXPathDecorator<O> newDecorator(Class<O> internalClass, String expression)
throws IllegalArgumentException, NullPointerException {
- return new JXPathDecorator<O>(internalClass, expression);
+ return new JXPathDecorator<O>(internalClass, expression, true);
}
/**
- * expression to format using {@link String#format(String, Object[])}, all variables are compute
- * using using the jxpath tokens.
+ * Sort a list of data based on the first token property of a given context
+ * in a given decorator.
+ *
+ * @param decorator the decorator to use to sort
+ * @param datas the list of data to sort
+ * @param pos the index of context to used in decorator to obtain sorted property.
*/
- protected String expression;
+ public static void sort(JXPathDecorator decorator, List<?> datas, int pos) {
+ Collections.sort(datas, decorator.getComparator(pos));
+ }
- /** list of jxpath tokens to apply on expression */
- protected String[] tokens;
+ protected static class Context implements Serializable {
+ /**
+ * expression to format using {@link String#format(String, Object[])}, all variables are compute
+ * using using the jxpath tokens.
+ */
+ protected String expression;
+ /** list of jxpath tokens to apply on expression */
+ protected String[] tokens;
+
+ protected transient Comparator comparator;
+
+ private static final long serialVersionUID = 1L;
+
+ public Context(String expression, String[] tokens) {
+ this.expression = expression;
+ this.tokens = tokens;
+ }
+
+ public String getFirstProperty() {
+ return tokens[0];
+ }
+
+ public Comparator getComparator(JXPathDecorator decorator, int pos) {
+ if (comparator == null) {
+
+ final String property = tokens[pos];
+
+ Class<?> type = getType(decorator, pos);
+
+ // does not work with javassist, a shame...
+ //Comparator<?> comparator = new BeanComparator(property);
+
+ if (Number.class.isAssignableFrom(type) || Comparable.class.isAssignableFrom(type)) {
+ comparator = new Comparator() {
+ public int compare(Object o1, Object o2) {
+ Comparable c1 = getValue(o1);
+ Comparable c2 = getValue(o2);
+ return c1.compareTo(c2);
+ }
+
+ public Comparable<Comparable> getValue(Object o) {
+ try {
+ Object r = PropertyUtils.getProperty(o, property);
+ return (Comparable) r;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+ }
+ if (comparator == null) {
+ throw new IllegalStateException("could not find comparator for type " + type);
+ }
+ //todo fixme add a default comparator basedon toString() comparator ?
+ return comparator;
+ }
+ return comparator;
+ }
+
+ protected Class<?> getType(JXPathDecorator decorator, int pos) {
+ ensureTokenIndex(decorator, pos);
+
+ String property = getFirstProperty();
+
+ if (property == null) {
+ throw new NullPointerException("could not find property in " + this);
+ }
+
+ for (PropertyDescriptor descriptor : decorator.getDescriptors()) {
+ if (property.equals(descriptor.getName())) {
+ Class<?> type = descriptor.getReadMethod().getReturnType();
+ if (type.isPrimitive()) {
+ type = MethodUtils.getPrimitiveWrapper(type);
+ }
+ return type;
+ }
+ }
+ throw new IllegalStateException("could not find read method for property " + property);
+ }
+
+ @Override
+ public String toString() {
+ return "<expression:" + expression + ", tokens:" + Arrays.toString(tokens) + ">";
+ }
+ }
+
+ /** the computed context of the decorator */
+ protected Context context;
+
/** nb jxpath tokens to compute */
protected int nbToken;
- protected JXPathDecorator(Class<O> internalClass, String expression) throws IllegalArgumentException, NullPointerException {
+ /** the initial expression used to compute the decorator context. */
+ protected String initialExpression;
+
+ /** cache of descriptors of the internal class (used for sorting) */
+ protected transient PropertyDescriptor[] descriptors;
+
+ public String toString(Object bean) {
+ if (bean == null) {
+ return null;
+ }
+ JXPathContext jxcontext = JXPathContext.newContext(bean);
+ Object[] args = new Object[nbToken];
+ for (int i = 0; i < nbToken; i++) {
+ args[i] = jxcontext.getValue(context.tokens[i]);
+ }
+ return String.format(context.expression, args);
+ }
+
+ public String getProperty(int pos) {
+ return getTokens()[pos];
+ }
+
+ public String getExpression() {
+ return context.expression;
+ }
+
+ public String[] getTokens() {
+ return context.tokens;
+ }
+
+ public int getNbToken() {
+ return nbToken;
+ }
+
+ public String getInitialExpression() {
+ return initialExpression;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + "<" + context + ">";
+ }
+
+ public PropertyDescriptor[] getDescriptors() {
+ if (descriptors == null) {
+ descriptors = PropertyUtils.getPropertyDescriptors(internalClass);
+ }
+ return descriptors;
+ }
+
+ public void setContext(Context context) {
+ this.context = context;
+ this.nbToken = context.tokens.length;
+ // always reset comparator
+ //this.context.comparator = null;
+ if (log.isDebugEnabled()) {
+ log.debug(context);
+ }
+ }
+
+ protected JXPathDecorator(Class<O> internalClass, String expression, boolean creatContext) throws IllegalArgumentException, NullPointerException {
super(internalClass);
+ this.initialExpression = expression;
+ if (creatContext) {
+ setContext(createInitialContext(expression));
+ if (log.isDebugEnabled()) {
+ log.debug(expression + " --> " + this.context);
+ }
+ }
+ }
+
+ @SuppressWarnings({"unchecked"})
+ protected Comparator<O> getComparator(int pos) {
+ ensureTokenIndex(this, pos);
+ return context.getComparator(this, pos);
+ }
+
+ protected static Context createInitialContext(String expression) {
List<String> lTokens = new ArrayList<String>();
StringBuilder buffer = new StringBuilder();
int size = expression.length();
@@ -96,41 +271,12 @@
// suffix after end jxpath (or all expression if no jxpath)
buffer.append(expression.substring(end + 1));
}
-
- this.tokens = lTokens.toArray(new String[lTokens.size()]);
- this.nbToken = tokens.length;
- this.expression = buffer.toString();
- if (log.isDebugEnabled()) {
- log.debug(expression + " --> " + this);
- }
+ return new Context(buffer.toString(), lTokens.toArray(new String[lTokens.size()]));
}
- public String toString(Object bean) {
- if (bean == null) {
- return null;
+ protected static void ensureTokenIndex(JXPathDecorator decorator, int pos) {
+ if (pos < -1 || pos > decorator.getNbToken()) {
+ throw new ArrayIndexOutOfBoundsException("token index " + pos + " is out of bound, can be inside [" + 0 + "," + decorator.nbToken + "]");
}
- JXPathContext jxcontext = JXPathContext.newContext(bean);
- Object[] args = new Object[nbToken];
- for (int i = 0; i < nbToken; i++) {
- args[i] = jxcontext.getValue(tokens[i]);
- }
- return String.format(expression, args);
}
-
- public String getExpression() {
- return expression;
- }
-
- public String[] getTokens() {
- return tokens;
- }
-
- public int getNbToken() {
- return nbToken;
- }
-
- @Override
- public String toString() {
- return super.toString() + "<expression:" + expression + ", tokens:" + Arrays.toString(tokens) + ">";
- }
}
Copied: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/MultiJXPathDecorator.java (from rev 1047, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/JXPathDecorator.java)
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/MultiJXPathDecorator.java (rev 0)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/MultiJXPathDecorator.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -0,0 +1,119 @@
+package jaxx.runtime;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.StringTokenizer;
+
+/**
+ * TODO
+ *
+ * @author chemit
+ * @see jaxx.runtime.Decorator
+ */
+public class MultiJXPathDecorator<O> extends JXPathDecorator<O> {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ private static final Log log = LogFactory.getLog(MultiJXPathDecorator.class);
+
+ private static final long serialVersionUID = 1L;
+
+ public static <O> MultiJXPathDecorator<O> newDecorator(Class<O> internalClass,
+ String expression,
+ String separator)
+ throws IllegalArgumentException, NullPointerException {
+
+ return newDecorator(internalClass, expression, separator, separator);
+ }
+
+ public static <O> MultiJXPathDecorator<O> newDecorator(Class<O> internalClass,
+ String expression,
+ String separator,
+ String separatorReplacement)
+ throws IllegalArgumentException, NullPointerException {
+
+ Context[] contexts = createInitialContexts(expression, separator, separatorReplacement);
+
+ return new MultiJXPathDecorator<O>(internalClass, expression, separator, separatorReplacement, contexts);
+ }
+
+ protected Context[] contexts;
+ protected String separator;
+ protected String separatorReplacement;
+
+
+ protected MultiJXPathDecorator(Class<O> internalClass, String expression,
+ String separator, String separatorReplacement,
+ Context[] contexts) throws IllegalArgumentException, NullPointerException {
+ super(internalClass, expression, false);
+ this.separator = separator;
+ this.separatorReplacement = separatorReplacement;
+ this.contexts = contexts;
+
+ setContextIndex(0);
+
+ if (log.isDebugEnabled()) {
+ log.debug(expression + " --> " + this.context);
+ }
+ }
+
+ public void setContextIndex(int index) {
+ ensureContextIndex(this, index);
+ setContext(contexts[index]);
+ }
+
+ public int getNbContext() {
+ return contexts.length;
+ }
+
+ public String getSeparator() {
+ return separator;
+ }
+
+ public String getSeparatorReplacement() {
+ return separatorReplacement;
+ }
+
+ @Override
+ protected Comparator<O> getComparator(int pos) {
+ ensureContextIndex(this, pos);
+ return contexts[pos].getComparator(this, 0);
+ }
+
+ protected static Context[] createInitialContexts(String expression, String separator, String separatorReplacement) {
+ int sep = expression.indexOf(separator);
+ if (sep == -1) {
+ return new Context[]{createInitialContext(expression)};
+ }
+
+ List<String> tokens = new ArrayList<String>();
+ StringTokenizer stk = new StringTokenizer(expression, separator);
+ while (stk.hasMoreTokens()) {
+ tokens.add(stk.nextToken());
+ }
+
+ int nbTokens = tokens.size();
+ Context[] contexts = new Context[nbTokens];
+ for (int i = 0; i < nbTokens; i++) {
+ StringBuilder buffer = new StringBuilder(expression.length());
+ for (int j = 0; j < nbTokens; j++) {
+ int index = (i + j) % nbTokens;
+ String str = tokens.get(index);
+ //todo replace %index with %j
+ buffer.append(separatorReplacement).append(str);
+ }
+ contexts[i] = createInitialContext(buffer.substring(separatorReplacement.length()));
+ }
+ return contexts;
+ }
+
+ protected static void ensureContextIndex(MultiJXPathDecorator decorator, int pos) {
+ if (pos < -1 || pos > decorator.contexts.length) {
+ throw new ArrayIndexOutOfBoundsException("context index " + pos + " is out of bound, can be inside [" + 0 + "," + decorator.contexts.length + "]");
+ }
+ }
+
+}
\ No newline at end of file
Property changes on: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/MultiJXPathDecorator.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/Util.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/Util.java 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/Util.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -1,5 +1,6 @@
package jaxx.runtime;
+import jaxx.Base64Coder;
import jaxx.runtime.validator.BeanValidator;
import jaxx.runtime.validator.ErrorListMouseListener;
import jaxx.runtime.validator.ErrorTableMouseListener;
@@ -7,6 +8,7 @@
import org.apache.commons.logging.LogFactory;
import org.jdesktop.jxlayer.JXLayer;
+import javax.swing.DefaultListCellRenderer;
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.JTable;
@@ -18,9 +20,7 @@
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;
@@ -35,7 +35,6 @@
import java.util.ListIterator;
import java.util.Map;
import java.util.WeakHashMap;
-import java.util.zip.GZIPInputStream;
public class Util {
@@ -66,12 +65,13 @@
*/
public static JAXXObjectDescriptor decodeJAXXObjectDescriptor(String descriptor) {
try {
- byte[] data = new byte[descriptor.length()];
+ return (JAXXObjectDescriptor) Base64Coder.deserialize(descriptor, false);
+ /*byte[] data = new byte[descriptor.length()];
// copy low-order bytes into the array. The high-order bytes should all be zero.
System.arraycopy(descriptor.getBytes(), 0, data, 0, data.length);
//descriptor.getBytes(0, descriptor.length(), data, 0);
ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(data));
- return (JAXXObjectDescriptor) in.readObject();
+ return (JAXXObjectDescriptor) in.readObject();*/
}
catch (IOException e) {
throw new RuntimeException("Internal error: can't-happen error", e);
@@ -84,12 +84,14 @@
public static JAXXObjectDescriptor decodeCompressedJAXXObjectDescriptor(String descriptor) {
try {
- byte[] data = new byte[descriptor.length()];
+ return (JAXXObjectDescriptor) Base64Coder.deserialize(descriptor, true);
+
+ /*byte[] data = new byte[descriptor.length()];
// copy low-order bytes into the array. The high-order bytes should all be zero.
System.arraycopy(descriptor.getBytes(), 0, data, 0, data.length);
//descriptor.getBytes(0, descriptor.length(), data, 0);
ObjectInputStream in = new ObjectInputStream(new GZIPInputStream(new ByteArrayInputStream(data)));
- return (JAXXObjectDescriptor) in.readObject();
+ return (JAXXObjectDescriptor) in.readObject();*/
}
catch (IOException e) {
throw new RuntimeException("Internal error: can't-happen error", e);
@@ -507,4 +509,20 @@
beanValidator.setChanged(newValue);
}
}
+
+ public static <O> DefaultListCellRenderer newDecoratedListCellRenderer(final Decorator<O> decorator) {
+ return new DefaultListCellRenderer() {
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+ String decorated;
+ if (value instanceof String) {
+ decorated = (String) value;
+ } else {
+ decorated = decorator.toString(value);
+ }
+ return super.getListCellRendererComponent(list, decorated, index, isSelected, cellHasFocus);
+ }
+ };
+ }
+
}
Added: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/I18nTableCellHeaderRenderer.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/I18nTableCellHeaderRenderer.java (rev 0)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/I18nTableCellHeaderRenderer.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -0,0 +1,38 @@
+package jaxx.runtime.swing;
+
+import static org.codelutin.i18n.I18n._;
+
+import javax.swing.JLabel;
+import javax.swing.JTable;
+import javax.swing.table.TableCellRenderer;
+import java.awt.Component;
+
+/**
+ * A simple TableCellRenderer using a delegate TableCellRenderer to render everything elese thant the text :
+ * the text is I18nalize.
+ *
+ * @author chemit
+ */
+public class I18nTableCellHeaderRenderer implements TableCellRenderer {
+
+ /** the libelles to display */
+ protected final String[] keys;
+
+ /** the delegate cell renderer */
+ protected TableCellRenderer delegate;
+
+ public I18nTableCellHeaderRenderer(TableCellRenderer delegate, String... keys) {
+ this.delegate = delegate;
+ this.keys = keys;
+ }
+
+ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasfocus, int row, int column) {
+ if (column > keys.length) {
+ throw new IndexOutOfBoundsException("colum can not be greater than " + keys.length);
+ }
+ JLabel rendererComponent = (JLabel) delegate.getTableCellRendererComponent(table, value, isSelected, hasfocus, row, column);
+
+ rendererComponent.setText(_(keys[column]));
+ return rendererComponent;
+ }
+}
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/JAXXButtonGroup.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/JAXXButtonGroup.java 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/JAXXButtonGroup.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -8,6 +8,7 @@
import javax.swing.ButtonGroup;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
+import javax.swing.event.EventListenerList;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.Enumeration;
@@ -15,15 +16,33 @@
public class JAXXButtonGroup extends ButtonGroup {
public static final String SELECTED_VALUE_PROPERTY = "selectedValue";
+ public static final String BUTTON8GROUP_CLIENT_PROPERTY = "$buttonGroup";
+
+ public static final String VALUE_CLIENT_PROPERTY = "$value";
+
+ public static final String SELECTED_TIP_CLIENT_PROPERTY = "$selected.toolTipText";
+
+ public static final String NOT_SELECTED_TIP_CLIENT_PROPERTY = "$not.selected.toolTipText";
+
+ protected EventListenerList listenerList = new EventListenerList();
+
private PropertyChangeSupport propertyChangeSupport;
- private Object selectedValue;
- private ChangeListener changeListener = new ChangeListener() {
+ private transient Object selectedValue;
+
+ protected boolean useToolTipText;
+
+ protected transient ChangeEvent changeEvent = new ChangeEvent(this);
+
+ private transient ChangeListener changeListener = new ChangeListener() {
public void stateChanged(ChangeEvent e) {
updateSelectedValue();
+ if (useToolTipText) {
+ updateToolTipText();
+ }
}
};
- private static final long serialVersionUID = -2096340516687228691L;
+ private static final long serialVersionUID = 1L;
@Override
public void add(AbstractButton button) {
@@ -45,7 +64,7 @@
while (e.hasMoreElements()) {
AbstractButton button = e.nextElement();
if (button.isSelected()) {
- Object selectedValue = button.getClientProperty("$value");
+ Object selectedValue = button.getClientProperty(VALUE_CLIENT_PROPERTY );
if (selectedValue != getSelectedValue()) {
setSelectedValue(selectedValue);
}
@@ -53,7 +72,19 @@
}
}
+ public void updateToolTipText() {
+ Enumeration<AbstractButton> e = getElements();
+ while (e.hasMoreElements()) {
+ AbstractButton button = e.nextElement();
+ String key = button.isSelected() ? SELECTED_TIP_CLIENT_PROPERTY : NOT_SELECTED_TIP_CLIENT_PROPERTY;
+ button.setToolTipText((String) button.getClientProperty(key));
+ }
+ }
+ public boolean isUseToolTipText() {
+ return useToolTipText;
+ }
+
public Object getSelectedValue() {
return selectedValue;
}
@@ -65,7 +96,32 @@
firePropertyChange(oldValue);
}
+ public void setUseToolTipText(boolean useToolTipText) {
+ this.useToolTipText = useToolTipText;
+ }
+ public void setSelectedButton(Object value) {
+ setSelectedValue(value);
+ if (value == null) {
+ Enumeration<AbstractButton> e = getElements();
+ while (e.hasMoreElements()) {
+ AbstractButton button = e.nextElement();
+ setSelected(button.getModel(), false);
+ }
+ return;
+ }
+
+ Enumeration<AbstractButton> e = getElements();
+ while (e.hasMoreElements()) {
+ AbstractButton button = e.nextElement();
+ Object selectedValue = button.getClientProperty(VALUE_CLIENT_PROPERTY );
+ if (value.equals(selectedValue)) {
+ button.setSelected(true);
+ break;
+ }
+ }
+ }
+
protected PropertyChangeSupport getPropertyChangeSupport() {
if (propertyChangeSupport == null) {
propertyChangeSupport = new PropertyChangeSupport(this);
@@ -99,5 +155,61 @@
getPropertyChangeSupport().firePropertyChange(SELECTED_VALUE_PROPERTY,
oldValue, getSelectedValue());
}
+ fireStateChanged();
}
+
+ /**
+ * Adds a <code>ChangeListener</code> to the button.
+ *
+ * @param l the listener to be added
+ */
+ public void addChangeListener(ChangeListener l) {
+ listenerList.add(ChangeListener.class, l);
+ }
+
+ /**
+ * Removes a ChangeListener from the button.
+ *
+ * @param l the listener to be removed
+ */
+ public void removeChangeListener(ChangeListener l) {
+ listenerList.remove(ChangeListener.class, l);
+ }
+
+ /**
+ * Returns an array of all the <code>ChangeListener</code>s added
+ * to this AbstractButton with addChangeListener().
+ *
+ * @return all of the <code>ChangeListener</code>s added or an empty
+ * array if no listeners have been added
+ * @since 1.4
+ */
+ public ChangeListener[] getChangeListeners() {
+ return listenerList.getListeners(ChangeListener.class);
+ }
+
+ /**
+ * Notifies all listeners that have registered interest for
+ * notification on this event type. The event instance
+ * is lazily created.
+ *
+ * @see EventListenerList
+ */
+ protected void fireStateChanged() {
+ // Guaranteed to return a non-null array
+ Object[] listeners = listenerList.getListenerList();
+ // Process the listeners last to first, notifying
+ // those that are interested in this event
+ for (int i = listeners.length - 2; i >= 0; i -= 2) {
+ if (listeners[i] == ChangeListener.class) {
+ // Lazily create the event:
+ if (changeEvent == null) {
+ changeEvent = new ChangeEvent(this);
+ }
+ ((ChangeListener) listeners[i + 1]).stateChanged(changeEvent);
+ }
+ }
+ }
+
+
}
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/DefaultObjectHandler.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/DefaultObjectHandler.java 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/DefaultObjectHandler.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -663,7 +663,10 @@
continue;
}
if (name.equals("javaBean")) {
- object.setJavaBean(true);
+ object.setJavaBean(true);
+ if (!value.isEmpty()) {
+ object.setJavaBeanInitCode(value);
+ }
return;
}
if (name.equals("implements")) {
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/JRadioButtonHandler.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/JRadioButtonHandler.java 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/JRadioButtonHandler.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -18,8 +18,8 @@
import javax.swing.event.ChangeListener;
public class JRadioButtonHandler extends DefaultComponentHandler {
- private static final String VALUE_PROPERTY = "value";
- private static final String BUTTON_GROUP_PROPERTY = "buttonGroup";
+ private static final String VALUE_PROPERTY = JAXXButtonGroup.VALUE_CLIENT_PROPERTY.substring(1);
+ private static final String BUTTON_GROUP_PROPERTY = JAXXButtonGroup.BUTTON8GROUP_CLIENT_PROPERTY.substring(1);
public JRadioButtonHandler(ClassDescriptor beanClass) {
super(beanClass);
@@ -69,7 +69,7 @@
}
return "{ javax.swing.ButtonGroup $buttonGroup = " + valueCode + "; " + id + ".putClientProperty(\"$buttonGroup\", $buttonGroup); $buttonGroup.add(" + id + "); }\n";
} else if (name.equals(VALUE_PROPERTY))
- return "{ " + id + ".putClientProperty(\"$value\", " + valueCode + "); Object $buttonGroup = " + id + ".getClientProperty(\"$buttonGroup\");" +
+ return "{ " + id + ".putClientProperty(\""+JAXXButtonGroup.VALUE_CLIENT_PROPERTY+"\", " + valueCode + "); Object $buttonGroup = " + id + ".getClientProperty(\""+JAXXButtonGroup.BUTTON8GROUP_CLIENT_PROPERTY+"\");" +
" if ($buttonGroup instanceof jaxx.runtime.swing.JAXXButtonGroup) { ((jaxx.runtime.swing.JAXXButtonGroup) $buttonGroup).updateSelectedValue(); } }\n";
else
return super.getSetPropertyCode(id, name, valueCode, compiler);
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/SwingInitializer.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/SwingInitializer.java 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/SwingInitializer.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -18,8 +18,8 @@
import jaxx.tags.DefaultObjectHandler;
import jaxx.tags.TagManager;
import jaxx.tags.validator.BeanValidatorHandler;
+import jaxx.tags.validator.ExcludeFieldValidatorHandler;
import jaxx.tags.validator.FieldValidatorHandler;
-import jaxx.tags.validator.ExcludeFieldValidatorHandler;
import jaxx.types.KeyStrokeConverter;
import jaxx.types.TypeManager;
Modified: lutinjaxx/trunk/jaxx-core/src/test/java/jaxx/runtime/JXPathDecoratorTest.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/test/java/jaxx/runtime/JXPathDecoratorTest.java 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/jaxx-core/src/test/java/jaxx/runtime/JXPathDecoratorTest.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -36,9 +36,9 @@
public void testNullBean() throws Exception {
decorator = JXPathDecorator.newDecorator(Object.class, "hello");
expected = "hello";
- assertEquals(expected, decorator.expression);
+ assertEquals(expected, decorator.getExpression());
assertEquals(0, decorator.nbToken);
- assertEquals(0, decorator.tokens.length);
+ assertEquals(0, decorator.getTokens().length);
result = decorator.toString(null);
assertEquals(null, result);
@@ -48,43 +48,49 @@
public void testNoJXPath() throws Exception {
decorator = JXPathDecorator.newDecorator(Object.class, "hello");
expected = "hello";
- assertEquals(expected, decorator.expression);
+ assertEquals(expected, decorator.getExpression());
assertEquals(0, decorator.nbToken);
- assertEquals(0, decorator.tokens.length);
+ assertEquals(0, decorator.getTokens().length);
result = decorator.toString(this);
assertEquals(expected, result);
}
-
@Test
public void testDecorator() throws Exception {
decorator = JXPathDecorator.newDecorator(JXPathDecorator.class, "${expression}$s - ${nbToken}$d");
- assertEquals("%1$s - %2$d", decorator.expression);
+ assertEquals("%1$s - %2$d", decorator.getExpression());
assertDecoratorInternal();
decorator = JXPathDecorator.newDecorator(JXPathDecorator.class, "${expression}${nbToken}");
- assertEquals("%1%2", decorator.expression);
+ assertEquals("%1%2", decorator.getExpression());
assertDecoratorInternal();
decorator = JXPathDecorator.newDecorator(JXPathDecorator.class, "before ${expression}$s - ${nbToken}$d after");
- assertEquals("before %1$s - %2$d after", decorator.expression);
+ assertEquals("before %1$s - %2$d after", decorator.getExpression());
assertDecoratorInternal();
decorator = JXPathDecorator.newDecorator(JXPathDecorator.class, "before${expression}$s-${nbToken}$dafter");
- assertEquals("before%1$s-%2$dafter", decorator.expression);
+ assertEquals("before%1$s-%2$dafter", decorator.getExpression());
assertDecoratorInternal();
}
- public void assertDecoratorInternal() {
- assertEquals(2, decorator.nbToken);
- assertEquals(2, decorator.tokens.length);
- assertEquals("expression", decorator.tokens[0]);
- assertEquals("nbToken", decorator.tokens[1]);
- expected = String.format(decorator.expression, decorator.getExpression(), decorator.getNbToken());
+ public void assertDecoratorInternal(String... tokens) {
+ assertTokens(tokens);
+ expected = String.format(decorator.getExpression(), decorator.getExpression(), decorator.getNbToken());
result = decorator.toString(decorator);
assertEquals(expected, result);
}
+ private void assertTokens(String... tokens) {
+ if (tokens.length == 0) {
+ tokens = new String[]{"expression", "nbToken"};
+ }
+ assertEquals(2, decorator.nbToken);
+ assertEquals(2, decorator.getTokens().length);
+ assertEquals(tokens[0], decorator.getTokens()[0]);
+ assertEquals(tokens[1], decorator.getTokens()[1]);
+ }
+
}
Copied: lutinjaxx/trunk/jaxx-core/src/test/java/jaxx/runtime/MultiJXPathDecoratorTest.java (from rev 1047, lutinjaxx/trunk/jaxx-core/src/test/java/jaxx/runtime/JXPathDecoratorTest.java)
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/test/java/jaxx/runtime/MultiJXPathDecoratorTest.java (rev 0)
+++ lutinjaxx/trunk/jaxx-core/src/test/java/jaxx/runtime/MultiJXPathDecoratorTest.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -0,0 +1,149 @@
+package jaxx.runtime;
+
+import org.junit.After;
+import static org.junit.Assert.assertEquals;
+import org.junit.Test;
+
+/** @author chemit */
+public class MultiJXPathDecoratorTest {
+
+
+ protected MultiJXPathDecorator<?> decorator;
+ protected String expected;
+ protected String result;
+
+ @After
+ public void after() {
+ decorator = null;
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testNullInternalClass() throws Exception {
+ decorator = MultiJXPathDecorator.newDecorator(null, "hello", "#");
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testMissingRightBrace() throws Exception {
+ decorator = MultiJXPathDecorator.newDecorator(Object.class, "${haha", "#");
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testMissingRightBrace2() throws Exception {
+ decorator = MultiJXPathDecorator.newDecorator(Object.class, "${haha${hum}", "#");
+ }
+
+ @Test
+ public void testNullBean() throws Exception {
+ decorator = MultiJXPathDecorator.newDecorator(Object.class, "hello", "");
+ expected = "hello";
+ assertEquals(expected, decorator.getExpression());
+ assertEquals(0, decorator.nbToken);
+ assertEquals(0, decorator.getTokens().length);
+
+ result = decorator.toString(null);
+ assertEquals(null, result);
+ }
+
+ @Test
+ public void testMultiDecorator() throws Exception {
+
+ decorator = MultiJXPathDecorator.newDecorator(JXPathDecorator.class, "${expression}$s#${nbToken}$d", "#", " - ");
+ assertEquals("%1$s - %2$d", decorator.getExpression());
+ assertDecoratorInternal();
+ assertEquals(2, decorator.contexts.length);
+ decorator.setContextIndex(1);
+ assertEquals("%1$d - %2$s", decorator.getExpression());
+ assertTokens("nbToken", "expression");
+ expected = String.format(decorator.getExpression(), decorator.getNbToken(), decorator.getExpression());
+ result = decorator.toString(decorator);
+ assertEquals(expected, result);
+
+ decorator = MultiJXPathDecorator.newDecorator(JXPathDecorator.class, "${expression}$s ## ${nbToken}$d", " ## ", " - ");
+ assertEquals("%1$s - %2$d", decorator.getExpression());
+ assertDecoratorInternal();
+ assertEquals(2, decorator.contexts.length);
+ decorator.setContextIndex(1);
+ assertEquals("%1$d - %2$s", decorator.getExpression());
+ assertTokens("nbToken", "expression");
+ expected = String.format(decorator.getExpression(), decorator.getNbToken(), decorator.getExpression());
+ result = decorator.toString(decorator);
+ assertEquals(expected, result);
+ }
+
+ @Test
+ public void testMultiDecorator2() throws Exception {
+
+ decorator = MultiJXPathDecorator.newDecorator(JXPathDecorator.class, "${expression}$s#${nbToken}$d#${separator}$s", "#", " - ");
+
+ assertEquals("%1$s - %2$d - %3$s", decorator.getExpression());
+ assertTokens("expression", "nbToken", "separator");
+ assertEquals(3, decorator.contexts.length);
+
+ expected = String.format(decorator.getExpression(), decorator.getExpression(), decorator.getNbToken(), decorator.getSeparator());
+ result = decorator.toString(decorator);
+ assertEquals(expected, result);
+
+ decorator.setContextIndex(1);
+ assertEquals("%1$d - %2$s - %3$s", decorator.getExpression());
+ assertTokens("nbToken", "separator", "expression");
+ expected = String.format(decorator.getExpression(), decorator.getNbToken(), decorator.getSeparator(), decorator.getExpression());
+ result = decorator.toString(decorator);
+ assertEquals(expected, result);
+
+ decorator.setContextIndex(2);
+ assertEquals("%1$s - %2$s - %3$d", decorator.getExpression());
+ assertTokens("separator", "expression", "nbToken");
+
+ expected = String.format(decorator.getExpression(), decorator.getSeparator(), decorator.getExpression(), decorator.getNbToken());
+ result = decorator.toString(decorator);
+ assertEquals(expected, result);
+ }
+
+ @Test
+ public void testMultiDecoratorWithMultiRef() throws Exception {
+
+ decorator = MultiJXPathDecorator.newDecorator(JXPathDecorator.class, "${expression}$s#${nbToken}$d#${separator}$s %3$s", "#", " - ");
+
+ assertEquals("%1$s - %2$d - %3$s %3$s", decorator.getExpression());
+ assertTokens("expression", "nbToken", "separator");
+ assertEquals(3, decorator.contexts.length);
+
+ expected = String.format(decorator.getExpression(), decorator.getExpression(), decorator.getNbToken(), decorator.getSeparator());
+ result = decorator.toString(decorator);
+ assertEquals(expected, result);
+
+ decorator.setContextIndex(1);
+ assertEquals("%1$d - %2$s %3$s - %3$s", decorator.getExpression());
+ assertTokens("nbToken", "separator", "expression");
+ expected = String.format(decorator.getExpression(), decorator.getNbToken(), decorator.getSeparator(), decorator.getExpression());
+ result = decorator.toString(decorator);
+ assertEquals(expected, result);
+
+ decorator.setContextIndex(2);
+ assertEquals("%1$s %3$s - %2$s - %3$d", decorator.getExpression());
+ assertTokens("separator", "expression", "nbToken");
+
+ expected = String.format(decorator.getExpression(), decorator.getSeparator(), decorator.getExpression(), decorator.getNbToken());
+ result = decorator.toString(decorator);
+ assertEquals(expected, result);
+ }
+
+ public void assertDecoratorInternal(String... tokens) {
+ assertTokens(tokens);
+ expected = String.format(decorator.getExpression(), decorator.getExpression(), decorator.getNbToken());
+ result = decorator.toString(decorator);
+ assertEquals(expected, result);
+ }
+
+ private void assertTokens(String... tokens) {
+ if (tokens.length == 0) {
+ tokens = new String[]{"expression", "nbToken"};
+ }
+ assertEquals(tokens.length, decorator.nbToken);
+ assertEquals(tokens.length, decorator.getTokens().length);
+ for (int i = 0; i < tokens.length; i++) {
+ assertEquals(tokens[i], decorator.getTokens()[i]);
+ }
+ }
+
+}
\ No newline at end of file
Property changes on: lutinjaxx/trunk/jaxx-core/src/test/java/jaxx/runtime/MultiJXPathDecoratorTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: lutinjaxx/trunk/maven-jaxx-plugin/changelog.txt
===================================================================
--- lutinjaxx/trunk/maven-jaxx-plugin/changelog.txt 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/maven-jaxx-plugin/changelog.txt 2008-12-10 09:04:11 UTC (rev 1060)
@@ -1,5 +1,6 @@
0.7 chemit 200812??
- * 20081207 [chemit] use lutinproject 3.1
+* 20081208 [chemit] - javabBean attribute use to initialize bean
+* 20081207 [chemit] use lutinproject 3.1
0.6 chemit 200811??
* 20081108 [chemit] can add extra imports in JaxxGeneratorMojo (will be added to all generated java files).
Modified: lutinjaxx/trunk/maven-jaxx-plugin/src/main/java/org/codelutin/jaxx/JaxxGeneratorMojo.java
===================================================================
--- lutinjaxx/trunk/maven-jaxx-plugin/src/main/java/org/codelutin/jaxx/JaxxGeneratorMojo.java 2008-12-10 08:50:08 UTC (rev 1059)
+++ lutinjaxx/trunk/maven-jaxx-plugin/src/main/java/org/codelutin/jaxx/JaxxGeneratorMojo.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -152,6 +152,14 @@
* @parameter expression="${jaxx.addLogger}" default-value="true"
*/
protected boolean addLogger;
+ /**
+ * flag to keep compilers after the generate operation (usefull for tests.
+ * <p/>
+ * By default, always reset.
+ *
+ * @parameter expression="${jaxx.resetAfterCompile}" default-value="true"
+ */
+ protected boolean resetAfterCompile;
/**
* the name of implementation of {@link jaxx.runtime.JAXXContext}
@@ -284,6 +292,7 @@
result.setVerbose(verbose);
result.setI18nable(i18nable);
result.setAddLogger(addLogger);
+ result.setResetAfterCompile(resetAfterCompile);
result.setJaxxContextImplementorClass(jaxxContextImplementorClass);
result.setExtraImports(extraImports);
return result;
Copied: lutinjaxx/trunk/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Bug1750Test.java (from rev 1003, lutinjaxx/trunk/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Bug1722Test.java)
===================================================================
--- lutinjaxx/trunk/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Bug1750Test.java (rev 0)
+++ lutinjaxx/trunk/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Bug1750Test.java 2008-12-10 09:04:11 UTC (rev 1060)
@@ -0,0 +1,44 @@
+package org.codelutin.jaxx;
+
+import jaxx.Base64Coder;
+import jaxx.compiler.JAXXCompiler;
+import jaxx.compiler.JAXXCompilerHelper;
+import jaxx.runtime.JAXXObjectDescriptor;
+import jaxx.runtime.Util;
+
+/** @author chemit */
+public class Bug1750Test extends JaxxBaseTest {
+
+ public void testBug_1750() throws Exception {
+ mojo.execute();
+ assertEquals(1, mojo.getFiles().length);
+
+ JAXXCompiler compiler = JAXXCompilerHelper.getJAXXCompiler("testcases.bug_1750.ComboBox");
+ assertNotNull(compiler);
+
+ JAXXObjectDescriptor descriptor = compiler.getJAXXObjectDescriptor();
+ assertNotNull(descriptor);
+
+ String data = Base64Coder.serialize(descriptor, false);
+
+ JAXXObjectDescriptor descriptor2 = (JAXXObjectDescriptor) Base64Coder.deserialize(data, false);
+ assertNotNull(descriptor2);
+ assertEquals(descriptor.toString(), descriptor2.toString());
+
+ descriptor2 = Util.decodeJAXXObjectDescriptor(data);
+ assertNotNull(descriptor2);
+ assertEquals(descriptor.toString(), descriptor2.toString());
+
+ data = Base64Coder.serialize(descriptor, true);
+
+ descriptor2 = (JAXXObjectDescriptor) Base64Coder.deserialize(data, true);
+ assertNotNull(descriptor2);
+ assertEquals(descriptor.toString(), descriptor2.toString());
+
+ descriptor2 = Util.decodeCompressedJAXXObjectDescriptor(data);
+ assertNotNull(descriptor2);
+ assertEquals(descriptor.toString(), descriptor2.toString());
+
+ }
+
+}
\ No newline at end of file
Property changes on: lutinjaxx/trunk/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/Bug1750Test.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/testcases/Bug_1750.xml (from rev 1003, lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/testcases/Bug_1722.xml)
===================================================================
--- lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/testcases/Bug_1750.xml (rev 0)
+++ lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/testcases/Bug_1750.xml 2008-12-10 09:04:11 UTC (rev 1060)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <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</outJava>
+ <outResource>${basedir}/target/it-generated-source/resources</outResource>
+ <force>true</force>
+ <verbose>true</verbose>
+ <resetAfterCompile>false</resetAfterCompile>
+ <includes>
+ <value>**/bug_1750/*.jaxx</value>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Property changes on: lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/testcases/Bug_1750.xml
___________________________________________________________________
Name: svn:mergeinfo
+
Added: lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/testcases/bug_1750/ComboBox.jaxx
===================================================================
--- lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/testcases/bug_1750/ComboBox.jaxx (rev 0)
+++ lutinjaxx/trunk/maven-jaxx-plugin/src/test/resources/testcases/bug_1750/ComboBox.jaxx 2008-12-10 09:04:11 UTC (rev 1060)
@@ -0,0 +1,18 @@
+<Table>
+
+ <!-- selectedItem state -->
+ <Object id='selectedItem' javaBean=''/>
+
+ <!-- check state -->
+ <Boolean id='check' constructorParams='false' javaBean=''/>
+
+ <row>
+ <cell>
+ <JComboBox id='combobox' selectedItem='{getSelectedItem()}'
+ onItemStateChanged='setSelectedItem(combobox.getSelectedItem())'/>
+ </cell>
+ <cell>
+ <JCheckBox id='checkbox' selected='{isCheck()}' onActionPerformed='setCheck(checkbox.isSelected())'/>
+ </cell>
+ </row>
+</Table>
1
0
r1059 - in lutinjaxx/trunk/jaxx-example/BeanDataBinding: . src/main/java/examples/BeanDataBinding
by tchemit@users.labs.libre-entreprise.org 10 Dec '08
by tchemit@users.labs.libre-entreprise.org 10 Dec '08
10 Dec '08
Author: tchemit
Date: 2008-12-10 08:50:08 +0000 (Wed, 10 Dec 2008)
New Revision: 1059
Modified:
lutinjaxx/trunk/jaxx-example/BeanDataBinding/changelog.txt
lutinjaxx/trunk/jaxx-example/BeanDataBinding/src/main/java/examples/BeanDataBinding/BaseBeanDataBinding.jaxx
lutinjaxx/trunk/jaxx-example/BeanDataBinding/src/main/java/examples/BeanDataBinding/BeanDataBinding.jaxx
Log:
javaBean attribute use to initialize bean
Modified: lutinjaxx/trunk/jaxx-example/BeanDataBinding/changelog.txt
===================================================================
--- lutinjaxx/trunk/jaxx-example/BeanDataBinding/changelog.txt 2008-12-07 12:06:03 UTC (rev 1058)
+++ lutinjaxx/trunk/jaxx-example/BeanDataBinding/changelog.txt 2008-12-10 08:50:08 UTC (rev 1059)
@@ -1,2 +1,3 @@
0.7 chemit 200812??
+ * 20081208 [chemit] javaBean attribute use to initialize bean
* 20081207 [chemit] use lutinproject 3.1
\ No newline at end of file
Modified: lutinjaxx/trunk/jaxx-example/BeanDataBinding/src/main/java/examples/BeanDataBinding/BaseBeanDataBinding.jaxx
===================================================================
--- lutinjaxx/trunk/jaxx-example/BeanDataBinding/src/main/java/examples/BeanDataBinding/BaseBeanDataBinding.jaxx 2008-12-07 12:06:03 UTC (rev 1058)
+++ lutinjaxx/trunk/jaxx-example/BeanDataBinding/src/main/java/examples/BeanDataBinding/BaseBeanDataBinding.jaxx 2008-12-10 08:50:08 UTC (rev 1059)
@@ -1,11 +1,11 @@
<Application title='{getContentMessage()}'>
<!-- a full java bean property of the class -->
- <Boolean id='editing' constructorParams='false' javaBean='anyvalue'/>
+ <Boolean id='editing' javaBean='false'/>
<!-- not full java bean property (must add script...) -->
<Boolean id='editing2' constructorParams='false'/>
- <String id='contentMessage' constructorParams='"message..."' javaBean='anyvalue'/>
+ <String id='contentMessage' javaBean='"message..."'/>
<script>
public Boolean isEditing2() { return editing2; }
Modified: lutinjaxx/trunk/jaxx-example/BeanDataBinding/src/main/java/examples/BeanDataBinding/BeanDataBinding.jaxx
===================================================================
--- lutinjaxx/trunk/jaxx-example/BeanDataBinding/src/main/java/examples/BeanDataBinding/BeanDataBinding.jaxx 2008-12-07 12:06:03 UTC (rev 1058)
+++ lutinjaxx/trunk/jaxx-example/BeanDataBinding/src/main/java/examples/BeanDataBinding/BeanDataBinding.jaxx 2008-12-10 08:50:08 UTC (rev 1059)
@@ -1,7 +1,6 @@
<BaseBeanDataBinding layout='{new GridLayout()}'>
-<!--BaseBeanDataBinding title="BeanDataBinding.jaxx" layout='{new GridLayout()}'-->
- <Boolean id='editing3' constructorParams='true' javaBean='anyvalue'/>
+ <Boolean id='editing3' javaBean='true'/>
<Table>
<row>
1
0
r1058 - lutinjaxx/trunk/jaxx-example/LabelStyle
by tchemit@users.labs.libre-entreprise.org 07 Dec '08
by tchemit@users.labs.libre-entreprise.org 07 Dec '08
07 Dec '08
Author: tchemit
Date: 2008-12-07 12:06:03 +0000 (Sun, 07 Dec 2008)
New Revision: 1058
Added:
lutinjaxx/trunk/jaxx-example/LabelStyle/README.txt
Log:
use lutinproject 3.1
Copied: lutinjaxx/trunk/jaxx-example/LabelStyle/README.txt (from rev 1057, lutinjaxx/trunk/jaxx-example/README.txt)
===================================================================
--- lutinjaxx/trunk/jaxx-example/LabelStyle/README.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-example/LabelStyle/README.txt 2008-12-07 12:06:03 UTC (rev 1058)
@@ -0,0 +1,2 @@
+To deploy new version of pom: mvn deploy
+To install localy: mvn install
Property changes on: lutinjaxx/trunk/jaxx-example/LabelStyle/README.txt
___________________________________________________________________
Name: svn:mergeinfo
+
1
0
r1057 - in lutinjaxx/trunk: . jaxx-core jaxx-example jaxx-example/BeanDataBinding jaxx-example/Calculator jaxx-example/Components jaxx-example/Counter jaxx-example/LabelStyle jaxx-example/Validation jaxx-swing-action jaxx-util maven-jaxx-plugin
by tchemit@users.labs.libre-entreprise.org 07 Dec '08
by tchemit@users.labs.libre-entreprise.org 07 Dec '08
07 Dec '08
Author: tchemit
Date: 2008-12-07 12:04:16 +0000 (Sun, 07 Dec 2008)
New Revision: 1057
Added:
lutinjaxx/trunk/README.txt
lutinjaxx/trunk/changelog.txt
lutinjaxx/trunk/jaxx-core/README.txt
lutinjaxx/trunk/jaxx-core/changelog.txt
lutinjaxx/trunk/jaxx-example/BeanDataBinding/README.txt
lutinjaxx/trunk/jaxx-example/BeanDataBinding/changelog.txt
lutinjaxx/trunk/jaxx-example/Calculator/README.txt
lutinjaxx/trunk/jaxx-example/Calculator/changelog.txt
lutinjaxx/trunk/jaxx-example/Components/README.txt
lutinjaxx/trunk/jaxx-example/Components/changelog.txt
lutinjaxx/trunk/jaxx-example/Counter/README.txt
lutinjaxx/trunk/jaxx-example/Counter/changelog.txt
lutinjaxx/trunk/jaxx-example/LabelStyle/changelog.txt
lutinjaxx/trunk/jaxx-example/README.txt
lutinjaxx/trunk/jaxx-example/Validation/README.txt
lutinjaxx/trunk/jaxx-example/Validation/changelog.txt
lutinjaxx/trunk/jaxx-example/changelog.txt
lutinjaxx/trunk/jaxx-swing-action/README.txt
lutinjaxx/trunk/jaxx-swing-action/changelog.txt
lutinjaxx/trunk/jaxx-util/README.txt
lutinjaxx/trunk/jaxx-util/changelog.txt
lutinjaxx/trunk/maven-jaxx-plugin/README.txt
lutinjaxx/trunk/maven-jaxx-plugin/changelog.txt
Removed:
lutinjaxx/trunk/jaxx-core/changelog
lutinjaxx/trunk/jaxx-swing-action/changelog
lutinjaxx/trunk/maven-jaxx-plugin/changelog
Modified:
lutinjaxx/trunk/jaxx-core/pom.xml
lutinjaxx/trunk/jaxx-example/BeanDataBinding/pom.xml
lutinjaxx/trunk/jaxx-example/Calculator/pom.xml
lutinjaxx/trunk/jaxx-example/Components/pom.xml
lutinjaxx/trunk/jaxx-example/Counter/pom.xml
lutinjaxx/trunk/jaxx-example/LabelStyle/pom.xml
lutinjaxx/trunk/jaxx-example/Validation/pom.xml
lutinjaxx/trunk/jaxx-example/pom.xml
lutinjaxx/trunk/jaxx-swing-action/pom.xml
lutinjaxx/trunk/jaxx-util/pom.xml
lutinjaxx/trunk/maven-jaxx-plugin/pom.xml
lutinjaxx/trunk/pom.xml
Log:
use lutinproject 3.1
Added: lutinjaxx/trunk/README.txt
===================================================================
--- lutinjaxx/trunk/README.txt (rev 0)
+++ lutinjaxx/trunk/README.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+To deploy new version of pom: mvn deploy
+To install localy: mvn install
Added: lutinjaxx/trunk/changelog.txt
===================================================================
--- lutinjaxx/trunk/changelog.txt (rev 0)
+++ lutinjaxx/trunk/changelog.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+0.7 chemit 200812??
+ * 20081207 [chemit] use lutinproject 3.1
\ No newline at end of file
Added: lutinjaxx/trunk/jaxx-core/README.txt
===================================================================
--- lutinjaxx/trunk/jaxx-core/README.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-core/README.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+To deploy new version of pom: mvn deploy
+To install localy: mvn install
Deleted: lutinjaxx/trunk/jaxx-core/changelog
===================================================================
--- lutinjaxx/trunk/jaxx-core/changelog 2008-12-04 01:37:16 UTC (rev 1056)
+++ lutinjaxx/trunk/jaxx-core/changelog 2008-12-07 12:04:16 UTC (rev 1057)
@@ -1,60 +0,0 @@
- 0.7 chemit 200812??
- - can exclude field from validator
- * 20081202 [chemit] - add strategy for loading ui in NavigationTreeSelectionAdapter
- - fix bug when searching for a inner class
-
- * 20081201 [chemit] - implements jaxx.runtime.JXPathDecorator
- - add setcontextValue and removeContextValue on JAXXContextEntryDef
- - introduce scope in BeanValidator (ERROR or WARNING) and related swing stuff
- - only enter once in $initialize method in generated code
-
- 0.6 chemit 20081117
- * 20081118 [chemit] introduce NavigationUtil, save in context selected node
- * 20081107 [chemit] improve data binding and code generation :
- - make possible inheritance in binding
- - add an attribute javaBean to an object : will generate a full java bean support property
- - make possible binding to the javaBean added properties
- - clean generated code
-
- * 20081105 [chemit] introduce a CardLayout2 to extends awt CardLayout
- introduce a NavigationTreeModel
- introduce a Decorator to render Object
- propagate constructor JAXXContext(JAXXContext) in JAXXObject generation
- begin of rst documentation
-
- * 20081104 [chemit] can add extra beanInfoSearchPath in SwingInitializer
- * 20081104 [chemit] add jaxxContextImplementorClass in option to make possible use of other JAXXContext implementor.
- * 20081102 [chemit] improve JAXXContext :
- - introduce a JAXXContextEntryDef to qualify an entry of a JAXXContext
- - do javadoc in JAXXContext
- - add logic in DefaultJAXXContext : seek in parent context if entry not found
- * 20081102 [chemit] improve tests :
- - fix the last failed test from Jaxx original version :)
- - dumps tests to JUnit4 :)
- * 20081030 [chemit] improve BeanValidator :
- - add full PropertyChangeEvent java-bean support and a property valid
- - when remove bean from validator, must remove errors from model
- - make possible to have a dynamic errorListModel in jaxx files
- * 20081030 [chemit] improve JAXXContext :
- - fix setContextValue bug when setting twice a same type for a same key
- - implements a DefaultJAXXContext
- - use this default implementation with delegate pattern in JAXXObject
- * 20081030 [chemit] add JAXXAction contract to simplify init of ui with JAXXInitialContext
- * 20081027 [chemit] fix bug 1722
- * 20081027 [chemit] add conversion support in validator
- * 20081025 [chemit] improve BeanValidator tag :
- - add a errorList attribute for set a ErrorListMouseListener on the errorList
- - add a beanInitializer attribute for set the validator's bean at runtime
- - add a default errorListModel value 'errors'
- * 20081025 [chemit] introduce JAXXInitialContext to fill JAXXContext at runtime before $initialize() method
- * 20081024 [chemit] fix validator context lost if UI is launched from another thread
- 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.codelutin
- * 20081002 [chemit] use a single module jaxx-core (no more core, runtime and 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/trunk/jaxx-core/changelog.txt (from rev 1054, lutinjaxx/trunk/jaxx-core/changelog)
===================================================================
--- lutinjaxx/trunk/jaxx-core/changelog.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-core/changelog.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,62 @@
+ 0.7 chemit 200812??
+
+ * 20081207 [chemit] use lutinproject 3.1
+ - can exclude field from validator
+ * 20081202 [chemit] - add strategy for loading ui in NavigationTreeSelectionAdapter
+ - fix bug when searching for a inner class
+
+ * 20081201 [chemit] - implements jaxx.runtime.JXPathDecorator
+ - add setcontextValue and removeContextValue on JAXXContextEntryDef
+ - introduce scope in BeanValidator (ERROR or WARNING) and related swing stuff
+ - only enter once in $initialize method in generated code
+
+ 0.6 chemit 20081117
+ * 20081118 [chemit] introduce NavigationUtil, save in context selected node
+ * 20081107 [chemit] improve data binding and code generation :
+ - make possible inheritance in binding
+ - add an attribute javaBean to an object : will generate a full java bean support property
+ - make possible binding to the javaBean added properties
+ - clean generated code
+
+ * 20081105 [chemit] introduce a CardLayout2 to extends awt CardLayout
+ introduce a NavigationTreeModel
+ introduce a Decorator to render Object
+ propagate constructor JAXXContext(JAXXContext) in JAXXObject generation
+ begin of rst documentation
+
+ * 20081104 [chemit] can add extra beanInfoSearchPath in SwingInitializer
+ * 20081104 [chemit] add jaxxContextImplementorClass in option to make possible use of other JAXXContext implementor.
+ * 20081102 [chemit] improve JAXXContext :
+ - introduce a JAXXContextEntryDef to qualify an entry of a JAXXContext
+ - do javadoc in JAXXContext
+ - add logic in DefaultJAXXContext : seek in parent context if entry not found
+ * 20081102 [chemit] improve tests :
+ - fix the last failed test from Jaxx original version :)
+ - dumps tests to JUnit4 :)
+ * 20081030 [chemit] improve BeanValidator :
+ - add full PropertyChangeEvent java-bean support and a property valid
+ - when remove bean from validator, must remove errors from model
+ - make possible to have a dynamic errorListModel in jaxx files
+ * 20081030 [chemit] improve JAXXContext :
+ - fix setContextValue bug when setting twice a same type for a same key
+ - implements a DefaultJAXXContext
+ - use this default implementation with delegate pattern in JAXXObject
+ * 20081030 [chemit] add JAXXAction contract to simplify init of ui with JAXXInitialContext
+ * 20081027 [chemit] fix bug 1722
+ * 20081027 [chemit] add conversion support in validator
+ * 20081025 [chemit] improve BeanValidator tag :
+ - add a errorList attribute for set a ErrorListMouseListener on the errorList
+ - add a beanInitializer attribute for set the validator's bean at runtime
+ - add a default errorListModel value 'errors'
+ * 20081025 [chemit] introduce JAXXInitialContext to fill JAXXContext at runtime before $initialize() method
+ * 20081024 [chemit] fix validator context lost if UI is launched from another thread
+ 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.codelutin
+ * 20081002 [chemit] use a single module jaxx-core (no more core, runtime and 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)
Property changes on: lutinjaxx/trunk/jaxx-core/changelog.txt
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: lutinjaxx/trunk/jaxx-core/pom.xml
===================================================================
--- lutinjaxx/trunk/jaxx-core/pom.xml 2008-12-04 01:37:16 UTC (rev 1056)
+++ lutinjaxx/trunk/jaxx-core/pom.xml 2008-12-07 12:04:16 UTC (rev 1057)
@@ -59,8 +59,8 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>${scm.connection.son}</connection>
- <developerConnection>${scm.developerConnection.son}</developerConnection>
- <url>${scm.url.son}</url>
+ <connection>${scm.connection.child}</connection>
+ <developerConnection>${scm.developerConnection.child}</developerConnection>
+ <url>${scm.url.child}</url>
</scm>
</project>
Added: lutinjaxx/trunk/jaxx-example/BeanDataBinding/README.txt
===================================================================
--- lutinjaxx/trunk/jaxx-example/BeanDataBinding/README.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-example/BeanDataBinding/README.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+To deploy new version of pom: mvn deploy
+To install localy: mvn install
Added: lutinjaxx/trunk/jaxx-example/BeanDataBinding/changelog.txt
===================================================================
--- lutinjaxx/trunk/jaxx-example/BeanDataBinding/changelog.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-example/BeanDataBinding/changelog.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+0.7 chemit 200812??
+ * 20081207 [chemit] use lutinproject 3.1
\ No newline at end of file
Modified: lutinjaxx/trunk/jaxx-example/BeanDataBinding/pom.xml
===================================================================
--- lutinjaxx/trunk/jaxx-example/BeanDataBinding/pom.xml 2008-12-04 01:37:16 UTC (rev 1056)
+++ lutinjaxx/trunk/jaxx-example/BeanDataBinding/pom.xml 2008-12-07 12:04:16 UTC (rev 1057)
@@ -31,8 +31,8 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>${scm.connection.example}</connection>
- <developerConnection>${scm.developerConnection.example}</developerConnection>
- <url>${scm.url.example}</url>
+ <connection>${scm.connection.child.child}</connection>
+ <developerConnection>${scm.developerConnection.child.child}</developerConnection>
+ <url>${scm.url.child.child}</url>
</scm>
</project>
\ No newline at end of file
Added: lutinjaxx/trunk/jaxx-example/Calculator/README.txt
===================================================================
--- lutinjaxx/trunk/jaxx-example/Calculator/README.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-example/Calculator/README.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+To deploy new version of pom: mvn deploy
+To install localy: mvn install
Added: lutinjaxx/trunk/jaxx-example/Calculator/changelog.txt
===================================================================
--- lutinjaxx/trunk/jaxx-example/Calculator/changelog.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-example/Calculator/changelog.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+0.7 chemit 200812??
+ * 20081207 [chemit] use lutinproject 3.1
\ No newline at end of file
Modified: lutinjaxx/trunk/jaxx-example/Calculator/pom.xml
===================================================================
--- lutinjaxx/trunk/jaxx-example/Calculator/pom.xml 2008-12-04 01:37:16 UTC (rev 1056)
+++ lutinjaxx/trunk/jaxx-example/Calculator/pom.xml 2008-12-07 12:04:16 UTC (rev 1057)
@@ -32,9 +32,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>${scm.connection.example}</connection>
- <developerConnection>${scm.developerConnection.example}</developerConnection>
- <url>${scm.url.example}</url>
+ <connection>${scm.connection.child.child}</connection>
+ <developerConnection>${scm.developerConnection.child.child}</developerConnection>
+ <url>${scm.url.child.child}</url>
</scm>
</project>
\ No newline at end of file
Added: lutinjaxx/trunk/jaxx-example/Components/README.txt
===================================================================
--- lutinjaxx/trunk/jaxx-example/Components/README.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-example/Components/README.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+To deploy new version of pom: mvn deploy
+To install localy: mvn install
Added: lutinjaxx/trunk/jaxx-example/Components/changelog.txt
===================================================================
--- lutinjaxx/trunk/jaxx-example/Components/changelog.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-example/Components/changelog.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+0.7 chemit 200812??
+ * 20081207 [chemit] use lutinproject 3.1
\ No newline at end of file
Modified: lutinjaxx/trunk/jaxx-example/Components/pom.xml
===================================================================
--- lutinjaxx/trunk/jaxx-example/Components/pom.xml 2008-12-04 01:37:16 UTC (rev 1056)
+++ lutinjaxx/trunk/jaxx-example/Components/pom.xml 2008-12-07 12:04:16 UTC (rev 1057)
@@ -42,8 +42,8 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>${scm.connection.example}</connection>
- <developerConnection>${scm.developerConnection.example}</developerConnection>
- <url>${scm.url.example}</url>
+ <connection>${scm.connection.child.child}</connection>
+ <developerConnection>${scm.developerConnection.child.child}</developerConnection>
+ <url>${scm.url.child.child}</url>
</scm>
</project>
\ No newline at end of file
Added: lutinjaxx/trunk/jaxx-example/Counter/README.txt
===================================================================
--- lutinjaxx/trunk/jaxx-example/Counter/README.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-example/Counter/README.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+To deploy new version of pom: mvn deploy
+To install localy: mvn install
Added: lutinjaxx/trunk/jaxx-example/Counter/changelog.txt
===================================================================
--- lutinjaxx/trunk/jaxx-example/Counter/changelog.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-example/Counter/changelog.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+0.7 chemit 200812??
+ * 20081207 [chemit] use lutinproject 3.1
\ No newline at end of file
Modified: lutinjaxx/trunk/jaxx-example/Counter/pom.xml
===================================================================
--- lutinjaxx/trunk/jaxx-example/Counter/pom.xml 2008-12-04 01:37:16 UTC (rev 1056)
+++ lutinjaxx/trunk/jaxx-example/Counter/pom.xml 2008-12-07 12:04:16 UTC (rev 1057)
@@ -31,8 +31,8 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>${scm.connection.example}</connection>
- <developerConnection>${scm.developerConnection.example}</developerConnection>
- <url>${scm.url.example}</url>
+ <connection>${scm.connection.child.child}</connection>
+ <developerConnection>${scm.developerConnection.child.child}</developerConnection>
+ <url>${scm.url.child.child}</url>
</scm>
</project>
\ No newline at end of file
Added: lutinjaxx/trunk/jaxx-example/LabelStyle/changelog.txt
===================================================================
--- lutinjaxx/trunk/jaxx-example/LabelStyle/changelog.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-example/LabelStyle/changelog.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+0.7 chemit 200812??
+ * 20081207 [chemit] use lutinproject 3.1
\ No newline at end of file
Modified: lutinjaxx/trunk/jaxx-example/LabelStyle/pom.xml
===================================================================
--- lutinjaxx/trunk/jaxx-example/LabelStyle/pom.xml 2008-12-04 01:37:16 UTC (rev 1056)
+++ lutinjaxx/trunk/jaxx-example/LabelStyle/pom.xml 2008-12-07 12:04:16 UTC (rev 1057)
@@ -32,8 +32,8 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>${scm.connection.example}</connection>
- <developerConnection>${scm.developerConnection.example}</developerConnection>
- <url>${scm.url.example}</url>
+ <connection>${scm.connection.child.child}</connection>
+ <developerConnection>${scm.developerConnection.child.child}</developerConnection>
+ <url>${scm.url.child.child}</url>
</scm>
</project>
\ No newline at end of file
Added: lutinjaxx/trunk/jaxx-example/README.txt
===================================================================
--- lutinjaxx/trunk/jaxx-example/README.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-example/README.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+To deploy new version of pom: mvn deploy
+To install localy: mvn install
Added: lutinjaxx/trunk/jaxx-example/Validation/README.txt
===================================================================
--- lutinjaxx/trunk/jaxx-example/Validation/README.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-example/Validation/README.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+To deploy new version of pom: mvn deploy
+To install localy: mvn install
Added: lutinjaxx/trunk/jaxx-example/Validation/changelog.txt
===================================================================
--- lutinjaxx/trunk/jaxx-example/Validation/changelog.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-example/Validation/changelog.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+0.7 chemit 200812??
+ * 20081207 [chemit] use lutinproject 3.1
\ No newline at end of file
Modified: lutinjaxx/trunk/jaxx-example/Validation/pom.xml
===================================================================
--- lutinjaxx/trunk/jaxx-example/Validation/pom.xml 2008-12-04 01:37:16 UTC (rev 1056)
+++ lutinjaxx/trunk/jaxx-example/Validation/pom.xml 2008-12-07 12:04:16 UTC (rev 1057)
@@ -31,8 +31,8 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>${scm.connection.example}</connection>
- <developerConnection>${scm.developerConnection.example}</developerConnection>
- <url>${scm.url.example}</url>
+ <connection>${scm.connection.child.child}</connection>
+ <developerConnection>${scm.developerConnection.child.child}</developerConnection>
+ <url>${scm.url.child.child}</url>
</scm>
</project>
\ No newline at end of file
Added: lutinjaxx/trunk/jaxx-example/changelog.txt
===================================================================
--- lutinjaxx/trunk/jaxx-example/changelog.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-example/changelog.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+0.7 chemit 200812??
+ * 20081207 [chemit] use lutinproject 3.1
\ No newline at end of file
Modified: lutinjaxx/trunk/jaxx-example/pom.xml
===================================================================
--- lutinjaxx/trunk/jaxx-example/pom.xml 2008-12-04 01:37:16 UTC (rev 1056)
+++ lutinjaxx/trunk/jaxx-example/pom.xml 2008-12-07 12:04:16 UTC (rev 1057)
@@ -59,28 +59,15 @@
<jnlp.build.directory>${project.build.directory}/jnlp</jnlp.build.directory>
- <!-- scm (for sons) -->
- <scm.url.example>
- http://${labs.host}/plugins/scmsvn/viewcvs.php/lutinjaxx/trunk/jaxx-example/${pom.artifactId}/?root=${labs.project}
- </scm.url.example>
-
- <scm.developerConnection.example>
- scm:svn:svn+ssh://${username}@${labs.host}/svnroot/${labs.project}/lutinjaxx/trunk/jaxx-example/${pom.artifactId}
- </scm.developerConnection.example>
-
- <scm.connection.example>
- scm:svn:svn://anonymous@${labs.host}/svnroot/${labs.project}/lutinjaxx/trunk/jaxx-example/${pom.artifactId}
- </scm.connection.example>
-
</properties>
<!-- ************************************************************* -->
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>${scm.connection.son}</connection>
- <developerConnection>${scm.developerConnection.son}</developerConnection>
- <url>${scm.url.son}</url>
+ <connection>${scm.connection.child}</connection>
+ <developerConnection>${scm.developerConnection.child}</developerConnection>
+ <url>${scm.url.child}</url>
</scm>
<build>
Added: lutinjaxx/trunk/jaxx-swing-action/README.txt
===================================================================
--- lutinjaxx/trunk/jaxx-swing-action/README.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-swing-action/README.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+To deploy new version of pom: mvn deploy
+To install localy: mvn install
Deleted: lutinjaxx/trunk/jaxx-swing-action/changelog
===================================================================
--- lutinjaxx/trunk/jaxx-swing-action/changelog 2008-12-04 01:37:16 UTC (rev 1056)
+++ lutinjaxx/trunk/jaxx-swing-action/changelog 2008-12-07 12:04:16 UTC (rev 1057)
@@ -1,10 +0,0 @@
-ver-0-5 chemit 20081002
- * 20081002 [chemit] Using lutinproject 3.0, changing groupId to org.codelutin
-
-jaxx-swing-action (0.4) stable; urgency=high
-
- * bug correction when have to compile actions but not the baseAction, providerConfig was null
- * bug correction when action herites from another not base action, the action has te be treated after the mother action
- * usemaven-i18n-plugin v0.4
-
- -- Tony Chemit <chemit(a)codelutin.com> Fri, 05 Aug 2008 02:02:02 +0200
Copied: lutinjaxx/trunk/jaxx-swing-action/changelog.txt (from rev 1003, lutinjaxx/trunk/jaxx-swing-action/changelog)
===================================================================
--- lutinjaxx/trunk/jaxx-swing-action/changelog.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-swing-action/changelog.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+0.7 chemit 200812??
+ * 20081207 [chemit] use lutinproject 3.1
\ No newline at end of file
Modified: lutinjaxx/trunk/jaxx-swing-action/pom.xml
===================================================================
--- lutinjaxx/trunk/jaxx-swing-action/pom.xml 2008-12-04 01:37:16 UTC (rev 1056)
+++ lutinjaxx/trunk/jaxx-swing-action/pom.xml 2008-12-07 12:04:16 UTC (rev 1057)
@@ -72,9 +72,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>${scm.connection.son}</connection>
- <developerConnection>${scm.developerConnection.son}</developerConnection>
- <url>${scm.url.son}</url>
+ <connection>${scm.connection.child}</connection>
+ <developerConnection>${scm.developerConnection.child}</developerConnection>
+ <url>${scm.url.child}</url>
</scm>
</project>
Added: lutinjaxx/trunk/jaxx-util/README.txt
===================================================================
--- lutinjaxx/trunk/jaxx-util/README.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-util/README.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+To deploy new version of pom: mvn deploy
+To install localy: mvn install
Added: lutinjaxx/trunk/jaxx-util/changelog.txt
===================================================================
--- lutinjaxx/trunk/jaxx-util/changelog.txt (rev 0)
+++ lutinjaxx/trunk/jaxx-util/changelog.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+0.7 chemit 200812??
+ * 20081207 [chemit] use lutinproject 3.1
\ No newline at end of file
Modified: lutinjaxx/trunk/jaxx-util/pom.xml
===================================================================
--- lutinjaxx/trunk/jaxx-util/pom.xml 2008-12-04 01:37:16 UTC (rev 1056)
+++ lutinjaxx/trunk/jaxx-util/pom.xml 2008-12-07 12:04:16 UTC (rev 1057)
@@ -39,9 +39,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>${scm.connection.son}</connection>
- <developerConnection>${scm.developerConnection.son}</developerConnection>
- <url>${scm.url.son}</url>
+ <connection>${scm.connection.child}</connection>
+ <developerConnection>${scm.developerConnection.child}</developerConnection>
+ <url>${scm.url.child}</url>
</scm>
</project>
Added: lutinjaxx/trunk/maven-jaxx-plugin/README.txt
===================================================================
--- lutinjaxx/trunk/maven-jaxx-plugin/README.txt (rev 0)
+++ lutinjaxx/trunk/maven-jaxx-plugin/README.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,2 @@
+To deploy new version of pom: mvn deploy
+To install localy: mvn install
Deleted: lutinjaxx/trunk/maven-jaxx-plugin/changelog
===================================================================
--- lutinjaxx/trunk/maven-jaxx-plugin/changelog 2008-12-04 01:37:16 UTC (rev 1056)
+++ lutinjaxx/trunk/maven-jaxx-plugin/changelog 2008-12-07 12:04:16 UTC (rev 1057)
@@ -1,10 +0,0 @@
-0.6 chemit 200811??
- * 20081108 [chemit] can add extra imports in JaxxGeneratorMojo (will be added to all generated java files).
- * 20081104 [chemit] can add extra beanInfoSearchPath in JaxxGeneratorMojo
-
-ver-0-5 chemit 20081002
- * 20081013 [chemit] can generate logger on jaxx files
- * 20081011 [chemit] improve site
- * 20081011 [chemit] refactor tests of the plugin using maven-plugin-testing-harness plugin
- * 20081002 [chemit] Using lutinpluginproject 3.0, changing groupId to org.codelutin
- * 20081002 [chemit] Make nearly all tests works again...
Copied: lutinjaxx/trunk/maven-jaxx-plugin/changelog.txt (from rev 1017, lutinjaxx/trunk/maven-jaxx-plugin/changelog)
===================================================================
--- lutinjaxx/trunk/maven-jaxx-plugin/changelog.txt (rev 0)
+++ lutinjaxx/trunk/maven-jaxx-plugin/changelog.txt 2008-12-07 12:04:16 UTC (rev 1057)
@@ -0,0 +1,13 @@
+0.7 chemit 200812??
+ * 20081207 [chemit] use lutinproject 3.1
+
+0.6 chemit 200811??
+ * 20081108 [chemit] can add extra imports in JaxxGeneratorMojo (will be added to all generated java files).
+ * 20081104 [chemit] can add extra beanInfoSearchPath in JaxxGeneratorMojo
+
+ver-0-5 chemit 20081002
+ * 20081013 [chemit] can generate logger on jaxx files
+ * 20081011 [chemit] improve site
+ * 20081011 [chemit] refactor tests of the plugin using maven-plugin-testing-harness plugin
+ * 20081002 [chemit] Using lutinpluginproject 3.0, changing groupId to org.codelutin
+ * 20081002 [chemit] Make nearly all tests works again...
Property changes on: lutinjaxx/trunk/maven-jaxx-plugin/changelog.txt
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: lutinjaxx/trunk/maven-jaxx-plugin/pom.xml
===================================================================
--- lutinjaxx/trunk/maven-jaxx-plugin/pom.xml 2008-12-04 01:37:16 UTC (rev 1056)
+++ lutinjaxx/trunk/maven-jaxx-plugin/pom.xml 2008-12-07 12:04:16 UTC (rev 1057)
@@ -97,7 +97,6 @@
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>2.4.3</version>
<executions>
@@ -116,7 +115,6 @@
<reporting>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>2.4.3</version>
</plugin>
@@ -127,9 +125,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>${scm.connection.son}</connection>
- <developerConnection>${scm.developerConnection.son}</developerConnection>
- <url>${scm.url.son}</url>
+ <connection>${scm.connection.child}</connection>
+ <developerConnection>${scm.developerConnection.child}</developerConnection>
+ <url>${scm.url.child}</url>
</scm>
</project>
\ No newline at end of file
Modified: lutinjaxx/trunk/pom.xml
===================================================================
--- lutinjaxx/trunk/pom.xml 2008-12-04 01:37:16 UTC (rev 1056)
+++ lutinjaxx/trunk/pom.xml 2008-12-07 12:04:16 UTC (rev 1057)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.codelutin</groupId>
<artifactId>lutinproject</artifactId>
- <version>3.1</version>
+ <version>3.2</version>
</parent>
<artifactId>lutinjaxx</artifactId>
@@ -46,8 +46,6 @@
<properties>
- <!--license-switcher.version>0.5-SNAPSHOT</license-switcher.version-->
-
<!-- current version -->
<current.version>0.7-SNAPSHOT</current.version>
@@ -56,21 +54,6 @@
<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/${project.artifactId}/?root=${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.project}/lutinjaxx/trunk/${project.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}/lutinjaxx/trunk/${project.artifactId}
- </scm.connection.son>
-
</properties>
<build>
1
0
r1056 - lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime
by tchemit@users.labs.libre-entreprise.org 04 Dec '08
by tchemit@users.labs.libre-entreprise.org 04 Dec '08
04 Dec '08
Author: tchemit
Date: 2008-12-04 01:37:16 +0000 (Thu, 04 Dec 2008)
New Revision: 1056
Modified:
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/Util.java
Log:
add setValidatorChanged util method to set changed property on some validators of an ui
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/Util.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/Util.java 2008-12-03 16:23:49 UTC (rev 1055)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/Util.java 2008-12-04 01:37:16 UTC (rev 1056)
@@ -461,7 +461,7 @@
}
/**
- * Convient method to attach a bean to all validators of an JAXXObject.
+ * Convinient method to attach a bean to all validators of an JAXXObject.
* <p/>
* It is possible to exclude some validator to be treated.
*
@@ -483,4 +483,28 @@
beanValidator.setBean(bean);
}
}
+
+ /**
+ * Convinient method to set the changed property to all validators of an JAXXObject.
+ * <p/>
+ * It is possible to exclude some validator to be treated.
+ *
+ * @param ui the ui containing the validatros to treate
+ * @param newValue the new value to set in changed validator property
+ * @param excludeIds the list of validator id to exclude
+ */
+ @SuppressWarnings({"unchecked"})
+ public static void setValidatorChanged(JAXXObject ui, boolean newValue, String... excludeIds) {
+ List<String> validatorIds = ui.getValidatorIds();
+ if (excludeIds.length > 0) {
+ validatorIds = new ArrayList<String>(validatorIds);
+ for (String excludeId : excludeIds) {
+ validatorIds.remove(excludeId);
+ }
+ }
+ for (String validatorId : validatorIds) {
+ BeanValidator beanValidator = ui.getValidator(validatorId);
+ beanValidator.setChanged(newValue);
+ }
+ }
}
1
0
r1055 - lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/navigation
by tchemit@users.labs.libre-entreprise.org 03 Dec '08
by tchemit@users.labs.libre-entreprise.org 03 Dec '08
03 Dec '08
Author: tchemit
Date: 2008-12-03 16:23:49 +0000 (Wed, 03 Dec 2008)
New Revision: 1055
Modified:
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeSelectionAdapter.java
Log:
fix bug when go back on a PER_UI strategy
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeSelectionAdapter.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeSelectionAdapter.java 2008-12-02 22:25:40 UTC (rev 1054)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeSelectionAdapter.java 2008-12-03 16:23:49 UTC (rev 1055)
@@ -1,6 +1,7 @@
package jaxx.runtime.swing.navigation;
import jaxx.runtime.JAXXAction;
+import jaxx.runtime.JAXXContextEntryDef;
import jaxx.runtime.JAXXObject;
import jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode;
import org.apache.commons.logging.Log;
@@ -24,6 +25,8 @@
static public final String NAVIGATION_SELECTED_BEAN = "navigation-selected-bean";
+ static public final JAXXContextEntryDef<Boolean> GO_BACK_DEF = JAXXContextEntryDef.newDef("goBack", Boolean.class);
+
/** defined the stategy of instanciation of ui */
public enum Strategy {
/** instanciate a ui for a node */
@@ -125,6 +128,13 @@
return;
}
+ Boolean goBack = GO_BACK_DEF.getContextValue(context);
+ if (goBack != null && goBack) {
+ // do not treate this, apsecial flag told us :)
+ GO_BACK_DEF.removeContextValue(context);
+ return;
+ }
+
try {
NavigationTreeNode node = prepareNode(event);
@@ -144,6 +154,7 @@
}
if (!closeUI(event, component)) {
+ GO_BACK_DEF.setContextValue(context, Boolean.TRUE);
// previous ui was not closed, so reselect the previous node in navigation
goBackToPreviousNode(event, null);
// and quit
1
0
r1054 - in lutinjaxx/trunk/jaxx-core: . src/main/java/jaxx/runtime/validator src/main/java/jaxx/tags/swing src/main/java/jaxx/tags/validator
by tchemit@users.labs.libre-entreprise.org 02 Dec '08
by tchemit@users.labs.libre-entreprise.org 02 Dec '08
02 Dec '08
Author: tchemit
Date: 2008-12-02 22:25:40 +0000 (Tue, 02 Dec 2008)
New Revision: 1054
Added:
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator/ExcludeFieldValidatorHandler.java
Modified:
lutinjaxx/trunk/jaxx-core/changelog
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/validator/BeanValidatorErrorTableModel.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/SwingInitializer.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator/BeanValidatorHandler.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator/FieldValidatorHandler.java
Log:
can exclude field from validator
Modified: lutinjaxx/trunk/jaxx-core/changelog
===================================================================
--- lutinjaxx/trunk/jaxx-core/changelog 2008-12-02 20:59:03 UTC (rev 1053)
+++ lutinjaxx/trunk/jaxx-core/changelog 2008-12-02 22:25:40 UTC (rev 1054)
@@ -1,4 +1,5 @@
0.7 chemit 200812??
+ - can exclude field from validator
* 20081202 [chemit] - add strategy for loading ui in NavigationTreeSelectionAdapter
- fix bug when searching for a inner class
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/validator/BeanValidatorErrorTableModel.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/validator/BeanValidatorErrorTableModel.java 2008-12-02 20:59:03 UTC (rev 1053)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/validator/BeanValidatorErrorTableModel.java 2008-12-02 22:25:40 UTC (rev 1054)
@@ -79,10 +79,9 @@
// clean errors in model
getDataVector().clear();
- Scope scope = validator.getScope();
// reinject in list model, all the errors
for (BeanValidatorError error : newErrors) {
- addRow(new Object[]{scope, error.getFieldName(), error});
+ addRow(new Object[]{error.getScope(), error.getFieldName(), error});
}
// notify thaht the model has changed
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/SwingInitializer.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/SwingInitializer.java 2008-12-02 20:59:03 UTC (rev 1053)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/swing/SwingInitializer.java 2008-12-02 22:25:40 UTC (rev 1054)
@@ -19,6 +19,7 @@
import jaxx.tags.TagManager;
import jaxx.tags.validator.BeanValidatorHandler;
import jaxx.tags.validator.FieldValidatorHandler;
+import jaxx.tags.validator.ExcludeFieldValidatorHandler;
import jaxx.types.KeyStrokeConverter;
import jaxx.types.TypeManager;
@@ -98,6 +99,7 @@
// validator
TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(BeanValidator.class), BeanValidatorHandler.class);
- TagManager.registerTag(JAXXCompiler.JAXX_NAMESPACE, FieldValidatorHandler.FIELD_VALIDATOR_TAG, new FieldValidatorHandler());
+ TagManager.registerTag(JAXXCompiler.JAXX_NAMESPACE, FieldValidatorHandler.TAG, new FieldValidatorHandler());
+ TagManager.registerTag(JAXXCompiler.JAXX_NAMESPACE, ExcludeFieldValidatorHandler.TAG, new FieldValidatorHandler());
}
}
\ No newline at end of file
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator/BeanValidatorHandler.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator/BeanValidatorHandler.java 2008-12-02 20:59:03 UTC (rev 1053)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator/BeanValidatorHandler.java 2008-12-02 22:25:40 UTC (rev 1054)
@@ -29,7 +29,7 @@
public class BeanValidatorHandler extends DefaultObjectHandler {
- public static final String BEAN_VALIDATOR_TAG = BeanValidator.class.getSimpleName();
+ public static final String TAG = BeanValidator.class.getSimpleName();
public static final String BEAN_ATTRIBUTE = "bean";
public static final String BEAN_CLASS_ATTRIBUTE = "beanClass";
public static final String BEAN_INITIALIZER_ATTRIBUTE = "beanInitializer";
@@ -71,8 +71,8 @@
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());
+ if (!tag.getLocalName().equals(FieldValidatorHandler.TAG)) {
+ compiler.reportError("tag '" + tag.getParentNode().getLocalName() + "' may only contain " + FieldValidatorHandler.TAG + " as children, but found : " + tag.getLocalName());
} else {
compiler.compileFirstPass(tag);
}
@@ -146,6 +146,7 @@
public static class CompiledBeanValidator extends CompiledObject {
protected Map<String, String> fields;
+ protected Map<String, String> excludeFields;
protected String bean;
protected String beanClass;
protected String contextName;
@@ -162,16 +163,25 @@
public CompiledBeanValidator(String id, ClassDescriptor objectClass, JAXXCompiler compiler) {
super(id, objectClass, compiler);
fields = new TreeMap<String, String>();
+ excludeFields = new TreeMap<String, String>();
}
public Map<String, String> getFields() {
return fields;
}
+ public Map<String, String> getExcludeFields() {
+ return excludeFields;
+ }
+
public void setFields(Map<String, String> fields) {
this.fields = fields;
}
+ public void setExcludeFields(Map<String, String> excludeFields) {
+ this.excludeFields = excludeFields;
+ }
+
@Override
public void addProperty(String property, String value) {
@@ -319,7 +329,7 @@
@Override
public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException {
// do nothing
- compiler.reportError("can not add CompiledObject in the tag '" + BEAN_VALIDATOR_TAG + " (only field tags)");
+ compiler.reportError("can not add CompiledObject in the tag '" + TAG + " (only field tags)");
}
public boolean foundBean() {
@@ -554,6 +564,10 @@
// already defined in field
continue;
}
+ if (excludeFields.containsKey(descriptionName)) {
+ // exclude field
+ continue;
+ }
if (!compiler.checkReference(tag, descriptionName, getStrictMode(), null)) {
// no editor component found
continue;
@@ -561,6 +575,14 @@
// ok add the field mapping
registerField(descriptionName, descriptionName, compiler);
}
+
+ for (Entry<String, String> entry : excludeFields.entrySet()) {
+ String key = entry.getKey();
+ if (fields.containsKey(key)) {
+ compiler.reportWarning("field '" + key + "' can not be used and excluded at same time ! (field is skipped) for validator " + this);
+ fields.remove(key);
+ }
+ }
}
public void registerField(String id, String component, JAXXCompiler compiler) {
@@ -574,6 +596,17 @@
}
}
+ public void registerExcludeField(String id, String component, JAXXCompiler compiler) {
+ if (excludeFields.containsKey(id)) {
+ compiler.reportError("duplicate field '" + id + "' for validator " + this);
+ } else {
+ if (compiler.getOptions().isVerbose()) {
+ log.info("add excludeField <" + id + ":" + component + ">");
+ }
+ excludeFields.put(id, component);
+ }
+ }
+
protected boolean checkBeanProperty(JAXXCompiler compiler, String propertyName) {
for (JAXXPropertyDescriptor beanProperty : getBeanDescriptor(compiler).getJAXXPropertyDescriptors()) {
Copied: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator/ExcludeFieldValidatorHandler.java (from rev 1003, lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator/FieldValidatorHandler.java)
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator/ExcludeFieldValidatorHandler.java (rev 0)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator/ExcludeFieldValidatorHandler.java 2008-12-02 22:25:40 UTC (rev 1054)
@@ -0,0 +1,85 @@
+/*
+ * 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 ExcludeFieldValidatorHandler implements TagHandler {
+
+ public static final String TAG = "excludeField";
+ public static final String NAME_ATTRIBUTE = "name";
+ public static final String COMPONENT_ATTRIBUTE = "component";
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(ExcludeFieldValidatorHandler.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.debug(tag);
+ }
+
+ if (!ClassDescriptorLoader.getClassDescriptor(BeanValidator.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) {
+ compiler.reportError(TAG + " tag may only appear within " + BeanValidatorHandler.TAG + " tag but was " + tag);
+ return;
+ }
+
+ CompiledBeanValidator info = (CompiledBeanValidator) compiler.getOpenComponent();
+ if (!info.getAutoField()) {
+ compiler.reportError(TAG + " tag can not be used without an 'autoField' validator : " + tag);
+ return;
+ }
+ String name = tag.getAttribute(NAME_ATTRIBUTE);
+ String component = tag.getAttribute(COMPONENT_ATTRIBUTE);
+ if (name == null || name.trim().isEmpty()) {
+ compiler.reportError(TAG + " tag requires a " + NAME_ATTRIBUTE + " attribute");
+ return;
+ }
+ name = name.trim();
+ if (component == null || component.trim().isEmpty()) {
+ // try to use the name as component
+ if (!compiler.checkReference(tag, name, false, name)) {
+ compiler.reportError(TAG + " tag requires a " + COMPONENT_ATTRIBUTE + " attribute, try to use the name attribute ["+name+"] for the component, but no such component found");
+ return;
+ }
+ component = name;
+ }
+ component = component.trim();
+
+ // check component is not already used by this compiled object
+ if (info.getFields().containsValue(component)) {
+ compiler.reportError(TAG + " tag found a attribute " + COMPONENT_ATTRIBUTE + " ["+component+"] already used in this validator");
+ return;
+ }
+ if (info.getExcludeFields().containsValue(component)) {
+ compiler.reportError(TAG + " tag found a attribute " + COMPONENT_ATTRIBUTE + " ["+component+"] already used in this validator");
+ return;
+ }
+ // check component exist (again perharps, but let the error knows exactly which tag failed...)
+ if (compiler.checkReference(tag, component, true, COMPONENT_ATTRIBUTE)) {
+ // add a field
+ info.registerField(name, component, compiler);
+ }
+
+
+ }
+
+}
\ No newline at end of file
Property changes on: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator/ExcludeFieldValidatorHandler.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator/FieldValidatorHandler.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator/FieldValidatorHandler.java 2008-12-02 20:59:03 UTC (rev 1053)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/validator/FieldValidatorHandler.java 2008-12-02 22:25:40 UTC (rev 1054)
@@ -18,7 +18,7 @@
public class FieldValidatorHandler implements TagHandler {
- public static final String FIELD_VALIDATOR_TAG = "field";
+ public static final String TAG = "field";
public static final String NAME_ATTRIBUTE = "name";
public static final String COMPONENT_ATTRIBUTE = "component";
@@ -38,7 +38,7 @@
}
if (!ClassDescriptorLoader.getClassDescriptor(BeanValidator.class).isAssignableFrom(compiler.getOpenComponent().getObjectClass())) {
- compiler.reportError(FIELD_VALIDATOR_TAG + " tag may only appear within " + BeanValidatorHandler.BEAN_VALIDATOR_TAG + " tag but was " + tag);
+ compiler.reportError(TAG + " tag may only appear within " + BeanValidatorHandler.TAG + " tag but was " + tag);
return;
}
@@ -47,14 +47,14 @@
String name = tag.getAttribute(NAME_ATTRIBUTE);
String component = tag.getAttribute(COMPONENT_ATTRIBUTE);
if (name == null || name.trim().isEmpty()) {
- compiler.reportError(FIELD_VALIDATOR_TAG + " tag requires a " + NAME_ATTRIBUTE + " attribute");
+ compiler.reportError(TAG + " tag requires a " + NAME_ATTRIBUTE + " attribute");
return;
}
name = name.trim();
if (component == 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");
+ compiler.reportError(TAG + " tag requires a " + COMPONENT_ATTRIBUTE + " attribute, try to use the name attribute ["+name+"] for the component, but no such component found");
return;
}
component = name;
@@ -63,7 +63,7 @@
// check component is not already used by this compiled object
if (info.getFields().containsValue(component)) {
- compiler.reportError(FIELD_VALIDATOR_TAG + " tag found a attribute " + COMPONENT_ATTRIBUTE + " ["+component+"] already used in this validator");
+ compiler.reportError(TAG + " tag found a attribute " + COMPONENT_ATTRIBUTE + " ["+component+"] already used in this validator");
return;
}
// check component exist (again perharps, but let the error knows exactly which tag failed...)
1
0
r1053 - in lutinjaxx/trunk/jaxx-core: . src/main/java/jaxx/runtime/swing/navigation
by tchemit@users.labs.libre-entreprise.org 02 Dec '08
by tchemit@users.labs.libre-entreprise.org 02 Dec '08
02 Dec '08
Author: tchemit
Date: 2008-12-02 20:59:03 +0000 (Tue, 02 Dec 2008)
New Revision: 1053
Modified:
lutinjaxx/trunk/jaxx-core/changelog
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeSelectionAdapter.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeSelectionAdapterWithCardLayout.java
Log:
add strategy for loading ui in NavigationTreeSelectionAdapter
Modified: lutinjaxx/trunk/jaxx-core/changelog
===================================================================
--- lutinjaxx/trunk/jaxx-core/changelog 2008-12-02 19:25:08 UTC (rev 1052)
+++ lutinjaxx/trunk/jaxx-core/changelog 2008-12-02 20:59:03 UTC (rev 1053)
@@ -1,5 +1,7 @@
0.7 chemit 200812??
- * 20081202 [chemit] - fix bug when searching for a inner class
+ * 20081202 [chemit] - add strategy for loading ui in NavigationTreeSelectionAdapter
+ - fix bug when searching for a inner class
+
* 20081201 [chemit] - implements jaxx.runtime.JXPathDecorator
- add setcontextValue and removeContextValue on JAXXContextEntryDef
- introduce scope in BeanValidator (ERROR or WARNING) and related swing stuff
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeSelectionAdapter.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeSelectionAdapter.java 2008-12-02 19:25:08 UTC (rev 1052)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeSelectionAdapter.java 2008-12-02 20:59:03 UTC (rev 1053)
@@ -24,6 +24,14 @@
static public final String NAVIGATION_SELECTED_BEAN = "navigation-selected-bean";
+ /** defined the stategy of instanciation of ui */
+ public enum Strategy {
+ /** instanciate a ui for a node */
+ PER_NODE,
+ /** instanciate only one a ui for a type,nodes will share the instanciation */
+ PER_UI_TYPE
+ }
+
/** la classe d'ui par defaut, associé à un noeud de l'arbe */
protected Class<? extends JAXXObject> defaultUIClass;
@@ -32,12 +40,16 @@
/** l'ui contenant l'arbre de navigation */
protected JAXXObject context;
- protected NavigationTreeSelectionAdapter(Class<? extends JAXXObject> defaultUIClass, Class<? extends JAXXAction> defaultUIHandlerClass, JAXXObject context) {
+ protected Strategy strategy;
+
+ protected NavigationTreeSelectionAdapter(Class<? extends JAXXObject> defaultUIClass, Class<? extends JAXXAction> defaultUIHandlerClass, JAXXObject context, Strategy strategy) {
this.defaultUIClass = defaultUIClass;
this.defaultUIHandlerClass = defaultUIHandlerClass;
this.context = context;
+ this.strategy = strategy;
}
+
protected abstract NavigationTreeModel getNavigationTreeModel();
/**
@@ -47,10 +59,10 @@
protected abstract Component getCurrentUI();
/**
- * @param path le chemin du noeud selectionne dont on veut afficher l'ui associée
+ * @param node le noeud associé à l'ui à retrouver
* @return l'ui associé au novueau noeud sélectionné
*/
- protected abstract Component getNewUI(String path);
+ protected abstract Component getUI(NavigationTreeNode node);
/**
* @param event l'evenement de selection de noeud
@@ -73,10 +85,10 @@
* Ouvre l'ui associée au noeud sélectionné dans l'arbre de navigation.
*
* @param newUI l'ui associé au noeud sélectionné à ouvrir
- * @param path le path dans le context de navigation
+ * @param node le node de l'ui a ouvrir
* @throws Exception if any
*/
- protected abstract void openUI(Component newUI, NavigationTreeNode path) throws Exception;
+ protected abstract void openUI(Component newUI, NavigationTreeNode node) throws Exception;
/**
* Retourne au noeud précdemment sélectionné dans l'arbre de navigation, avec la possibilité de notifier
@@ -123,10 +135,10 @@
log.trace(path);
}
- Component newUI = getNewUI(path);
+ Component newUI = getUI(node);
Component component = getCurrentUI();
- if (newUI != null && newUI.equals(component)) {
+ if (newUI != null && strategy == Strategy.PER_NODE && newUI.equals(component)) {
// call back from goto back to previous node, do nothing
return;
}
@@ -143,23 +155,11 @@
// before all, attach bean in context associated with the selected node in naivgation tree
Object data = getNavigationTreeModel().getJAXXContextValue(context, path);
- if (log.isDebugEnabled()) {
- log.debug("find data for contextPath <" + path + "> : " + (data == null ? null : data.getClass()));
- }
+ addSelectedBeanInContext(node, data);
- context.removeContextValue(Object.class,NAVIGATION_SELECTED_BEAN);
-
- if (data != null) {
- context.setContextValue(data, NAVIGATION_SELECTED_BEAN);
- //todo should we not use this to avoid conflict in context ?
- context.setContextValue(data);
- }
-
-
if (newUI == null) {
// instanciate a new ui associated with the selected node
newUI = createUI(node);
-
}
// save in context current node context path
@@ -179,25 +179,36 @@
}
}
- /* protected Object attachBeanFromNodeToContext(NavigationTreeNode node) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException {
+ protected void addSelectedBeanInContext(NavigationTreeNode node, Object data) {
- String path = node.getContextPath();
+ if (log.isDebugEnabled()) {
+ log.debug("find data for contextPath <" + node.getContextPath() + "> : " + (data == null ? null : data.getClass()));
+ }
- NavigationTreeModel navigationModel = getNavigationTreeModel();
+ context.removeContextValue(Object.class, NAVIGATION_SELECTED_BEAN);
- //if (navigationModel != null) {
-
- Object data = navigationModel.getJAXXContextValue(context, path);
if (data != null) {
- if (log.isInfoEnabled()) {
- log.info("find data for contextPath <" + path + "> : " + data.getClass());
- }
+ context.setContextValue(data, NAVIGATION_SELECTED_BEAN);
+ //todo should we not use this to avoid conflict in context ?
context.setContextValue(data);
}
- //}
- return data;
- }*/
+ }
+ protected String getNodeConstraints(NavigationTreeNode node) {
+ String constraints;
+ switch (strategy) {
+ case PER_NODE:
+ constraints = node.getContextPath();
+ break;
+ case PER_UI_TYPE:
+ constraints = node.getJaxxClass().getName();
+ break;
+ default:
+ throw new IllegalArgumentException("could not find constraint for node : " + node);
+ }
+ return constraints;
+ }
+
protected void returnToPreviousNode(JTree tree, TreeSelectionEvent event) {
// go back to previous node
// put in context a tag to not come back again here
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeSelectionAdapterWithCardLayout.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeSelectionAdapterWithCardLayout.java 2008-12-02 19:25:08 UTC (rev 1052)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/swing/navigation/NavigationTreeSelectionAdapterWithCardLayout.java 2008-12-02 20:59:03 UTC (rev 1053)
@@ -4,8 +4,8 @@
import jaxx.runtime.JAXXContext;
import jaxx.runtime.JAXXInitialContext;
import jaxx.runtime.JAXXObject;
+import jaxx.runtime.swing.CardLayout2;
import jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode;
-import jaxx.runtime.swing.CardLayout2;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -44,8 +44,8 @@
*/
protected abstract CardLayout2 getContentLayout();
- public NavigationTreeSelectionAdapterWithCardLayout(Class<? extends JAXXObject> defaultUIClass, Class<? extends JAXXAction> defaultUIHandlerClass, JAXXObject context) {
- super(defaultUIClass, defaultUIHandlerClass, context);
+ public NavigationTreeSelectionAdapterWithCardLayout(Class<? extends JAXXObject> defaultUIClass, Class<? extends JAXXAction> defaultUIHandlerClass, JAXXObject context, Strategy strategy) {
+ super(defaultUIClass, defaultUIHandlerClass, context,strategy);
if (getContentContainer() == null) {
throw new IllegalArgumentException("could not have a null 'contentContainer' in ui " + context);
@@ -61,17 +61,19 @@
return layout.getVisibleComponent(container);
}
- protected Component getNewUI(String path) {
+ protected Component getUI(NavigationTreeNode node) {
CardLayout2 layout = getContentLayout();
JPanel container = getContentContainer();
+ String path = getNodeConstraints(node);
return layout.contains(path) ? layout.getComponent(container, path) : null;
}
protected void openUI(Component newUI, NavigationTreeNode node) throws Exception {
+
CardLayout2 layout = getContentLayout();
JPanel container = getContentContainer();
// switch layout
- layout.show(container, node.getContextPath());
+ layout.show(container, getNodeConstraints(node));
}
protected boolean closeUI(TreeSelectionEvent event, Component component) throws Exception {
@@ -99,7 +101,7 @@
log.debug("instanciate new ui " + newUI);
}
- getContentContainer().add((Component) newUI, node.getContextPath());
+ getContentContainer().add((Component) newUI, getNodeConstraints(node));
return (Component) newUI;
}
}
1
0
r1052 - in lutinjaxx/trunk/jaxx-core: . src/main/java/jaxx/compiler src/main/java/jaxx/reflect src/main/java/jaxx/runtime src/main/java/jaxx/runtime/validator src/main/java/jaxx/tags src/test/java/jaxx/junit
by tchemit@users.labs.libre-entreprise.org 02 Dec '08
by tchemit@users.labs.libre-entreprise.org 02 Dec '08
02 Dec '08
Author: tchemit
Date: 2008-12-02 19:25:08 +0000 (Tue, 02 Dec 2008)
New Revision: 1052
Modified:
lutinjaxx/trunk/jaxx-core/changelog
lutinjaxx/trunk/jaxx-core/pom.xml
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXObjectGenerator.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/reflect/ClassDescriptorLoader.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/Util.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/validator/BeanValidator.java
lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/DefaultObjectHandler.java
lutinjaxx/trunk/jaxx-core/src/test/java/jaxx/junit/ClassDescriptorTest.java
Log:
fix bug when searching for a inner class
add usefullmethod to setBean on all validators of a JAXXObject
+ little stuff
Modified: lutinjaxx/trunk/jaxx-core/changelog
===================================================================
--- lutinjaxx/trunk/jaxx-core/changelog 2008-12-02 01:07:51 UTC (rev 1051)
+++ lutinjaxx/trunk/jaxx-core/changelog 2008-12-02 19:25:08 UTC (rev 1052)
@@ -1,4 +1,5 @@
0.7 chemit 200812??
+ * 20081202 [chemit] - fix bug when searching for a inner class
* 20081201 [chemit] - implements jaxx.runtime.JXPathDecorator
- add setcontextValue and removeContextValue on JAXXContextEntryDef
- introduce scope in BeanValidator (ERROR or WARNING) and related swing stuff
Modified: lutinjaxx/trunk/jaxx-core/pom.xml
===================================================================
--- lutinjaxx/trunk/jaxx-core/pom.xml 2008-12-02 01:07:51 UTC (rev 1051)
+++ lutinjaxx/trunk/jaxx-core/pom.xml 2008-12-02 19:25:08 UTC (rev 1052)
@@ -52,6 +52,9 @@
<!-- ************************************************************* -->
<packaging>jar</packaging>
+ <build>
+ <defaultGoal>install</defaultGoal>
+ </build>
<!-- ************************************************************* -->
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXObjectGenerator.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXObjectGenerator.java 2008-12-02 01:07:51 UTC (rev 1051)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/compiler/JAXXObjectGenerator.java 2008-12-02 19:25:08 UTC (rev 1052)
@@ -491,6 +491,8 @@
code.append("getValidator(").append(id).append(").validate();");
code.append(JAXXCompiler.getLineSeparator());
}
+ code.append("validatorIds = java.util.Collections.unmodifiableList(validatorIds);");
+ code.append(JAXXCompiler.getLineSeparator());
}
return newMethod(Modifier.PRIVATE, "void", "$completeSetup", code.toString());
}
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/reflect/ClassDescriptorLoader.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/reflect/ClassDescriptorLoader.java 2008-12-02 01:07:51 UTC (rev 1051)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/reflect/ClassDescriptorLoader.java 2008-12-02 19:25:08 UTC (rev 1052)
@@ -45,11 +45,12 @@
public static synchronized ClassDescriptor getClassDescriptor(String className, ClassLoader classLoader) throws ClassNotFoundException {
ClassDescriptor result = descriptors.get(className);
if (result == null) {
- if (JAXXCompiler.getSymbolTable(className) != null)
+ if (JAXXCompiler.getSymbolTable(className) != null) {
result = createClassDescriptorFromSymbolTable(className, classLoader);
- else {
- if (classLoader == null)
+ } else {
+ if (classLoader == null) {
classLoader = ClassDescriptorLoader.class.getClassLoader();
+ }
String relativePath = className.replaceAll("\\.", "/");
String relativePathPattern = ".*";// + className + ".*"; // used to ensure that the located resource has the right character cases
@@ -57,13 +58,15 @@
// find the most recently updated source for the class -- Java source, JAXX source, or compiled class file
long javaLastModified = -1;
URL javaFile = classLoader.getResource(relativePath + ".java");
- if (javaFile != null && javaFile.toString().startsWith("file:") && javaFile.toString().matches(relativePathPattern))
+ if (javaFile != null && javaFile.toString().startsWith("file:") && javaFile.toString().matches(relativePathPattern)) {
javaLastModified = JAXXCompiler.URLtoFile(javaFile).lastModified();
+ }
long classLastModified = -1;
URL classFile = classLoader.getResource(relativePath + ".class");
- if (classFile != null && classFile.toString().startsWith("file:") && classFile.toString().matches(relativePathPattern))
+ if (classFile != null && classFile.toString().startsWith("file:") && classFile.toString().matches(relativePathPattern)) {
classLastModified = JAXXCompiler.URLtoFile(classFile).lastModified();
+ }
long jaxxLastModified = -1;
URL jaxxFile = classLoader.getResource(relativePath + ".jaxx");
@@ -73,23 +76,26 @@
String simplePath = jaxxFilePath.getPath();
simplePath = simplePath.substring(0, simplePath.length() - ".jaxx".length());
File cssFilePath = new File(simplePath + ".css");
- if (cssFilePath.exists())
+ if (cssFilePath.exists()) {
jaxxLastModified = Math.max(jaxxLastModified, cssFilePath.lastModified());
+ }
File scriptFilePath = new File(simplePath + ".script");
- if (scriptFilePath.exists())
+ if (scriptFilePath.exists()) {
jaxxLastModified = Math.max(jaxxLastModified, scriptFilePath.lastModified());
+ }
}
- if (jaxxLastModified != -1 && JAXXCompiler.getSymbolTable(className) == null)
+ if (jaxxLastModified != -1 && JAXXCompiler.getSymbolTable(className) == null) {
jaxxLastModified = -1; // file has been modified, but wasn't included in this
+ }
// compilation set so we don't have a symbol table
if (javaLastModified != -1 || classLastModified != -1 || jaxxLastModified != -1) {
- if (jaxxLastModified > classLastModified && jaxxLastModified > javaLastModified)
+ if (jaxxLastModified > classLastModified && jaxxLastModified > javaLastModified) {
result = createClassDescriptorFromSymbolTable(className, classLoader);
- else
- if (javaLastModified > classLastModified && javaLastModified > jaxxLastModified)
+ } else if (javaLastModified > classLastModified && javaLastModified > jaxxLastModified) {
result = createClassDescriptorFromJavaSource(javaFile, classLoader);
+ }
}
// else work off of the class file. This also handles the case where the class is available, but wasn't in a location where
// we could check its last modified date (in a JAR, over the network, etc.)
@@ -114,8 +120,9 @@
}
public static Class getClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
- if (className.equals("boolean"))
+ if (className.equals("boolean")) {
return boolean.class;
+ }
if (className.equals("byte")) {
return byte.class;
}
@@ -151,8 +158,27 @@
}
try {
return classLoader != null ? Class.forName(className, true, classLoader) : Class.forName(className);
+ } catch (ClassNotFoundException e) {
+ // perharps we are in a inner class ?
+ int dotIndex = className.lastIndexOf(".");
+ if (dotIndex > -1) {
+ String parentFQN = className.substring(0, dotIndex);
+ String simpleName = className.substring(dotIndex + 1);
+ try {
+ Class<?> parentClass = classLoader != null ? Class.forName(parentFQN, true, classLoader) : Class.forName(parentFQN);
+ for (Class<?> innerClass : parentClass.getClasses()) {
+ if (simpleName.equals(innerClass.getSimpleName())) {
+ return innerClass;
+ }
+ }
+ } catch (ClassNotFoundException e1) {
+ // no super class,so let the first exception throw...
+ }
+ }
+ throw e;
}
catch (NoClassDefFoundError e) {
+
throw new ClassNotFoundException(e.toString());
}
}
@@ -180,8 +206,9 @@
private static JAXXObjectDescriptor getJAXXObjectDescriptor(Class<?> jaxxClass) {
- if (!JAXXObject.class.isAssignableFrom(jaxxClass) || jaxxClass == JAXXObject.class)
+ if (!JAXXObject.class.isAssignableFrom(jaxxClass) || jaxxClass == JAXXObject.class) {
return null;
+ }
try {
Method getJAXXObjectDescriptor = jaxxClass.getMethod("$getJAXXObjectDescriptor", new Class[0]);
return (JAXXObjectDescriptor) getJAXXObjectDescriptor.invoke(null);
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/Util.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/Util.java 2008-12-02 01:07:51 UTC (rev 1051)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/Util.java 2008-12-02 19:25:08 UTC (rev 1052)
@@ -446,12 +446,41 @@
}
return value;
-
}
+ /**
+ * Convinient method to process more than one binding on a JAXX ui.
+ *
+ * @param src the ui to treate
+ * @param bindings the list of binding to process.
+ */
public static void processDataBinding(JAXXObject src, String... bindings) {
for (String binding : bindings) {
src.processDataBinding(binding);
}
}
+
+ /**
+ * Convient method to attach a bean to all validators of an JAXXObject.
+ * <p/>
+ * It is possible to exclude some validator to be treated.
+ *
+ * @param ui the ui containing the validatros to treate
+ * @param bean the bean to attach in validators (can be null)
+ * @param excludeIds the list of validator id to exclude
+ */
+ @SuppressWarnings({"unchecked"})
+ public static void setValidatorBean(JAXXObject ui, Object bean, String... excludeIds) {
+ List<String> validatorIds = ui.getValidatorIds();
+ if (excludeIds.length > 0) {
+ validatorIds = new ArrayList<String>(validatorIds);
+ for (String excludeId : excludeIds) {
+ validatorIds.remove(excludeId);
+ }
+ }
+ for (String validatorId : validatorIds) {
+ BeanValidator beanValidator = ui.getValidator(validatorId);
+ beanValidator.setBean(bean);
+ }
+ }
}
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/validator/BeanValidator.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/validator/BeanValidator.java 2008-12-02 01:07:51 UTC (rev 1051)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/runtime/validator/BeanValidator.java 2008-12-02 19:25:08 UTC (rev 1052)
@@ -520,6 +520,11 @@
}
}
+ @Override
+ public String toString() {
+ return super.toString() + "<contextName:" + contextName + ">";
+ }
+
/** @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;
Modified: lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/DefaultObjectHandler.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/DefaultObjectHandler.java 2008-12-02 01:07:51 UTC (rev 1051)
+++ lutinjaxx/trunk/jaxx-core/src/main/java/jaxx/tags/DefaultObjectHandler.java 2008-12-02 19:25:08 UTC (rev 1052)
@@ -521,7 +521,7 @@
try {
init();
} catch (IntrospectionException e) {
- throw new RuntimeException(e);
+ throw new CompilerException(e);
}
CompiledObject object = objectMap.get(tag);
if (object == null) {
Modified: lutinjaxx/trunk/jaxx-core/src/test/java/jaxx/junit/ClassDescriptorTest.java
===================================================================
--- lutinjaxx/trunk/jaxx-core/src/test/java/jaxx/junit/ClassDescriptorTest.java 2008-12-02 01:07:51 UTC (rev 1051)
+++ lutinjaxx/trunk/jaxx-core/src/test/java/jaxx/junit/ClassDescriptorTest.java 2008-12-02 19:25:08 UTC (rev 1052)
@@ -3,37 +3,45 @@
import jaxx.reflect.ClassDescriptor;
import jaxx.reflect.ClassDescriptorLoader;
import jaxx.reflect.MethodDescriptor;
-import org.junit.Assert;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import org.junit.Test;
public class ClassDescriptorTest {
@Test
+ public void testGetClassDescriptor() throws Exception {
+ ClassDescriptor object = ClassDescriptorLoader.getClassDescriptor("jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode");
+
+
+ }
+
+ @Test
public void testBuiltInClassName() throws ClassNotFoundException, NoSuchMethodException {
ClassDescriptor object = ClassDescriptorLoader.getClassDescriptor("java.lang.Object");
MethodDescriptor toString = object.getMethodDescriptor("toString", new ClassDescriptor[0]);
- Assert.assertEquals(toString.getName(), "toString");
- Assert.assertEquals(toString.getParameterTypes().length, 0);
+ assertEquals(toString.getName(), "toString");
+ assertEquals(toString.getParameterTypes().length, 0);
MethodDescriptor equals = object.getMethodDescriptor("equals", new ClassDescriptor[]{object});
- Assert.assertEquals(equals.getName(), "equals");
- Assert.assertEquals(equals.getParameterTypes().length, 1);
- Assert.assertEquals(equals.getParameterTypes()[0], object);
+ assertEquals(equals.getName(), "equals");
+ assertEquals(equals.getParameterTypes().length, 1);
+ assertEquals(equals.getParameterTypes()[0], object);
}
@Test
public void testBuiltInClass() throws ClassNotFoundException, NoSuchMethodException {
ClassDescriptor object1 = ClassDescriptorLoader.getClassDescriptor("java.lang.Object");
ClassDescriptor object2 = ClassDescriptorLoader.getClassDescriptor(Object.class);
- Assert.assertEquals(object1, object2);
+ assertEquals(object1, object2);
}
@Test
public void testUserClassName() throws ClassNotFoundException, NoSuchMethodException {
ClassDescriptor me = ClassDescriptorLoader.getClassDescriptor("jaxx.junit.ClassDescriptorTest", getClass().getClassLoader());
MethodDescriptor testUserClassName = me.getMethodDescriptor("testUserClassName", new ClassDescriptor[0]);
- Assert.assertEquals(testUserClassName.getName(), "testUserClassName");
- Assert.assertEquals(testUserClassName.getParameterTypes().length, 0);
+ assertEquals(testUserClassName.getName(), "testUserClassName");
+ assertEquals(testUserClassName.getParameterTypes().length, 0);
}
@Test(expected = ClassNotFoundException.class)
@@ -50,8 +58,8 @@
@Test
public void testArrays() throws ClassNotFoundException {
ClassDescriptor intArray = ClassDescriptorLoader.getClassDescriptor(int[].class);
- Assert.assertNotNull(intArray);
+ assertNotNull(intArray);
ClassDescriptor objectArray = ClassDescriptorLoader.getClassDescriptor(Object[].class);
- Assert.assertNotNull(objectArray);
+ assertNotNull(objectArray);
}
}
\ No newline at end of file
1
0
02 Dec '08
Author: tchemit
Date: 2008-12-02 01:07:51 +0000 (Tue, 02 Dec 2008)
New Revision: 1051
Modified:
lutinjaxx/trunk/jaxx-swing-action/pom.xml
Log:
fix scm values
Modified: lutinjaxx/trunk/jaxx-swing-action/pom.xml
===================================================================
--- lutinjaxx/trunk/jaxx-swing-action/pom.xml 2008-12-02 01:00:12 UTC (rev 1050)
+++ lutinjaxx/trunk/jaxx-swing-action/pom.xml 2008-12-02 01:07:51 UTC (rev 1051)
@@ -73,7 +73,7 @@
<!-- ************************************************************* -->
<scm>
<connection>${scm.connection.son}</connection>
- <developerConnection>$scm.developerConnection.son}</developerConnection>
+ <developerConnection>${scm.developerConnection.son}</developerConnection>
<url>${scm.url.son}</url>
</scm>
1
0