KickJava   Java API By Example, From Geeks To Geeks.

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


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  * Base class for all property sheet items that need to be placed on a JSP page
25  *
26  * @author gavinc
27  */

28 public abstract class PropertySheetItemTag extends BaseComponentTag
29 {
30    private String JavaDoc name;
31    private String JavaDoc displayLabel;
32    private String JavaDoc readOnly;
33    private String JavaDoc mode;
34    private String JavaDoc converter;
35
36    /**
37     * @param displayLabel Sets the display label
38     */

39    public void setDisplayLabel(String JavaDoc displayLabel)
40    {
41       this.displayLabel = displayLabel;
42    }
43
44    /**
45     * @param name Sets the name
46     */

47    public void setName(String JavaDoc name)
48    {
49       this.name = name;
50    }
51
52    /**
53     * @param readOnly Sets whether the property is read only
54     */

55    public void setReadOnly(String JavaDoc readOnly)
56    {
57       this.readOnly = readOnly;
58    }
59    
60    /**
61     * @param mode The mode, either "edit" or "view"
62     */

63    public void setMode(String JavaDoc mode)
64    {
65       this.mode = mode;
66    }
67    
68    /**
69     * @param converter Sets the id of the converter
70     */

71    public void setConverter(String JavaDoc converter)
72    {
73       this.converter = converter;
74    }
75
76    /**
77     * @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
78     */

79    protected void setProperties(UIComponent component)
80    {
81       super.setProperties(component);
82       
83       setStringProperty(component, "name", this.name);
84       setStringProperty(component, "displayLabel", this.displayLabel);
85       setStringProperty(component, "mode", this.mode);
86       setStringProperty(component, "converter", this.converter);
87       setBooleanProperty(component, "readOnly", this.readOnly);
88    }
89    
90    /**
91     * @see javax.faces.webapp.UIComponentTag#release()
92     */

93    public void release()
94    {
95       this.name = null;
96       this.displayLabel = null;
97       this.mode = null;
98       this.converter = null;
99       this.readOnly = null;
100       
101       super.release();
102    }
103 }
104
Popular Tags