tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r612177 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry/corelib/components/ main/java/org/apache/tapestry/services/ site/apt/ test/app1/ test/java/org/apache/tapestry/integration/ test/java/org/apache/tapestr...
Date Tue, 15 Jan 2008 17:56:25 GMT
Author: hlship
Date: Tue Jan 15 09:56:14 2008
New Revision: 612177

URL: http://svn.apache.org/viewvc?rev=612177&view=rev
Log:
Simplify (and sort!) the integration app's Start page
Add an Unless component

Added:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Unless.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/app1/UnlessDemo.tml
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/UnlessDemo.java
Removed:
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/MerryChristmas.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry/integration/app1/pages/MerryChristmas.tml
Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/If.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/DataTypeAnalyzer.java
    tapestry/tapestry5/trunk/tapestry-core/src/site/apt/index.apt
    tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Start.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/If.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/If.java?rev=612177&r1=612176&r2=612177&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/If.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/If.java
Tue Jan 15 09:56:14 2008
@@ -29,22 +29,24 @@
     private boolean _test;
 
     /**
-     * Optional parameter to invert the test. If true, then the body is rendered when the
test
-     * parameter is false (not true).
+     * Optional parameter to invert the test. If true, then the body is rendered when the
test parameter is false (not
+     * true).
+     *
+     * @see Unless
      */
     @Parameter
     private boolean _negate;
 
     /**
-     * An alternate {@link Block} to render if the test parameter is false. The default,
null, means
-     * render nothing in that situation.
+     * An alternate {@link Block} to render if the test parameter is false. The default,
null, means render nothing in
+     * that situation.
      */
     @Parameter
     private Block _else;
 
     /**
-     * Returns null if the test parameter is true, which allows normal rendering (of the
body). If
-     * the test parameter is false, returns the else parameter (this may also be null).
+     * Returns null if the test parameter is true, which allows normal rendering (of the
body). If the test parameter is
+     * false, returns the else parameter (this may also be null).
      */
     Object beginRender()
     {
@@ -52,8 +54,8 @@
     }
 
     /**
-     * If the test parameter is true, then the body is rendered, otherwise not. The component
does
-     * not have a template or do any other rendering besides its body.
+     * If the test parameter is true, then the body is rendered, otherwise not. The component
does not have a template
+     * or do any other rendering besides its body.
      */
     boolean beforeRenderBody()
     {

Added: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Unless.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Unless.java?rev=612177&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Unless.java
(added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Unless.java
Tue Jan 15 09:56:14 2008
@@ -0,0 +1,39 @@
+// Copyright 2008 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.components;
+
+import org.apache.tapestry.annotations.Parameter;
+
+/**
+ * A close relative of the {@link org.apache.tapestry.corelib.components.If} component that
inverts the meaning of its
+ * test.  This is easier than an If component with the negate parameter set to true.
+ */
+public class Unless
+{
+    /**
+     * If true, then the body of the If component is rendered. If false, the body is omitted.
+     */
+    @Parameter(required = true)
+    private boolean _test;
+
+    /**
+     * Returns the inversion of it's test parameter. Therefore, when test is true, nothing
is rendered. When test is
+     * false, the component (which is to say, the body of the component, as that's the point)
is rendered.
+     */
+    boolean beginRender()
+    {
+        return !_test;
+    }
+}

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/DataTypeAnalyzer.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/DataTypeAnalyzer.java?rev=612177&r1=612176&r2=612177&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/DataTypeAnalyzer.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/DataTypeAnalyzer.java
Tue Jan 15 09:56:14 2008
@@ -19,19 +19,19 @@
 import org.apache.tapestry.ioc.services.PropertyAdapter;
 
 /**
- * Used by {@link BeanModelSource} to identify the type of data associated with a particular
- * property (represented as a {@link PropertyAdapter}). The data type is a string used to
determine
- * what kind of interface to use for displaying the value of the property, or what kind of
interface
- * to use for editing the value of the property. Common property types are "text", "enum",
- * "checkbox", but the list is extensible.
+ * Used by {@link BeanModelSource} to identify the type of data associated with a particular
property (represented as a
+ * {@link PropertyAdapter}). The data type is a string used to determine what kind of interface
to use for displaying
+ * the value of the property, or what kind of interface to use for editing the value of the
property. Common property
+ * types are "text", "enum", "checkbox", but the list is extensible.
  * <p/>
- * <p>Different strategies for identifying the data type are encapsulated in the DataTypeAnalyzer
service, forming
- * a chain of command.
+ * <p>Different strategies for identifying the data type are encapsulated in the DataTypeAnalyzer
service, forming a
+ * chain of command.
  *
  * @see Grid
  * @see BeanEditForm
  * @see BeanBlockSource
- * @see org.apache.tapestry.services.TapestryModule#contributeDataTypeAnalyzer(org.apache.tapestry.ioc.OrderedConfiguration,
DataTypeAnalyzer)
+ * @see org.apache.tapestry.services.TapestryModule#contributeDataTypeAnalyzer(org.apache.tapestry.ioc.OrderedConfiguration,
+ *      DataTypeAnalyzer)
  */
 public interface DataTypeAnalyzer
 {

Modified: tapestry/tapestry5/trunk/tapestry-core/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/site/apt/index.apt?rev=612177&r1=612176&r2=612177&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/site/apt/index.apt (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/site/apt/index.apt Tue Jan 15 09:56:14 2008
@@ -13,6 +13,11 @@
   Progress on Tapestry 5 is really taking off. This space lists some cool new features that
have been added
   recently.
 
+  * Page instances are now cached more efficiently, with Tapestry attempting to control how
many instances
+    are created, and culling unused instances periodically.
+
+  * New Unless component (like an If component, but inverted).
+
   * Support for "password" and "longtext" data types (for use with the BeanEditor), and a
new
     {{{../apidocs/org/apache/tapestry/corelib/components/TextOutput.html}TextOutput}} component.
 
@@ -36,32 +41,7 @@
   * Tapestry templates now use the extension .tml (not .html). Page templates in the context
are now stored at the root, not under WEB-INF.
   
   * The core of BeanEditForm has been factored out as a new component, BeanEditor (this allows
you to edit multiple beans within the same form).
-  
-  * Some of the annotations that aren't used specifically with component classes have been
split off into the new
-    {{{../tapestry-annotations/}tapestry-annotations}} module.
-  
-  * Validator constraint values may now be specified in the component message catalog, rather
than in the @Validation annotation (or validate component parameter). 
-  
-  * A new validator, regexp, has been added.
-  
-  * A Radio button component has been added.
-  
-  * A file upload form component has been added (in a new library: {{{../tapestry-upload/}tapestry-upload}}).

-  
-  * The BeanEditForm component can now create the object it edits.
-  
-  * Added the Palette component for sophisticated multiple-property selection and ordering.
-  
-  * New "asset:" binding prefix to allow asset files to be bound to parameters.
-  
-  * Template expansions are now allowed inside attributes.
-  
-  * Applications may optionally provide a global message catalog (which is searched when
a page or component message catalog
-    can not directly provide a localized message).
-  
-  * Explicit \<!DOCTYPE\> declarations inside page and component templates will now
be forwarded through to the client
-    web browser.
-    
+
  
 Changes from Tapestry 4 to Tapestry 5
 
@@ -71,10 +51,12 @@
   to provide a stable, powerful, extensible platform for many years to come.
   
   Here's a few of the planned and implemented features:
+
+  * Easy to get started using Maven.
   
-  * Simplified, minimal API based on annotations
+  * Simplified, minimal API based on annotations.
   
-  * <<No>> base class requirement; components are true, pure Pojos (Plain Old
Java Objects)
+  * <<No>> base class requirement; components are true, pure Pojos (Plain Old
Java Objects).
   
   * Abstract classes ... gone!  Classes are normal, concrete classes.
   
@@ -82,11 +64,11 @@
   
   * Less configuration all around.
   
-  * Automatic reloading of templates and even <Java classes>
+  * Automatic reloading of templates and even <Java classes>.
   
-  * Super-duper Ajax integration built in (<that's still very much in progress>)
+  * Super-duper Ajax integration built in.
   
-  * Easy & fast unit testing of individual pages or components
+  * Easy & fast unit testing of individual pages or components.
     
 Adaptive API
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml?rev=612177&r1=612176&r2=612177&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml Tue Jan 15 09:56:14 2008
@@ -3,70 +3,29 @@
 
     <h1>Tapestry 5 Integration Application 1</h1>
 
-
-    <ul xml:space="default">
-        <li>
-            <a t:type="PageLink" page="MerryChristmas">Count Page</a>
-        </li>
-        <li>
-            <a t:type="PageLink" page="InjectDemo">Inject Demo</a>
-        </li>
-        <li>
-            <a t:type="PageLink" page="Countdown">Countdown Page</a>
-        </li>
-        <li>
-            <a t:type="PageLink" page="ParameterConflict">
-                Template Overridden by Class Page
-            </a>
-        </li>
-        <li>
-            <a t:type="PageLink" page="EnvironmentalDemo">
-                Environmental Annotation Usage
-            </a>
-        </li>
-        <li>
-            <a t:type="PageLink" page="expansion">Expansion Page</a>
+    <ul>
+        <li t:type="loop" source="items" value="item">
+            <t:pagelink page="prop:item.pageName">${item.label}</t:pagelink>
+            -- ${item.description}
         </li>
+    </ul>
+
+    <h2>Special Pages</h2>
+
+    <p>These are often pages which can't load due to errors.</p>
+
+    <ul>
         <li>
             <a href="BadTemplate">BadTemplate Page</a>
             -- More exception reporting
         </li>
         <li>
-            <a t:type="PageLink" page="ActionPage">Action Page</a>
-            -- tests fixture for ActionLink component
-        </li>
-        <li>
-            <a t:type="PageLink" page="InstanceMixin">InstanceMixin</a>
-            -- Mixin added to particular component instance
-        </li>
-        <li>
-            <a t:type="PageLink" page="RenderPhaseOrder">
-                RenderPhaseOrder
-            </a>
-            -- Order of operations when invoking render phase methods
-        </li>
-        <li>
-            <a t:type="PageLink" page="SimpleForm">SimpleForm</a>
-            -- first pass at writing Form and TextField components
-        </li>
-        <li>
-            <a t:type="PageLink" page="NumberSelect">NumberSelect</a>
-            -- passivate/activate page context demo
-        </li>
-        <li>
-            <a t:type="PageLink" page="Localization">Localization</a>
-            -- accessing localized messages from the component catalog
-        </li>
-        <li>
-            <a t:type="PageLink" page="nested/AssetDemo">AssetDemo</a>
-            -- declaring an using Assets
-        </li>
-        <li>
-            <a t:type="PageLink" page="ExpansionSubclass">
-                ExpansionSubclass
-            </a>
-            -- components can inherit templates from base classes
+            <t:pagelink page="eventhandlerdemo" context="'clear'">
+                EventHandler Demo
+            </t:pagelink>
+            -- Tests for event handling method order and matching
         </li>
+
         <li>
             <a href="InjectContainerMismatch">
                 InjectContainerMismatch
@@ -76,247 +35,11 @@
         </li>
 
         <li>
-            <a t:type="PageLink" page="ParameterDefault">
-                ParameterDefault
-            </a>
-            -- defaulter methods for component parameters
-        </li>
-        <li>
-            <a t:type="PageLink" page="ValidForm">ValidForm</a>
-            -- server-side input validation
-        </li>
-        <li>
-            <a t:type="PageLink" page="PasswordFieldDemo">
-                PasswordFieldDemo
-            </a>
-            -- test for the PasswordField component
-        </li>
-        <li>
-            <a t:type="PageLink" page="RenderComponentDemo">
-                RenderComponentDemo
-            </a>
-            -- components that "nominate" other components to render
-        </li>
-        <li>
-            <a t:type="PageLink" page="BlockDemo">BlockDemo</a>
-            -- use of blocks to control rendering
-        </li>
-        <li>
-            <a t:type="PageLink" page="ToDoListVolatile">
-                ToDo List (Volatile)
-            </a>
-            -- Loops and Submit inside Form, volatile mode
-        </li>
-        <li>
-            <t:pagelink page="MissingTemplate">
-                Missing Template Demo
-            </t:pagelink>
-            -- Demo for what happens when a template is not found for a
-            page
-        </li>
-
-        <li>
-            <t:pagelink page="zonedemo">Zone Demo</t:pagelink>
-            -- dynamic updates within a page
-        </li>
-
-        <li>
-            <a t:type="PageLink" page="ToDoList">ToDo List</a>
-            -- Loops and Submit inside Form using a primary key encoder
-        </li>
-        <li>
-            <a t:type="PageLink" page="FlashDemo">FlashDemo</a>
-            -- demonstrate "flash" persistence
-        </li>
-        <li>
-            <a t:type="PageLink" page="beaneditordemo">
-                BeanEditor Demo
-            </a>
-            -- demonstrate the BeanEditor mega-component
-        </li>
-        <li>
-            <a t:type="PageLink" page="pageloadeddemo">
-                PageLoaded Demo
-            </a>
-            -- shows that page lifecycle methods are invoked
-        </li>
-        <li>
-            <a t:type="PageLink" page="griddemo">Grid Demo</a>
-            -- default Grid component
-        </li>
-        <li>
-            <a t:type="PageLink" page="nullgrid">Null Grid</a>
-            -- handling of null source for Grid
-        </li>
-        <li>
-            <a t:type="PageLink" page="gridsetdemo">Grid Set Demo</a>
-            -- handling of Set sources for Grid
-        </li>
-        <li>
-            <a t:type="PageLink" page="gridenumdemo">Grid Enum Demo</a>
-            -- handling of enum types in the Grid
-        </li>
-        <li>
-            <t:pageLink page="GridRemoveReorderDemo">
-                Grid Remove/Reorder Demo
-            </t:pageLink>
-            -- handling of remove and reorder parameters
-        </li>
-        <li>
-            <a t:type="PageLink" page="protected">Protected Page</a>
-            -- Demonstrate result of non-void return from a page's
-            activate method.
-        </li>
-        <li>
-            <a t:type="PageLink" page="kicker">Kicker</a>
-            -- demos complex page and component context in links
-        </li>
-        <li>
-            <a t:type="PageLink" page="simpletrackgriddemo">
-                SimpleTrack Grid Demo
-            </a>
-            -- customizing the model for a Grid around an interface
-        </li>
-        <li>
-            <a t:type="PageLink" page="pagelinkcontext">
-                PageLink Context Demo
-            </a>
-            -- passing explicit context in a page render link
-        </li>
-        <li>
-            <a t:type="pagelink" page="ValidBeanEditorDemo">
-                Client Validation Demo
-            </a>
-            --BeanEditor with validation enabled
-        </li>
-        <li>
             <a href="recursivedemo">Recursive Demo</a>
             -- check for handling of recursive components
         </li>
-        <li>
-            <t:pagelink page="renderabledemo">
-                Renderable Demo
-            </t:pagelink>
-            -- Shows that render phase methods can return a Renderable
-            object
-        </li>
-        <li>
-            <t:pagelink page="eventhandlerdemo" context="'clear'">
-                EventHandler Demo
-            </t:pagelink>
-            -- Tests for event handling method order and matching
-        </li>
-        <li>
-            <t:pagelink page="inheritedbindingsdemo">
-                Inherited Bindings Demo
-            </t:pagelink>
-            -- Tests for components that inherit bindings from
-            containing components
-        </li>
-        <li>
-            <t:pagelink page="ClientPersistenceDemo">
-                Client Persistence Demo
-            </t:pagelink>
-            -- component field values persisted on the client side
-        </li>
-        <li>
-            <t:pagelink page="attributeExpansionsDemo">
-                Attribute Expansions Demo
-            </t:pagelink>
-            -- use expansions inside attributes of ordinary elements
-        </li>
-        <li>
-            <t:pagelink page="PaletteDemo">Palette Demo</t:pagelink>
-            -- multiple selection component
-        </li>
-        <li>
-            <t:pagelink page="ReturnTypes">Return Types</t:pagelink>
-            -- Tests various event handler return types
-        </li>
-        <li>
-            <t:pagelink page="FormEncodingType">
-                Form Encoding Type
-            </t:pagelink>
-            -- Test ability to set an encoding type for a Form
-        </li>
-        <li>
-            <t:pagelink page="RadioDemo">RadioDemo</t:pagelink>
-            -- Use of the RadioGroup and Radio components.
-        </li>
-        <li>
-            <t:pagelink page="RegexpDemo">Regexp Demo</t:pagelink>
-            -- Use of the Regexp validator
-        </li>
-        <li>
-            <t:pagelink page="BeanEditRemoveReorder">
-                BeanEdit Remove/Reorder
-            </t:pagelink>
-            -- Use of the remove and reorder parameters with
-            BeanEditForm
-        </li>
-        <li>
-            <t:pagelink page="MultiBeanEditDemo">
-                MultiBeanEdit Demo
-            </t:pagelink>
-            -- Multiple BeanEditor components in a single form
-        </li>
-        <li>
-            <t:pagelink page="GridFormDemo">Grid Form Demo</t:pagelink>
-            -- Grid operating inside a Form
-        </li>
-        <li>
-            <t:pagelink page="DateFieldDemo">DateField Demo</t:pagelink>
-            -- using DateField by itself on a page
-        </li>
-        <li>
-            <t:pagelink page="BeanEditDateDemo">
-                BeanEditor / Date Demo
-            </t:pagelink>
-            -- Use of date properties inside BeanEditor and BeanDisplay
-        </li>
-
-        <li>
-            <t:pagelink page="eventmethodtranslate">EventMethod Translator</t:pagelink>
-            -- Demo ability to provide toclient and parseclient event handler methods
-        </li>
-
-        <li>
-            <t:pagelink page="autocompletedemo">Autocomplete Mixin Demo</t:pagelink>
-            -- Demo the autocomplete mixin for text fields.
-        </li>
-
-        <li>
-            <t:pagelink page="componentparameter">ComponentParameter Demo</t:pagelink>
-            -- Demo using a component type as a parameter type and succesfuly passing
-            a component
-        </li>
-
-        <li>
-            <t:pagelink page="inheritinformalsdemo">Inherit Informal Parameters Demo</t:pagelink>
-            -- Demo a component which inherits informal parameters from its container
-        </li>
-
-        <li>
-            <t:pagelink page="disabledfields">Disabled Fields</t:pagelink>
-            -- Demonstrate a bunch of disabled fields, to verify that the RenderDisabled
mixin works
-            and is being used properly
-        </li>
-
-        <li>
-            <t:pagelink page="BeanEditorOverride">BeanEditor Override</t:pagelink>
-            -- Property editor overrides work for the BeanEditor component itself (not just
the BeanEditForm component)
-        </li>
-
-        <li>
-            <t:pagelink page="varbindingdemo">Var Binding Demo</t:pagelink>
-            -- use of the var: binding prefix
-        </li>
-
-        <li>
-            <t:pagelink page="leangriddemo">Lean Grid Demo</t:pagelink>
-            -- Grid component with lean parameter turned on, to eliminate CSS class attributes
in TD and TH elements
-        </li>
 
     </ul>
 
-</html>
+</html>                      
+

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/UnlessDemo.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/UnlessDemo.tml?rev=612177&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/UnlessDemo.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/UnlessDemo.tml Tue Jan 15 09:56:14
2008
@@ -0,0 +1,12 @@
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+    <p id="false">
+        <t:unless test="false">
+            false is rendered
+        </t:unless>
+    </p>
+
+    <p id="true">
+        <t:unless test="true">true is not rendered</t:unless>
+    </p>
+</html>
\ No newline at end of file

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java?rev=612177&r1=612176&r2=612177&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
Tue Jan 15 09:56:14 2008
@@ -70,18 +70,6 @@
         assertEquals(downloaded, actual);
     }
 
-    @Test
-    public void basic_parameters() throws Exception
-    {
-
-        // OK ... could be a separate test, but for efficiency, we'll mix it in here.
-        // It takes a while to start up Selenium RC (and a Firefox browser).
-
-        start("Count Page");
-
-        assertTextPresent("Merry Christmas: Ho! Ho! Ho! ");
-    }
-
     /**
      * Tests the ability to inject a Block, and the ability to use the block to control rendering.
      */
@@ -1366,4 +1354,13 @@
         // assertText("//th[1]/@class", "");
     }
 
+    @Test
+    public void unless_compnent()
+    {
+        start("Unless Demo");
+
+        assertText("//p[@id='false']", "false is rendered");
+
+        assertText("//p[@id='true']", "");
+    }
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Start.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Start.java?rev=612177&r1=612176&r2=612177&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Start.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Start.java
Tue Jan 15 09:56:14 2008
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007 The Apache Software Foundation
+// Copyright 2006, 2007, 2008 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.
@@ -14,10 +14,206 @@
 
 package org.apache.tapestry.integration.app1.pages;
 
+import org.apache.tapestry.ioc.internal.util.CollectionFactory;
+
+import java.util.Collections;
+import java.util.List;
+
 /**
  * Have to start somewhere!
  */
 public class Start
 {
-    // Empty.
+    public static class Item implements Comparable<Item>
+    {
+        private final String _pageName;
+        private final String _label;
+        private final String _description;
+
+        public Item(String pageName, String label, String description)
+        {
+            _pageName = pageName;
+            _label = label;
+            _description = description;
+        }
+
+        public String getPageName()
+        {
+            return _pageName;
+        }
+
+        public String getLabel()
+        {
+            return _label;
+        }
+
+        public String getDescription()
+        {
+            return _description;
+        }
+
+        public int compareTo(Item o)
+        {
+            return _label.compareTo(o._label);
+        }
+    }
+
+    private static final List<Item> ITEMS = CollectionFactory.newList(
+            new Item("actionpage", "Action Page", "tests fixture for ActionLink component"),
+
+            new Item("nested/AssetDemo", "AssetDemo", "declaring an image using Assets"),
+
+            new Item("blockdemo", "BlockDemo", "use of blocks to control rendering"),
+
+            new Item("countdown", "Countdown Page", "defining component using @Component
annotation"),
+
+            new Item("injectdemo", "Inject Demo", "use of various kinds of injection"),
+
+            new Item("instancemixin", "InstanceMixin", "mixin added to a particular component
instance"),
+
+
+            new Item("EnvironmentalDemo", "Environmental Annotation Usage",
+                     "Storing and retrieving Environmental values"),
+
+            new Item("Expansion", "Expansion Page", "Use of expansions in templates"),
+
+            new Item("ExpansionSubclass", "ExpansionSubclass", "components can inherit templates
from base classes"),
+
+            new Item("Localization", "Localization", "access localized messages from the
component catalog"),
+
+            new Item("NumberSelect", "NumberSelect", "passivate/activate page context demo"),
+
+            new Item("ParameterConflict", "Template Overridden by Class Page",
+                     "Parameters in the class override those in the template"),
+
+            new Item("ParameterDefault", "ParameterDefault", "defaulter methods for component
parameters"),
+
+            new Item("passwordfielddemo", "PasswordFieldDemo", "test for the PasswordField
component"),
+
+            new Item("rendercomponentdemo", "RenderComponentDemo",
+                     "components that \"nominate\" other components to render"),
+
+            new Item("renderphaseorder", "RenderPhaseOrder", "order of operations when invoking
render phase methods"),
+
+            new Item("simpleform", "SimpleForm", "first pass at writing Form and TextField
components"),
+
+            new Item("validform", "ValidForm", "server-side input validation"),
+
+            new Item("ToDoListVolatile", "ToDo List (Volatile)", "Loops and Submit inside
Form, volatile mode"),
+
+            new Item("MissingTemplate", "Missing Template Demo",
+                     "Demo for what happens when a template is not found for a page"),
+
+            new Item("zonedemo", "Zone Demo", "dynamic updates within a page"),
+
+            new Item("todolist", "ToDo List", "Loops and Submit inside Form using primary
key encoder"),
+
+            new Item("flashdemo", "FlashDemo", "demonstrate 'flash' persistence"),
+
+            new Item("beaneditordemo", "BeanEditor Demo", "demonstrate the BeanEditor mega-component"),
+
+            new Item("pageloadeddemo", "PageLoaded Demo", "shows that page lifecycle methods
are invoked"),
+
+            new Item("griddemo", "Grid Demo", "default Grid component"),
+
+            new Item("nullgrid", "Null Grid", "handling of null source for Grid"),
+
+            new Item("gridsetdemo", "Grid Set Demo", "handling of Set sources for Grid"),
+
+            new Item("gridenumdemo", "Grid Enum Demo", "handling of enum types in the Grid"),
+
+            new Item("GridRemoveReorderDemo", "Grid Remove/Reorder Demo", "handling of remove
and reorder parameters"),
+
+            new Item("protected", "Protected Page",
+                     "Demonstrate result of non-void return from a page's activate method"),
+
+            new Item("Kicker", "Kicker", "demos complex page and component context in links"),
+
+            new Item("simpletrackgriddemo", "SimpleTrack Grid Demo",
+                     "customizing the model for a Grid around an interface"),
+
+            new Item("pagelinkcontext", "PageLink Context Demo", "passing explicit context
in a page render link"),
+
+
+            new Item("ValidBeanEditorDemo", "Client Validation Demo", "BeanEditor with validation
enabled"),
+
+
+            new Item("renderabledemo", "Renderable Demo", "shows that render phase methods
can return a Renderable"),
+
+            new Item("inheritedbindingsdemo", "Inherited Bindings Demo",
+                     "Tests for components that inherit bindings from containing components"),
+
+            new Item("ClientPersistenceDemo", "Client Persistence Demo",
+                     "component field values persisted on the client side"),
+
+            new Item("attributeExpansionsDemo", "Attribute Expansions Demo",
+                     "use expansions inside attributes of ordinary elements"),
+
+            new Item("PaletteDemo", "Palette Demo", "multiple selection component"),
+
+            new Item("ReturnTypes", "Return Types", "tests various event handler return types"),
+
+            new Item("FormEncodingType", "Form Encoding Type", "Test ability to set an encoding
type for a Form"),
+
+            new Item("RadioDemo", "RadioDemo", "Use of the RadioGroup and Radio components"),
+
+            new Item("RegexpDemo", "Regexp Demo", "Use of the Regexp validator"),
+
+            new Item("BeanEditRemoveReorder", "BeanEdit Remove/Reorder",
+                     "Use of the remove and reorder parameters with BeanEditForm"),
+
+            new Item("MultiBeanEditDemo", "MultiBeanEdit Demo", "Multiple BeanEditor components
in a single form"),
+
+            new Item("GridFormDemo", "Grid Form Demo", "Grid operating inside a Form"),
+
+            new Item("DateFieldDemo", "DateField Demo", "using DateField by itself on a page"),
+
+            new Item("BeanEditDateDemo", "BeanEditor / Date Demo",
+                     "Use of date properties inside BeanEditor and BeanDisplay"),
+
+            new Item("eventmethodtranslate", "EventMethod Translator",
+                     "Demo ability to provide toclient and parseclient event handler methods"),
+
+            new Item("autocompletedemo", "Autocomplete Mixin Demo", "Demo the autocomplete
mixin for text fields"),
+
+            new Item("componentparameter", "ComponentParameter Demo",
+                     " Demo using a component type as a parameter type and succesfuly passing
a component"),
+
+            new Item("inheritinformalsdemo", "Inherit Informal Parameters Demo",
+                     "Demo a component which inherits informal parameters from its container"),
+
+            new Item("disabledfields", "Disabled Fields",
+                     "Demonstrate a bunch of disabled fields, to verify that the RenderDisabled
mixin works and is being used properly"),
+
+            new Item("BeanEditorOverride", "BeanEditor Override",
+                     "Property editor overrides work for the BeanEditor component itself
(not just the BeanEditForm component)"),
+
+            new Item("varbindingdemo", "Var Binding Demo", "use of the var: binding prefix"),
+
+            new Item("leangriddemo", "Lean Grid Demo",
+                     "Grid component with lean parameter turned on, to eliminate CSS class
attributes in TD and TH elements"),
+
+            new Item("unlessdemo", "Unless Demo", "use of the Unless component"));
+
+    static
+    {
+        Collections.sort(ITEMS);
+    }
+
+    private Item _item;
+
+    public List<Item> getItems()
+    {
+        return ITEMS;
+    }
+
+    public Item getItem()
+    {
+        return _item;
+    }
+
+    public void setItem(Item item)
+    {
+        _item = item;
+    }
 }

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/UnlessDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/UnlessDemo.java?rev=612177&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/UnlessDemo.java
(added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/UnlessDemo.java
Tue Jan 15 09:56:14 2008
@@ -0,0 +1,19 @@
+// Copyright 2008 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.integration.app1.pages;
+
+public class UnlessDemo
+{
+}



Mime
View raw message