Clover coverage report - Code Coverage for tapestry release 4.0-beta-10
Coverage timestamp: Sat Oct 8 2005 19:08:05 EDT
file stats: LOC: 90   Methods: 0
NCLOC: 10   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
IForm.java - - - -
coverage
 1    // Copyright 2004, 2005 The Apache Software Foundation
 2    //
 3    // Licensed under the Apache License, Version 2.0 (the "License");
 4    // you may not use this file except in compliance with the License.
 5    // You may obtain a copy of the License at
 6    //
 7    // http://www.apache.org/licenses/LICENSE-2.0
 8    //
 9    // Unless required by applicable law or agreed to in writing, software
 10    // distributed under the License is distributed on an "AS IS" BASIS,
 11    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12    // See the License for the specific language governing permissions and
 13    // limitations under the License.
 14   
 15    package org.apache.tapestry;
 16   
 17    import org.apache.tapestry.valid.IValidationDelegate;
 18   
 19    /**
 20    * A generic way to access a component which defines an HTML form (or, perhaps, other similar
 21    * constructs, such as a WML {@link org.apache.tapestry.wml.Go}). This interface exists so that the
 22    * {@link IRequestCycle}can invoke the {@link #rewind(IMarkupWriter, IRequestCycle)}method (which
 23    * is used to deal with a Form that uses the direct service). In release 1.0.5, more responsibility
 24    * for forms was moved here.
 25    *
 26    * @author Howard Lewis Ship
 27    * @since 1.0.2
 28    */
 29   
 30    public interface IForm extends IAction, FormBehavior
 31    {
 32   
 33    /**
 34    * Attribute name used with the request cycle; allows other components to locate the IForm.
 35    *
 36    * @since 1.0.5
 37    * @deprecated To be removed; use {@link TapestryUtils#FORM_ATTRIBUTE}instead.
 38    */
 39   
 40    public static final String ATTRIBUTE_NAME = TapestryUtils.FORM_ATTRIBUTE;
 41   
 42    /**
 43    * Invoked by the {@link IRequestCycle}to allow a form that uses the direct service, to respond
 44    * to the form submission.
 45    */
 46   
 47    public void rewind(IMarkupWriter writer, IRequestCycle cycle);
 48   
 49    /**
 50    * Returns the name of the form. The name is determined as the form component begins to render,
 51    * but is not reset (as a convienience for building client-side JavaScript event handlers). The
 52    * Form (and Go) components render this name as both the name and the id attribute (so it can be
 53    * used like
 54    * {@link org.apache.tapestry.form.IFormComponent#getClientId() a field's clientId property}.
 55    *
 56    * @since 1.0.5
 57    */
 58   
 59    public String getName();
 60   
 61    /**
 62    * Returns the validation delegate for the form. Returns null if the form does not have a
 63    * delegate.
 64    *
 65    * @since 1.0.8
 66    */
 67   
 68    public IValidationDelegate getDelegate();
 69   
 70    /**
 71    * Indicates whether or not client-side validation will be generated during render.
 72    *
 73    * @return true, if client-side validation is enabled, false otherwise
 74    * @since 4.0
 75    */
 76    public boolean isClientValidationEnabled();
 77   
 78    /**
 79    * Returns true if the form should support automatic field focus (that is, adding JavaScript to
 80    * position the cursor into the first field of the form, automatically). This requires that the
 81    * Form component be enclosed by a {@link org.apache.tapestry.html.Body} component. When a
 82    * single page contains multiple Forms, only the first Form that renders will get field focus;
 83    * by setting the Form's focus parameter to false, it is possible to control which Form gets
 84    * focus.
 85    *
 86    * @since 4.0
 87    */
 88   
 89    public boolean getFocus();
 90    }