KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > navmenu > NavigationMenuItem


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.navmenu;
17
18 import javax.faces.model.SelectItem;
19
20 /**
21  * @author Thomas Spiegl (latest modification by $Author: oros $)
22  * @version $Revision: 1.6 $ $Date: 2004/12/13 23:14:38 $
23  * $Log: NavigationMenuItem.java,v $
24  * Revision 1.6 2004/12/13 23:14:38 oros
25  * fix #1044663: handle enabledOnUserRole/visibleOnUserRole, disabled menu items are rendered with null actions
26  *
27  * Revision 1.5 2004/10/13 11:50:57 matze
28  * renamed packages to org.apache
29  *
30  * Revision 1.4 2004/07/05 08:32:41 royalts
31  * changed constructor signature
32  *
33  * Revision 1.3 2004/07/05 08:28:25 royalts
34  * added example for <x:navigationMenuItems>
35  *
36  * Revision 1.2 2004/07/01 21:53:07 mwessendorf
37  * ASF switch
38  *
39  * Revision 1.1 2004/06/23 13:44:31 royalts
40  * no message
41  *
42  */

43 public class NavigationMenuItem
44     extends SelectItem
45 {
46     private String JavaDoc _icon;
47     private String JavaDoc _action;
48     boolean _split;
49     private boolean rendered = true;
50     private NavigationMenuItem[] _navigationMenuItems = null;
51
52     public NavigationMenuItem(String JavaDoc label, String JavaDoc action, String JavaDoc icon, boolean split)
53     {
54         super(label, label);
55         _action = action;
56         _icon = icon;
57         _split = split;
58     }
59
60     public NavigationMenuItem(Object JavaDoc value,
61                               String JavaDoc label,
62                               String JavaDoc description,
63                               boolean disabled,
64                               String JavaDoc action,
65                               String JavaDoc icon,
66                               boolean split)
67     {
68         super(value, label, description, disabled);
69         _action = action;
70         _icon = icon;
71         _split = split;
72     }
73
74     public NavigationMenuItem(Object JavaDoc value,
75                               String JavaDoc label,
76                               String JavaDoc description,
77                               boolean disabled,
78                               boolean rendered,
79                               String JavaDoc action,
80                               String JavaDoc icon,
81                               boolean split)
82     {
83         this(value, label, description, disabled, action, icon, split);
84         this.rendered = rendered;
85     }
86
87
88     public boolean isRendered()
89     {
90         return rendered;
91     }
92
93
94     public String JavaDoc getAction()
95     {
96         return _action;
97     }
98
99     public void setAction(String JavaDoc action)
100     {
101         _action = action;
102     }
103
104     public boolean isSplit()
105     {
106         return _split;
107     }
108
109     public void setSplit(boolean split)
110     {
111         _split = split;
112     }
113
114     public String JavaDoc getIcon()
115     {
116         return _icon;
117     }
118
119     public void setIcon(String JavaDoc icon)
120     {
121         _icon = icon;
122     }
123
124     public NavigationMenuItem[] getNavigationMenuItems()
125     {
126         return _navigationMenuItems;
127     }
128
129     public void setNavigationMenuItems(NavigationMenuItem[] navigationMenuItems)
130     {
131         _navigationMenuItems = navigationMenuItems;
132     }
133 }
134
Popular Tags