KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > web > ui > repo > tag > shelf > ShelfTag


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.shelf;
18
19 import javax.faces.FacesException;
20 import javax.faces.component.UIComponent;
21 import javax.faces.el.MethodBinding;
22
23 import org.alfresco.web.ui.common.tag.BaseComponentTag;
24 import org.alfresco.web.ui.repo.component.shelf.UIShelf;
25
26 /**
27  * @author Kevin Roast
28  */

29 public class ShelfTag extends BaseComponentTag
30 {
31    /**
32     * @see javax.faces.webapp.UIComponentTag#getComponentType()
33     */

34    public String JavaDoc getComponentType()
35    {
36       return "org.alfresco.faces.Shelf";
37    }
38
39    /**
40     * @see javax.faces.webapp.UIComponentTag#getRendererType()
41     */

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

51    protected void setProperties(UIComponent component)
52    {
53       super.setProperties(component);
54       
55       setStringProperty(component, "groupPanel", this.groupPanel);
56       setStringProperty(component, "groupBgcolor", this.groupBgcolor);
57       setStringProperty(component, "selectedGroupPanel", this.selectedGroupPanel);
58       setStringProperty(component, "selectedGroupBgcolor", this.selectedGroupBgcolor);
59       setStringProperty(component, "innerGroupPanel", this.innerGroupPanel);
60       setStringProperty(component, "innerGroupBgcolor", this.innerGroupBgcolor);
61       if (this.groupExpandedActionListener != null)
62       {
63          if (isValueReference(this.groupExpandedActionListener))
64          {
65             MethodBinding vb = getFacesContext().getApplication().createMethodBinding(this.groupExpandedActionListener, ACTION_CLASS_ARGS);
66             ((UIShelf)component).setGroupExpandedActionListener(vb);
67          }
68          else
69          {
70             throw new FacesException("Shelf Group Expanded Action listener method binding incorrectly specified: " + this.groupExpandedActionListener);
71          }
72       }
73    }
74    
75    /**
76     * @see org.alfresco.web.ui.common.tag.HtmlComponentTag#release()
77     */

78    public void release()
79    {
80       super.release();
81       
82       this.groupPanel = null;
83       this.groupBgcolor = null;
84       this.selectedGroupPanel = null;
85       this.selectedGroupBgcolor = null;
86       this.innerGroupPanel = null;
87       this.innerGroupBgcolor = null;
88       this.groupExpandedActionListener = null;
89    }
90    
91    /**
92     * Set the groupPanel
93     *
94     * @param groupPanel the groupPanel
95     */

96    public void setGroupPanel(String JavaDoc groupPanel)
97    {
98       this.groupPanel = groupPanel;
99    }
100
101    /**
102     * Set the groupBgcolor
103     *
104     * @param groupBgcolor the groupBgcolor
105     */

106    public void setGroupBgcolor(String JavaDoc groupBgcolor)
107    {
108       this.groupBgcolor = groupBgcolor;
109    }
110
111    /**
112     * Set the selectedGroupPanel
113     *
114     * @param selectedGroupPanel the selectedGroupPanel
115     */

116    public void setSelectedGroupPanel(String JavaDoc selectedGroupPanel)
117    {
118       this.selectedGroupPanel = selectedGroupPanel;
119    }
120
121    /**
122     * Set the selectedGroupBgcolor
123     *
124     * @param selectedGroupBgcolor the selectedGroupBgcolor
125     */

126    public void setSelectedGroupBgcolor(String JavaDoc selectedGroupBgcolor)
127    {
128       this.selectedGroupBgcolor = selectedGroupBgcolor;
129    }
130
131    /**
132     * Set the innerGroupPanel
133     *
134     * @param innerGroupPanel the innerGroupPanel
135     */

136    public void setInnerGroupPanel(String JavaDoc innerGroupPanel)
137    {
138       this.innerGroupPanel = innerGroupPanel;
139    }
140
141    /**
142     * Set the innerGroupBgcolor
143     *
144     * @param innerGroupBgcolor the innerGroupBgcolor
145     */

146    public void setInnerGroupBgcolor(String JavaDoc innerGroupBgcolor)
147    {
148       this.innerGroupBgcolor = innerGroupBgcolor;
149    }
150    
151    /**
152     * Set the groupExpandedActionListener
153     *
154     * @param groupExpandedActionListener the groupExpandedActionListener
155     */

156    public void setGroupExpandedActionListener(String JavaDoc groupExpandedActionListener)
157    {
158       this.groupExpandedActionListener = groupExpandedActionListener;
159    }
160
161
162    /** the groupExpandedActionListener */
163    private String JavaDoc groupExpandedActionListener;
164
165    /** the groupPanel */
166    private String JavaDoc groupPanel;
167
168    /** the groupBgcolor */
169    private String JavaDoc groupBgcolor;
170
171    /** the selectedGroupPanel */
172    private String JavaDoc selectedGroupPanel;
173
174    /** the selectedGroupBgcolor */
175    private String JavaDoc selectedGroupBgcolor;
176
177    /** the innerGroupPanel */
178    private String JavaDoc innerGroupPanel;
179
180    /** the innerGroupBgcolor */
181    private String JavaDoc innerGroupBgcolor;
182 }
183
Popular Tags