View Javadoc

1   /*
2    * $Id: SimpleMenuItem.java 421151 2006-07-12 06:07:14Z wsmoak $
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;
22  
23  /***
24   * A MenuItem implementation.
25   * Used to read menu items in definitions.
26   */
27  public class SimpleMenuItem implements MenuItem, Serializable {
28  
29      private String value = null;
30  
31      private String link = null;
32  
33      private String icon = null;
34  
35      private String 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 value) {
48          this.value = value;
49      }
50  
51      /***
52       * Get value property.
53       */
54      public String getValue() {
55          return value;
56      }
57  
58      /***
59       * Set link property.
60       */
61      public void setLink(String link) {
62          this.link = link;
63      }
64  
65      /***
66       * Get link property.
67       */
68      public String getLink() {
69          return link;
70      }
71  
72      /***
73       * Set icon property.
74       */
75      public void setIcon(String icon) {
76          this.icon = icon;
77      }
78  
79      /***
80       * Get icon property.
81       */
82      public String getIcon() {
83          return icon;
84      }
85  
86      /***
87       * Set tooltip property.
88       */
89      public void setTooltip(String tooltip) {
90          this.tooltip = tooltip;
91      }
92  
93      /***
94       * Get tooltip property.
95       */
96      public String getTooltip() {
97          return tooltip;
98      }
99  
100     /***
101      * Return String representation.
102      */
103     public String toString() {
104         StringBuffer buff = new StringBuffer("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 }