KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openi > menu > MenuItem


1 /*********************************************************************************
2  * The contents of this file are subject to the OpenI Public License Version 1.0
3  * ("License"); You may not use this file except in compliance with the
4  * License. You may obtain a copy of the License at
5  * http://www.openi.org/docs/LICENSE.txt
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is: OpenI Open Source
12  *
13  * The Initial Developer of the Original Code is Loyalty Matrix, Inc.
14  * Portions created by Loyalty Matrix, Inc. are
15  * Copyright (C) 2005 Loyalty Matrix, Inc.; All Rights Reserved.
16  *
17  * Contributor(s): ______________________________________.
18  *
19  ********************************************************************************/

20 package org.openi.menu;
21
22 import java.io.Serializable JavaDoc;
23 import java.util.*;
24
25
26 /**
27  * @author plucas
28  *
29  * Revision:
30  * Ver 1.1 Uddhab Pant - Feb 18,2005
31  * Renamed MenuNode class to MenuItem as followed Java convention
32  * for Menu and MenuItem. Removed childNodes since Menu Item
33  * doesn't have childs. Only Menu contains childs.
34  *
35  *
36  */

37 public class MenuItem implements Serializable JavaDoc {
38     private String JavaDoc url;
39     private String JavaDoc displayName;
40     private String JavaDoc target;
41
42     /**
43      * Default constuctor
44      */

45     public MenuItem() {
46     }
47
48     /**
49      * Constructs menu item with display name.
50      * @param displayName String
51      */

52     public MenuItem(String JavaDoc displayName) {
53         this.displayName = displayName;
54     }
55
56     public MenuItem(String JavaDoc displayName, String JavaDoc url) {
57         this.displayName = displayName;
58         this.url = url;
59     }
60
61     /**
62      * @return Returns the displayName.
63      */

64     public String JavaDoc getDisplayName() {
65         return displayName;
66     }
67
68     /**
69      * @param displayName The displayName to set.
70      */

71     public void setDisplayName(String JavaDoc displayName) {
72         this.displayName = displayName;
73     }
74
75     /**
76      * @return Returns the target.
77      */

78     public String JavaDoc getTarget() {
79         return target;
80     }
81
82     /**
83      * @param target The target to set.
84      */

85     public void setTarget(String JavaDoc target) {
86         this.target = target;
87     }
88
89     /**
90      * @return Returns the url.
91      */

92     public String JavaDoc getUrl() {
93         return url;
94     }
95
96     /**
97      * @param url The url to set.
98      */

99     public void setUrl(String JavaDoc url) {
100         this.url = url;
101     }
102
103     /**
104      *
105      * @return displayName
106      */

107     public String JavaDoc toString() {
108         return String.valueOf(displayName);
109     }
110 }
111
Popular Tags