tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From freem...@apache.org
Subject svn commit: r505676 [1/2] - in /tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src: main/java/org/apache/tapestry/ main/java/org/apache/tapestry/corelib/components/ main/java/org/apache/tapestry/corelib/mixins/ main/java/org/apache/t...
Date Sat, 10 Feb 2007 11:36:43 GMT
Author: freemant
Date: Sat Feb 10 03:36:41 2007
New Revision: 505676

URL: http://svn.apache.org/viewvc?view=rev&rev=505676
Log:
1) Changed the rest core components to use type safe configuration.
2) Allow runtime setting of informal parameters.

Added:
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/mixins/RuntimeInformalWriter.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/NoOpInstantiator.java   (with props)
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/model/
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/model/NoOpComponentModel.java   (with props)
Modified:
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ComponentResources.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/ActionLink.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Any.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/Delegate.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Errors.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Form.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/If.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/Loop.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/PageLink.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Submit.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/mixins/RenderInformals.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/pages/ExceptionReport.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImpl.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/resources/org/apache/tapestry/corelib/components/BeanEditForm.html
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/AnyDemo.html
    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/ClassLoaderInspect.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/RenderComponentDemo.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/java/org/apache/tapestry/integration/IntegrationTests.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/ActionPage.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/AnyDemo.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/ClassLoaderInspect.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/NumberSelect.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/RenderComponentDemo.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/ValidForm.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForActionLink.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForIf.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/NoOpComponentResources.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImplTest.java
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/resources/org/apache/tapestry/integration/app1/pages/ActionPage.html
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/resources/org/apache/tapestry/integration/app1/pages/NumberSelect.html
    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/TestPageForActionLink.html
    tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForIf.html

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ComponentResources.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ComponentResources.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ComponentResources.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/ComponentResources.java Sat Feb 10 03:36:41 2007
@@ -14,6 +14,8 @@
 
 package org.apache.tapestry;
 
+import java.util.Map;
+
 import org.apache.tapestry.ioc.Messages;
 import org.apache.tapestry.model.ComponentModel;
 import org.apache.tapestry.runtime.Component;
@@ -80,8 +82,10 @@
      * 
      * @param writer
      *            to which {@link MarkupWriter#attributes(Object[]) attributes} will be written
+     * @param runtimeParameters
+     *            informal parameters set at runtime.
      */
-    void renderInformalParameters(MarkupWriter writer);
+    void renderInformalParameters(MarkupWriter writer, Map<String, String> runtimeParameters);
 
     /** Returns the message catalog for this component. */
     Messages getMessages();

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/ActionLink.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/ActionLink.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/ActionLink.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/ActionLink.java Sat Feb 10 03:36:41 2007
@@ -16,6 +16,7 @@
 
 import static org.apache.tapestry.TapestryConstants.DEFAULT_EVENT;
 
+import java.util.Arrays;
 import java.util.List;
 
 import org.apache.tapestry.ComponentResources;
@@ -27,7 +28,6 @@
 import org.apache.tapestry.annotations.Environmental;
 import org.apache.tapestry.annotations.Inject;
 import org.apache.tapestry.annotations.Mixin;
-import org.apache.tapestry.annotations.Parameter;
 import org.apache.tapestry.corelib.mixins.RenderInformals;
 import org.apache.tapestry.services.PageRenderSupport;
 
@@ -42,13 +42,11 @@
      * strings and included in the URI. The strings will be coerced back to whatever their values
      * are and made available to event handler methods.
      */
-    @Parameter
     private List<?> _context;
 
     @Inject
     private ComponentResources _resources;
 
-    @SuppressWarnings("unused")
     @Mixin
     private RenderInformals _renderInformals;
 
@@ -65,8 +63,6 @@
         Link link = _resources.createActionLink(DEFAULT_EVENT, false, contextArray);
 
         writer.element("a", "href", link, "id", clientId);
-
-        _resources.renderInformalParameters(writer);
     }
 
     @AfterRender
@@ -74,4 +70,15 @@
     {
         writer.end(); // <a>
     }
+
+    public void setContext(Object... context)
+    {
+        _context = Arrays.asList(context);
+    }
+
+    public void setInformalParameter(String name, String value)
+    {
+        _renderInformals.setInformalParameter(name, value);
+    }
+    
 }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Any.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Any.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Any.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Any.java Sat Feb 10 03:36:41 2007
@@ -19,8 +19,9 @@
 import org.apache.tapestry.annotations.ComponentClass;
 import org.apache.tapestry.annotations.Environmental;
 import org.apache.tapestry.annotations.Inject;
-import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.annotations.Mixin;
 import org.apache.tapestry.annotations.SupportsInformalParameters;
+import org.apache.tapestry.corelib.mixins.RenderInformals;
 import org.apache.tapestry.services.PageRenderSupport;
 
 /**
@@ -38,7 +39,6 @@
      * The element to be rendered by the component. Normally, this matches the element from the
      * template, but this can be overridden if necessary.
      */
-    @Parameter(value="prop:componentResources.elementName", defaultPrefix="literal")
     private String _element;
 
     @Inject
@@ -49,15 +49,25 @@
 
     private String _clientId;
 
+    @Mixin
+    private RenderInformals _renderInformals;
+
     void beginRender(MarkupWriter writer)
     {
+        if (_element == null)
+        {
+            useDefaultElement();
+        }
         String componentId = _resources.getId();
 
         _clientId = _pageRenderSupport.allocateClientId(componentId);
 
         writer.element(_element, "id", _clientId);
+    }
 
-        _resources.renderInformalParameters(writer);
+    private void useDefaultElement()
+    {
+        _element = _resources.getElementName();
     }
 
     void afterRender(MarkupWriter writer)
@@ -68,5 +78,15 @@
     public String getClientId()
     {
         return _clientId;
+    }
+
+    public void setElement(String element)
+    {
+        _element = element;
+    }
+
+    public void setInformalParameter(String name, String value)
+    {
+        _renderInformals.setInformalParameter(name, value);
     }
 }

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=505676&r1=505675&r2=505676
==============================================================================
--- 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 Sat Feb 10 03:36:41 2007
@@ -55,8 +55,7 @@
 @ComponentClass
 public class BeanEditForm
 {
-    public static class PropertyNameUpdatedListener implements ValueUpdatedListener,
-            Serializable
+    public static class PropertyNameUpdatedListener implements ValueUpdatedListener, Serializable
     {
         private static final long serialVersionUID = 1L;
 
@@ -75,6 +74,42 @@
         _loop.setSource(getModel().getPropertyNames());
         _loop.setValueUpdatedListener(new PropertyNameUpdatedListener());
     }
+
+    @Component
+    private Label _textFieldLabel;
+
+    @Component
+    private Label _selectLabel;
+
+    @Component
+    private Label _checkboxFieldLabel;
+
+    public void configure_checkboxFieldLabel()
+    {
+        _checkboxFieldLabel.setField(_checkboxField);
+    }
+
+    public void configure_selectLabel()
+    {
+        _selectLabel.setField(_select);
+    }
+
+    public void configure_textFieldLabel()
+    {
+        _textFieldLabel.setField(_textField);
+    }
+
+    @Component
+    private Delegate _delegate;
+
+    public void configure_delegate()
+    {
+        _delegate.setTo(getBlockForProperty());
+    }
+
+    @SuppressWarnings("unused")
+    @Component
+    private Errors _errors;
 
     /** The object to be editted by the BeanEditor. */
     @Parameter(required = true)

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Delegate.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Delegate.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Delegate.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Delegate.java Sat Feb 10 03:36:41 2007
@@ -16,7 +16,6 @@
 
 import org.apache.tapestry.Block;
 import org.apache.tapestry.annotations.ComponentClass;
-import org.apache.tapestry.annotations.Parameter;
 
 /**
  * A component that does not do any rendering of its own, but will delegate to some other object
@@ -26,11 +25,18 @@
 @ComponentClass
 public class Delegate
 {
-    @Parameter(required = true)
+    /**
+     * Delegetes to this object.
+     */
     private Object _to;
 
     Object beginRender()
     {
         return _to;
+    }
+
+    public void setTo(Object to)
+    {
+        _to = to;
     }
 }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Errors.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Errors.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Errors.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Errors.java Sat Feb 10 03:36:41 2007
@@ -14,11 +14,12 @@
 
 package org.apache.tapestry.corelib.components;
 
+import org.apache.tapestry.ComponentResources;
 import org.apache.tapestry.MarkupWriter;
 import org.apache.tapestry.ValidationTracker;
 import org.apache.tapestry.annotations.ComponentClass;
 import org.apache.tapestry.annotations.Environmental;
-import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.annotations.Inject;
 import org.apache.tapestry.internal.InternalConstants;
 
 /**
@@ -27,11 +28,12 @@
 @ComponentClass
 public class Errors
 {
-    @Parameter("message:default-banner")
     private String _banner;
 
-    @Parameter
-    private String _class = InternalConstants.TAPESTRY_ERROR_CLASS;
+    private String _class;
+
+    @Inject
+    private ComponentResources _resources;
 
     // Allow null so we can generate a better error message if missing
     @Environmental(false)
@@ -39,6 +41,14 @@
 
     void beginRender(MarkupWriter writer)
     {
+        if (_class == null)
+        {
+            useDefaultClass();
+        }
+        if (_banner == null)
+        {
+            useDefaultBanner();
+        }
         // TODO: Would be nice if there was a Location to report ... can we add a Location property
         // to ComponentResources?
 
@@ -67,5 +77,25 @@
         writer.end(); // ul
         writer.end(); // div
 
+    }
+
+    private void useDefaultBanner()
+    {
+        _banner = _resources.getMessages().get("default-banner");
+    }
+
+    private void useDefaultClass()
+    {
+        _class = InternalConstants.TAPESTRY_ERROR_CLASS;
+    }
+
+    public void setBanner(String banner)
+    {
+        _banner = banner;
+    }
+
+    public void setClass(String class1)
+    {
+        _class = class1;
     }
 }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Form.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Form.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Form.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Form.java Sat Feb 10 03:36:41 2007
@@ -39,7 +39,7 @@
 import org.apache.tapestry.annotations.Parameter;
 import org.apache.tapestry.annotations.Persist;
 import org.apache.tapestry.annotations.SetupRender;
-import org.apache.tapestry.corelib.mixins.RenderInformals;
+import org.apache.tapestry.corelib.mixins.RuntimeInformalWriter;
 import org.apache.tapestry.dom.Element;
 import org.apache.tapestry.internal.services.FormParameterLookup;
 import org.apache.tapestry.internal.services.HeartbeatImpl;
@@ -149,9 +149,8 @@
 
     private Base64ObjectOutputStream _actions;
 
-    @SuppressWarnings("unused")
     @Mixin
-    private RenderInformals _renderInformals;
+    private RuntimeInformalWriter _informalWriter;
 
     public ValidationTracker getDefaultTracker()
     {
@@ -207,7 +206,7 @@
                 .createActionLink(TapestryConstants.DEFAULT_EVENT, true, contextArray);
         writer.element("form", "name", name, "id", name, "method", "post", "action", link);
 
-        _resources.renderInformalParameters(writer);
+        _informalWriter.write(writer);
 
         _div = writer.element("div", "class", "t-invisible");
 
@@ -436,5 +435,10 @@
     public void clearErrors()
     {
         _tracker.clear();
+    }
+
+    public void setInformalParameter(String name, String value)
+    {
+        _informalWriter.setInformalParameter(name, value);
     }
 }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/If.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/If.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/If.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/If.java Sat Feb 10 03:36:41 2007
@@ -16,7 +16,6 @@
 
 import org.apache.tapestry.Block;
 import org.apache.tapestry.annotations.ComponentClass;
-import org.apache.tapestry.annotations.Parameter;
 
 /**
  * Conditionally renders its body.
@@ -24,10 +23,8 @@
 @ComponentClass
 public class If
 {
-    @Parameter(required = true)
     private boolean _test;
 
-    @Parameter
     private Block _else;
 
     /**
@@ -46,5 +43,15 @@
     boolean beforeRenderBody()
     {
         return _test;
+    }
+
+    public void setElse(Block else1)
+    {
+        _else = else1;
+    }
+
+    public void setTest(boolean test)
+    {
+        _test = test;
     }
 }

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=505676&r1=505675&r2=505676
==============================================================================
--- 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 Sat Feb 10 03:36:41 2007
@@ -24,21 +24,20 @@
 import org.apache.tapestry.annotations.ComponentClass;
 import org.apache.tapestry.annotations.Environmental;
 import org.apache.tapestry.annotations.Inject;
-import org.apache.tapestry.annotations.Parameter;
-import org.apache.tapestry.annotations.SupportsInformalParameters;
+import org.apache.tapestry.annotations.Mixin;
+import org.apache.tapestry.corelib.mixins.RenderInformals;
 import org.apache.tapestry.dom.Element;
+import org.apache.tapestry.ioc.internal.util.Defense;
 import org.apache.tapestry.services.Heartbeat;
 
 /** Generates a &lt;label&gt; element for a particular field. */
 @ComponentClass
-@SupportsInformalParameters
 public class Label
 {
     /**
      * The for parameter is used to identify the {@link Field} linked to this label (it is named
      * this way because it results in the for attribute of the label element).
      */
-    @Parameter(name = "for", required = true, defaultPrefix = "component")
     private Field _field;
 
     @Environmental
@@ -50,14 +49,19 @@
     @Inject
     private ComponentResources _resources;
 
+    @Mixin
+    private RenderInformals _renderInformals;
+
     @BeginRender
     void begin(MarkupWriter writer)
     {
+        Defense.notNull(_field, "field");
         final Field field = _field;
 
         final Element element = writer.element("label");
 
-        _resources.renderInformalParameters(writer);
+        _resources
+                .renderInformalParameters(writer, _renderInformals.getRuntimeInformalParameters());
 
         // Uh oh! Referencing a private field (that happens to get instrumented up the wazoo) from
         // a inner class causes a java.lang.Verify error (Unable to pop operand off an empty stack).
@@ -101,5 +105,15 @@
     void after(MarkupWriter writer)
     {
         writer.end(); // label
+    }
+
+    public void setField(Field field)
+    {
+        _field = field;
+    }
+
+    public void setInformalParameter(String name, String value)
+    {
+        _renderInformals.setInformalParameter(name, value);
     }
 }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Loop.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Loop.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Loop.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Loop.java Sat Feb 10 03:36:41 2007
@@ -33,9 +33,10 @@
 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.SetupRender;
-import org.apache.tapestry.annotations.SupportsInformalParameters;
 import org.apache.tapestry.corelib.base.RestorePropertiesAction;
+import org.apache.tapestry.corelib.mixins.RuntimeInformalWriter;
 import org.apache.tapestry.internal.services.FormPersistPropertySource;
 import org.apache.tapestry.runtime.Component;
 import org.apache.tapestry.services.BindingSource;
@@ -52,7 +53,6 @@
  * full objects when there is not encoder, or as client-side objects when there is an encoder).
  */
 @ComponentClass
-@SupportsInformalParameters
 public class Loop<E, K extends Serializable> implements FormPersistPropertySource,
         BindingSourceProvider
 {
@@ -243,6 +243,9 @@
 
     private List<K> _keyList;
 
+    @Mixin
+    private RuntimeInformalWriter _informalWriter;
+
     @SetupRender
     boolean setup()
     {
@@ -366,7 +369,7 @@
         if (_elementName != null)
         {
             writer.element(_elementName);
-            _resources.renderInformalParameters(writer);
+            _informalWriter.write(writer);
         }
     }
 
@@ -522,5 +525,10 @@
     public void setValueUpdatedListener(ValueUpdatedListener valueUpdatedListener)
     {
         _valueUpdatedListener = valueUpdatedListener;
+    }
+
+    public void setInformalParameter(String name, String value)
+    {
+        _informalWriter.setInformalParameter(name, value);
     }
 }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/PageLink.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/PageLink.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/PageLink.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/PageLink.java Sat Feb 10 03:36:41 2007
@@ -22,7 +22,9 @@
 import org.apache.tapestry.annotations.ComponentClass;
 import org.apache.tapestry.annotations.Environmental;
 import org.apache.tapestry.annotations.Inject;
+import org.apache.tapestry.annotations.Mixin;
 import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.corelib.mixins.RenderInformals;
 import org.apache.tapestry.services.PageRenderSupport;
 
 /**
@@ -40,6 +42,9 @@
     @Environmental
     private PageRenderSupport _support;
 
+    @Mixin
+    private RenderInformals _renderInformals;
+
     @BeginRender
     void begin(MarkupWriter writer)
     {
@@ -48,13 +53,16 @@
         Link link = _resources.createPageLink(_page);
 
         writer.element("a", "href", link, "id", clientId);
-
-        _resources.renderInformalParameters(writer);
     }
 
     @AfterRender
     void end(MarkupWriter writer)
     {
         writer.end(); // <a>
+    }
+
+    public void setInformalParameter(String name, String value)
+    {
+        _renderInformals.setInformalParameter(name, value);
     }
 }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Submit.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Submit.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Submit.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/components/Submit.java Sat Feb 10 03:36:41 2007
@@ -17,6 +17,7 @@
 import org.apache.tapestry.ComponentResources;
 import org.apache.tapestry.MarkupWriter;
 import org.apache.tapestry.annotations.Environmental;
+import org.apache.tapestry.annotations.FormPersist;
 import org.apache.tapestry.annotations.Inject;
 import org.apache.tapestry.corelib.base.AbstractField;
 import org.apache.tapestry.internal.services.FormParameterLookup;
@@ -37,6 +38,7 @@
      * If true, then any notification sent by the component will be deferred until the end of the
      * form submission (this is usually desirable).
      */
+    @FormPersist
     private boolean _defer = true;
 
     @Environmental
@@ -86,7 +88,7 @@
 
     }
 
-    void setDefer(boolean defer)
+    public void setDefer(boolean defer)
     {
         _defer = defer;
     }
@@ -96,5 +98,10 @@
         _resources = resources;
         _formSupport = support;
         _heartbeat = heartbeat;
+    }
+
+    public boolean isDefer()
+    {
+        return _defer;
     }
 }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/mixins/RenderInformals.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/mixins/RenderInformals.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/mixins/RenderInformals.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/mixins/RenderInformals.java Sat Feb 10 03:36:41 2007
@@ -14,15 +14,11 @@
 
 package org.apache.tapestry.corelib.mixins;
 
-import org.apache.tapestry.ComponentResources;
 import org.apache.tapestry.MarkupWriter;
 import org.apache.tapestry.annotations.AfterRenderTemplate;
 import org.apache.tapestry.annotations.BeforeRenderTemplate;
 import org.apache.tapestry.annotations.BeginRender;
-import org.apache.tapestry.annotations.ComponentClass;
-import org.apache.tapestry.annotations.Inject;
 import org.apache.tapestry.annotations.MixinAfter;
-import org.apache.tapestry.annotations.SupportsInformalParameters;
 
 /**
  * Used to render out all informal parameters, in the {@link PostBeginRender} phase.
@@ -37,17 +33,13 @@
  * <p>
  * This is often used as a base class, for cases where a component doesn't have other mixins.
  */
-@ComponentClass
 @MixinAfter
-@SupportsInformalParameters
-public class RenderInformals
+public class RenderInformals extends RuntimeInformalWriter
 {
-    @Inject
-    private ComponentResources _resources;
-
     @BeginRender
-    void write(MarkupWriter writer)
+    void begin(MarkupWriter writer)
     {
-        _resources.renderInformalParameters(writer);
+        write(writer);
     }
+
 }

Added: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/mixins/RuntimeInformalWriter.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/mixins/RuntimeInformalWriter.java?view=auto&rev=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/mixins/RuntimeInformalWriter.java (added)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/mixins/RuntimeInformalWriter.java Sat Feb 10 03:36:41 2007
@@ -0,0 +1,52 @@
+// 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.mixins;
+
+import java.util.Map;
+
+import org.apache.tapestry.ComponentResources;
+import org.apache.tapestry.MarkupWriter;
+import org.apache.tapestry.annotations.ComponentClass;
+import org.apache.tapestry.annotations.Inject;
+import org.apache.tapestry.annotations.SupportsInformalParameters;
+import org.apache.tapestry.ioc.internal.util.CollectionFactory;
+
+/**
+ * Used to store runtime informal parameters and write them out on request.
+ */
+@ComponentClass
+@SupportsInformalParameters
+public class RuntimeInformalWriter
+{
+    @Inject
+    private ComponentResources _resources;
+
+    private Map<String, String> _runtimeInformalParameters = CollectionFactory.newMap();
+
+    public void write(MarkupWriter writer)
+    {
+        _resources.renderInformalParameters(writer, _runtimeInformalParameters);
+    }
+
+    public void setInformalParameter(String name, String value)
+    {
+        _runtimeInformalParameters.put(name, value);
+    }
+
+    public Map<String, String> getRuntimeInformalParameters()
+    {
+        return _runtimeInformalParameters;
+    }
+}

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

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/pages/ExceptionReport.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/pages/ExceptionReport.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/pages/ExceptionReport.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/corelib/pages/ExceptionReport.java Sat Feb 10 03:36:41 2007
@@ -20,6 +20,7 @@
 import org.apache.tapestry.annotations.Component;
 import org.apache.tapestry.annotations.ComponentClass;
 import org.apache.tapestry.annotations.Inject;
+import org.apache.tapestry.corelib.components.If;
 import org.apache.tapestry.corelib.components.Loop;
 import org.apache.tapestry.ioc.services.ExceptionAnalysis;
 import org.apache.tapestry.ioc.services.ExceptionAnalyzer;
@@ -46,6 +47,38 @@
 
     @Component
     private Loop<String, Serializable> _attrLoop;
+
+    @Component
+    private If _hasMessage;
+
+    @Component
+    private If _showProperties;
+
+    @Component
+    private If _hasStackTrace;
+
+    @Component
+    private If _hasSession;
+
+    public void configure_hasSession()
+    {
+        _hasSession.setTest(getHasSession());
+    }
+
+    public void configure_hasStackTrace()
+    {
+        _hasStackTrace.setTest(!getInfo().getStackTrace().isEmpty());
+    }
+
+    public void configure_showProperties()
+    {
+        _showProperties.setTest(getShowPropertyList());
+    }
+
+    public void configure_hasMessage()
+    {
+        _hasMessage.setTest(getInfo().getMessage() != null);
+    }
 
     public void configure_attrLoop()
     {

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java Sat Feb 10 03:36:41 2007
@@ -533,15 +533,9 @@
 
         if (isBlank(embeddedType) && isBlank(embeddedComponentClassName))
         {
-            // non-null means its invisible instrumentation; the Any component
-            // will mimic the actual element, w/ body and informal parameters.
-
-            if (elementName != null)
-                embeddedType = "Any";
-            else
-                throw new TapestryException(ServicesMessages.noTypeForEmbeddedComponent(
-                        embeddedId,
-                        _loadingComponentModel.getComponentClassName()), token, null);
+            throw new TapestryException(ServicesMessages.noTypeForEmbeddedComponent(
+                    embeddedId,
+                    _loadingComponentModel.getComponentClassName()), token, null);
         }
 
         ComponentPageElement newComponent = _pageElementFactory.newComponentElement(

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImpl.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImpl.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImpl.java Sat Feb 10 03:36:41 2007
@@ -252,8 +252,12 @@
         return _element.getMixinByClassName(mixinClassName);
     }
 
-    public void renderInformalParameters(MarkupWriter writer)
+    public void renderInformalParameters(MarkupWriter writer, Map<String, String> runtimeParameters)
     {
+        for (String name : runtimeParameters.keySet())
+        {
+            writer.attributes(name, runtimeParameters.get(name));
+        }
         if (_bindings == null)
             return;
 
@@ -315,4 +319,5 @@
     {
         return _element.getBlock(blockId);
     }
+
 }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/resources/org/apache/tapestry/corelib/components/BeanEditForm.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/resources/org/apache/tapestry/corelib/components/BeanEditForm.html?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/resources/org/apache/tapestry/corelib/components/BeanEditForm.html (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/resources/org/apache/tapestry/corelib/components/BeanEditForm.html Sat Feb 10 03:36:41 2007
@@ -1,9 +1,9 @@
 <form t:id="form" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
-    <t:comp type="Errors"/>
+    <t:comp id="errors"/>
 
     <div class="t-beaneditor">
         <div class="t-beaneditor-row" t:id="loop">
-            <t:comp type="Delegate" to="blockForProperty"/>
+            <t:comp id="delegate"/>
         </div>
         <div class="t-beaneditor-row">
             <input type="submit" value="Create/Update"/>
@@ -11,17 +11,17 @@
     </div>
     
     <t:block id="text">
-        <label t:type="Label" for="textField"/>
+        <label t:id="textFieldLabel"/>
         <input t:id="textField"/>
     </t:block>
 
     <t:block id="enum">
-        <label t:type="Label" for="select"/>
+        <label t:id="selectLabel"/>
         <input t:id="select"/>
     </t:block>
     
     <t:block id="checkbox">
-        <label t:type="Label" for="checkboxField"/>
+        <label t:id="checkboxFieldLabel"/>
         <input t:id="checkboxField"/>
     </t:block>
 </form>

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html Sat Feb 10 03:36:41 2007
@@ -12,24 +12,23 @@
                     <li>
                         <span class="t-exception-class-name">${info.className}</span>
 
-                        <t:comp type="If" test="info.message">
+                        <t:comp id="hasMessage">
                             <div class="t-exception-message">
                                 ${info.message}
                             </div>
                         </t:comp>
 
-                        <t:comp type="If" test="showPropertyList">
+                        <t:comp id="showProperties">
                             <dl>
                                 <t:comp id="propLoop">
                                     <dt>${propertyName}</dt>
                                     <dd>${propertyValue}</dd>
                                 </t:comp>
-                                <t:comp type="If" test="info.stackTrace">
+                                <t:comp id="hasStackTrace">
                                     <dt>Stack trace</dt>
                                     <dd>
                                         <ul class="t-stack-trace">
-                                            <t:comp id="frameLoop" source="info.stackTrace"
-                                                value="frame">
+                                            <t:comp id="frameLoop">
                                                 <li>${frame}</li>
                                             </t:comp>
                                         </ul>
@@ -42,7 +41,7 @@
             </ul>
         </div>
         <div class="t-env-data">
-            <t:comp type="If" test="hasSession">
+            <t:comp id="hasSession">
                 <h2>Session</h2>
                 <dl>
                     <t:comp id="attrLoop">

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/AnyDemo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/AnyDemo.html?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/AnyDemo.html (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/AnyDemo.html Sat Feb 10 03:36:41 2007
@@ -9,7 +9,7 @@
     
     <div t:id="heading" class="heading">Heading</div>
     
-    <div t:id="section" element="h2" class="section">Section</div>
+    <div t:id="section" class="section">Section</div>
         
         
     <ul>    

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/BlockDemo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/BlockDemo.html?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/BlockDemo.html (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/BlockDemo.html Sat Feb 10 03:36:41 2007
@@ -8,7 +8,7 @@
 </p>    
     
     <form t:type="Form">
-        <select t:id="blockName" onchange="this.form.submit();"/> <label t:type="Label" for="blockName">Block to display</label>
+        <select t:id="blockName" onchange="this.form.submit();"/> <label t:id="label">Block to display</label>
     </form>
     
     <p>The block: [<t:comp type="Render" value="blockToRender"/>]</p>

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/ClassLoaderInspect.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/ClassLoaderInspect.html?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/ClassLoaderInspect.html (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/ClassLoaderInspect.html Sat Feb 10 03:36:41 2007
@@ -15,7 +15,7 @@
     <h2>Class Loader Hierarchy</h2>
 
     <ul>
-        <t:comp type="Loop" source="loaders" value="loader">
+        <t:comp id="loaderLoop">
             <li> ${loader} </li>
         </t:comp>
     </ul>
@@ -23,19 +23,19 @@
     <h2> Find Resources </h2>
 
     <form t:id="search">
-        <t:comp type="Errors"/>
-        <label t:type="Label" for="resource"/>: <input t:id="resource"
-            t:type="TextField" size="50" validate="required"/>
+        <t:comp id="errors"/>
+        <label t:type="Label"/>: <input t:id="resourceField"
+            size="50"/>
         <br/>
         <input type="submit"/>
     </form>
 
-    <t:comp type="If" test="showMatches">
+    <t:comp id="hasMatches">
 
         <h3>${listSize} Matches</h3>
 
         <ul>
-            <t:comp type="Loop" source="URLs" value="URL">
+            <t:comp id="URLLoop" source="URLs" value="URL">
                 <li>${URL} <dl>
                 
                 <dt>Connection</dt>
@@ -54,7 +54,7 @@
 
                         <dd>
                             <ul>
-                                <t:comp type="Loop" source="jarEntries" value="jarEntry">
+                                <t:comp id="jarEntriesLoop">
                                     <li> ${jarEntry} </li>
                                 </t:comp>
                             </ul>

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/PasswordFieldDemo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/PasswordFieldDemo.html?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/PasswordFieldDemo.html (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/PasswordFieldDemo.html Sat Feb 10 03:36:41 2007
@@ -5,12 +5,12 @@
 
     <form t:id="form">
 
-        <span t:type="Errors"/>
+        <span t:id="errors"/>
 
-        <label t:type="Label" for="userName"/>
+        <label t:id="l1"/>
         <input t:id="userName" size="30"/>
         <br/>
-        <label t:type="Label" for="password"/>
+        <label t:id="l2"/>
         <input t:id="password" size="30"/>
         <br/>
         <input type="submit" value="Login"/>

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/RenderComponentDemo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/RenderComponentDemo.html?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/RenderComponentDemo.html (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/RenderComponentDemo.html Sat Feb 10 03:36:41 2007
@@ -13,14 +13,14 @@
     </t:block>
     
     <form t:type="Form">
-        <input t:type="Checkbox" t:id="enabled" onchange="this.form.submit();"/> <label t:type="Label" for="enabled">Enable optional text</label>
+        <input t:id="enabled" onchange="this.form.submit();"/> <label t:id="label">Enable optional text</label>
     </form>
     
-    <t:comp type="If" test="enabled">
-        Should now show up:
-        <t:parameter name="else">
+    <t:comp id="ifEnabled">
+        Should now show up:
+        <t:block id="else">
             Should be blank:            
-        </t:parameter>
+        </t:block>
     </t:comp>
 
     <span id="container">[<t:comp type="Render" value="thing"/>]</span>

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/SimpleForm.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/SimpleForm.html?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/SimpleForm.html (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/app1/WEB-INF/SimpleForm.html Sat Feb 10 03:36:41 2007
@@ -4,27 +4,27 @@
     <p> This is the <em>very early</em> start to Tapestry 5 form support. </p>
 
     <form t:type="Form">
-        <input t:type="Checkbox" t:id="disabled"/>
-        <label id="l1" t:type="Label" for="disabled"/>
+        <input t:id="disabled"/>
+        <label id="l1" t:id="l1"/>
         <br/>
         
         <div class="t-beaneditor">
             
-            <label id="l2" t:type="Label" for="email">This isn't used</label>
+            <label id="l2" t:id="l2">This isn't used</label>
             <input 
                 t:id="email" size="50"/>
             <br/>
-            <label id="l3" t:type="Label" for="message"/>
+            <label id="l3" t:id="l3"/>
             <input t:id="message"
                 cols="50" rows="10"> You can put text here, but it isn't used. </input>
             <br/>
-            <label id="l4" t:type="Label" for="operatingSystem"/>
+            <label id="l4" t:id="l4"/>
             <select t:id="operatingSystem" />
             <br/>
-            <label id="l5" t:type="Label" for="department"/>
+            <label id="l5" t:id="l5"/>
             <select t:id="department"/>
             <br/>
-            <label id="l6" t:type="Label" for="urgent"/>
+            <label id="l6" t:id="l6"/>
             <input t:id="urgent"/>
             <br/>
             <input type="submit"/></div>

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/IntegrationTests.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/IntegrationTests.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/IntegrationTests.java Sat Feb 10 03:36:41 2007
@@ -459,7 +459,14 @@
         for (int i = 2; i < 5; i++)
         {
             clickAndWait("link=" + i);
-
+            assertFalse(_selenium.isElementPresent(String.format(
+                    "//a[@id='choose_%d']/@class",
+                    i - 3)));
+            assertEquals(_selenium
+                    .getAttribute(String.format("//a[@id='choose_%d']/@class", i - 2)), "selected");
+            assertFalse(_selenium.isElementPresent(String.format(
+                    "//a[@id='choose_%d']/@class",
+                    i - 1)));
             assertTextPresent(YOU_CHOSE + i);
         }
     }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/ActionPage.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/ActionPage.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/ActionPage.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/ActionPage.java Sat Feb 10 03:36:41 2007
@@ -14,13 +14,43 @@
 
 package org.apache.tapestry.integration.app1.pages;
 
+import java.io.Serializable;
+
+import org.apache.tapestry.annotations.Component;
 import org.apache.tapestry.annotations.ComponentClass;
 import org.apache.tapestry.annotations.Persist;
+import org.apache.tapestry.corelib.components.ActionLink;
+import org.apache.tapestry.corelib.components.If;
+import org.apache.tapestry.corelib.components.Loop;
+import org.apache.tapestry.internal.util.IntegerRange;
 
 @ComponentClass
 public class ActionPage
 {
-    private int _index;
+    @Component
+    private If _hasValue;
+
+    @Component
+    private ActionLink _choose;
+
+    @Component
+    private Loop<Integer, Serializable> _loop;
+
+    public void configure_loop()
+    {
+        _loop.setSource(new IntegerRange(1, 10));
+    }
+
+    public void configure_choose()
+    {
+        _choose.setContext(getIndex());
+        _choose.setInformalParameter("class", getLinkClass());
+    }
+
+    public void configure_hasValue()
+    {
+        _hasValue.setTest(_value > 0);
+    }
 
     // Must be persistent, to survive from one request to the next.
     // An action request is always followed by a redirect request.
@@ -34,12 +64,7 @@
 
     public int getIndex()
     {
-        return _index;
-    }
-
-    public void setIndex(int index)
-    {
-        _index = index;
+        return _loop.getValue();
     }
 
     public int getValue()
@@ -49,6 +74,6 @@
 
     public String getLinkClass()
     {
-        return _index == _value ? "selected" : null;
+        return getIndex() == _value ? "selected" : null;
     }
 }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/AnyDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/AnyDemo.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/AnyDemo.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/AnyDemo.java Sat Feb 10 03:36:41 2007
@@ -25,6 +25,22 @@
 @ComponentClass
 public class AnyDemo
 {
+    @SuppressWarnings("unused")
+    @Component
+    private Any _title;
+
+    @SuppressWarnings("unused")
+    @Component
+    private Any _heading;
+    
+    @Component
+    private Any _section;
+
+    public void configure_section()
+    {
+        _section.setElement("h2");
+    }
+
     @Component
     private Loop<Integer, Serializable> _loop;
 

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/BlockDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/BlockDemo.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/BlockDemo.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/BlockDemo.java Sat Feb 10 03:36:41 2007
@@ -22,6 +22,7 @@
 import org.apache.tapestry.annotations.Inject;
 import org.apache.tapestry.annotations.Persist;
 import org.apache.tapestry.annotations.Retain;
+import org.apache.tapestry.corelib.components.Label;
 import org.apache.tapestry.corelib.components.Select;
 import org.apache.tapestry.internal.TapestryUtils;
 import org.apache.tapestry.ioc.internal.util.CollectionFactory;
@@ -29,9 +30,17 @@
 @ComponentClass
 public class BlockDemo
 {
-    @Component(id="blockName")
+    @Component
+    private Label _label;
+
+    public void configure_label()
+    {
+        _label.setField(_blockNameField);
+    }
+
+    @Component(id = "blockName")
     private Select<String> _blockNameField;
-    
+
     @Inject
     private Block _fred;
 

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/ClassLoaderInspect.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/ClassLoaderInspect.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/ClassLoaderInspect.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/ClassLoaderInspect.java Sat Feb 10 03:36:41 2007
@@ -17,6 +17,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.io.Serializable;
 import java.net.JarURLConnection;
 import java.net.URL;
 import java.net.URLConnection;
@@ -27,16 +28,74 @@
 import org.apache.tapestry.annotations.Component;
 import org.apache.tapestry.annotations.ComponentClass;
 import org.apache.tapestry.annotations.Persist;
+import org.apache.tapestry.corelib.components.Errors;
 import org.apache.tapestry.corelib.components.Form;
+import org.apache.tapestry.corelib.components.If;
+import org.apache.tapestry.corelib.components.Label;
+import org.apache.tapestry.corelib.components.Loop;
+import org.apache.tapestry.corelib.components.TextField;
 import org.apache.tapestry.ioc.internal.util.CollectionFactory;
 import org.apache.tapestry.ioc.internal.util.InternalUtils;
+import org.apache.tapestry.validator.Required;
 
 @ComponentClass
 public class ClassLoaderInspect
 {
     private static final ClassLoader _classLoader = Thread.currentThread().getContextClassLoader();
 
-    private ClassLoader _loader;
+    @SuppressWarnings("unused")
+    @Component
+    private Errors _errors;
+
+    @Component
+    private TextField<String> _resourceField;
+
+    @Component
+    private Loop<URL, Serializable> _URLLoop;
+
+    @Component
+    private Loop<JarEntry, Serializable> _jarEntriesLoop;
+
+    @Component
+    private Label _label;
+
+    public void configure_label()
+    {
+        _label.setField(_resourceField);
+    }
+
+    public void configure_jarEntriesLoop()
+    {
+        _jarEntriesLoop.setSource(getJarEntries());
+    }
+
+    public void configure_URLLoop()
+    {
+        _URLLoop.setSource(getURLs());
+    }
+
+    public void configure_resourceField()
+    {
+        _resourceField.setValueBindingExpr("resource");
+        _resourceField.setValidators(new Required());
+        _resourceField.setLabel("Resource");
+    }
+
+    @Component
+    private Loop<ClassLoader, Serializable> _loaderLoop;
+
+    public void configure_loaderLoop()
+    {
+        _loaderLoop.setSource(getLoaders());
+    }
+
+    @Component
+    private If _hasMatches;
+
+    public void configure_hasMatches()
+    {
+        _hasMatches.setTest(getShowMatches());
+    }
 
     @Persist
     private String _resource;
@@ -50,18 +109,9 @@
     @Persist
     private boolean _showMatches;
 
-    private URL _URL;
-
-    private JarEntry _jarEntry;
-
     public URL getURL()
     {
-        return _URL;
-    }
-
-    public void setURL(URL url)
-    {
-        _URL = url;
+        return _URLLoop.getValue();
     }
 
     public ClassLoader getClassLoader()
@@ -71,12 +121,7 @@
 
     public ClassLoader getLoader()
     {
-        return _loader;
-    }
-
-    public void setLoader(ClassLoader loader)
-    {
-        _loader = loader;
+        return _loaderLoop.getValue();
     }
 
     public List<ClassLoader> getLoaders()
@@ -162,7 +207,7 @@
 
         try
         {
-            InputStream is = _URL.openStream();
+            InputStream is = getURL().openStream();
             InputStreamReader reader = new InputStreamReader(is);
 
             char[] buffer = new char[1000];
@@ -191,7 +236,7 @@
     {
         try
         {
-            URLConnection rawConnection = _URL.openConnection();
+            URLConnection rawConnection = getURL().openConnection();
 
             JarURLConnection jarConnection = (JarURLConnection) rawConnection;
 
@@ -224,7 +269,7 @@
     {
         try
         {
-            return _URL.openConnection();
+            return getURL().openConnection();
         }
         catch (IOException ex)
         {
@@ -234,11 +279,11 @@
 
     public JarEntry getJarEntry()
     {
-        return _jarEntry;
+        return _jarEntriesLoop.getValue();
     }
 
-    public void setJarEntry(JarEntry jarEntry)
+    public TextField<String> getResourceField()
     {
-        _jarEntry = jarEntry;
+        return _resourceField;
     }
 }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/NumberSelect.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/NumberSelect.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/NumberSelect.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/NumberSelect.java Sat Feb 10 03:36:41 2007
@@ -17,12 +17,30 @@
 import org.apache.tapestry.annotations.Component;
 import org.apache.tapestry.annotations.ComponentClass;
 import org.apache.tapestry.annotations.InjectPage;
+import org.apache.tapestry.corelib.components.ActionLink;
+import org.apache.tapestry.corelib.components.If;
 import org.apache.tapestry.corelib.components.Loop;
 import org.apache.tapestry.internal.util.IntegerRange;
 
 @ComponentClass
 public class NumberSelect
 {
+    @Component
+    private If _ifNotFirst;
+
+    @Component
+    private ActionLink _select;
+
+    public void configure_select()
+    {
+        _select.setContext(getIndex());
+    }
+
+    public void configure_ifNotFirst()
+    {
+        _ifNotFirst.setTest(isNotFirst());
+    }
+
     @Component
     private Loop<Integer, Integer> _loop;
 

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/PasswordFieldDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/PasswordFieldDemo.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/PasswordFieldDemo.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/PasswordFieldDemo.java Sat Feb 10 03:36:41 2007
@@ -18,7 +18,9 @@
 import org.apache.tapestry.annotations.ComponentClass;
 import org.apache.tapestry.annotations.Inject;
 import org.apache.tapestry.annotations.Retain;
+import org.apache.tapestry.corelib.components.Errors;
 import org.apache.tapestry.corelib.components.Form;
+import org.apache.tapestry.corelib.components.Label;
 import org.apache.tapestry.corelib.components.PasswordField;
 import org.apache.tapestry.corelib.components.TextField;
 import org.apache.tapestry.integration.app1.services.UserAuthenticator;
@@ -27,9 +29,29 @@
 @ComponentClass
 public class PasswordFieldDemo
 {
-    @Component(id="userName")
+    @SuppressWarnings("unused")
+    @Component
+    private Errors _errors;
+
+    @Component
+    private Label _l1;
+
+    @Component
+    private Label _l2;
+
+    public void configure_l2()
+    {
+        _l2.setField(_passwordField);
+    }
+
+    public void configure_l1()
+    {
+        _l1.setField(_userNameField);
+    }
+
+    @Component(id = "userName")
     private TextField<String> _userNameField;
-    
+
     @Retain
     private String _userName;
 
@@ -81,6 +103,7 @@
     {
         _userNameField.setValidators(new Required());
     }
+
     public void configure_password()
     {
         _passwordField.setValidators(new Required());

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/RenderComponentDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/RenderComponentDemo.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/RenderComponentDemo.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/RenderComponentDemo.java Sat Feb 10 03:36:41 2007
@@ -14,32 +14,60 @@
 
 package org.apache.tapestry.integration.app1.pages;
 
+import org.apache.tapestry.Block;
 import org.apache.tapestry.annotations.Component;
 import org.apache.tapestry.annotations.ComponentClass;
+import org.apache.tapestry.annotations.Inject;
 import org.apache.tapestry.annotations.Persist;
 import org.apache.tapestry.corelib.components.Any;
+import org.apache.tapestry.corelib.components.Checkbox;
+import org.apache.tapestry.corelib.components.If;
+import org.apache.tapestry.corelib.components.Label;
 
 @ComponentClass
 public class RenderComponentDemo
 {
+    @Component
+    private Checkbox _enabled;
+
+    @Component
+    private Label _label;
+
+    public void configure_label()
+    {
+        _label.setField(_enabled);
+    }
+
+    @Component
+    private If _ifEnabled;
+
+    @Inject
+    private Block _else;
+
+    public void configure_ifEnabled()
+    {
+        _ifEnabled.setTest(isEnabled());
+        _ifEnabled.setElse(_else);
+    }
+
     @Persist
-    private boolean _enabled;
+    private boolean _isEnabled;
 
     @Component
     private Any _optional;
 
     public boolean isEnabled()
     {
-        return _enabled;
+        return _isEnabled;
     }
 
     public void setEnabled(boolean enable)
     {
-        _enabled = enable;
+        _isEnabled = enable;
     }
 
     public Object getThing()
     {
-        return _enabled ? _optional : null;
+        return _isEnabled ? _optional : null;
     }
 }

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/SimpleForm.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/SimpleForm.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/SimpleForm.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/SimpleForm.java Sat Feb 10 03:36:41 2007
@@ -20,6 +20,7 @@
 import org.apache.tapestry.annotations.Inject;
 import org.apache.tapestry.annotations.Persist;
 import org.apache.tapestry.corelib.components.Checkbox;
+import org.apache.tapestry.corelib.components.Label;
 import org.apache.tapestry.corelib.components.Select;
 import org.apache.tapestry.corelib.components.TextArea;
 import org.apache.tapestry.corelib.components.TextField;
@@ -32,6 +33,57 @@
 public class SimpleForm
 {
     @Component
+    private Label _l1;
+
+    @Component
+    private Label _l2;
+
+    @Component
+    private Label _l3;
+
+    @Component
+    private Label _l4;
+
+    @Component
+    private Label _l5;
+
+    @Component
+    private Label _l6;
+
+    public void configure_l6()
+    {
+        _l6.setField(_urgent);
+    }
+
+    public void configure_l5()
+    {
+        _l5.setField(_department);
+    }
+
+    public void configure_l4()
+    {
+        _l4.setField(_operatingSystem);
+    }
+
+    public void configure_l3()
+    {
+        _l3.setField(_message);
+    }
+
+    public void configure_l2()
+    {
+        _l2.setField(_email);
+    }
+
+    public void configure_l1()
+    {
+        _l1.setField(_disabled);
+    }
+
+    @Component
+    private Checkbox _disabled;
+
+    @Component
     private TextField<String> _email;
 
     @Component
@@ -50,7 +102,7 @@
     {
         _email.setValueBindingExpr("incident.email");
         _email.setValidators(new Required());
-        _email.setDisabled(_disabled);
+        _email.setDisabled(_isDisabled);
     }
 
     public void configure_message()
@@ -58,13 +110,13 @@
         _message.setValueBindingExpr("incident.message");
         _message.setValidators(new Required());
         _message.setLabel("Incident Message");
-        _message.setDisabled(_disabled);
+        _message.setDisabled(_isDisabled);
     }
 
     public void configure_department()
     {
         _department.setValueBindingExpr("incident.department");
-        _department.setDisabled(_disabled);
+        _department.setDisabled(_isDisabled);
         _department.useDefaultsFor(Department.class);
     }
 
@@ -74,7 +126,7 @@
     public void configure_operatingSystem()
     {
         _operatingSystem.setValueBindingExpr("incident.operatingSystem");
-        _operatingSystem.setDisabled(_disabled);
+        _operatingSystem.setDisabled(_isDisabled);
         _operatingSystem.setModel(TapestryUtils.toSelectModel(_resources.getMessages().get(
                 "os-values")));
         _operatingSystem.useDefaultEncoder(String.class);
@@ -83,23 +135,23 @@
     public void configure_urgent()
     {
         _urgent.setValueBindingExpr("incident.urgent");
-        _urgent.setDisabled(_disabled);
+        _urgent.setDisabled(_isDisabled);
     }
 
     @Persist
     private IncidentData _incident;
 
     @Persist
-    private boolean _disabled;
+    private boolean _isDisabled;
 
     public boolean isDisabled()
     {
-        return _disabled;
+        return _isDisabled;
     }
 
     public void setDisabled(boolean disable)
     {
-        _disabled = disable;
+        _isDisabled = disable;
     }
 
     public IncidentData getIncident()

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/ValidForm.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/ValidForm.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/ValidForm.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app1/pages/ValidForm.java Sat Feb 10 03:36:41 2007
@@ -18,6 +18,7 @@
 import org.apache.tapestry.annotations.ComponentClass;
 import org.apache.tapestry.annotations.Persist;
 import org.apache.tapestry.corelib.components.Checkbox;
+import org.apache.tapestry.corelib.components.Label;
 import org.apache.tapestry.corelib.components.TextArea;
 import org.apache.tapestry.corelib.components.TextField;
 import org.apache.tapestry.integration.app1.data.IncidentData;
@@ -26,6 +27,38 @@
 @ComponentClass
 public class ValidForm
 {
+    @Component
+    private Label _l1;
+
+    @Component
+    private Label _l2;
+
+    @Component
+    private Label _l3;
+
+    @Component
+    private Label _l4;
+
+    public void configure_l4()
+    {
+        _l4.setField(_hours);
+    }
+
+    public void configure_l3()
+    {
+        _l3.setField(_urgent);
+    }
+
+    public void configure_l2()
+    {
+        _l2.setField(_message);
+    }
+
+    public void configure_l1()
+    {
+        _l1.setField(_email);
+    }
+
     @Component
     private TextField<String> _email;
 

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForActionLink.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForActionLink.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForActionLink.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForActionLink.java Sat Feb 10 03:36:41 2007
@@ -12,22 +12,32 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.integration.app2.pages;
-
-import org.apache.tapestry.annotations.ComponentClass;
-import org.apache.tapestry.annotations.InjectPage;
-import org.apache.tapestry.annotations.OnEvent;
-
-@ComponentClass
-public class TestPageForActionLink
-{
-    @InjectPage("ResultPageForActionLink")
-    private ResultPageForActionLink resultPage;
-
-    @OnEvent(component = "link1")
-    public ResultPageForActionLink onClick(int number)
-    {
-        resultPage.setNumber(number);
-        return resultPage;
-    }
-}
+package org.apache.tapestry.integration.app2.pages;
+
+import org.apache.tapestry.annotations.Component;
+import org.apache.tapestry.annotations.ComponentClass;
+import org.apache.tapestry.annotations.InjectPage;
+import org.apache.tapestry.annotations.OnEvent;
+import org.apache.tapestry.corelib.components.ActionLink;
+
+@ComponentClass
+public class TestPageForActionLink
+{
+    @Component
+    private ActionLink _link1;
+
+    public void configure_link1()
+    {
+        _link1.setContext(123);
+    }
+
+    @InjectPage("ResultPageForActionLink")
+    private ResultPageForActionLink resultPage;
+
+    @OnEvent(component = "link1")
+    public ResultPageForActionLink onClick(int number)
+    {
+        resultPage.setNumber(number);
+        return resultPage;
+    }
+}

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForIf.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForIf.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForIf.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForIf.java Sat Feb 10 03:36:41 2007
@@ -12,25 +12,59 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.integration.app2.pages;
-
-import org.apache.tapestry.annotations.ComponentClass;
-
-@ComponentClass
-public class TestPageForIf
-{
-    private boolean property1 = true;
-
-    private boolean property2 = false;
-
-    public boolean isProperty1()
-    {
-        return property1;
-    }
-
-    public boolean isProperty2()
-    {
-        return property2;
-    }
-
-}
+package org.apache.tapestry.integration.app2.pages;
+
+import org.apache.tapestry.annotations.Component;
+import org.apache.tapestry.annotations.ComponentClass;
+import org.apache.tapestry.corelib.components.If;
+
+@ComponentClass
+public class TestPageForIf
+{
+    @Component
+    private If _if1;
+
+    @Component
+    private If _if2;
+
+    @Component
+    private If _if3;
+
+    @Component
+    private If _if4;
+
+    public void configure_if4()
+    {
+        _if4.setTest(isProperty2());
+    }
+
+    public void configure_if3()
+    {
+        _if3.setTest(isProperty1());
+    }
+
+    public void configure_if2()
+    {
+        _if2.setTest(false);
+    }
+
+    public void configure_if1()
+    {
+        _if1.setTest(true);
+    }
+
+    private boolean property1 = true;
+
+    private boolean property2 = false;
+
+    public boolean isProperty1()
+    {
+        return property1;
+    }
+
+    public boolean isProperty2()
+    {
+        return property2;
+    }
+
+}

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/NoOpComponentResources.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/NoOpComponentResources.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/NoOpComponentResources.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/NoOpComponentResources.java Sat Feb 10 03:36:41 2007
@@ -1,6 +1,7 @@
 package org.apache.tapestry.internal.services;
 
 import java.util.Locale;
+import java.util.Map;
 
 import org.apache.commons.logging.Log;
 import org.apache.tapestry.AnnotationProvider;
@@ -56,11 +57,6 @@
         return false;
     }
 
-    public void renderInformalParameters(MarkupWriter writer)
-    {
-
-    }
-
     public Messages getMessages()
     {
         return null;
@@ -134,6 +130,11 @@
     public <T> T coerce(Object value, Class<T> expectedType)
     {
         return null;
+    }
+
+    public void renderInformalParameters(MarkupWriter writer, Map<String, String> runtimeParameters)
+    {
+        
     }
 
 }

Added: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/NoOpInstantiator.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/NoOpInstantiator.java?view=auto&rev=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/NoOpInstantiator.java (added)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/NoOpInstantiator.java Sat Feb 10 03:36:41 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.internal.services;
+
+import org.apache.tapestry.internal.InternalComponentResources;
+import org.apache.tapestry.model.ComponentModel;
+import org.apache.tapestry.runtime.Component;
+
+public class NoOpInstantiator implements Instantiator
+{
+
+    public Component newInstance(InternalComponentResources resources)
+    {
+        return null;
+    }
+
+    public ComponentModel getModel()
+    {
+        return null;
+    }
+
+}

Propchange: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/services/NoOpInstantiator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImplTest.java?view=diff&rev=505676&r1=505675&r2=505676
==============================================================================
--- tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImplTest.java (original)
+++ tapestry/tapestry5/tapestry-core/branches/kt-20070205-IDE-support/src/test/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImplTest.java Sat Feb 10 03:36:41 2007
@@ -14,19 +14,30 @@
 
 package org.apache.tapestry.internal.structure;
 
+import java.util.Collections;
+import java.util.Map;
+
 import org.apache.tapestry.Binding;
 import org.apache.tapestry.MarkupWriter;
+import org.apache.tapestry.dom.Element;
 import org.apache.tapestry.internal.InternalComponentResources;
+import org.apache.tapestry.internal.bindings.LiteralBinding;
 import org.apache.tapestry.internal.services.Instantiator;
+import org.apache.tapestry.internal.services.MarkupWriterImpl;
+import org.apache.tapestry.internal.services.NoOpInstantiator;
 import org.apache.tapestry.internal.test.InternalBaseTestCase;
+import org.apache.tapestry.ioc.internal.services.TypeCoercerImpl;
+import org.apache.tapestry.ioc.internal.util.CollectionFactory;
 import org.apache.tapestry.ioc.services.TypeCoercer;
 import org.apache.tapestry.model.ComponentModel;
+import org.apache.tapestry.model.NoOpComponentModel;
 import org.apache.tapestry.model.ParameterModel;
 import org.apache.tapestry.runtime.Component;
 import org.testng.annotations.Test;
 
 public class InternalComponentResourcesImplTest extends InternalBaseTestCase
 {
+    @SuppressWarnings("unchecked")
     @Test
     public void render_informal_parameters_no_bindings()
     {
@@ -44,11 +55,12 @@
         InternalComponentResources resources = new InternalComponentResourcesImpl(element, null,
                 ins, coercer, null);
 
-        resources.renderInformalParameters(writer);
+        resources.renderInformalParameters(writer, Collections.EMPTY_MAP);
 
         verify();
     }
 
+    @SuppressWarnings("unchecked")
     @Test
     public void render_informal_parameters_skips_formal_parameters()
     {
@@ -72,11 +84,12 @@
 
         resources.bindParameter("fred", binding);
 
-        resources.renderInformalParameters(writer);
+        resources.renderInformalParameters(writer, Collections.EMPTY_MAP);
 
         verify();
     }
 
+    @SuppressWarnings("unchecked")
     @Test
     public void render_an_informal_parameter()
     {
@@ -107,8 +120,42 @@
 
         resources.bindParameter("fred", binding);
 
-        resources.renderInformalParameters(writer);
+        resources.renderInformalParameters(writer, Collections.EMPTY_MAP);
 
         verify();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void runtime_informals()
+    {
+        final ComponentModel model = new NoOpComponentModel();
+        Instantiator instantiator = new NoOpInstantiator()
+        {
+
+            @Override
+            public ComponentModel getModel()
+            {
+                return model;
+            }
+
+        };
+        InternalComponentResourcesImpl resources = new InternalComponentResourcesImpl(null, null,
+                instantiator, new TypeCoercerImpl(Collections.EMPTY_SET), null);
+        resources.bindParameter("a", new LiteralBinding(null, "456", null));
+        resources.bindParameter("c", new LiteralBinding(null, "789", null));
+        Map<String, String> runtimeParameters = CollectionFactory.newMap();
+        runtimeParameters.put("id", "123");
+        runtimeParameters.put("a", "x");
+        runtimeParameters.put("b", "3");
+        MarkupWriter writer = new MarkupWriterImpl();
+        writer.element("foo");
+        resources.renderInformalParameters(writer, runtimeParameters);
+        writer.end();
+        Element element = writer.getDocument().getElementById("123");
+        assertNotNull(element);
+        assertEquals(element.getAttribute("a"), "x");
+        assertEquals(element.getAttribute("b"), "3");
+        assertEquals(element.getAttribute("c"), "789");
     }
 }



Mime
View raw message