1 /*
2 * $Id$
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 private static final long serialVersionUID = -5488084076348864047L;
32
33 private String value = null;
34
35 private String link = null;
36
37 private String icon = null;
38
39 private String tooltip = null;
40
41 /**
42 * Constructor.
43 */
44 public SimpleMenuItem() {
45 super();
46 }
47
48 /**
49 * Set value property.
50 */
51 public void setValue(String value) {
52 this.value = value;
53 }
54
55 /**
56 * Get value property.
57 */
58 public String getValue() {
59 return value;
60 }
61
62 /**
63 * Set link property.
64 */
65 public void setLink(String link) {
66 this.link = link;
67 }
68
69 /**
70 * Get link property.
71 */
72 public String getLink() {
73 return link;
74 }
75
76 /**
77 * Set icon property.
78 */
79 public void setIcon(String icon) {
80 this.icon = icon;
81 }
82
83 /**
84 * Get icon property.
85 */
86 public String getIcon() {
87 return icon;
88 }
89
90 /**
91 * Set tooltip property.
92 */
93 public void setTooltip(String tooltip) {
94 this.tooltip = tooltip;
95 }
96
97 /**
98 * Get tooltip property.
99 */
100 public String getTooltip() {
101 return tooltip;
102 }
103
104 /**
105 * Return String representation.
106 */
107 public String toString() {
108 StringBuilder buff = new StringBuilder("SimpleMenuItem[");
109
110 if (getValue() != null) {
111 buff.append("value=").append(getValue()).append(", ");
112 }
113
114 if (getLink() != null) {
115 buff.append("link=").append(getLink()).append(", ");
116 }
117
118 if (getTooltip() != null) {
119 buff.append("tooltip=").append(getTooltip()).append(", ");
120 }
121
122 if (getIcon() != null) {
123 buff.append("icon=").append(getIcon()).append(", ");
124 }
125
126 buff.append("]");
127 return buff.toString();
128 }
129
130 }