|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
IFormComponent.java | - | - | - | - |
|
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.form;
|
|
16 |
|
|
17 |
import org.apache.tapestry.IComponent;
|
|
18 |
import org.apache.tapestry.IForm;
|
|
19 |
|
|
20 |
/**
|
|
21 |
* A common interface implemented by all form components (components that
|
|
22 |
* create interactive elements in the rendered page).
|
|
23 |
*
|
|
24 |
* @author Howard Lewis Ship
|
|
25 |
**/
|
|
26 |
|
|
27 |
public interface IFormComponent extends IComponent |
|
28 |
{ |
|
29 |
/**
|
|
30 |
* Returns the {@link org.apache.tapestry.IForm} which contains the component,
|
|
31 |
* or null if the component is not contained by a form,
|
|
32 |
* of if the containing Form is not currently renderring.
|
|
33 |
*
|
|
34 |
**/
|
|
35 |
|
|
36 |
public IForm getForm();
|
|
37 |
|
|
38 |
/**
|
|
39 |
* Returns the name of the component, which is automatically generated
|
|
40 |
* during renderring.
|
|
41 |
*
|
|
42 |
* <p>This value is set inside the component's render method and is
|
|
43 |
* <em>not</em> cleared. If the component is inside a {@link org.apache.tapestry.components.Foreach}, the
|
|
44 |
* value returned is the most recent name generated for the component.
|
|
45 |
*
|
|
46 |
* <p>This property is made available to facilitate writing JavaScript that
|
|
47 |
* allows components (in the client web browser) to interact.
|
|
48 |
*
|
|
49 |
* <p>In practice, a {@link org.apache.tapestry.html.Script} component
|
|
50 |
* works with the {@link org.apache.tapestry.html.Body} component to get the
|
|
51 |
* JavaScript code inserted and referenced.
|
|
52 |
*
|
|
53 |
**/
|
|
54 |
|
|
55 |
public String getName();
|
|
56 |
|
|
57 |
/**
|
|
58 |
* Invoked by {@link IForm#getElementId(IFormComponent)} when a name is created
|
|
59 |
* for a form component.
|
|
60 |
*
|
|
61 |
* @since 3.0
|
|
62 |
*
|
|
63 |
**/
|
|
64 |
|
|
65 |
public void setName(String name); |
|
66 |
|
|
67 |
/**
|
|
68 |
* May be implemented to return a user-presentable, localized name for the component,
|
|
69 |
* which is used in labels or error messages. Most components simply return null.
|
|
70 |
*
|
|
71 |
* @since 1.0.9
|
|
72 |
*
|
|
73 |
**/
|
|
74 |
|
|
75 |
public String getDisplayName();
|
|
76 |
|
|
77 |
/**
|
|
78 |
* Returns true if the component is disabled. This is important when the containing
|
|
79 |
* form is submitted, since disabled parameters do not update their bindings.
|
|
80 |
*
|
|
81 |
* @since 2.2
|
|
82 |
*
|
|
83 |
**/
|
|
84 |
|
|
85 |
public boolean isDisabled(); |
|
86 |
} |
|