KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > web > ui > repo > tag > property > PropertyTag


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.web.ui.repo.tag.property;
18
19 import javax.faces.component.UIComponent;
20
21 import org.alfresco.web.ui.common.tag.BaseComponentTag;
22
23 /**
24  * @author gavinc
25  */

26 public class PropertyTag extends BaseComponentTag
27 {
28    private String JavaDoc name;
29    private String JavaDoc displayLabel;
30    private String JavaDoc readOnly;
31    private String JavaDoc mode;
32    private String JavaDoc converter;
33    
34    /**
35     * @see javax.faces.webapp.UIComponentTag#getRendererType()
36     */

37    public String JavaDoc getRendererType()
38    {
39       return "org.alfresco.faces.PropertyRenderer";
40    }
41    
42    /**
43     * @see javax.faces.webapp.UIComponentTag#getComponentType()
44     */

45    public String JavaDoc getComponentType()
46    {
47       return "org.alfresco.faces.Property";
48    }
49
50    /**
51     * @param displayLabel Sets the display label
52     */

53    public void setDisplayLabel(String JavaDoc displayLabel)
54    {
55       this.displayLabel = displayLabel;
56    }
57
58    /**
59     * @param name Sets the name
60     */

61    public void setName(String JavaDoc name)
62    {
63       this.name = name;
64    }
65
66    /**
67     * @param readOnly Sets whether the property is read only
68     */

69    public void setReadOnly(String JavaDoc readOnly)
70    {
71       this.readOnly = readOnly;
72    }
73    
74    /**
75     * @param mode The mode, either "edit" or "view"
76     */

77    public void setMode(String JavaDoc mode)
78    {
79       this.mode = mode;
80    }
81    
82    /**
83     * @param converter Sets the id of the converter
84     */

85    public void setConverter(String JavaDoc converter)
86    {
87       this.converter = converter;
88    }
89
90    /**
91     * @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
92     */

93    protected void setProperties(UIComponent component)
94    {
95       super.setProperties(component);
96       
97       setStringProperty(component, "name", this.name);
98       setStringProperty(component, "displayLabel", this.displayLabel);
99       setStringProperty(component, "mode", this.mode);
100       setStringProperty(component, "converter", this.converter);
101       setBooleanProperty(component, "readOnly", this.readOnly);
102    }
103    
104    /**
105     * @see javax.faces.webapp.UIComponentTag#release()
106     */

107    public void release()
108    {
109       this.name = null;
110       this.displayLabel = null;
111       this.mode = null;
112       this.converter = null;
113       this.readOnly = null;
114       
115       super.release();
116    }
117 }
118
Popular Tags