KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > sortheader > HtmlCommandSortHeaderTag


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.myfaces.custom.sortheader;
17
18
19 import org.apache.myfaces.taglib.html.ext.HtmlCommandLinkTag;
20
21 import javax.faces.component.UIComponent;
22
23 /**
24  * @author Manfred Geiler (latest modification by $Author: matzew $)
25  * @version $Revision: 1.7 $ $Date: 2005/02/18 17:19:31 $
26  * $Log: HtmlCommandSortHeaderTag.java,v $
27  * Revision 1.7 2005/02/18 17:19:31 matzew
28  * added release() to tag clazzes.
29  *
30  * Revision 1.6 2004/10/13 11:50:58 matze
31  * renamed packages to org.apache
32  *
33  * Revision 1.5 2004/08/13 13:34:20 manolito
34  * HtmlCommandSortHeader now supports immediate attribute
35  *
36  * Revision 1.4 2004/07/01 21:53:10 mwessendorf
37  * ASF switch
38  *
39  * Revision 1.3 2004/04/05 11:04:54 manolito
40  * setter for renderer type removed, no more default renderer type needed
41  *
42  * Revision 1.2 2004/04/01 12:57:41 manolito
43  * additional extended component classes for user role support
44  *
45  * Revision 1.1 2004/03/31 12:15:27 manolito
46  * custom component refactoring
47  *
48  */

49 public class HtmlCommandSortHeaderTag
50         extends HtmlCommandLinkTag
51 {
52     //private static final Log log = LogFactory.getLog(HtmlCommandSortHeaderTag.class);
53

54     public String JavaDoc getComponentType()
55     {
56         return HtmlCommandSortHeader.COMPONENT_TYPE;
57     }
58
59     public String JavaDoc getRendererType()
60     {
61         return "org.apache.myfaces.SortHeader";
62     }
63
64     private String JavaDoc _columnName;
65     private String JavaDoc _arrow;
66     private boolean _immediateSet;
67     
68     public void release() {
69         super.release();
70
71         _columnName=null;
72         _arrow=null;
73         _immediateSet=true;
74
75     }
76
77     // User Role support --> already handled by HtmlPanelGroupTag
78

79     
80     protected void setProperties(UIComponent component)
81     {
82         super.setProperties(component);
83
84         setStringProperty(component, "columnName", _columnName);
85         setBooleanProperty(component, "arrow", _arrow);
86
87         if (!_immediateSet)
88         {
89             //Default of immediate is true (contrary to normal command links)
90
setBooleanProperty(component, "immediate", "true");
91         }
92     }
93
94     public void setColumnName(String JavaDoc columnName)
95     {
96         _columnName = columnName;
97     }
98
99     public void setArrow(String JavaDoc arrow)
100     {
101         _arrow = arrow;
102     }
103
104     public void setImmediate(String JavaDoc immediate)
105     {
106         super.setImmediate(immediate);
107         _immediateSet = true;
108     }
109 }
110
Popular Tags