KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > jsfext > component > factory > basic > EditAreaFactory


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
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
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 in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 package com.sun.enterprise.tools.jsfext.component.factory.basic;
22
23 import com.sun.enterprise.tools.jsfext.component.factory.ComponentFactoryBase;
24 import com.sun.enterprise.tools.jsfext.layout.descriptor.LayoutComponent;
25 import com.sun.enterprise.tools.jsfext.component.EditArea;
26
27 import javax.faces.component.UIComponent;
28 import javax.faces.context.FacesContext;
29
30
31 /**
32  * <p> This factory is responsible for instantiating an <code>EditArea
33  * UIComponent</code>. This component is not normally used directly, it
34  * is implicitly used by the framework.</p>
35  *
36  * @author Ken Paulsen (ken.paulsen@sun.com)
37  */

38 public class EditAreaFactory extends ComponentFactoryBase {
39
40     /**
41      * <p> This is the factory method responsible for creating the
42      * <code>UIComponent</code>.</p>
43      *
44      * @param context The <code>FacesContext</code>
45      * @param descriptor The {@link LayoutComponent} descriptor associated
46      * with the requested <code>UIComponent</code>.
47      * @param parent The parent <code>UIComponent</code>
48      *
49      * @return The newly created <code>EditArea</code>.
50      */

51     public UIComponent create(FacesContext context, LayoutComponent descriptor, UIComponent parent) {
52     // Create the UIComponent
53
EditArea table = new EditArea();
54
55     // This needs to be done here (before setOptions) so that $...{...}
56
// expressions can be resolved... may want to defer these?
57
if (parent != null) {
58         addChild(context, descriptor, parent, table);
59     }
60
61     // Set all the attributes / properties
62
setOptions(context, descriptor, table);
63
64     // Return the component
65
return table;
66     }
67 }
68
Popular Tags