001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.taglib.aui;
016    
017    import javax.servlet.jsp.tagext.TagSupport;
018    
019    /**
020     * @author Julio Camarero
021     * @author Brian Wing Shun Chan
022     */
023    public class ToolTag extends TagSupport {
024    
025            public int doStartTag() {
026                    PanelTag parentTag = (PanelTag)findAncestorWithClass(
027                            this, PanelTag.class);
028    
029                    parentTag.addToolTag(this);
030    
031                    return EVAL_PAGE;
032            }
033    
034            public String getHandler() {
035                    return _handler;
036            }
037    
038            public String getIcon() {
039                    return _icon;
040            }
041    
042            public String getId() {
043                    return _id;
044            }
045    
046            public void setHandler(String handler) {
047                    _handler = handler;
048            }
049    
050            public void setIcon(String icon) {
051                    _icon = icon;
052            }
053    
054            public void setId(String id) {
055                    _id = id;
056            }
057    
058            protected void cleanUp() {
059                    _handler = null;
060                    _icon = null;
061                    _id = null;
062            }
063    
064            private String _handler;
065            private String _icon;
066            private String _id;
067    
068    }