KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > struts > tiles > beans > SimpleMenuItem


1 /*
2  * $Id: SimpleMenuItem.java 54929 2004-10-16 16:38:42Z germuska $
3  *
4  * Copyright 1999-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 package org.apache.struts.tiles.beans;
20
21 import java.io.Serializable JavaDoc;
22
23 /**
24  * A MenuItem implementation.
25  * Used to read menu items in definitions.
26  */

27 public class SimpleMenuItem implements MenuItem, Serializable JavaDoc {
28
29     private String JavaDoc value = null;
30
31     private String JavaDoc link = null;
32
33     private String JavaDoc icon = null;
34
35     private String JavaDoc tooltip = null;
36
37     /**
38      * Constructor.
39      */

40     public SimpleMenuItem() {
41         super();
42     }
43
44     /**
45      * Set value property.
46      */

47     public void setValue(String JavaDoc value) {
48         this.value = value;
49     }
50
51     /**
52      * Get value property.
53      */

54     public String JavaDoc getValue() {
55         return value;
56     }
57
58     /**
59      * Set link property.
60      */

61     public void setLink(String JavaDoc link) {
62         this.link = link;
63     }
64
65     /**
66      * Get link property.
67      */

68     public String JavaDoc getLink() {
69         return link;
70     }
71
72     /**
73      * Set icon property.
74      */

75     public void setIcon(String JavaDoc icon) {
76         this.icon = icon;
77     }
78
79     /**
80      * Get icon property.
81      */

82     public String JavaDoc getIcon() {
83         return icon;
84     }
85
86     /**
87      * Set tooltip property.
88      */

89     public void setTooltip(String JavaDoc tooltip) {
90         this.tooltip = tooltip;
91     }
92
93     /**
94      * Get tooltip property.
95      */

96     public String JavaDoc getTooltip() {
97         return tooltip;
98     }
99
100     /**
101      * Return String representation.
102      */

103     public String JavaDoc toString() {
104         StringBuffer JavaDoc buff = new StringBuffer JavaDoc("SimpleMenuItem[");
105
106         if (getValue() != null) {
107             buff.append("value=").append(getValue()).append(", ");
108         }
109
110         if (getLink() != null) {
111             buff.append("link=").append(getLink()).append(", ");
112         }
113
114         if (getTooltip() != null) {
115             buff.append("tooltip=").append(getTooltip()).append(", ");
116         }
117
118         if (getIcon() != null) {
119             buff.append("icon=").append(getIcon()).append(", ");
120         }
121
122         buff.append("]");
123         return buff.toString();
124     }
125
126 }
127
Popular Tags