Author: hlship
Date: Sun Feb 18 19:52:51 2007
New Revision: 509082

URL: http://svn.apache.org/viewvc?view=rev&rev=509082
Log:
Fix a bug where the default value for parameters was always evaluated as a 
"prop" expression, even when the parameter define a different default binding 
prefix.
Add documentation for all the parameters of all the builtin components.

Modified:
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/ActionLink.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Delegate.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Errors.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Form.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Grid.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridCell.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridColumns.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridPager.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridRows.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/If.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Loop.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/PageLink.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/PasswordField.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Select.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/TextArea.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/TextField.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/BindingSourceImpl.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ParameterWorker.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/BindingSource.java
    tapestry/tapestry5/tapestry-core/trunk/src/site/site.xml
    
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/InternalClassTransformationImplTest.java
    
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ParameterWorkerTest.java

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java
 Sun Feb 18 19:52:51 2007
@@ -34,6 +34,7 @@
 import org.apache.tapestry.corelib.mixins.DiscardBody;
 import org.apache.tapestry.corelib.mixins.RenderDisabled;
 import org.apache.tapestry.corelib.mixins.RenderInformals;
+import org.apache.tapestry.internal.InternalConstants;
 import org.apache.tapestry.internal.TapestryUtils;
 import org.apache.tapestry.internal.bindings.LiteralBinding;
 import org.apache.tapestry.internal.services.FormParameterLookup;
@@ -52,12 +53,19 @@
 {
     /**
      * The user presentable label for the field. If not provided, a reasonable 
label is generated
-     * from the component's id.
+     * from the component's id, first by looking for a message key named 
"id-label" (substituting
+     * the component's actual id), then by converting the actual id to a 
presentable string (for
+     * example, "userId" to "User Id").
      */
     @Parameter(defaultPrefix = "literal")
     private String _label;
 
-    @Parameter
+    /**
+     * If true, then the field will render out with a disabled attribute (to 
turn off client-side
+     * behavior). Further, a disabled field ignores any value in the request 
when the form is
+     * submitted.
+     */
+    @Parameter("false")
     private boolean _disabled;
 
     @SuppressWarnings("unused")
@@ -113,6 +121,12 @@
     /** Used a shared instance for all types of fields, for efficiency. */
     private static final ProcessSubmissionAction PROCESS_SUBMISSION_ACTION = 
new ProcessSubmissionAction();
 
+    /**
+     * The id used to generate a page-unique client-side identifier for the 
component. If a
+     * component renders multiple times, a suffix will be appended to the to 
id to ensure
+     * uniqueness. The uniqued value may be accessed via the
+     * [EMAIL PROTECTED] #getClientId() clientId property}.
+     */
     @Parameter(value = "prop:componentResources.id", defaultPrefix = "literal")
     private String _clientId;
 
@@ -233,6 +247,7 @@
         return _bindingSource.newBinding(
                 "default " + parameterName,
                 containerResources,
+                InternalConstants.PROP_BINDING_PREFIX,
                 componentId);
     }
 

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java
 Sun Feb 18 19:52:51 2007
@@ -40,12 +40,28 @@
  */
 public abstract class AbstractTextField extends AbstractField
 {
+    /**
+     * The value to be read and updated. This is not necessarilly a string, a 
translator may be
+     * provided to convert between client side and server side 
representations. If not bound, a
+     * default binding is made to a property of the container matching the 
component's id. If no
+     * such property exists, then you will see a runtime exception due to the 
unbound value
+     * parameter.
+     */
     @Parameter(required = true, principal = true)
     private Object _value;
 
-    @Parameter
+    /**
+     * The object which will perform translation between server-side and 
client-side
+     * representations. If not specified, a value will usually be generated 
based on the type of the
+     * value parameter.
+     */
+    @Parameter(required = true)
     private Translator<Object> _translate;
 
+    /**
+     * The object that will peform input validation (which occurs after 
translation). The translate
+     * binding prefix is genereally used to provide this object in a 
declarative fashion.
+     */
     @Parameter(defaultPrefix = "validate")
     @SuppressWarnings("unchecked")
     private FieldValidator<Object> _validate = NOOP_VALIDATOR;

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/ActionLink.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/ActionLink.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/ActionLink.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/ActionLink.java
 Sun Feb 18 19:52:51 2007
@@ -57,7 +57,7 @@
      * If true, then then no link element is rendered (and no informal 
parameters as well). The body
      * is, however, still rendered.
      */
-    @Parameter
+    @Parameter("false")
     private boolean _disabled;
 
     @BeginRender

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java
 Sun Feb 18 19:52:51 2007
@@ -58,10 +58,16 @@
 @SupportsInformalParameters
 public class BeanEditForm
 {
+    /** The text label for the submit button of the form, by default 
"Create/Update". */
     @Parameter(value = "message:submit-label", defaultPrefix = "literal")
     private String _submitLabel;
 
-    /** The object to be editted by the BeanEditor. */
+    /**
+     * The object to be editted by the BeanEditor. This will be read when the 
component renders and
+     * updated when the form for the component is submitted. Typically, the 
container will listen
+     * for a "prepare" event, in order to ensure that a non-null value is 
ready to be read or
+     * updated.
+     */
     @Parameter(required = true)
     private Object _object;
 
@@ -111,6 +117,11 @@
     @Inject
     private Locale _locale;
 
+    /**
+     * The model that identifies the parameters to be editted, 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.
+     */
     @Parameter
     private BeanModel _model;
 

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java
 Sun Feb 18 19:52:51 2007
@@ -26,6 +26,10 @@
 public class Checkbox extends AbstractField
 {
 
+    /**
+     * The value to be read or updated. If not bound, the Checkbox will 
attempt to edit a property
+     * of its container whose name matches the component's id.
+     */
     @Parameter(required = true)
     private boolean _value;
 

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Delegate.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Delegate.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Delegate.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Delegate.java
 Sun Feb 18 19:52:51 2007
@@ -24,6 +24,10 @@
  */
 public class Delegate
 {
+    /**
+     * Th object which will be rendered in place of the Delegate component. 
This is typically a
+     * specific component instance, or a [EMAIL PROTECTED] Block}.
+     */
     @Parameter(required = true)
     private Object _to;
 

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Errors.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Errors.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Errors.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Errors.java
 Sun Feb 18 19:52:51 2007
@@ -21,13 +21,20 @@
 import org.apache.tapestry.internal.InternalConstants;
 
 /**
- * Standard validation error presenter. Must be enclosed by a [EMAIL 
PROTECTED] Form} component.
+ * Standard validation error presenter. Must be enclosed by a [EMAIL 
PROTECTED] Form} component. If errors are
+ * present, renders a div element around a banner message and around an 
unnumbered list of error
+ * messages.
  */
 public class Errors
 {
+    /**
+     * The banner message displayed above the errors. The default value is 
"You must correct the
+     * following errors before you may continue.".
+     */
     @Parameter("message:default-banner")
     private String _banner;
 
+    /** The CSS class for the div element rendered by the component. The 
default value is "t-error". */
     @Parameter
     private String _class = InternalConstants.TAPESTRY_ERROR_CLASS;
 

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Form.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Form.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Form.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Form.java
 Sun Feb 18 19:52:51 2007
@@ -113,6 +113,13 @@
     @Parameter
     private List<?> _context;
 
+    /**
+     * The object which will record user input and validation errors. The 
object must be persistent
+     * between requests (since the form submission and validation occurs in an 
component event
+     * request and the subsequent render occurs in a render request). The 
default is a persistent
+     * property of the Form component and this is sufficient for nearly all 
purposes (except when a
+     * Form is rendered inside a loop).
+     */
     @Parameter("defaultTracker")
     private ValidationTracker _tracker;
 

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Grid.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Grid.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Grid.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Grid.java
 Sun Feb 18 19:52:51 2007
@@ -35,19 +35,35 @@
  * A grid presents tabular data. It is a composite component, created in terms 
of several
  * sub-components. The sub-components are statically wired to the Grid, as it 
provides access to the
  * data and other models that they need.
+ * 
+ * @see BeanModel
+ * @see BeanModelSource
  */
 @SupportsInformalParameters
 public class Grid implements GridModelProvider
 {
+    /**
+     * The source of data for the Grid to display. This will usually be a List 
or array but can also
+     * be an explicit [EMAIL PROTECTED] GridDataSource}. For Lists and Arrays, 
a GridDataSource is created
+     * automatically as a wrapper around the underlying List.
+     */
     @Parameter(required = true)
     private Object _source;
 
-    @Parameter
-    private int _rowsPerPage = 25;
-
-    /** Literal strings will be coerced into a position value. */
-    @Parameter(defaultPrefix = "literal")
-    private GridPagerPosition _pagerPosition = GridPagerPosition.BOTTOM;
+    /**
+     * The number of rows of data displayed on each page. If there are more 
rows than will fit, the
+     * Grid will divide up the rows into "pages" and (normally) provide a 
pager to allow the user to
+     * navigate within the overall result set.
+     */
+    @Parameter("25")
+    private int _rowsPerPage;
+
+    /**
+     * Defines where the pager (used to navigate within the "pages" of 
results) should be displayed:
+     * "top", "bottom", "both" or "none".
+     */
+    @Parameter(value = "bottom", defaultPrefix = "literal")
+    private GridPagerPosition _pagerPosition;
 
     @Persist
     private int _currentPage = 1;
@@ -58,12 +74,30 @@
     @Persist
     private boolean _sortAscending = true;
 
+    /**
+     * Used to store the current object being rendered (for the current row). 
This is used when
+     * parameter blocks are provided to override the default cell renderer for 
a particular column
+     * ... the components within the block can use the property bound to the 
row parameter to know
+     * what they should render.
+     */
     @Parameter
     private Object _row;
 
+    /**
+     * 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.
+     */
     @Parameter
     private BeanModel _model;
 
+    /**
+     * A Block to render instead of the table (and pager, etc.) when the 
source is empty. The
+     * default is simply the text "There is no data to display". This 
parameter is used to customize
+     * that message, possibly including components to allow the user to create 
new objects.
+     */
     @Parameter(value = "block:empty")
     private Block _empty;
 
@@ -80,6 +114,11 @@
 
     private GridDataSource _dataSource;
 
+    /**
+     * The CSS class for the tr element for each data row. This can be used to 
highlight particular
+     * rows, or cycle between CSS values (for the "zebra effect"). If null or 
not bound, then no
+     * particular CSS class value is used.
+     */
     @Parameter(cache = false)
     private String _rowClass;
 

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridCell.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridCell.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridCell.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridCell.java
 Sun Feb 18 19:52:51 2007
@@ -22,16 +22,27 @@
 import org.apache.tapestry.beaneditor.PropertyModel;
 import org.apache.tapestry.internal.TapestryUtils;
 
+/**
+ * Part of [EMAIL PROTECTED] Grid} that renders a single data cell. GridCell 
is used inside a pair of loops;
+ * the outer loop for each row, the inner loop for each property of the row.
+ */
 public class GridCell
 {
     /** Model for property displayed by the cell. */
     @Parameter(required = true)
     private PropertyModel _model;
 
-    /** Resources used to search for overrides. */
+    /**
+     * Resources used to search for block parameter overrides (this is 
normally the enclosing Grid
+     * component's resources).
+     */
     @Parameter(required = true)
     private ComponentResources _resources;
 
+    /**
+     * Identifies the object being rendered. The GridCell will extract a 
property from the row and
+     * render its value (or delegate to a [EMAIL PROTECTED] Block} that will 
do so).
+     */
     @Parameter(required = true)
     private Object _row;
 

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridColumns.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridColumns.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridColumns.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridColumns.java
 Sun Feb 18 19:52:51 2007
@@ -31,14 +31,23 @@
  */
 public class GridColumns
 {
-    @Parameter(value = "componentResources.container", required = true)
+    /**
+     * The object that provides access to bean and data models.
+     */
+    @Parameter(required = true)
     private GridModelProvider _dataProvider;
 
     private PropertyModel _columnModel;
 
+    /**
+     * The column which is currently being sorted. This value is the column's
+     * [EMAIL PROTECTED] PropertyModel#getId() id}, not its [EMAIL PROTECTED] 
PropertyModel#getPropertyName() name}.
+     * This parameter may be null, in which case no column is being used for 
sorting.
+     */
     @Parameter(required = true)
     private String _sortColumnId;
 
+    /** If true, then the sort is ascending (A - Z), if false the descending 
(Z - A). */
     @Parameter(required = true)
     private boolean _sortAscending;
 

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridPager.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridPager.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridPager.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridPager.java
 Sun Feb 18 19:52:51 2007
@@ -23,19 +23,33 @@
 import org.apache.tapestry.grid.GridDataSource;
 import org.apache.tapestry.ioc.Messages;
 
+/**
+ * Generates a series of links used to jump to a particular page index within 
the overall data set.
+ */
 public class GridPager
 {
+    /**
+     * The source of the data displayed by the grid (this is used to determine
+     * [EMAIL PROTECTED] GridDataSource#getAvailableRows() how many rows are 
available}, which in turn
+     * determines the page count).
+     */
     @Parameter(required = true)
     private GridDataSource _source;
 
+    /** The number of rows displayed per page. */
     @Parameter(required = true)
     private int _rowsPerPage;
 
+    /** The current page number (indexed from 1). */
     @Parameter(required = true)
     private int _currentPage;
 
-    /** Number of pages before and after the current page in the range. */
-    private int _range = 5;
+    /**
+     * Number of pages before and after the current page in the range. The 
pager always displays
+     * links for 2 * range + 1 pages, unless that's more than the total number 
of available pages.
+     */
+    @Parameter("5")
+    private int _range;
 
     private int _lastIndex;
 

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridRows.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridRows.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridRows.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/GridRows.java
 Sun Feb 18 19:52:51 2007
@@ -21,6 +21,9 @@
 import org.apache.tapestry.grid.GridDataSource;
 import org.apache.tapestry.grid.GridModelProvider;
 
+/**
+ * Renders out a series of rows within the table.
+ */
 public class GridRows
 {
     /**
@@ -30,15 +33,22 @@
     @Parameter(cache = false)
     private String _rowClass;
 
+    /** Object that provides access to the bean and data models used to render 
the Grid. */
     @Parameter(required = true)
     private GridModelProvider _provider;
 
+    /** Number of rows displayed on each page. Long result sets are split 
across multiple pages. */
     @Parameter(required = true)
     private int _rowsPerPage;
 
+    /** The current page number within the available pages (indexed from 1). */
     @Parameter(required = true)
     private int _currentPage;
 
+    /**
+     * The current row being rendered, this is primarily an output parameter 
used to allow the Grid,
+     * and the Grid's container, to know what object is being rendered.
+     */
     @Parameter(required = true)
     private Object _row;
 

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/If.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/If.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/If.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/If.java
 Sun Feb 18 19:52:51 2007
@@ -22,9 +22,14 @@
  */
 public class If
 {
+    /** If true, then the body of the If component is rendered. If false, the 
body is omitted. */
     @Parameter(required = true)
     private boolean _test;
 
+    /**
+     * An alternate [EMAIL PROTECTED] Block} to render if the test parameter 
is false. The default, null, means
+     * render nothing in that situation.
+     */
     @Parameter
     private Block _else;
 

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Loop.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Loop.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Loop.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Loop.java
 Sun Feb 18 19:52:51 2007
@@ -185,6 +185,10 @@
     @Environmental(false)
     private FormSupport _formSupport;
 
+    /**
+     * The element to render. If not null, then the loop will render the 
indicated element around
+     * its body (on each pass through the loop). The default is derived from 
the component template.
+     */
     @Parameter(value = "prop:componentResources.elementName", defaultPrefix = 
"literal")
     private String _elementName;
 

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/PageLink.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/PageLink.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/PageLink.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/PageLink.java
 Sun Feb 18 19:52:51 2007
@@ -29,6 +29,7 @@
  */
 public class PageLink
 {
+    /** The name of the page to link to. */
     @Parameter(required = true, defaultPrefix = "literal")
     private String _page;
 

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/PasswordField.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/PasswordField.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/PasswordField.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/PasswordField.java
 Sun Feb 18 19:52:51 2007
@@ -18,8 +18,8 @@
 import org.apache.tapestry.corelib.base.AbstractTextField;
 
 /**
- * A version of [EMAIL PROTECTED] TextField}, but written out as a &lt;input 
type="password"&gt;. Further, the
- * output value for a PasswordField is always blank.
+ * A version of [EMAIL PROTECTED] TextField}, but rendered out as an &lt;input 
type="password"&gt; element.
+ * Further, the output value for a PasswordField is always blank.
  */
 public class PasswordField extends AbstractTextField
 {

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Select.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Select.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Select.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Select.java
 Sun Feb 18 19:52:51 2007
@@ -45,6 +45,7 @@
  */
 public final class Select extends AbstractField
 {
+    /** The value to read or update. */
     @Parameter(required = true, principal = true)
     private Object _value;
 
@@ -71,9 +72,14 @@
 
     // Maybe this should default to property "<componentId>Model"?
 
+    /**
+     * The model used to identify the option groups and options to be 
presented to the user. This
+     * can be generated automatically for Enum types.
+     */
     @Parameter(required = true)
     private SelectModel _model;
 
+    /** Performs input validation on the value supplied by the user in the 
form submission. */
     @Parameter(defaultPrefix = "validate")
     @SuppressWarnings("unchecked")
     private FieldValidator<Object> _validate = NOOP_VALIDATOR;

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/TextArea.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/TextArea.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/TextArea.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/TextArea.java
 Sun Feb 18 19:52:51 2007
@@ -19,8 +19,8 @@
 import org.apache.tapestry.corelib.base.AbstractTextField;
 
 /**
- * TextArea component corresponds to a &lt;textarea&gt;. The value parameter 
is almost always bound
- * to a string, but this is not an absolute requirement.
+ * TextArea component corresponds to a &lt;textarea&gt; element. The value 
parameter is almost
+ * always bound to a string, but this is not an absolute requirement.
  */
 public final class TextArea extends AbstractTextField
 {

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/TextField.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/TextField.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/TextField.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/TextField.java
 Sun Feb 18 19:52:51 2007
@@ -18,7 +18,7 @@
 import org.apache.tapestry.corelib.base.AbstractTextField;
 
 /**
- * TextField component corresponds to &lt;input type="text"&gt;. The value 
parameter will be
+ * TextField component corresponds to &lt;input type="text"&gt; element. The 
value parameter will be
  * editted. TextField is generally used with string values, but other values 
are acceptible, as long
  * as they can be freely converted back and forth to strings.
  */

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/BindingSourceImpl.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/BindingSourceImpl.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/BindingSourceImpl.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/BindingSourceImpl.java
 Sun Feb 18 19:52:51 2007
@@ -21,7 +21,6 @@
 
 import org.apache.tapestry.Binding;
 import org.apache.tapestry.ComponentResources;
-import org.apache.tapestry.internal.InternalConstants;
 import org.apache.tapestry.ioc.Location;
 import org.apache.tapestry.ioc.internal.util.TapestryException;
 import org.apache.tapestry.services.BindingFactory;
@@ -36,15 +35,10 @@
         _factories = factories;
     }
 
-    public Binding newBinding(String description, ComponentResources 
container, String expression)
+    public Binding newBinding(String description, ComponentResources container,
+            String defaultPrefix, String expression)
     {
-        return newBinding(
-                description,
-                container,
-                container,
-                InternalConstants.PROP_BINDING_PREFIX,
-                expression,
-                null);
+        return newBinding(description, container, container, defaultPrefix, 
expression, null);
     }
 
     public Binding newBinding(String description, ComponentResources container,

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ParameterWorker.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ParameterWorker.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ParameterWorker.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ParameterWorker.java
 Sun Feb 18 19:52:51 2007
@@ -99,6 +99,7 @@
 
         String invariantFieldName = addParameterSetup(
                 name,
+                annotation.defaultPrefix(),
                 annotation.value(),
                 parameterName,
                 cachedFieldName,
@@ -132,9 +133,9 @@
     /**
      * Returns the name of a field that stores whether the parameter binding 
is invariant.
      */
-    private String addParameterSetup(String fieldName, String defaultBinding, 
String parameterName,
-            String cachedFieldName, boolean cache, String fieldType, String 
resourcesFieldName,
-            ClassTransformation transformation)
+    private String addParameterSetup(String fieldName, String defaultPrefix, 
String defaultBinding,
+            String parameterName, String cachedFieldName, boolean cache, 
String fieldType,
+            String resourcesFieldName, ClassTransformation transformation)
     {
         String defaultFieldName = transformation.addField(Modifier.PRIVATE, 
fieldType, fieldName
                 + "_default");
@@ -147,6 +148,7 @@
 
         addDefaultBindingSetup(
                 parameterName,
+                defaultPrefix,
                 defaultBinding,
                 resourcesFieldName,
                 transformation,
@@ -189,8 +191,9 @@
         return invariantFieldName;
     }
 
-    private void addDefaultBindingSetup(String parameterName, String 
defaultBinding,
-            String resourcesFieldName, ClassTransformation transformation, 
BodyBuilder builder)
+    private void addDefaultBindingSetup(String parameterName, String 
defaultPrefix,
+            String defaultBinding, String resourcesFieldName, 
ClassTransformation transformation,
+            BodyBuilder builder)
     {
         if (InternalUtils.isNonBlank(defaultBinding))
         {
@@ -201,12 +204,14 @@
                     "bindingSource",
                     _bindingSource);
 
-            builder.addln(
-                    "  %s.bindParameter(\"%s\", %s.newBinding(\"default 
%2$s\", %1$s, \"%s\"));",
-                    resourcesFieldName,
-                    parameterName,
-                    bindingFactoryFieldName,
-                    defaultBinding);
+            builder
+                    .addln(
+                            "  %s.bindParameter(\"%s\", 
%s.newBinding(\"default %2$s\", %1$s, \"%s\", \"%s\"));",
+                            resourcesFieldName,
+                            parameterName,
+                            bindingFactoryFieldName,
+                            defaultPrefix,
+                            defaultBinding);
 
             return;
 

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/BindingSource.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/BindingSource.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/BindingSource.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/BindingSource.java
 Sun Feb 18 19:52:51 2007
@@ -63,9 +63,12 @@
      *            typically, the parent of the component. This value will be 
used as the container
      *            <em>and</em> the component, so whatever type of expression 
is evaluated, will be
      *            evaulated in terms of this component
+     * @param defaultPrefix
+     *            the default prefix used when the expression itself does not 
have a prefix
      * @param expression
      *            the binding
      * @return a binding
      */
-    Binding newBinding(String description, ComponentResources container, 
String expression);
+    Binding newBinding(String description, ComponentResources container, 
String defaultPrefix,
+            String expression);
 }

Modified: tapestry/tapestry5/tapestry-core/trunk/src/site/site.xml
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/site.xml?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/site.xml (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/site.xml Sun Feb 18 
19:52:51 2007
@@ -52,6 +52,7 @@
  -->
         <menu name="Tapestry Core">
             <item name="Introduction" href="/index.html"/>
+            <item name="Component Reference" href="component-parameters.html"/>
             <item name="Upgrade from Tapestry 4" href="/upgrade.html"/>
             <item name="Download" 
href="http://tapestry.apache.org/download.html"/>
         </menu> 

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/InternalClassTransformationImplTest.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/InternalClassTransformationImplTest.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/InternalClassTransformationImplTest.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/InternalClassTransformationImplTest.java
 Sun Feb 18 19:52:51 2007
@@ -712,8 +712,6 @@
     @Test
     public void removed_fields_should_not_show_up_as_unclaimed() throws 
Exception
     {
-        InternalComponentResources resources = newInternalComponentResources();
-
         Log log = newLog();
 
         replay();

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ParameterWorkerTest.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ParameterWorkerTest.java?view=diff&rev=509082&r1=509081&r2=509082
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ParameterWorkerTest.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/ParameterWorkerTest.java
 Sun Feb 18 19:52:51 2007
@@ -1,4 +1,4 @@
-// Copyright 2006 The Apache Software Foundation
+// Copyright 2006, 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.
@@ -472,8 +472,12 @@
             {
                 train_isBound(resources, "value", false);
 
-                expect(source.newBinding("default value", resources, 
"literal:greeting"))
-                        .andReturn(binding);
+                expect(
+                        source.newBinding(
+                                "default value",
+                                resources,
+                                InternalConstants.PROP_BINDING_PREFIX,
+                                "literal:greeting")).andReturn(binding);
 
                 resources.bindParameter("value", binding);
 


Reply via email to