You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2010/05/04 01:05:07 UTC

svn commit: r940664 - in /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components: BeanDisplay.java BeanEditForm.java BeanEditor.java Grid.java

Author: hlship
Date: Mon May  3 23:05:07 2010
New Revision: 940664

URL: http://svn.apache.org/viewvc?rev=940664&view=rev
Log:
TAP5-1088: Bean editor model for <class name> already contains a property model for property <property name> when combining model parameter with add parameter of BeanEditor or BeanEditForm

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanDisplay.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditForm.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditor.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanDisplay.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanDisplay.java?rev=940664&r1=940663&r2=940664&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanDisplay.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanDisplay.java Mon May  3 23:05:07 2010
@@ -1,10 +1,10 @@
-// Copyright 2007, 2008 The Apache Software Foundation
+// Copyright 2007, 2008, 2010 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
+// 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,
@@ -27,15 +27,15 @@ import org.apache.tapestry5.services.Bea
 
 /**
  * Used to display the properties of a bean, using an underlying {@link BeanModel}. The output definition list: a
- * &lt;dl&gt; element containing a series of &lt;dt&gt;/&lt;dd&gt; pairs.  The property label is used as the &lt;dt&gt;
+ * &lt;dl&gt; element containing a series of &lt;dt&gt;/&lt;dd&gt; pairs. The property label is used as the &lt;dt&gt;
  * and the property value (formatted as per the datatype) is the &lt;dd&gt;. Only properties that have a known data type
  * are displayed.
  * <p/>
  * The property id is used as the class attribute of the &lt;dt&gt; and &lt;dd&gt; element, allowing CSS customization
- * per property.  This does not occur when lean is bound to true.
+ * per property. This does not occur when lean is bound to true.
  * <p/>
  * The outer &lt;dl&gt; element has the CSS class "t-beandisplay".
- *
+ * 
  * @see org.apache.tapestry5.beaneditor.DataType
  * @see BeanModel
  */
@@ -58,25 +58,29 @@ public class BeanDisplay
     private boolean lean;
 
     /**
-     * The model that identifies the parameters to be displayed, their order, and every other aspect. If not specified,
-     * a default bean model will be created from the type of the object bound to the object parameter.
+     * The model that identifies the parameters to be edited, their order, and every other aspect. If not specified, a
+     * default bean model will be created from the type of the object bound to the object parameter. The add, include,
+     * exclude and reorder
+     * parameters are <em>only</em> applied to a default model, not an explicitly provided one.
      */
     @Parameter
     @Property(write = false)
     private BeanModel model;
-
     /**
-     * A comma-separated list of property names to be retained from the {@link org.apache.tapestry5.beaneditor.BeanModel}.
+     * A comma-separated list of property names to be retained from the
+     * {@link org.apache.tapestry5.beaneditor.BeanModel} (only used
+     * when a default model is created automatically).
      * Only these properties will be retained, and the properties will also be reordered. The names are
      * case-insensitive.
      */
-    @SuppressWarnings("unused")
     @Parameter(defaultPrefix = BindingConstants.LITERAL)
     private String include;
 
     /**
-     * A comma-separated list of property names to be removed from the {@link BeanModel}. The names are
-     * case-insensitive.
+     * A comma-separated list of property names to be removed from the {@link org.apache.tapestry5.beaneditor.BeanModel}
+     * (only used
+     * when a default model is created automatically).
+     * The names are case-insensitive.
      */
     @Parameter(defaultPrefix = BindingConstants.LITERAL)
     private String exclude;
@@ -84,12 +88,21 @@ public class BeanDisplay
     /**
      * A comma-separated list of property names indicating the order in which the properties should be presented. The
      * names are case insensitive. Any properties not indicated in the list will be appended to the end of the display
-     * order.
+     * orde. Only used
+     * when a default model is created automatically.
      */
     @Parameter(defaultPrefix = BindingConstants.LITERAL)
     private String reorder;
 
     /**
+     * A comma-separated list of property names to be added to the {@link org.apache.tapestry5.beaneditor.BeanModel}
+     * (only used
+     * when a default model is created automatically).
+     */
+    @Parameter(defaultPrefix = BindingConstants.LITERAL)
+    private String add;
+
+    /**
      * Where to search for local overrides of property display blocks as block parameters. Further, the container of the
      * overrides is used as the source for overridden validation messages. This is normally the component itself, but
      * when the component is used within a BeanEditForm, it will be the BeanEditForm's block parameter that will be
@@ -99,12 +112,6 @@ public class BeanDisplay
     @Property(write = false)
     private ComponentResources overrides;
 
-    /**
-     * A comma-separated list of property names to be added to the {@link org.apache.tapestry5.beaneditor.BeanModel}.
-     */
-    @Parameter(defaultPrefix = BindingConstants.LITERAL)
-    private String add;
-
     @Inject
     private ComponentResources resources;
 
@@ -116,9 +123,12 @@ public class BeanDisplay
 
     void setupRender()
     {
-        if (model == null) model = modelSource.createDisplayModel(object.getClass(), overrides.getContainerMessages());
+        if (model == null)
+        {
+            model = modelSource.createDisplayModel(object.getClass(), overrides.getContainerMessages());
 
-        BeanModelUtils.modify(model, add, include, exclude, reorder);
+            BeanModelUtils.modify(model, add, include, exclude, reorder);
+        }
     }
 
     /**
@@ -129,7 +139,6 @@ public class BeanDisplay
         return model.get(propertyName);
     }
 
-
     public String getPropertyClass()
     {
         return lean ? null : getPropertyModel().getId();

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditForm.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditForm.java?rev=940664&r1=940663&r2=940664&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditForm.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditForm.java Mon May  3 23:05:07 2010
@@ -70,38 +70,40 @@ public class BeanEditForm implements Cli
 
     /**
      * A comma-separated list of property names to be retained from the
-     * {@link org.apache.tapestry5.beaneditor.BeanModel}.
+     * {@link org.apache.tapestry5.beaneditor.BeanModel} (only used
+     * when a default model is created automatically).
      * Only these properties will be retained, and the properties will also be reordered. The names are
      * case-insensitive.
      */
-    @SuppressWarnings("unused")
     @Parameter(defaultPrefix = BindingConstants.LITERAL)
     private String include;
 
     /**
-     * A comma-separated list of property names to be added to the {@link org.apache.tapestry5.beaneditor.BeanModel}.
-     */
-    @Parameter(defaultPrefix = BindingConstants.LITERAL)
-    private String add;
-
-    /**
      * A comma-separated list of property names to be removed from the {@link org.apache.tapestry5.beaneditor.BeanModel}
-     * .
+     * (only used
+     * when a default model is created automatically).
      * The names are case-insensitive.
      */
-    @SuppressWarnings("unused")
     @Parameter(defaultPrefix = BindingConstants.LITERAL)
     private String exclude;
 
     /**
      * A comma-separated list of property names indicating the order in which the properties should be presented. The
      * names are case insensitive. Any properties not indicated in the list will be appended to the end of the display
-     * order.
+     * orde. Only used
+     * when a default model is created automatically.
      */
-    @SuppressWarnings("unused")
     @Parameter(defaultPrefix = BindingConstants.LITERAL)
     private String reorder;
 
+    /**
+     * A comma-separated list of property names to be added to the {@link org.apache.tapestry5.beaneditor.BeanModel}
+     * (only used
+     * when a default model is created automatically).
+     */
+    @Parameter(defaultPrefix = BindingConstants.LITERAL)
+    private String add;
+
     @Component(parameters = "validationId=componentResources.id", publishParameters = "clientValidation,autofocus,zone")
     private Form form;
 
@@ -118,7 +120,8 @@ public class BeanEditForm implements Cli
 
     /**
      * The model that identifies the parameters to be edited, their order, and every other aspect. If not specified, a
-     * default bean model will be created from the type of the object bound to the object parameter.
+     * default bean model will be created from the type of the object bound to the object parameter. The add, include,
+     * exclude and reorder parameters are <em>only</em> applied to a default model, not an explicitly provided one.
      */
     @SuppressWarnings("unused")
     @Parameter
@@ -144,9 +147,9 @@ public class BeanEditForm implements Cli
             Class beanType = resources.getBoundType("object");
 
             model = beanModelSource.createEditModel(beanType, resources.getContainerMessages());
-        }
 
-        BeanModelUtils.modify(model, add, include, exclude, reorder);
+            BeanModelUtils.modify(model, add, include, exclude, reorder);
+        }
     }
 
     /**
@@ -187,7 +190,7 @@ public class BeanEditForm implements Cli
         resources.triggerEvent(EventConstants.CANCELED, null, eventCallback);
 
         // Prevent further event handlers.
-        
+
         return true;
     }
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditor.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditor.java?rev=940664&r1=940663&r2=940664&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditor.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/BeanEditor.java Mon May  3 23:05:07 2010
@@ -1,10 +1,10 @@
-// Copyright 2007, 2008 The Apache Software Foundation
+// Copyright 2007, 2008, 2010 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
+// 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,
@@ -87,7 +87,9 @@ public class BeanEditor
     private Object object;
 
     /**
-     * A comma-separated list of property names to be retained from the {@link org.apache.tapestry5.beaneditor.BeanModel}.
+     * A comma-separated list of property names to be retained from the
+     * {@link org.apache.tapestry5.beaneditor.BeanModel} (only used
+     * when a default model is created automatically).
      * Only these properties will be retained, and the properties will also be reordered. The names are
      * case-insensitive.
      */
@@ -95,7 +97,9 @@ public class BeanEditor
     private String include;
 
     /**
-     * A comma-separated list of property names to be removed from the {@link org.apache.tapestry5.beaneditor.BeanModel}.
+     * A comma-separated list of property names to be removed from the {@link org.apache.tapestry5.beaneditor.BeanModel}
+     * (only used
+     * when a default model is created automatically).
      * The names are case-insensitive.
      */
     @Parameter(defaultPrefix = BindingConstants.LITERAL)
@@ -104,21 +108,25 @@ public class BeanEditor
     /**
      * A comma-separated list of property names indicating the order in which the properties should be presented. The
      * names are case insensitive. Any properties not indicated in the list will be appended to the end of the display
-     * order.
+     * orde. Only used
+     * when a default model is created automatically.
      */
     @Parameter(defaultPrefix = BindingConstants.LITERAL)
     private String reorder;
 
     /**
-     * A comma-separated list of property names to be added to the {@link org.apache.tapestry5.beaneditor.BeanModel}.
+     * A comma-separated list of property names to be added to the {@link org.apache.tapestry5.beaneditor.BeanModel}
+     * (only used
+     * when a default model is created automatically).
      */
     @Parameter(defaultPrefix = BindingConstants.LITERAL)
     private String add;
 
-
     /**
      * The model that identifies the parameters to be edited, their order, and every other aspect. If not specified, a
-     * default bean model will be created from the type of the object bound to the object parameter.
+     * default bean model will be created from the type of the object bound to the object parameter. The add, include,
+     * exclude and reorder
+     * parameters are <em>only</em> applied to a default model, not an explicitly provided one.
      */
     @Parameter
     @Property(write = false)
@@ -183,9 +191,9 @@ public class BeanEditor
         {
             Class type = resources.getBoundType("object");
             model = modelSource.createEditModel(type, overrides.getOverrideMessages());
-        }
 
-        BeanModelUtils.modify(model, add, include, exclude, reorder);
+            BeanModelUtils.modify(model, add, include, exclude, reorder);
+        }
 
         // The only problem here is that if the bound property is backed by a persistent field, it
         // is assigned (and stored to the session, and propagated around the cluster) first,
@@ -199,15 +207,13 @@ public class BeanEditor
             }
             catch (Exception ex)
             {
-                String message = InternalMessages.failureInstantiatingObject(model.getBeanType(),
-                                                                             resources.getCompleteId(),
-                                                                             ex);
+                String message = InternalMessages.failureInstantiatingObject(model.getBeanType(), resources
+                        .getCompleteId(), ex);
                 throw new TapestryException(message, resources.getLocation(), ex);
             }
-            
-            
-            //If 'object' parameter is bound to a null-value BeanValidationContext is empty. 
-            //This prevents JSR-303 javascript validators to be rendered properly .
+
+            // If 'object' parameter is bound to a null-value BeanValidationContext is empty.
+            // This prevents JSR-303 javascript validators to be rendered properly .
             refreshBeanValidationContext();
         }
 
@@ -224,7 +230,6 @@ public class BeanEditor
             }
         };
 
-
         cachedObject = object;
 
         environment.push(BeanEditContext.class, context);
@@ -234,20 +239,20 @@ public class BeanEditor
     {
         environment.pop(BeanEditContext.class);
     }
-    
+
     private void refreshBeanValidationContext()
     {
-        if(environment.peek(BeanValidationContext.class) != null)
+        if (environment.peek(BeanValidationContext.class) != null)
         {
             environment.pop(BeanValidationContext.class);
-            
+
             environment.push(BeanValidationContext.class, new BeanValidationContextImpl(object));
         }
     }
 
     // For testing
     void inject(ComponentResources resources, PropertyOverrides overrides, BeanModelSource source,
-                Environment environment)
+            Environment environment)
     {
         this.resources = resources;
         this.overrides = overrides;

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java?rev=940664&r1=940663&r2=940664&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java Mon May  3 23:05:07 2010
@@ -1,10 +1,10 @@
-// Copyright 2007, 2008, 2009 The Apache Software Foundation
+// Copyright 2007, 2008, 2009, 2010 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
+// 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,
@@ -41,7 +41,7 @@ import java.util.List;
  * the {@link org.apache.tapestry5.grid.GridDataSource} changes between render and form submission, then there's the
  * possibility that data will be applied to the wrong server-side objects. In general, when using Grid and Form
  * together, you want to provide the Grid with a {@link org.apache.tapestry5.ValueEncoder} (via the encoder parameter).
- *
+ * 
  * @see org.apache.tapestry5.beaneditor.BeanModel
  * @see org.apache.tapestry5.services.BeanModelSource
  * @see org.apache.tapestry5.grid.GridDataSource
@@ -96,7 +96,9 @@ public class Grid implements GridModel
      * The model used to identify the properties to be presented and the order of presentation. The model may be
      * omitted, in which case a default model is generated from the first object in the data source (this implies that
      * the objects provided by the source are uniform). The model may be explicitly specified to override the default
-     * behavior, say to reorder or rename columns or add additional columns.
+     * behavior, say to reorder or rename columns or add additional columns. The add, include,
+     * exclude and reorder
+     * parameters are <em>only</em> applied to a default model, not an explicitly provided one.
      */
     @Parameter
     private BeanModel model;
@@ -116,23 +118,28 @@ public class Grid implements GridModel
 
     /**
      * A comma-seperated list of property names to be added to the {@link org.apache.tapestry5.beaneditor.BeanModel}.
-     * Cells for added columns will be blank unless a cell override is provided.
+     * Cells for added columns will be blank unless a cell override is provided. This parameter is only used
+     * when a default model is created automatically.
      */
     @Parameter(defaultPrefix = BindingConstants.LITERAL)
     private String add;
 
     /**
-     * A comma-separated list of property names to be retained from the {@link org.apache.tapestry5.beaneditor.BeanModel}.
+     * A comma-separated list of property names to be retained from the
+     * {@link org.apache.tapestry5.beaneditor.BeanModel}.
      * Only these properties will be retained, and the properties will also be reordered. The names are
-     * case-insensitive.
+     * case-insensitive. This parameter is only used
+     * when a default model is created automatically.
      */
     @SuppressWarnings("unused")
     @Parameter(defaultPrefix = BindingConstants.LITERAL)
     private String include;
 
     /**
-     * A comma-separated list of property names to be removed from the {@link org.apache.tapestry5.beaneditor.BeanModel}.
-     * The names are case-insensitive.
+     * A comma-separated list of property names to be removed from the {@link org.apache.tapestry5.beaneditor.BeanModel}
+     * .
+     * The names are case-insensitive. This parameter is only used
+     * when a default model is created automatically.
      */
     @Parameter(defaultPrefix = BindingConstants.LITERAL)
     private String exclude;
@@ -140,7 +147,8 @@ public class Grid implements GridModel
     /**
      * A comma-separated list of property names indicating the order in which the properties should be presented. The
      * names are case insensitive. Any properties not indicated in the list will be appended to the end of the display
-     * order.
+     * order. This parameter is only used
+     * when a default model is created automatically.
      */
     @Parameter(defaultPrefix = BindingConstants.LITERAL)
     private String reorder;
@@ -154,7 +162,7 @@ public class Grid implements GridModel
     private Block empty;
 
     /**
-     * CSS class for the &lt;table&gt; element.  In addition, informal parameters to the Grid are rendered in the table
+     * CSS class for the &lt;table&gt; element. In addition, informal parameters to the Grid are rendered in the table
      * element.
      */
     @Parameter(name = "class", defaultPrefix = BindingConstants.LITERAL, value = "t-data-grid")
@@ -162,8 +170,9 @@ public class Grid implements GridModel
     private String tableClass;
 
     /**
-     * If true, then the Grid will be wrapped in an element that acts like a {@link
-     * org.apache.tapestry5.corelib.components.Zone}; all the paging and sorting links will refresh the zone, repainting
+     * If true, then the Grid will be wrapped in an element that acts like a
+     * {@link org.apache.tapestry5.corelib.components.Zone}; all the paging and sorting links will refresh the zone,
+     * repainting
      * the entire grid within it, but leaving the rest of the page (outside the zone) unchanged.
      */
     @Parameter
@@ -186,7 +195,6 @@ public class Grid implements GridModel
     @Persist
     private Boolean sortAscending;
 
-
     @Inject
     private ComponentResources resources;
 
@@ -196,29 +204,17 @@ public class Grid implements GridModel
     @Environmental
     private ClientBehaviorSupport clientBehaviorSupport;
 
-    @Component(
-            parameters = {
-                    "index=inherit:columnIndex",
-                    "lean=inherit:lean",
-                    "overrides=overrides",
-                    "zone=zone" })
+    @Component(parameters =
+    { "index=inherit:columnIndex", "lean=inherit:lean", "overrides=overrides", "zone=zone" })
     private GridColumns columns;
 
-    @Component(
-            parameters = {
-                    "columnIndex=inherit:columnIndex",
-                    "rowsPerPage=rowsPerPage",
-                    "currentPage=currentPage",
-                    "row=row",
-                    "overrides=overrides" },
-            publishParameters = "rowIndex,rowClass,volatile,encoder,lean")
+    @Component(parameters =
+    { "columnIndex=inherit:columnIndex", "rowsPerPage=rowsPerPage", "currentPage=currentPage", "row=row",
+            "overrides=overrides" }, publishParameters = "rowIndex,rowClass,volatile,encoder,lean")
     private GridRows rows;
 
-    @Component(parameters = {
-            "source=dataSource",
-            "rowsPerPage=rowsPerPage",
-            "currentPage=currentPage",
-            "zone=zone" })
+    @Component(parameters =
+    { "source=dataSource", "rowsPerPage=rowsPerPage", "currentPage=currentPage", "zone=zone" })
     private GridPager pager;
 
     @Component(parameters = "to=pagerTop")
@@ -323,7 +319,6 @@ public class Grid implements GridModel
             return getSortAscending() ? ColumnSort.ASCENDING : ColumnSort.DESCENDING;
         }
 
-
         public void updateSort(String columnId)
         {
             Defense.notBlank(columnId, "columnId");
@@ -364,8 +359,8 @@ public class Grid implements GridModel
     /**
      * Returns a {@link org.apache.tapestry5.Binding} instance that attempts to identify the model from the source
      * parameter (via {@link org.apache.tapestry5.grid.GridDataSource#getRowType()}. Subclasses may override to provide
-     * a different mechanism.  The returning binding is variant (not invariant).
-     *
+     * a different mechanism. The returning binding is variant (not invariant).
+     * 
      * @see BeanModelSource#createDisplayModel(Class, org.apache.tapestry5.ioc.Messages)
      */
     protected Binding defaultModel()
@@ -382,9 +377,10 @@ public class Grid implements GridModel
 
                 if (rowType == null)
                     throw new RuntimeException(
-                            String.format(
-                                    "Unable to determine the bean type for rows from %s. You should bind the model parameter explicitly.",
-                                    gridDataSource));
+                            String
+                                    .format(
+                                            "Unable to determine the bean type for rows from %s. You should bind the model parameter explicitly.",
+                                            gridDataSource));
 
                 // Properties do not have to be read/write
 
@@ -423,7 +419,8 @@ public class Grid implements GridModel
 
     Object setupRender()
     {
-        if (formSupport != null) formSupport.store(this, SETUP_DATA_SOURCE);
+        if (formSupport != null)
+            formSupport.store(this, SETUP_DATA_SOURCE);
 
         setupDataSource();
 
@@ -443,7 +440,8 @@ public class Grid implements GridModel
 
         int availableRows = cachingSource.getAvailableRows();
 
-        if (availableRows == 0) return;
+        if (availableRows == 0)
+            return;
 
         int maxPage = ((availableRows - 1) / rowsPerPage) + 1;
 
@@ -468,7 +466,8 @@ public class Grid implements GridModel
         // Skip rendering of component (template, body, etc.) when there's nothing to display.
         // The empty placeholder will already have rendered.
 
-        if (cachingSource.getAvailableRows() == 0) return false;
+        if (cachingSource.getAvailableRows() == 0)
+            return false;
 
         if (inPlace && zone == null)
         {
@@ -561,8 +560,8 @@ public class Grid implements GridModel
     }
 
     /**
-     * Resets the Grid to inital settings; this sets the current page to one, and {@linkplain
-     * org.apache.tapestry5.grid.GridSortModel#clear() clears the sort model}.
+     * Resets the Grid to inital settings; this sets the current page to one, and
+     * {@linkplain org.apache.tapestry5.grid.GridSortModel#clear() clears the sort model}.
      */
     public void reset()
     {
@@ -573,8 +572,9 @@ public class Grid implements GridModel
     /**
      * Event handler for inplaceupdate event triggered from nested components when an Ajax update occurs. The event
      * context will carry the zone, which is recorded here, to allow the Grid and its sub-components to properly
-     * re-render themselves.  Invokes {@link org.apache.tapestry5.services.ComponentEventResultProcessor#processResultValue(Object)}
-     * passing this (the Grid component) as the content provider for the update.
+     * re-render themselves. Invokes
+     * {@link org.apache.tapestry5.services.ComponentEventResultProcessor#processResultValue(Object)} passing this (the
+     * Grid component) as the content provider for the update.
      */
     void onInPlaceUpdate(String zone) throws IOException
     {