KickJava   Java API By Example, From Geeks To Geeks.

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


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 association editor tag implementations
25  *
26  * @author gavinc
27  */

28 public abstract class BaseAssociationEditorTag extends BaseComponentTag
29 {
30    private String JavaDoc associationName;
31    private String JavaDoc availableOptionsSize;
32    private String JavaDoc selectItemMsg;
33    private String JavaDoc selectItemsMsg;
34    private String JavaDoc selectedItemsMsg;
35    private String JavaDoc noSelectedItemsMsg;
36    private String JavaDoc disabled;
37    
38    /**
39     * @see javax.faces.webapp.UIComponentTag#getRendererType()
40     */

41    public String JavaDoc getRendererType()
42    {
43       return null;
44    }
45
46    /**
47     * @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
48     */

49    protected void setProperties(UIComponent component)
50    {
51       super.setProperties(component);
52       
53       setStringStaticProperty(component, "availableOptionsSize", this.availableOptionsSize);
54       setStringProperty(component, "associationName", this.associationName);
55       setStringProperty(component, "selectItemMsg", this.selectItemMsg);
56       setStringProperty(component, "selectItemsMsg", this.selectItemsMsg);
57       setStringProperty(component, "selectedItemsMsg", this.selectedItemsMsg);
58       setStringProperty(component, "noSelectedItemsMsg", this.noSelectedItemsMsg);
59       setBooleanProperty(component, "disabled", this.disabled);
60    }
61    
62    /**
63     * Sets the association name
64     *
65     * @param associationName The association name
66     */

67    public void setAssociationName(String JavaDoc associationName)
68    {
69       this.associationName = associationName;
70    }
71    
72    /**
73     * @param availableOptionsSize Sets the size of the available options size when
74     * multiple items can be selected
75     */

76    public void setAvailableOptionsSize(String JavaDoc availableOptionsSize)
77    {
78       this.availableOptionsSize = availableOptionsSize;
79    }
80    
81    /**
82     * Sets the message to display for the no selected items
83     *
84     * @param noSelectedItemsMsg The message
85     */

86    public void setNoSelectedItemsMsg(String JavaDoc noSelectedItemsMsg)
87    {
88       this.noSelectedItemsMsg = noSelectedItemsMsg;
89    }
90    
91    /**
92     * Sets the message to display for the selected items
93     *
94     * @param selectedItemsMsg The message
95     */

96    public void setSelectedItemsMsg(String JavaDoc selectedItemsMsg)
97    {
98       this.selectedItemsMsg = selectedItemsMsg;
99    }
100
101    /**
102     * Sets the message to display for inviting the user to select an item
103     *
104     * @param selectItemMsg The message
105     */

106    public void setSelectItemMsg(String JavaDoc selectItemMsg)
107    {
108       this.selectItemMsg = selectItemMsg;
109    }
110    
111    /**
112     * Sets the message to display for inviting the user to select items
113     *
114     * @param selectItemsMsg The message
115     */

116    public void setSelectItemsMsg(String JavaDoc selectItemsMsg)
117    {
118       this.selectItemsMsg = selectItemsMsg;
119    }
120    
121    /**
122     * Sets whether the component should be rendered in a disabled state
123     *
124     * @param disabled true to render the component in a disabled state
125     */

126    public void setDisabled(String JavaDoc disabled)
127    {
128       this.disabled = disabled;
129    }
130
131    /**
132     * @see javax.faces.webapp.UIComponentTag#release()
133     */

134    public void release()
135    {
136       this.associationName = null;
137       this.availableOptionsSize = null;
138       this.selectItemMsg = null;
139       this.selectItemsMsg = null;
140       this.selectedItemsMsg = null;
141       this.noSelectedItemsMsg = null;
142       this.disabled = null;
143
144       super.release();
145    }
146 }
147
Popular Tags