KickJava   Java API By Example, From Geeks To Geeks.

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


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.UIRecentSpacesShelfItem;
25
26 /**
27  * @author Kevin Roast
28  */

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

34    public String JavaDoc getComponentType()
35    {
36       return "org.alfresco.faces.RecentSpacesShelfItem";
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       setStringBindingProperty(component, "value", this.value);
55       if (isValueReference(this.navigateActionListener))
56       {
57          MethodBinding vb = getFacesContext().getApplication().createMethodBinding(this.navigateActionListener, ACTION_CLASS_ARGS);
58          ((UIRecentSpacesShelfItem)component).setNavigateActionListener(vb);
59       }
60       else
61       {
62          throw new FacesException("Navigate Action listener method binding incorrectly specified: " + this.navigateActionListener);
63       }
64    }
65    
66    /**
67     * @see javax.servlet.jsp.tagext.Tag#release()
68     */

69    public void release()
70    {
71       super.release();
72       
73       this.value = null;
74       this.navigateActionListener = null;
75    }
76    
77    /**
78     * Set the value used to bind the recent spaces list to the component
79     *
80     * @param value the value
81     */

82    public void setValue(String JavaDoc value)
83    {
84       this.value = value;
85    }
86    
87    /**
88     * Set the navigateActionListener
89     *
90     * @param navigateActionListener the navigateActionListener
91     */

92    public void setNavigateActionListener(String JavaDoc navigateActionListener)
93    {
94       this.navigateActionListener = navigateActionListener;
95    }
96
97
98    /** the navigateActionListener */
99    private String JavaDoc navigateActionListener;
100    
101    /** the value */
102    private String JavaDoc value;
103 }
104
Popular Tags