KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > jsfext > component > TemplateComponent


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.enterprise.tools.jsfext.component;
24
25 import com.sun.enterprise.tools.jsfext.layout.descriptor.LayoutDefinition;
26
27 import javax.faces.component.UIComponent;
28 import javax.faces.context.FacesContext;
29
30
31 /**
32  * <p> This interface defines additional methods in addition to those defined
33  * by UIComponent that are needed to work with a TemplateRenderer.</p>
34  *
35  * <p> JSF did not define an interface for UIComponent, so I cannot extend an
36  * interface here. This means that casting is needed to use UIComponent
37  * features from a TemplateComponent.</p>
38  *
39  * <p> If you need to have a <code>NamingContainer</code>, do not forget to
40  * implement that interface in addition to this interface.</p>
41  *
42  * @author Ken Paulsen (ken.paulsen@sun.com)
43  */

44 public interface TemplateComponent extends ChildManager {
45
46     /**
47      * This method will find the request child UIComponent by id. If it is
48      * not found, it will attempt to create it if it can find a LayoutElement
49      * describing it.
50      *
51      * @param context The FacesContext
52      * @param id The UIComponent id to search for
53      *
54      * @return The requested UIComponent
55      */

56     public UIComponent getChild(FacesContext context, String JavaDoc id);
57
58     /**
59      * This method returns the LayoutDefinition associated with this component.
60      *
61      * @param context The FacesContext
62      *
63      * @return LayoutDefinition associated with this component.
64      */

65     public LayoutDefinition getLayoutDefinition(FacesContext context);
66
67     /**
68      * This method returns the LayoutDefinitionKey for this component.
69      *
70      * @return key The key to use in the LayoutDefinitionManager
71      */

72     public String JavaDoc getLayoutDefinitionKey();
73
74     /**
75      * This method sets the LayoutDefinition key for this component.
76      *
77      * @param key The key to use in the LayoutDefinitionManager
78      */

79     public void setLayoutDefinitionKey(String JavaDoc key);
80 }
81
Popular Tags