1 /*
2 * $Id: SimpleMenuItem.java 471754 2006-11-06 14:55:09Z husted $
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 package org.apache.struts.tiles.beans;
23
24 import java.io.Serializable;
25
26 /**
27 * A MenuItem implementation.
28 * Used to read menu items in definitions.
29 */
30 public class SimpleMenuItem implements MenuItem, Serializable {
31
32 private String value = null;
33
34 private String link = null;
35
36 private String icon = null;
37
38 private String tooltip = null;
39
40 /**
41 * Constructor.
42 */
43 public SimpleMenuItem() {
44 super();
45 }
46
47 /**
48 * Set value property.
49 */
50 public void setValue(String value) {
51 this.value = value;
52 }
53
54 /**
55 * Get value property.
56 */
57 public String getValue() {
58 return value;
59 }
60
61 /**
62 * Set link property.
63 */
64 public void setLink(String link) {
65 this.link = link;
66 }
67
68 /**
69 * Get link property.
70 */
71 public String getLink() {
72 return link;
73 }
74
75 /**
76 * Set icon property.
77 */
78 public void setIcon(String icon) {
79 this.icon = icon;
80 }
81
82 /**
83 * Get icon property.
84 */
85 public String getIcon() {
86 return icon;
87 }
88
89 /**
90 * Set tooltip property.
91 */
92 public void setTooltip(String tooltip) {
93 this.tooltip = tooltip;
94 }
95
96 /**
97 * Get tooltip property.
98 */
99 public String getTooltip() {
100 return tooltip;
101 }
102
103 /**
104 * Return String representation.
105 */
106 public String toString() {
107 StringBuffer buff = new StringBuffer("SimpleMenuItem[");
108
109 if (getValue() != null) {
110 buff.append("value=").append(getValue()).append(", ");
111 }
112
113 if (getLink() != null) {
114 buff.append("link=").append(getLink()).append(", ");
115 }
116
117 if (getTooltip() != null) {
118 buff.append("tooltip=").append(getTooltip()).append(", ");
119 }
120
121 if (getIcon() != null) {
122 buff.append("icon=").append(getIcon()).append(", ");
123 }
124
125 buff.append("]");
126 return buff.toString();
127 }
128
129 }