You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by fr...@apache.org on 2007/02/05 18:15:44 UTC

svn commit: r503777 [1/4] - in /tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support: ./ .settings/ src/main/java/org/apache/tapestry/ src/main/java/org/apache/tapestry/annotations/ src/main/java/org/apache/tapestry/beaneditor/ src/main/ja...

Author: freemant
Date: Mon Feb  5 09:15:39 2007
New Revision: 503777

URL: http://svn.apache.org/viewvc?view=rev&rev=503777
Log:
Supports type safe configuration of components leading to IDE auto-completion, compile time checking, ease of working with POJO's.

Added:
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/BindingExprValueConduit.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/BindingSourceProvider.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ConstantValueConduit.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/DefaultValueEncoder.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/SetterValueConduit.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueConduit.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueSetter.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/annotations/FormPersist.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/LengthRange.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Max.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Min.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Required.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/NoOpFieldValidator.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/RestorePropertiesAction.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/beaneditor/AnnotationValidatorGenerator.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/beaneditor/LengthRangeValidateAnnotationWorker.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/beaneditor/MaxValidateAnnotationWorker.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/beaneditor/MinValidateAnnotationWorker.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/beaneditor/PrimitiveFieldValidatorGenerator.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/beaneditor/RequiredValidateAnnotationWorker.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/beaneditor/ValidateAnnotationWorker.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/services/CompoundalidatorGenerator.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/services/FieldValidatorMessages.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/services/FieldValidatorMessagesImpl.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/services/FormPersistWorker.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/services/ValidatorGenerator.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/BindingExprValueConduitTest.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/corelib/base/
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/corelib/base/RestorePropertiesActionTest.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app2/components/
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForSelect.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForTextField.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/pagelevel/SelectTest.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/pagelevel/TextFieldTest.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/beaneditor/AnnotationValidatorGeneratorTest.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/beaneditor/CompoundValidatorGeneratorTest.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/FieldValidatorMessagesImplTest.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/FormPersistWorkerTest.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/NoOpClassTransformation.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/NoOpComponentResources.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/NoOpField.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/NoOpFieldComponent.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/NoOpValidator.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/services/NoOpBindingSource.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/validator/MaxTest.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForSelect.html   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForTextField.html   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForTextField.properties   (with props)
Removed:
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/beaneditor/PrimitiveFieldConstraintGenerator.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/beaneditor/ValidateAnnotationConstraintGenerator.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/bindings/ValidateBindingFactory.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/services/FieldValidatorDefaultSourceImpl.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/services/FieldValidatorDefaultSourceImplTest.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/services/FieldValidatorSourceImpl.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/services/ValidationConstraintGeneratorImpl.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/services/FieldValidatorDefaultSource.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/services/FieldValidatorSource.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/services/ValidationConstraintGenerator.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/validator/MaxTest.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/beaneditor/ValidateAnnotationConstraintGeneratorTest.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/bindings/ValidateBindingFactoryTest.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/FieldValidatorSourceImplTest.java
Modified:
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/.settings/org.eclipse.jdt.core.prefs
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/pom.xml
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/EnumSelectModel.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/EnumValueEncoder.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/OptionGroupModel.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/OptionModel.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/SelectModel.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/Validator.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueEncoder.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Label.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/PasswordField.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Select.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/TextArea.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/TextField.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/OptionGroupModelImpl.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/OptionModelImpl.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/SelectModelImpl.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/TapestryUtils.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/services/FieldValidatorImpl.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/services/InternalClassTransformationImpl.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/services/TapestryModule.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/test/TapestryTestCase.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/translator/DoubleTranslator.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/translator/IntegerTranslator.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/translator/LongTranslator.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/translator/StringTranslator.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/validator/Max.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/validator/MaxLength.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/validator/Min.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/validator/MinLength.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/validator/Required.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/resources/org/apache/tapestry/internal/ValidationMessages.properties
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/BlockDemo.html
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/PasswordFieldDemo.html
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/SimpleForm.html
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/ToDoList.html
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/ToDoListVolatile.html
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/EnumSelectModelTest.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/corelib/components/SelectTest.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/data/RegistrationData.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/BlockDemo.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/PasswordFieldDemo.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/SimpleForm.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/ToDoList.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/ToDoListVolatile.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/ValidForm.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForForm.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForSubmit.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/OptionGroupModelImplTest.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/OptionModelImplTest.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/TapestryUtilsTest.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/FieldValidatorImplTest.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/validator/MaxLengthTest.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/validator/MinLengthTest.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/validator/MinTest.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/validator/RequiredTest.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/resources/org/apache/tapestry/integration/app1/pages/ValidForm.html
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForForm.html
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForSubmit.html

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/.settings/org.eclipse.jdt.core.prefs?view=diff&rev=503777&r1=503776&r2=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/.settings/org.eclipse.jdt.core.prefs (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/.settings/org.eclipse.jdt.core.prefs Mon Feb  5 09:15:39 2007
@@ -1,4 +1,4 @@
-#Sat Oct 14 06:55:27 PDT 2006
+#Tue Feb 06 00:44:25 CST 2007
 eclipse.preferences.version=1
 org.eclipse.jdt.core.codeComplete.argumentPrefixes=
 org.eclipse.jdt.core.codeComplete.argumentSuffixes=

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/pom.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/pom.xml?view=diff&rev=503777&r1=503776&r2=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/pom.xml (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/pom.xml Mon Feb  5 09:15:39 2007
@@ -3,7 +3,7 @@
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.apache.tapestry</groupId>
-    <artifactId>tapestry-core</artifactId>
+    <artifactId>tapestry-core-kt-IDE-support</artifactId>
     <packaging>jar</packaging>
     <version>5.0.1</version>
     <parent>
@@ -119,4 +119,4 @@
             </plugin>
         </plugins>
     </reporting>
-</project>
+</project>

Added: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/BindingExprValueConduit.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/BindingExprValueConduit.java?view=auto&rev=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/BindingExprValueConduit.java (added)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/BindingExprValueConduit.java Mon Feb  5 09:15:39 2007
@@ -0,0 +1,71 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry;
+
+import java.io.Serializable;
+
+import org.apache.tapestry.ioc.internal.util.Defense;
+import org.apache.tapestry.runtime.ComponentResourcesAware;
+
+/**
+ * Uses a binding expression to back a {@link org.apache.tapestry.ValueConduit}.
+ * 
+ * @param <T>
+ *            the type of the value
+ */
+public class BindingExprValueConduit<T> implements ValueConduit<T>, Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    private String _bindingExpr;
+
+    transient private Binding _binding;
+
+    public BindingExprValueConduit(String bindingExpr)
+    {
+        _bindingExpr = bindingExpr;
+    }
+
+    @SuppressWarnings("unchecked")
+    public T get(Object component)
+    {
+        return (T) getBinding(component).get();
+    }
+
+    public void set(Object component, T value)
+    {
+        getBinding(component).set(value);
+    }
+
+    private Binding getBinding(Object component)
+    {
+        if (_binding == null)
+        {
+            BindingSourceProvider provider = Defense.cast(
+                    component,
+                    BindingSourceProvider.class,
+                    "component");
+            ComponentResourcesAware aware = Defense.cast(
+                    component,
+                    ComponentResourcesAware.class,
+                    "component");
+            _binding = provider.getBindingSource().newBinding(
+                    getClass().getSimpleName(),
+                    aware.getComponentResources().getContainerResources(),
+                    _bindingExpr);
+        }
+        return _binding;
+    }
+}

Propchange: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/BindingExprValueConduit.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/BindingSourceProvider.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/BindingSourceProvider.java?view=auto&rev=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/BindingSourceProvider.java (added)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/BindingSourceProvider.java Mon Feb  5 09:15:39 2007
@@ -0,0 +1,30 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry;
+
+import org.apache.tapestry.services.BindingSource;
+
+/**
+ * It allows the {@link org.apache.tapestry.BindingExprValueConduit} to access the
+ * {@link org.apache.tapestry.services.BindingSource} from the
+ * {@link org.apache.tapestry.corelib.base.AbstractField} concerned. Due to classloading issue, it
+ * can't access it as an AbstractField. Instead, it must access it using an interface such as this
+ * one.
+ */
+public interface BindingSourceProvider
+{
+    BindingSource getBindingSource();
+
+}

Propchange: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/BindingSourceProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ConstantValueConduit.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ConstantValueConduit.java?view=auto&rev=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ConstantValueConduit.java (added)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ConstantValueConduit.java Mon Feb  5 09:15:39 2007
@@ -0,0 +1,46 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry;
+
+import java.io.Serializable;
+
+/**
+ * Uses a given constant object to back a {@link org.apache.tapestry.ValueConduit}.
+ * 
+ * @param <T>
+ *            the type of the value
+ */
+public class ConstantValueConduit<T> implements ValueConduit<T>, Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    private T _value;
+
+    public ConstantValueConduit(T value)
+    {
+        _value = value;
+    }
+
+    public T get(Object component)
+    {
+        return _value;
+    }
+
+    public void set(Object component, T value)
+    {
+        throw new RuntimeException(getClass().getName() + " is read-only");
+    }
+
+}

Propchange: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ConstantValueConduit.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/DefaultValueEncoder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/DefaultValueEncoder.java?view=auto&rev=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/DefaultValueEncoder.java (added)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/DefaultValueEncoder.java Mon Feb  5 09:15:39 2007
@@ -0,0 +1,35 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry;
+
+import java.io.Serializable;
+
+/**
+ * A {@link org.apache.tapestry.ValueEncoder} that treats the value and the clientValue as the same.
+ */
+public class DefaultValueEncoder implements ValueEncoder<String>, Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    public String toClient(Object component, String value)
+    {
+        return value;
+    }
+
+    public String toValue(Object component, String clientValue)
+    {
+        return clientValue;
+    }
+}

Propchange: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/DefaultValueEncoder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/EnumSelectModel.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/EnumSelectModel.java?view=diff&rev=503777&r1=503776&r2=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/EnumSelectModel.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/EnumSelectModel.java Mon Feb  5 09:15:39 2007
@@ -35,18 +35,18 @@
  * <li>As a user-presentable version of the name, i.e., "Local Variable".
  * </ul>
  */
-public final class EnumSelectModel implements SelectModel, Serializable
+public final class EnumSelectModel<T extends Enum> implements SelectModel<T>, Serializable
 {
     private static final long serialVersionUID = -3590412082766899684L;
 
-    private final List<OptionModel> _options = newList();;
+    private final List<OptionModel<T>> _options = newList();;
 
-    public <T extends Enum> EnumSelectModel(Class<T> enumClass, Messages messages)
+    public EnumSelectModel(Class<T> enumClass, Messages messages)
     {
         this(enumClass, messages, enumClass.getEnumConstants());
     }
 
-    public <T extends Enum> EnumSelectModel(Class<T> enumClass, Messages messages, T[] values)
+    public EnumSelectModel(Class<T> enumClass, Messages messages, T[] values)
     {
         Defense.notNull(enumClass, "enumClass");
         Defense.notNull(messages, "messages");
@@ -57,7 +57,7 @@
         {
             String label = labelForValue(messages, prefix, value);
 
-            _options.add(new OptionModelImpl(label, false, value));
+            _options.add(new OptionModelImpl<T>(label, false, value));
         }
     }
 
@@ -77,13 +77,13 @@
     }
 
     /** Returns null. */
-    public List<OptionGroupModel> getOptionGroups()
+    public List<OptionGroupModel<T>> getOptionGroups()
     {
         return null;
     }
 
     /** Returns the option groupos created in the constructor. */
-    public List<OptionModel> getOptions()
+    public List<OptionModel<T>> getOptions()
     {
         return _options;
     }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/EnumValueEncoder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/EnumValueEncoder.java?view=diff&rev=503777&r1=503776&r2=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/EnumValueEncoder.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/EnumValueEncoder.java Mon Feb  5 09:15:39 2007
@@ -14,30 +14,32 @@
 
 package org.apache.tapestry;
 
+import java.io.Serializable;
+
 import org.apache.tapestry.ioc.internal.util.Defense;
 
 /**
  * A value encoder that can be used for aribrary Enum types. The enum name is stored as the client
  * side value (the "primary key").
  */
-public class EnumValueEncoder implements ValueEncoder<Enum>
+public class EnumValueEncoder<T extends Enum<T>> implements ValueEncoder<T>, Serializable
 {
-    private final Class<Enum> _enumType;
+    private static final long serialVersionUID = 1L;
+
+    private final Class<T> _enumType;
 
-    public EnumValueEncoder(final Class<Enum> enumType)
+    public EnumValueEncoder(final Class<T> enumType)
     {
         Defense.notNull(enumType, "enumType");
-
         _enumType = enumType;
     }
 
-    public String toClient(Enum value)
+    public String toClient(Object component, T value)
     {
         return value.name();
     }
 
-    @SuppressWarnings("unchecked")
-    public Enum toValue(String clientValue)
+    public T toValue(Object component, String clientValue)
     {
         if (clientValue == null)
             return null;

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/OptionGroupModel.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/OptionGroupModel.java?view=diff&rev=503777&r1=503776&r2=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/OptionGroupModel.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/OptionGroupModel.java Mon Feb  5 09:15:39 2007
@@ -21,7 +21,7 @@
  * Defines a group of related options. Options may be enabled or disabled as a group. Corresponds to
  * the [X]HTML element &lt;optgroup&gt;.
  */
-public interface OptionGroupModel
+public interface OptionGroupModel<T>
 {
     /** Localized, user-presentable label for the group. */
     String getLabel();
@@ -41,5 +41,5 @@
     Map<String, String> getAttributes();
 
     /** The list of options within the group. */
-    List<OptionModel> getOptions();
+    List<OptionModel<T>> getOptions();
 }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/OptionModel.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/OptionModel.java?view=diff&rev=503777&r1=503776&r2=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/OptionModel.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/OptionModel.java Mon Feb  5 09:15:39 2007
@@ -20,7 +20,7 @@
  * A single option within a {@link OptionGroupModel}. Corresponds closely to the [X]HTML
  * &lt;option&gt; element.
  */
-public interface OptionModel
+public interface OptionModel<T>
 {
     /** The localized, user-presentable label for the option. */
     String getLabel();
@@ -36,5 +36,5 @@
      * be selected. It is also used, via {@link ValueEncoder#toClient(Object)}, to generate
      * the client-side value attribute.
      */
-    Object getValue();
+    T getValue();
 }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/SelectModel.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/SelectModel.java?view=diff&rev=503777&r1=503776&r2=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/SelectModel.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/SelectModel.java Mon Feb  5 09:15:39 2007
@@ -25,14 +25,14 @@
  * needs to present a list of options to the user. Generally paired with a {@link ValueEncoder} to
  * create client-side representations of server-side values.
  */
-public interface SelectModel
+public interface SelectModel<V>
 {
     /**
      * The list of groups, each containing some number of individual options.
      * 
      * @return the groups, or null
      */
-    List<OptionGroupModel> getOptionGroups();
+    List<OptionGroupModel<V>> getOptionGroups();
 
     /**
      * The list of ungrouped options, which appear after any grouped options. Generally, a model
@@ -40,5 +40,5 @@
      * 
      * @return the ungrouped options, or null
      */
-    List<OptionModel> getOptions();
+    List<OptionModel<V>> getOptions();
 }

Added: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/SetterValueConduit.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/SetterValueConduit.java?view=auto&rev=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/SetterValueConduit.java (added)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/SetterValueConduit.java Mon Feb  5 09:15:39 2007
@@ -0,0 +1,50 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry;
+
+import java.io.Serializable;
+
+/**
+ * TODO: It was meant to allow a page to specify a setter call back. However, it needs to downcast
+ * the component back to its page class, which won't work because the page class is loaded in a
+ * special class loader. One has to create an interface and cast to it instead. This is too much
+ * troublesome. Because most usually only the setter is used on form submission but the value is
+ * not, the value is not serialized.
+ */
+public class SetterValueConduit<T> implements ValueConduit<T>, Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    transient private T _value;
+
+    private ValueSetter<T> _setter;
+
+    public SetterValueConduit(T value, ValueSetter<T> setter)
+    {
+        _value = value;
+        _setter = setter;
+    }
+
+    public T get(Object component)
+    {
+        return _value;
+    }
+
+    public void set(Object component, T value)
+    {
+        _setter.set(component, value);
+    }
+
+}

Propchange: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/SetterValueConduit.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/Validator.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/Validator.java?view=diff&rev=503777&r1=503776&r2=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/Validator.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/Validator.java Mon Feb  5 09:15:39 2007
@@ -23,24 +23,9 @@
  * <p>
  * Validators are usually encapsulated inside a {@link FieldValidator}.
  */
-public interface Validator<C, T>
+public interface Validator<T>
 {
     /**
-     * Returns the type of constraint value used with this validator. Constraint values are used to
-     * parameterize a validator, for example a "maxLength" validator will have a constraint value of
-     * type int (the maximum length allowed). For constraints that do not have a constraint value,
-     * this method returns null.
-     */
-    Class<C> getConstraintType();
-
-    /**
-     * Returns the value type associated with this validator.
-     * {@link #validate(Field, Object, MessageFormatter, Object)} will only be invoked when the
-     * value is assignable to the validator's value type.
-     */
-    Class<T> getValueType();
-
-    /**
      * Returns the message key, within the validiation messages, normally used by this validator.
      * This is used to provide the {@link MessageFormatter} passed to
      * {@link #validate(Field, Object, MessageFormatter, Object)} (unless overridden).
@@ -57,8 +42,6 @@
      * 
      * @param field
      *            the field for which a client submitted value is being validated
-     * @param constraintValue
-     *            the value used to constrain
      * @param formatter
      *            Validation messages, in the appropriate locale
      * @param value
@@ -66,8 +49,7 @@
      * @throws ValidationException
      *             if the value violates the constraint
      */
-    void validate(Field field, C constraintValue, MessageFormatter formatter, T value)
-            throws ValidationException;
+    void validate(Field field, MessageFormatter formatter, T value) throws ValidationException;
 
     /**
      * Returns true if the validator should be invoked for null or blank (empty string) values. This

Added: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueConduit.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueConduit.java?view=auto&rev=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueConduit.java (added)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueConduit.java Mon Feb  5 09:15:39 2007
@@ -0,0 +1,26 @@
+package org.apache.tapestry;
+
+public interface ValueConduit<T>
+{
+    /**
+     * Reads the current value of a certain property (or other resource) of the container of a given
+     * component. When reading properties of objects that are primitive types, this will return an
+     * instance of the wrapper type. In some cases, a value holder is write-only and this method
+     * will throw a runtime exception.
+     * 
+     * @param component
+     *            the component that is looking for the value
+     */
+    T get(Object component);
+
+    /**
+     * Updates the current value. Some value holders are read-only, and this method will throw a
+     * runtime exception.
+     * 
+     * @param component
+     *            the component that is updating the value
+     * @param value
+     */
+    void set(Object component, T value);
+
+}

Propchange: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueConduit.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueEncoder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueEncoder.java?view=diff&rev=503777&r1=503776&r2=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueEncoder.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueEncoder.java Mon Feb  5 09:15:39 2007
@@ -22,26 +22,30 @@
  * 
  * @see SelectModel
  */
-public interface ValueEncoder<V>
+public interface ValueEncoder<T>
 {
     /**
      * Converts a value into a client-side representation. The value should be parseable by
      * {@link #toValue(String)}. In some cases, what is returned is an identifier used to locate
      * the true object, rather than a string representation of the value itself.
      * 
+     * @param component
+     *            the component such as a {@link Select} whose value is being encoded.
      * @param value
      *            to be encoded
      * @return a string representation of the value, or the value's identity
      */
-    String toClient(V value);
+    String toClient(Object component, T value);
 
     /**
      * Converts a client-side representation, provided by {@link #toClient(Object)}, back into a
      * server-side value.
      * 
+     * @param component
+     *            the component such as a {@link Select} whose value is being decoded.
      * @param clientValue
      *            string representation of the value's identity
      * @return the corresponding entity, or null if not found
      */
-    V toValue(String clientValue);
+    T toValue(Object component, String clientValue);
 }

Added: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueSetter.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueSetter.java?view=auto&rev=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueSetter.java (added)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueSetter.java Mon Feb  5 09:15:39 2007
@@ -0,0 +1,6 @@
+package org.apache.tapestry;
+
+public interface ValueSetter<T>
+{
+    void set(Object component, T value);
+}

Propchange: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ValueSetter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/annotations/FormPersist.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/annotations/FormPersist.java?view=auto&rev=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/annotations/FormPersist.java (added)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/annotations/FormPersist.java Mon Feb  5 09:15:39 2007
@@ -0,0 +1,39 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Marker annotation placed on fields whose value should persist across the rendering and submission
+ * of a form. That is, the values will be saved into a hidden form field. On form submission, the
+ * values will be restored just before the
+ * {@link org.apache.tapestry.corelib.base.AbstractField#processSubmission()} is called.
+ * <p>
+ * It doesn't fit in as a persistent field strategy because such persistent fields are restored at
+ * the moment the page is attached, which doesn't work for form submissions and doesn't work if the
+ * component is in a loop.
+ */
+@Target(FIELD)
+@Retention(RUNTIME)
+@Documented
+public @interface FormPersist {
+
+}

Propchange: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/annotations/FormPersist.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/LengthRange.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/LengthRange.java?view=auto&rev=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/LengthRange.java (added)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/LengthRange.java Mon Feb  5 09:15:39 2007
@@ -0,0 +1,34 @@
+//Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.beaneditor;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * An annotation to a String property to indicate that its length is limited.
+ */
+@Target(METHOD)
+@Retention(RUNTIME)
+@Documented
+public @interface LengthRange {
+    int minLength() default 0;
+
+    int maxLength() default Integer.MAX_VALUE;
+}

Propchange: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/LengthRange.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Max.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Max.java?view=auto&rev=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Max.java (added)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Max.java Mon Feb  5 09:15:39 2007
@@ -0,0 +1,32 @@
+//Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.beaneditor;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * An annotation to a number property to indicate that its maximum value.
+ */
+@Target(METHOD)
+@Retention(RUNTIME)
+@Documented
+public @interface Max {
+    long value();
+}

Propchange: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Max.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Min.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Min.java?view=auto&rev=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Min.java (added)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Min.java Mon Feb  5 09:15:39 2007
@@ -0,0 +1,32 @@
+//Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.beaneditor;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * An annotation to a number property to indicate that its minimum value.
+ */
+@Target(METHOD)
+@Retention(RUNTIME)
+@Documented
+public @interface Min {
+    long value();
+}

Propchange: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Min.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Required.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Required.java?view=auto&rev=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Required.java (added)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Required.java Mon Feb  5 09:15:39 2007
@@ -0,0 +1,31 @@
+//Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.beaneditor;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * An annotation to a property to indicate that it's mandatory.
+ */
+@Target(METHOD)
+@Retention(RUNTIME)
+@Documented
+public @interface Required {
+}

Propchange: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/beaneditor/Required.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java?view=diff&rev=503777&r1=503776&r2=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java Mon Feb  5 09:15:39 2007
@@ -15,32 +15,31 @@
 package org.apache.tapestry.corelib.base;
 
 import java.io.Serializable;
+import java.util.List;
 
-import org.apache.tapestry.Binding;
+import org.apache.tapestry.BindingSourceProvider;
 import org.apache.tapestry.ComponentAction;
 import org.apache.tapestry.ComponentResources;
 import org.apache.tapestry.Field;
 import org.apache.tapestry.FieldValidator;
 import org.apache.tapestry.MarkupWriter;
 import org.apache.tapestry.ValidationDecorator;
-import org.apache.tapestry.ValidationException;
 import org.apache.tapestry.annotations.AfterRender;
 import org.apache.tapestry.annotations.BeginRender;
+import org.apache.tapestry.annotations.CleanupRender;
 import org.apache.tapestry.annotations.ComponentClass;
 import org.apache.tapestry.annotations.Environmental;
+import org.apache.tapestry.annotations.FormPersist;
 import org.apache.tapestry.annotations.Inject;
 import org.apache.tapestry.annotations.Mixin;
-import org.apache.tapestry.annotations.Parameter;
 import org.apache.tapestry.annotations.SetupRender;
 import org.apache.tapestry.corelib.mixins.DiscardBody;
 import org.apache.tapestry.corelib.mixins.RenderDisabled;
 import org.apache.tapestry.corelib.mixins.RenderInformals;
 import org.apache.tapestry.internal.TapestryUtils;
-import org.apache.tapestry.internal.bindings.LiteralBinding;
 import org.apache.tapestry.internal.services.FormParameterLookup;
 import org.apache.tapestry.ioc.Messages;
-import org.apache.tapestry.ioc.services.PropertyAccess;
-import org.apache.tapestry.runtime.Component;
+import org.apache.tapestry.ioc.internal.util.CollectionFactory;
 import org.apache.tapestry.services.BindingSource;
 import org.apache.tapestry.services.FormSupport;
 import org.apache.tapestry.services.PageRenderSupport;
@@ -50,16 +49,16 @@
  * {@link RenderInformals}, {@link RenderDisabled} and {@link DiscardBody} mixins.
  */
 @ComponentClass
-public abstract class AbstractField implements Field
+public abstract class AbstractField implements Field, BindingSourceProvider
 {
     /**
      * The user presentable label for the field. If not provided, a reasonable label is generated
      * from the component's id.
      */
-    @Parameter(defaultPrefix = "literal")
+    @FormPersist
     private String _label;
 
-    @Parameter
+    @FormPersist
     private boolean _disabled;
 
     @SuppressWarnings("unused")
@@ -77,13 +76,7 @@
     @Environmental
     private ValidationDecorator _decorator;
 
-    protected static final FieldValidator NOOP_VALIDATOR = new FieldValidator()
-    {
-        public void validate(Object value) throws ValidationException
-        {
-            // Do nothing
-        }
-    };
+    protected static final FieldValidator NOOP_VALIDATOR = new NoOpFieldValidator();
 
     static class SetupAction implements ComponentAction<AbstractField>, Serializable
     {
@@ -115,7 +108,6 @@
     /** Used a shared instance for all types of fields, for efficiency. */
     private static final ProcessSubmissionAction PROCESS_SUBMISSION_ACTION = new ProcessSubmissionAction();
 
-    @Parameter(value = "prop:componentResources.id", defaultPrefix="literal")
     private String _clientId;
 
     private String _assignedClientId;
@@ -137,10 +129,7 @@
     @Inject("infrastructure:BindingSource")
     private BindingSource _bindingSource;
 
-    @Inject("infrastructure:PropertyAccess")
-    private PropertyAccess _propertyAccess;
-
-    final Binding defaultLabel()
+    final String getDefaultLabel()
     {
         Messages containerMessages = _resources.getContainer().getComponentResources()
                 .getMessages();
@@ -152,14 +141,12 @@
         String label = containerMessages.contains(key) ? containerMessages.get(key) : TapestryUtils
                 .toUserPresentable(componentId);
 
-        // Bypassing the BindingSource for this ...
-
-        return new LiteralBinding("default label", label, null);
+        return label;
     }
 
     public final String getLabel()
     {
-        return _label;
+        return _label == null ? getDefaultLabel() : _label;
     }
 
     @SetupRender
@@ -167,7 +154,10 @@
     {
         // By default, use the component id as the (base) client id. If the clientid
         // parameter is bound, then that is the value to use.
-        
+        if (_clientId == null)
+        {
+            useDefaultClientId();
+        }
         String id = _clientId;
 
         // Often, these elementName and _clientId will end up as the same value. There are many
@@ -178,9 +168,38 @@
         String elementName = _formSupport.allocateElementName(id);
 
         _formSupport.storeAndExecute(this, new SetupAction(elementName));
+    }
+
+    private void useDefaultClientId()
+    {
+        _clientId = _resources.getId();
+    }
+
+    @CleanupRender
+    final void cleanupRender()
+    {
+        // Can't store properties in setup() because some times they're set to
+        // default values during rendering.
+        List<String> formPersistPropNames = CollectionFactory.newList();
+        collectFormPersistPropNames(formPersistPropNames);
+        _formSupport.store(this, new RestorePropertiesAction<AbstractField>(this,
+                formPersistPropNames.toArray(new String[0])));
+        // Process form submission after the properties are restored.
         _formSupport.store(this, PROCESS_SUBMISSION_ACTION);
     }
 
+    /**
+     * Add the list of names of the properties whose values will be restored on form submission. The
+     * {@link org.apache.tapestry.internal.services.FormPersistWorker} will a
+     * {@link #collectFormPersistPropNames(List)} method in a sub-class to call this method and then
+     * add its own property names. Actually, it will replace this method with one that adds form
+     * persistent property names declared in this class.
+     */
+    protected void collectFormPersistPropNames(List<String> formPersistPropNames)
+    {
+
+    }
+
     public final String getClientId()
     {
         return _assignedClientId;
@@ -211,34 +230,6 @@
     }
 
     /**
-     * Used by subclasses to create a default binding to a property of the container matching the
-     * component id.
-     * 
-     * @return a binding to the property, or null if the container does not have a corresponding
-     *         property
-     */
-    protected final Binding createDefaultParameterBinding(String parameterName)
-    {
-        String componentId = _resources.getId();
-
-        Component container = _resources.getContainer();
-
-        // Only provide a default binding if the container actually contains the property.
-        // This sets up an error condition for when the value parameter is not bound, and
-        // the binding can't be deduced.
-
-        if (_propertyAccess.getAdapter(container).getPropertyAdapter(componentId) == null)
-            return null;
-
-        ComponentResources containerResources = _resources.getContainerResources();
-
-        return _bindingSource.newBinding(
-                "default " + parameterName,
-                containerResources,
-                componentId);
-    }
-
-    /**
      * Method implemented by subclasses to actually do the work of processing the submission of the
      * form. The element's elementName property will already have been set. This method is only
      * invoked if the field is <strong>not {@link #isDisabled() disabled}</strong>.
@@ -268,5 +259,30 @@
     protected final ValidationDecorator getValidationDecorator()
     {
         return _decorator;
+    }
+
+    public void setDisabled(boolean disabled)
+    {
+        _disabled = disabled;
+    }
+
+    public void setLabel(String label)
+    {
+        _label = label;
+    }
+
+    public String getIdBasedBindingExpression()
+    {
+        return _resources.getId();
+    }
+
+    public BindingSource getBindingSource()
+    {
+        return _bindingSource;
+    }
+
+    public void setClientId(String clientId)
+    {
+        _clientId = clientId;
     }
 }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java?view=diff&rev=503777&r1=503776&r2=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java Mon Feb  5 09:15:39 2007
@@ -16,39 +16,41 @@
 
 import java.util.Locale;
 
-import org.apache.tapestry.Binding;
-import org.apache.tapestry.ComponentResources;
+import org.apache.tapestry.BindingExprValueConduit;
 import org.apache.tapestry.FieldValidator;
 import org.apache.tapestry.MarkupWriter;
 import org.apache.tapestry.Translator;
 import org.apache.tapestry.ValidationException;
 import org.apache.tapestry.ValidationTracker;
+import org.apache.tapestry.Validator;
+import org.apache.tapestry.ValueConduit;
 import org.apache.tapestry.annotations.AfterRender;
 import org.apache.tapestry.annotations.BeginRender;
 import org.apache.tapestry.annotations.Environmental;
+import org.apache.tapestry.annotations.FormPersist;
 import org.apache.tapestry.annotations.Inject;
-import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.internal.services.FieldValidatorImpl;
+import org.apache.tapestry.internal.services.FieldValidatorMessages;
 import org.apache.tapestry.internal.services.FormParameterLookup;
 import org.apache.tapestry.ioc.Messages;
-import org.apache.tapestry.services.FieldValidatorDefaultSource;
 import org.apache.tapestry.services.TranslatorDefaultSource;
 import org.apache.tapestry.services.ValidationMessagesSource;
+import org.apache.tapestry.translator.StringTranslator;
 
 /**
  * Abstract class for a variety of components that render some variation of a text field. Most of
  * the hooks for user input validation are in this class.
  */
-public abstract class AbstractTextField extends AbstractField
+public abstract class AbstractTextField<T> extends AbstractField
 {
-    @Parameter(required = true, principal = true)
-    private Object _value;
+    @FormPersist
+    private ValueConduit<T> _valueConduit;
 
-    @Parameter
-    private Translator<Object> _translate;
+    @FormPersist
+    private Translator<T> _translator;
 
-    @Parameter(defaultPrefix = "validate")
-    @SuppressWarnings("unchecked")
-    private FieldValidator<Object> _validate = NOOP_VALIDATOR;
+    @FormPersist
+    private Validator<? super T>[] _validators;
 
     @Environmental
     private ValidationTracker _tracker;
@@ -56,76 +58,49 @@
     @Inject("infrastructure:ValidationMessagesSource")
     private ValidationMessagesSource _messagesSource;
 
+    @Inject("infrastructure:FieldValidatorMessages")
+    private FieldValidatorMessages _fieldValidatorMessages;
+
     @Inject("infrastructure:TranslatorDefaultSource")
     private TranslatorDefaultSource _translatorDefaultSource;
 
-    @Inject("infrastructure:FieldValidatorDefaultSource")
-    private FieldValidatorDefaultSource _fieldValidatorDefaultSource;
-
-    @Inject
-    private ComponentResources _resources;
-
     @Inject
     private Locale _locale;
 
-    /**
-     * Computes a default value for the "translate" parameter using {@link TranslatorDefaultSource}.
-     */
-    final Translator defaultTranslate()
-    {
-        // Because the value parameter is a principal parameter, we know that it will be bound (even
-        // via its default parameter) by the time this method is invoked.
-
-        Class type = _resources.getBoundType("value");
-
-        if (type == null)
-            return null;
-
-        return _translatorDefaultSource.find(type);
-    }
-
-    /**
-     * Computes a default value for the "validate" parameter using
-     * {@link FieldValidatorDefaultSource}.
-     */
-    final FieldValidator defaultValidate()
-    {
-        Class type = _resources.getBoundType("value");
-
-        if (type == null)
-            return null;
-
-        return _fieldValidatorDefaultSource.createDefaultValidator(
-                this,
-                _resources.getId(),
-                _resources.getContainerMessages(),
-                _locale,
-                type,
-                _resources.getAnnotationProvider("value"));
-    }
-
-    /**
-     * The default value is a property of the container whose name matches the component's id. May
-     * return null if the container does not have a matching property.
-     */
-    final Binding defaultValue()
-    {
-        return createDefaultParameterBinding("value");
-    }
-
+    @SuppressWarnings("unchecked")
     @BeginRender
     final void begin(MarkupWriter writer)
     {
+        // Need to use defaults if they're unspecified, even if the tracker already contains
+        // a value. Otherwise, they will remain as null and when the form is submitted,
+        // we'll be in trouble.
+        if (_valueConduit == null)
+        {
+            setValueBindingExpr(getIdBasedBindingExpression());
+        }
+        T rawValue = _valueConduit.get(this);
+        if (_translator == null)
+        {
+            useDefaultTranslator(rawValue);
+        }
         String value = _tracker.getInput(this);
 
         if (value == null)
-            value = _translate.toClient(_value);
-
+        {
+            value = _translator.toClient(rawValue);
+        }
         writeFieldTag(writer, value);
 
         getValidationDecorator().insideField(this);
     }
 
+    @SuppressWarnings("unchecked")
+    private void useDefaultTranslator(T rawValue)
+    {
+        _translator = rawValue != null ? _translatorDefaultSource.find(rawValue.getClass())
+                : new StringTranslator();
+    }
+
     /**
      * Invoked from {@link #begin(MarkupWriter)} to write out the element and attributes (typically,
      * &lt;input&gt;). The {@link AbstractField#getElementName() elementName} and
@@ -155,11 +130,13 @@
 
         try
         {
-            Object translated = _translate.parseClient(rawValue, messages);
+            T translated = _translator.parseClient(rawValue, messages);
 
-            _validate.validate(translated);
+            FieldValidator<T> fieldValidator = new FieldValidatorImpl<T>(this,
+                    _fieldValidatorMessages, _validators);
+            fieldValidator.validate(translated);
 
-            _value = translated;
+            _valueConduit.set(this, translated);
         }
         catch (ValidationException ex)
         {
@@ -167,4 +144,41 @@
             return;
         }
     }
-}
+
+    public void setValidators(Validator<? super T>... validators)
+    {
+        _validators = validators;
+    }
+
+    public Translator<T> getTranslator()
+    {
+        return _translator;
+    }
+
+    public Validator<? super T>[] getValidators()
+    {
+        return _validators;
+    }
+
+    @SuppressWarnings("unchecked")
+    public void setValueBindingExpr(String valueBindingExpr)
+    {
+        _valueConduit = new BindingExprValueConduit(valueBindingExpr);
+    }
+
+    public void setTranslator(Translator<T> translator)
+    {
+        _translator = translator;
+    }
+
+    public ValueConduit<T> getValueConduit()
+    {
+        return _valueConduit;
+    }
+
+    public void setValueConduit(ValueConduit<T> valueHolder)
+    {
+        _valueConduit = valueHolder;
+    }
+
+}
\ No newline at end of file

Added: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/NoOpFieldValidator.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/NoOpFieldValidator.java?view=auto&rev=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/NoOpFieldValidator.java (added)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/NoOpFieldValidator.java Mon Feb  5 09:15:39 2007
@@ -0,0 +1,30 @@
+//Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.corelib.base;
+
+import java.io.Serializable;
+
+import org.apache.tapestry.FieldValidator;
+import org.apache.tapestry.ValidationException;
+
+public class NoOpFieldValidator implements FieldValidator, Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    public void validate(Object value) throws ValidationException
+    {
+        // Do nothing
+    }
+}

Propchange: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/NoOpFieldValidator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/RestorePropertiesAction.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/RestorePropertiesAction.java?view=auto&rev=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/RestorePropertiesAction.java (added)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/RestorePropertiesAction.java Mon Feb  5 09:15:39 2007
@@ -0,0 +1,73 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.corelib.base;
+
+import java.beans.IntrospectionException;
+import java.beans.PropertyDescriptor;
+import java.io.Serializable;
+
+import org.apache.tapestry.ComponentAction;
+import org.apache.tapestry.ioc.internal.services.PropertyAdapterImpl;
+import org.apache.tapestry.ioc.services.PropertyAdapter;
+
+/**
+ * A {@link org.apache.tapestry.ComponentAction} that stores in it the specified property names and
+ * values of a given component. On execution, it will restore the values into the component.
+ * 
+ * @param <T>
+ *            the type of the component
+ * @see org.apache.tapestry.annotations.FormPersist
+ */
+public class RestorePropertiesAction<T> implements ComponentAction<T>, Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    private final String[] _propertyNames;
+
+    private final Object[] _propertyValues;
+
+    public RestorePropertiesAction(Object component, String... propertyNames)
+    {
+        _propertyNames = propertyNames;
+        _propertyValues = new Object[_propertyNames.length];
+        for (int i = 0; i < _propertyNames.length; i++)
+        {
+            _propertyValues[i] = getPropertyAdaptor(component.getClass(), i).get(component);
+        }
+    }
+
+    public void execute(T component)
+    {
+        for (int i = 0; i < _propertyNames.length; i++)
+        {
+            getPropertyAdaptor(component.getClass(), i).set(component, _propertyValues[i]);
+        }
+    }
+
+    private PropertyAdapter getPropertyAdaptor(Class<?> clazz, int i)
+    {
+        String propertyName = _propertyNames[i];
+        PropertyDescriptor pd;
+        try
+        {
+            pd = new PropertyDescriptor(propertyName, clazz);
+        }
+        catch (IntrospectionException ex)
+        {
+            throw new RuntimeException(ex);
+        }
+        return new PropertyAdapterImpl(pd);
+    }
+}

Propchange: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/base/RestorePropertiesAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java?view=diff&rev=503777&r1=503776&r2=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java Mon Feb  5 09:15:39 2007
@@ -14,16 +14,16 @@
 
 package org.apache.tapestry.corelib.components;
 
-import java.util.Locale;
+import java.util.List;
 
 import org.apache.tapestry.Block;
 import org.apache.tapestry.ComponentResources;
 import org.apache.tapestry.EnumSelectModel;
 import org.apache.tapestry.EnumValueEncoder;
 import org.apache.tapestry.Field;
-import org.apache.tapestry.FieldValidator;
 import org.apache.tapestry.SelectModel;
 import org.apache.tapestry.Translator;
+import org.apache.tapestry.Validator;
 import org.apache.tapestry.ValueEncoder;
 import org.apache.tapestry.annotations.Component;
 import org.apache.tapestry.annotations.ComponentClass;
@@ -33,8 +33,8 @@
 import org.apache.tapestry.beaneditor.PropertyEditModel;
 import org.apache.tapestry.ioc.Messages;
 import org.apache.tapestry.services.BeanEditorModelSource;
-import org.apache.tapestry.services.FieldValidatorDefaultSource;
 import org.apache.tapestry.services.TranslatorDefaultSource;
+import org.apache.tapestry.services.ValidatorGenerator;
 
 /**
  * A component that creates an entire form editting the properties of a particular bean. Inspired by
@@ -66,8 +66,8 @@
     @Inject("infrastructure:TranslatorDefaultSource")
     private TranslatorDefaultSource _translatorDefaultSource;
 
-    @Inject("infrastructure:FieldValidatorDefaultSource")
-    private FieldValidatorDefaultSource _fieldValidatorDefaultSource;
+    @Inject("infrastructure:ValidatorGenerator")
+    private ValidatorGenerator _validatorGenerator;
 
     @Inject
     private Block _text;
@@ -81,27 +81,45 @@
     @Component
     private Form _form;
 
-    @Component(parameters =
-    { "value=valueForProperty", "label=prop:propertyEditModel.label",
-            "encoder=valueEncoderForProperty", "model=selectModelForProperty",
-            "validate=prop:validateForProperty", "clientId=prop:propertyName" })
+    @Component
     private Select _select;
 
-    @Component(parameters =
-    { "value=valueForProperty", "label=prop:propertyEditModel.label",
-            "translate=prop:translateForProperty", "validate=prop:validateForProperty",
-            "clientId=prop:propertyName" })
+    @SuppressWarnings("unchecked")
+    public void configureSelect()
+    {
+        _select.setValueBindingExpr("valueForProperty");
+        _select.setLabel(getPropertyEditModel().getLabel());
+        _select.setEncoder(getValueEncoderForProperty());
+        _select.setModel(getSelectModelForProperty());
+        _select.setValidators(getValidatorsForProperty());
+        _select.setClientId(getPropertyName());
+    }
+
+    @Component
     private TextField _textField;
 
-    @Component(parameters =
-    { "value=valueForProperty", "label=prop:propertyEditModel.label", "clientId=prop:propertyName" })
+    @SuppressWarnings("unchecked")
+    public void configureTextField()
+    {
+        _textField.setValueBindingExpr("valueForProperty");
+        _textField.setLabel(getPropertyEditModel().getLabel());
+        _textField.setTranslator(getTranslateForProperty());
+        _textField.setValidators(getValidatorsForProperty());
+        _textField.setClientId(getPropertyName());
+    }
+
+    @Component
     private Checkbox _checkboxField;
 
-    @Inject
-    private Messages _messages;
+    public void configureCheckboxField()
+    {
+        _checkboxField.setValueBindingExpr("valueForProperty");
+        _checkboxField.setLabel(getPropertyEditModel().getLabel());
+        _checkboxField.setClientId(getPropertyName());
+    }
 
     @Inject
-    private Locale _locale;
+    private Messages _messages;
 
     @Parameter
     private BeanEditorModel _model;
@@ -183,15 +201,12 @@
         return _translatorDefaultSource.find(_propertyEditModel.getPropertyType());
     }
 
-    public FieldValidator getValidateForProperty()
+    public Validator[] getValidatorsForProperty()
     {
-        return _fieldValidatorDefaultSource.createDefaultValidator(
-                _fieldForProperty,
-                _propertyName,
-                _resources.getContainerMessages(),
-                _locale,
+        List<? extends Validator> validators = _validatorGenerator.buildValidators(
                 _propertyEditModel.getPropertyType(),
                 _propertyEditModel.getConduit());
+        return validators == null ? null : validators.toArray(new Validator[0]);
     }
 
     public PropertyEditModel getPropertyEditModel()

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java?view=diff&rev=503777&r1=503776&r2=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java Mon Feb  5 09:15:39 2007
@@ -14,29 +14,34 @@
 
 package org.apache.tapestry.corelib.components;
 
-import org.apache.tapestry.Binding;
+import org.apache.tapestry.BindingExprValueConduit;
 import org.apache.tapestry.MarkupWriter;
+import org.apache.tapestry.ValueConduit;
 import org.apache.tapestry.annotations.AfterRender;
 import org.apache.tapestry.annotations.BeginRender;
-import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.annotations.FormPersist;
 import org.apache.tapestry.corelib.base.AbstractField;
 import org.apache.tapestry.internal.services.FormParameterLookup;
 
 /** A Checkbox component is simply a &lt;input type="checkbox"&gt;. */
 public class Checkbox extends AbstractField
 {
+    @FormPersist
+    private ValueConduit<Boolean> _valueConduit;
 
-    @Parameter(required = true)
-    private boolean _value;
-
-    Binding defaultValue()
+    @SuppressWarnings("unchecked")
+    public void setValueBindingExpr(String valueBindingExpr)
     {
-        return createDefaultParameterBinding("value");
+        _valueConduit = new BindingExprValueConduit(valueBindingExpr);
     }
 
     @BeginRender
     void begin(MarkupWriter writer)
     {
+        if (_valueConduit == null)
+        {
+            setValueBindingExpr(getIdBasedBindingExpression());
+        }
         writer.element(
                 "input",
                 "type",
@@ -46,7 +51,7 @@
                 "id",
                 getClientId(),
                 "checked",
-                _value ? "checked" : null);
+                _valueConduit.get(this) ? "checked" : null);
 
         getValidationDecorator().insideField(this);
     }
@@ -62,7 +67,16 @@
     {
         String postedValue = paramLookup.getParameter(elementName);
 
-        _value = postedValue != null;
+        _valueConduit.set(this, postedValue != null);
+    }
+
+    public ValueConduit<Boolean> getValueConduit()
+    {
+        return _valueConduit;
     }
 
+    public void setValueConduit(ValueConduit<Boolean> valueConduit)
+    {
+        _valueConduit = valueConduit;
+    }
 }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Label.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Label.java?view=diff&rev=503777&r1=503776&r2=503777
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Label.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Label.java Mon Feb  5 09:15:39 2007
@@ -80,6 +80,9 @@
                 element.forceAttributes("for", fieldId);
 
                 decorator.insideLabel(field, element);
+
+                element.text(field.getLabel());
+
             }
         };
 
@@ -97,8 +100,6 @@
     @AfterRender
     void after(MarkupWriter writer)
     {
-        writer.write(_field.getLabel());
-
         writer.end(); // label
     }
 }