KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > panelstack > PanelStackTag


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.panelstack;
17
18 import org.apache.myfaces.taglib.UIComponentTagBase;
19
20 import javax.faces.component.UIComponent;
21 import javax.faces.context.FacesContext;
22 import javax.servlet.jsp.JspException JavaDoc;
23
24
25 /**
26  * PanelStack tag.
27  *
28  * @author <a HREF="mailto:oliver@rossmueller.com">Oliver Rossmueller</a>
29  * @version $Revision: 1.4 $ $Date: 2005/02/18 17:19:30 $
30  * $Log: PanelStackTag.java,v $
31  * Revision 1.4 2005/02/18 17:19:30 matzew
32  * added release() to tag clazzes.
33  *
34  * Revision 1.3 2004/10/13 11:50:57 matze
35  * renamed packages to org.apache
36  *
37  * Revision 1.2 2004/09/01 18:32:55 mwessendorf
38  * Organize Imports
39  *
40  * Revision 1.1 2004/08/15 22:42:12 o_rossmueller
41  * new custom component: HtmlPanelStack
42  *
43  * Revision 1.6 2004/08/15 15:28:04 o_rossmueller
44  * new model listener handling to get modified from events which occur outside the scope of a tree request
45  *
46  * Revision 1.5 2004/07/01 21:53:06 mwessendorf
47  * ASF switch
48  *
49  * Revision 1.4 2004/05/10 01:24:51 o_rossmueller
50  * added iconClass attribute
51  *
52  * Revision 1.3 2004/05/05 00:18:57 o_rossmueller
53  * various fixes/modifications in model event handling and tree update
54  *
55  * Revision 1.2 2004/04/22 21:59:17 o_rossmueller
56  * added expandRoot attribute
57  *
58  * Revision 1.1 2004/04/22 10:20:25 manolito
59  * tree component
60  *
61  */

62 public class PanelStackTag
63         extends UIComponentTagBase
64 {
65
66     private String JavaDoc selectedPanel;
67
68     public void release() {
69         super.release();
70         selectedPanel=null;
71     }
72
73     public String JavaDoc getComponentType()
74     {
75         return "org.apache.myfaces.HtmlPanelStack";
76     }
77
78
79     public String JavaDoc getRendererType()
80     {
81         return "org.apache.myfaces.PanelStack";
82     }
83
84
85     public String JavaDoc getSelectedPanel()
86     {
87         return selectedPanel;
88     }
89
90
91     public void setSelectedPanel(String JavaDoc selectedPanel)
92     {
93         this.selectedPanel = selectedPanel;
94     }
95
96
97     public int doStartTag() throws JspException JavaDoc
98     {
99         return super.doStartTag();
100     }
101
102
103     /**
104      * Applies attributes to the tree component
105      */

106     protected void setProperties(UIComponent component)
107     {
108         super.setProperties(component);
109         FacesContext context = FacesContext.getCurrentInstance();
110
111         setStringProperty(component, "selectedPanel", selectedPanel);
112     }
113 }
114
Popular Tags