KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > web > ui > common > tag > ActionLinkTag


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.common.tag;
18
19 import javax.faces.component.UICommand;
20 import javax.faces.component.UIComponent;
21
22 /**
23  * @author kevinr
24  */

25 public class ActionLinkTag extends HtmlComponentTag
26 {
27    /**
28     * @see javax.faces.webapp.UIComponentTag#getComponentType()
29     */

30    public String JavaDoc getComponentType()
31    {
32       return "org.alfresco.faces.ActionLink";
33    }
34
35    /**
36     * @see javax.faces.webapp.UIComponentTag#getRendererType()
37     */

38    public String JavaDoc getRendererType()
39    {
40       return "org.alfresco.faces.ActionLinkRenderer";
41    }
42    
43    /**
44     * @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
45     */

46    protected void setProperties(UIComponent component)
47    {
48       super.setProperties(component);
49       
50       setActionProperty((UICommand)component, this.action);
51       setActionListenerProperty((UICommand)component, this.actionListener);
52       setStringProperty(component, "image", this.image);
53       setBooleanProperty(component, "showLink", this.showLink);
54       setStringProperty(component, "verticalAlign", this.verticalAlign);
55       setIntProperty(component, "padding", this.padding);
56       setStringProperty(component, "href", this.href);
57       setStringProperty(component, "value", this.value);
58       setStringProperty(component, "target", this.target);
59       setStringProperty(component, "onclick", this.onclick);
60       
61       // TODO: Add image width/height properties
62
}
63
64    /**
65     * @see org.alfresco.web.ui.common.tag.HtmlComponentTag#release()
66     */

67    public void release()
68    {
69       super.release();
70       this.value = null;
71       this.action = null;
72       this.actionListener = null;
73       this.image = null;
74       this.showLink = null;
75       this.verticalAlign = null;
76       this.padding = null;
77       this.href = null;
78       this.target = null;
79       this.onclick = null;
80    }
81    
82    /**
83     * Set the value
84     *
85     * @param value the value
86     */

87    public void setValue(String JavaDoc value)
88    {
89       this.value = value;
90    }
91
92    /**
93     * Set the action
94     *
95     * @param action the action
96     */

97    public void setAction(String JavaDoc action)
98    {
99       this.action = action;
100    }
101
102    /**
103     * Set the actionListener
104     *
105     * @param actionListener the actionListener
106     */

107    public void setActionListener(String JavaDoc actionListener)
108    {
109       this.actionListener = actionListener;
110    }
111
112    /**
113     * Set the image
114     *
115     * @param image the image
116     */

117    public void setImage(String JavaDoc image)
118    {
119       this.image = image;
120    }
121
122    /**
123     * Set the showLink
124     *
125     * @param showLink the showLink
126     */

127    public void setShowLink(String JavaDoc showLink)
128    {
129       this.showLink = showLink;
130    }
131    
132    /**
133     * Set the vertical alignment value
134     *
135     * @param verticalAlign the vertical alignment value
136     */

137    public void setVerticalAlign(String JavaDoc verticalAlign)
138    {
139       this.verticalAlign = verticalAlign;
140    }
141    
142    /**
143     * Set the padding in pixels
144     *
145     * @param padding the padding in pixels
146     */

147    public void setPadding(String JavaDoc padding)
148    {
149       this.padding = padding;
150    }
151    
152    /**
153     * Set the href to use instead of a JSF action
154     *
155     * @param href the href
156     */

157    public void setHref(String JavaDoc href)
158    {
159       this.href = href;
160    }
161    
162    /**
163     * Set the target
164     *
165     * @param target the target
166     */

167    public void setTarget(String JavaDoc target)
168    {
169       this.target = target;
170    }
171
172    /**
173     * Sets the onclick handler
174     *
175     * @param onclick The onclick handler
176     */

177    public void setOnclick(String JavaDoc onclick)
178    {
179       this.onclick = onclick;
180    }
181
182    /** the target */
183    private String JavaDoc target;
184
185    /** the padding in pixels */
186    private String JavaDoc padding;
187
188    /** the vertical alignment value */
189    private String JavaDoc verticalAlign;
190    
191    /** the value (text to display) */
192    private String JavaDoc value;
193
194    /** the action */
195    private String JavaDoc action;
196
197    /** the actionListener */
198    private String JavaDoc actionListener;
199
200    /** the image */
201    private String JavaDoc image;
202
203    /** the showLink boolean */
204    private String JavaDoc showLink;
205    
206    /** the href link */
207    private String JavaDoc href;
208    
209    /** the onclick handler */
210    private String JavaDoc onclick;
211 }
212
Popular Tags