KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > webapp > menu > MenuBase


1 /*
2  * Copyright 2004 Blandware (http://www.blandware.com)
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 com.blandware.atleap.webapp.menu;
17
18 import java.io.Serializable JavaDoc;
19
20
21 /**
22  * <p>Provides base functionality for menu components.</p>
23  * <p>This class was copied from Struts Menu. 'Width' and 'height' fields replaced with 'style' and 'styleClass'</p>
24  * <p><a HREF="MenuBase.java.htm"><i>View Source</i></a></p>
25  *
26  * @author Scott Sayles
27  * @author Matt Raible
28  * @author Sergey Zubtcovskii <a HREF="mailto:sergey.zubtcovskii@blandware.com">&lt;sergey.zubtcovskii@blandware.com&gt;</a>
29  */

30 public abstract class MenuBase implements Serializable JavaDoc {
31     //~ Instance fields ========================================================
32

33     /**
34      * Holds value of property action, that is, Struts Logical Action Name.
35      */

36     protected String JavaDoc action;
37
38     /**
39      * Align menu 'left','right','top','bottom' ...and other alignment of particular menu system
40      */

41     protected String JavaDoc align;
42
43     /**
44      * Holds value of property altImage.
45      */

46     protected String JavaDoc altImage;
47
48     /**
49      * Holds value of property description.
50      */

51     protected String JavaDoc description;
52
53     /**
54      * Holds value of property forward.
55      */

56     protected String JavaDoc forward;
57
58     /**
59      * Holds value of property style.
60      */

61     protected String JavaDoc style;
62
63     /**
64      * Holds value of property styleClass.
65      */

66     protected String JavaDoc styleClass;
67
68     /**
69      * Holds value of property styleId
70      */

71     protected String JavaDoc styleId;
72
73     /**
74      * Holds value of property image.
75      */

76     protected String JavaDoc image;
77
78     /**
79      * Holds value of property location.
80      */

81     protected String JavaDoc location;
82
83     /**
84      * Whether or not location is external
85      */

86     protected Boolean JavaDoc externalLocation = Boolean.FALSE;
87
88     /**
89      * Holds value of property name.
90      */

91     protected String JavaDoc name;
92
93     /**
94      * Holds value of property onclick.
95      */

96     protected String JavaDoc onclick;
97
98     /**
99      * Holds value of property onmouseout.
100      */

101     protected String JavaDoc onmouseout;
102
103     /**
104      * Holds value of property onmouseover.
105      */

106     protected String JavaDoc onmouseover;
107
108     /**
109      * Holds value of property page.
110      */

111     protected String JavaDoc anchor;
112
113     /**
114      * Holds value of property roles.
115      */

116     protected String JavaDoc roles;
117
118     /**
119      * Holds value of property target.
120      */

121     protected String JavaDoc target;
122
123     /**
124      * Holds value of property title.
125      */

126     protected String JavaDoc title;
127
128     /**
129      * Holds value of property toolTip.
130      */

131     protected String JavaDoc toolTip;
132
133     /**
134      * Holds parsed (with variables) url that is used to render a link
135      */

136     private String JavaDoc url;
137
138     //~ Constructors ===========================================================
139

140     /**
141      * Creates new MenuBase
142      */

143     public MenuBase() {
144     }
145
146     //~ Methods ================================================================
147

148     /**
149      * Sets the value for action.
150      *
151      * @param action New value of property action.
152      */

153     public void setAction(String JavaDoc action) {
154         this.action = action;
155     }
156
157     /**
158      * Returns the value for action.
159      *
160      * @return Value of property action.
161      */

162     public String JavaDoc getAction() {
163         return this.action;
164     }
165
166     /**
167      * Returns the value for align.
168      *
169      * @return Value of property align.
170      */

171     public String JavaDoc getAlign() {
172         return align;
173     }
174
175     /**
176      * Sets the value for align.
177      *
178      * @param align New value of property align.
179      */

180     public void setAlign(String JavaDoc align) {
181         this.align = align;
182     }
183
184     /**
185      * Setter for property altImage.
186      *
187      * @param altImage New value of property altImage.
188      */

189     public void setAltImage(String JavaDoc altImage) {
190         this.altImage = altImage;
191     }
192
193     /**
194      * Getter for property altImage.
195      *
196      * @return Value of property altImage.
197      */

198     public String JavaDoc getAltImage() {
199         return altImage;
200     }
201
202     /**
203      * Setter for property description.
204      *
205      * @param description New value of property description.
206      */

207     public void setDescription(String JavaDoc description) {
208         this.description = description;
209     }
210
211     /**
212      * Getter for property description.
213      *
214      * @return Value of property description.
215      */

216     public String JavaDoc getDescription() {
217         return description;
218     }
219
220     /**
221      * Sets the forward.
222      *
223      * @param forward The forward to set
224      */

225     public void setForward(String JavaDoc forward) {
226         this.forward = forward;
227     }
228
229     /**
230      * Gets the forward
231      *
232      * @return String value of property 'forward'
233      */

234     public String JavaDoc getForward() {
235         return forward;
236     }
237
238     /**
239      * Sets the CSS style applied to this menu
240      *
241      * @param style The style to set
242      */

243     public void setStyle(String JavaDoc style) {
244         this.style = style;
245     }
246
247     /**
248      * Gets the CSS style applied to this menu
249      *
250      * @return Style
251      */

252     public String JavaDoc getStyle() {
253         return style;
254     }
255
256     /**
257      * Sets the style class.
258      *
259      * @param styleClass The style class to set
260      */

261     public void setStyleClass(String JavaDoc styleClass) {
262         this.styleClass = styleClass;
263     }
264
265     /**
266      * Gets the style class
267      *
268      * @return Style class
269      */

270     public String JavaDoc getStyleClass() {
271         return styleClass;
272     }
273
274     /**
275      * Gets the style ID
276      *
277      * @return Style ID
278      */

279     public String JavaDoc getStyleId() {
280         return styleId;
281     }
282
283     /**
284      * Sets the style ID
285      *
286      * @param styleId The style ID to set
287      */

288     public void setStyleId(String JavaDoc styleId) {
289         this.styleId = styleId;
290     }
291
292     /**
293      * Setter for property image.
294      *
295      * @param image New value of property image.
296      */

297     public void setImage(String JavaDoc image) {
298         this.image = image;
299     }
300
301     /**
302      * Getter for property image.
303      *
304      * @return Value of property image.
305      */

306     public String JavaDoc getImage() {
307         return image;
308     }
309
310     /**
311      * Setter for property location.
312      *
313      * @param location New value of property location.
314      */

315     public void setLocation(String JavaDoc location) {
316         this.location = location;
317     }
318
319     /**
320      * Getter for property location.
321      *
322      * @return Value of property location.
323      */

324     public String JavaDoc getLocation() {
325         return location;
326     }
327
328     /**
329      * Returns <code>Boolean.TRUE</code> if location is external
330      *
331      * @return Whether location is external
332      */

333     public Boolean JavaDoc getExternalLocation() {
334         return externalLocation;
335     }
336
337     /**
338      * Sets whether location is external
339      *
340      * @param externalLocation Whether location is external
341      */

342     public void setExternalLocation(Boolean JavaDoc externalLocation) {
343         this.externalLocation = externalLocation;
344     }
345
346     /**
347      * Setter for property name.
348      *
349      * @param name New value of property name.
350      */

351     public void setName(String JavaDoc name) {
352         this.name = name;
353     }
354
355     /**
356      * Getter for property name.
357      *
358      * @return Value of property name.
359      */

360     public String JavaDoc getName() {
361         return name;
362     }
363
364     /**
365      * Setter for property onclick.
366      *
367      * @param onclick New value of property onclick.
368      */

369     public void setOnclick(String JavaDoc onclick) {
370         this.onclick = onclick;
371     }
372
373     /**
374      * Getter for property onclick.
375      *
376      * @return Value of property onclick.
377      */

378     public String JavaDoc getOnclick() {
379         return onclick;
380     }
381
382     /**
383      * Setter for property onmouseout.
384      *
385      * @param onmouseout New value of property onmouseout.
386      */

387     public void setOnmouseout(String JavaDoc onmouseout) {
388         this.onmouseout = onmouseout;
389     }
390
391     /**
392      * Getter for property onmouseout.
393      *
394      * @return Value of property onmouseout.
395      */

396     public String JavaDoc getOnmouseout() {
397         return onmouseout;
398     }
399
400     /**
401      * Setter for property onmouseover.
402      *
403      * @param onmouseover New value of property onmouseover.
404      */

405     public void setOnmouseover(String JavaDoc onmouseover) {
406         this.onmouseover = onmouseover;
407     }
408
409     /**
410      * Getter for property onmouseover.
411      *
412      * @return Value of property onmouseover.
413      */

414     public String JavaDoc getOnmouseover() {
415         return onmouseover;
416     }
417
418     /**
419      * Sets the value for anchor.
420      *
421      * @param anchor New value of property anchor.
422      */

423     public void setAnchor(String JavaDoc anchor) {
424         this.anchor = anchor;
425     }
426
427     /**
428      * Returns the value for anchor.
429      *
430      * @return Value of property anchor.
431      */

432     public String JavaDoc getAnchor() {
433         return this.anchor;
434     }
435
436     /**
437      * Sets the roles.
438      *
439      * @param roles The roles to set
440      */

441     public void setRoles(String JavaDoc roles) {
442         this.roles = roles;
443     }
444
445     /**
446      * Returns the roles.
447      *
448      * @return String
449      */

450     public String JavaDoc getRoles() {
451         return roles;
452     }
453
454     /**
455      * Setter for property target.
456      *
457      * @param target New value of property target.
458      */

459     public void setTarget(String JavaDoc target) {
460         this.target = target;
461     }
462
463     /**
464      * Getter for property target.
465      *
466      * @return Value of property target.
467      */

468     public String JavaDoc getTarget() {
469         return target;
470     }
471
472     /**
473      * Setter for property title.
474      *
475      * @param title New value of property title.
476      */

477     public void setTitle(String JavaDoc title) {
478         this.title = title;
479     }
480
481     /**
482      * Getter for property title.
483      *
484      * @return Value of property title.
485      */

486     public String JavaDoc getTitle() {
487         return title;
488     }
489
490     /**
491      * Setter for property toolTip.
492      *
493      * @param toolTip New value of property toolTip.
494      */

495     public void setToolTip(String JavaDoc toolTip) {
496         this.toolTip = toolTip;
497     }
498
499     /**
500      * Getter for property toolTip.
501      *
502      * @return Value of property toolTip.
503      */

504     public String JavaDoc getToolTip() {
505         return toolTip;
506     }
507
508     /**
509      * Sets URL
510      *
511      * @param url The URL to set
512      */

513     public void setUrl(String JavaDoc url) {
514         this.url = url;
515     }
516
517     /**
518      * Returns URL
519      *
520      * @return URL
521      */

522     public String JavaDoc getUrl() {
523         return url;
524     }
525
526
527 }
528
Popular Tags