001: /*
002: * $Id: SimpleMenuItem.java 471754 2006-11-06 14:55:09Z husted $
003: *
004: * Licensed to the Apache Software Foundation (ASF) under one
005: * or more contributor license agreements. See the NOTICE file
006: * distributed with this work for additional information
007: * regarding copyright ownership. The ASF licenses this file
008: * to you under the Apache License, Version 2.0 (the
009: * "License"); you may not use this file except in compliance
010: * with the License. You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing,
015: * software distributed under the License is distributed on an
016: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017: * KIND, either express or implied. See the License for the
018: * specific language governing permissions and limitations
019: * under the License.
020: */
021:
022: package org.apache.struts.tiles.beans;
023:
024: import java.io.Serializable;
025:
026: /**
027: * A MenuItem implementation.
028: * Used to read menu items in definitions.
029: */
030: public class SimpleMenuItem implements MenuItem, Serializable {
031:
032: private String value = null;
033:
034: private String link = null;
035:
036: private String icon = null;
037:
038: private String tooltip = null;
039:
040: /**
041: * Constructor.
042: */
043: public SimpleMenuItem() {
044: super ();
045: }
046:
047: /**
048: * Set value property.
049: */
050: public void setValue(String value) {
051: this .value = value;
052: }
053:
054: /**
055: * Get value property.
056: */
057: public String getValue() {
058: return value;
059: }
060:
061: /**
062: * Set link property.
063: */
064: public void setLink(String link) {
065: this .link = link;
066: }
067:
068: /**
069: * Get link property.
070: */
071: public String getLink() {
072: return link;
073: }
074:
075: /**
076: * Set icon property.
077: */
078: public void setIcon(String icon) {
079: this .icon = icon;
080: }
081:
082: /**
083: * Get icon property.
084: */
085: public String getIcon() {
086: return icon;
087: }
088:
089: /**
090: * Set tooltip property.
091: */
092: public void setTooltip(String tooltip) {
093: this .tooltip = tooltip;
094: }
095:
096: /**
097: * Get tooltip property.
098: */
099: 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: }
|