Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
FormSupport |
|
| 1.0;1 |
1 | // Copyright 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.form; | |
16 | ||
17 | import org.apache.tapestry.FormBehavior; | |
18 | import org.apache.tapestry.IForm; | |
19 | import org.apache.tapestry.IRender; | |
20 | import org.apache.tapestry.engine.ILink; | |
21 | ||
22 | /** | |
23 | * Interface for a utility object that encapsulates the majority of the | |
24 | * {@link org.apache.tapestry.form.Form}'s behavior. | |
25 | * | |
26 | * @author Howard M. Lewis Ship | |
27 | * @since 4.0 | |
28 | */ | |
29 | public interface FormSupport extends FormBehavior | |
30 | { | |
31 | ||
32 | /** | |
33 | * Invoked when the form is rendering. This should only be invoked by the {@link Form} | |
34 | * component. | |
35 | * | |
36 | * @param method | |
37 | * the HTTP method ("get" or "post") | |
38 | * @param informalParametersRenderer | |
39 | * object that will render informal parameters | |
40 | * @param link | |
41 | * The link to which the form will submit (encapsulating the URL and the query | |
42 | * parameters) | |
43 | * @param scheme | |
44 | * the desired scheme for the generated URL, typically "http" or "https". If | |
45 | * non-null, and the scheme does not match the current request's scheme, then an | |
46 | * absolute URL with the specified scheme will be generated, rather than a URI. | |
47 | * @param port | |
48 | * the desired port for the generated URL, typically "80", "443". If | |
49 | * non-null, and the port does not match the current request's port, then an | |
50 | * absolute URL with the specified port will be generated, rather than a URI. | |
51 | */ | |
52 | void render(String method, IRender informalParametersRenderer, ILink link, String scheme, Integer port); | |
53 | ||
54 | /** | |
55 | * Invoked to rewind the form, which renders the body of the form, allowing form element | |
56 | * components to pull data from the request and update page properties. This should only be | |
57 | * invoked by the {@link Form} component. | |
58 | * | |
59 | * @return a code indicating why the form was submitted: {@link FormConstants#SUBMIT_NORMAL}, | |
60 | * {@link FormConstants#SUBMIT_CANCEL} or {@link FormConstants#SUBMIT_REFRESH}. | |
61 | */ | |
62 | String rewind(); | |
63 | ||
64 | /** | |
65 | * Gets a reference to the previously stored {@link IForm}. | |
66 | * @return The form this object is managing/supporting. | |
67 | * @since 4.1 | |
68 | */ | |
69 | IForm getForm(); | |
70 | } |