1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.om.folder.impl;
18
19 import java.util.List;
20
21 import org.apache.jetspeed.om.folder.MenuDefinition;
22 import org.apache.jetspeed.page.impl.DatabasePageManagerUtils;
23
24 /***
25 * BaseMenuDefinitionImpl
26 *
27 * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
28 * @version $Id:$
29 */
30 public abstract class BaseMenuDefinitionImpl extends BaseMenuDefinitionMetadata implements MenuDefinition
31 {
32 private String name;
33 private String options;
34 private int depth;
35 private boolean paths;
36 private boolean regexp;
37 private String profile;
38 private String order;
39 private String skin;
40 private String title;
41 private String shortTitle;
42 private List elements;
43
44 /***
45 * accessElements
46 *
47 * Access mutable persistent collection member for List wrappers.
48 *
49 * @return persistent collection
50 */
51 public List accessElements()
52 {
53
54 if (elements == null)
55 {
56 elements = DatabasePageManagerUtils.createList();
57 }
58 return elements;
59 }
60
61
62
63
64 public String getName()
65 {
66 return name;
67 }
68
69
70
71
72 public void setName(String name)
73 {
74 this.name = name;
75 }
76
77
78
79
80 public String getOptions()
81 {
82 return options;
83 }
84
85
86
87
88 public void setOptions(String options)
89 {
90 this.options = options;
91 }
92
93
94
95
96 public int getDepth()
97 {
98 return depth;
99 }
100
101
102
103
104 public void setDepth(int depth)
105 {
106 this.depth = depth;
107 }
108
109
110
111
112 public boolean isPaths()
113 {
114 return paths;
115 }
116
117
118
119
120 public void setPaths(boolean paths)
121 {
122 this.paths = paths;
123 }
124
125
126
127
128 public boolean isRegexp()
129 {
130 return regexp;
131 }
132
133
134
135
136 public void setRegexp(boolean regexp)
137 {
138 this.regexp = regexp;
139 }
140
141
142
143
144 public String getProfile()
145 {
146 return profile;
147 }
148
149
150
151
152 public void setProfile(String locatorName)
153 {
154 profile = locatorName;
155 }
156
157
158
159
160 public String getOrder()
161 {
162 return order;
163 }
164
165
166
167
168 public void setOrder(String order)
169 {
170 this.order = order;
171 }
172
173
174
175
176 public String getSkin()
177 {
178 return skin;
179 }
180
181
182
183
184 public void setSkin(String name)
185 {
186 skin = name;
187 }
188
189
190
191
192 public String getTitle()
193 {
194 return title;
195 }
196
197
198
199
200 public void setTitle(String title)
201 {
202 this.title = title;
203 }
204
205
206
207
208 public String getShortTitle()
209 {
210 return shortTitle;
211 }
212
213
214
215
216 public void setShortTitle(String title)
217 {
218 this.shortTitle = title;
219 }
220
221
222
223
224 public abstract List getMenuElements();
225
226
227
228
229 public void setMenuElements(List elements)
230 {
231
232
233
234 List menuElements = getMenuElements();
235 if (elements != menuElements)
236 {
237
238 menuElements.clear();
239 if (elements != null)
240 {
241 menuElements.addAll(elements);
242 }
243 }
244 }
245
246
247
248
249 public boolean equals(Object o)
250 {
251 if (o instanceof BaseMenuDefinitionImpl)
252 {
253 if (name != null)
254 {
255 return name.equals(((BaseMenuDefinitionImpl)o).getName());
256 }
257 else
258 {
259 return (((BaseMenuDefinitionImpl)o).getName() == null);
260 }
261 }
262 return false;
263 }
264
265
266
267
268 public int hashCode()
269 {
270 if (name != null)
271 {
272 return name.hashCode();
273 }
274 return 0;
275 }
276 }