1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.taglib.aui;
16  
17  import javax.servlet.jsp.tagext.TagSupport;
18  
19  /**
20   * <a href="ToolTag.java.html"><b><i>View Source</i></b></a>
21   *
22   * @author Julio Camarero
23   * @author Brian Wing Shun Chan
24   */
25  public class ToolTag extends TagSupport {
26  
27      public int doStartTag() {
28          if (_icon == null) {
29              _icon = _id;
30          }
31  
32          PanelTag parentTag = (PanelTag)findAncestorWithClass(
33              this, PanelTag.class);
34  
35          parentTag.addToolTag(this);
36  
37          return EVAL_PAGE;
38      }
39  
40      public String getHandler() {
41          return _handler;
42      }
43  
44      public String getIcon() {
45          return _icon;
46      }
47  
48      public String getId() {
49          return _id;
50      }
51  
52      public void setHandler(String handler) {
53          _handler = handler;
54      }
55  
56      public void setIcon(String icon) {
57          _icon = icon;
58      }
59  
60      public void setId(String id) {
61          _id = id;
62      }
63  
64      private String _handler;
65      private String _icon;
66      private String _id;
67  
68  }