001    /**
002     * Copyright (c) 2000-2010 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 com.liferay.taglib.util.IncludeTag;
018    
019    import javax.servlet.http.HttpServletRequest;
020    
021    /**
022     * @author Julio Camarero
023     * @author Jorge Ferrer
024     * @author Brian Wing Shun Chan
025     */
026    public class ATag extends IncludeTag {
027    
028            public void setCssClass(String cssClass) {
029                    _cssClass = cssClass;
030            }
031    
032            public void setHref(String href) {
033                    _href = href;
034            }
035    
036            public void setId(String id) {
037                    _id = id;
038            }
039    
040            public void setLabel(String label) {
041                    _label = label;
042            }
043    
044            public void setLang(String lang) {
045                    _lang = lang;
046            }
047    
048            public void setTarget(String target) {
049                    _target = target;
050            }
051    
052            protected void cleanUp() {
053                    _cssClass = null;
054                    _href = null;
055                    _id = null;
056                    _label = null;
057                    _lang = null;
058                    _target = null;
059            }
060    
061            protected String getEndPage() {
062                    return _END_PAGE;
063            }
064    
065            protected String getStartPage() {
066                    return _START_PAGE;
067            }
068    
069            protected boolean isCleanUpSetAttributes() {
070                    return _CLEAN_UP_SET_ATTRIBUTES;
071            }
072    
073            protected void setAttributes(HttpServletRequest request) {
074                    request.setAttribute("aui:a:cssClass", _cssClass);
075                    request.setAttribute("aui:a:dynamicAttributes", getDynamicAttributes());
076                    request.setAttribute("aui:a:href", _href);
077                    request.setAttribute("aui:a:id", _id);
078                    request.setAttribute("aui:a:label", _label);
079                    request.setAttribute("aui:a:lang", _lang);
080                    request.setAttribute("aui:a:target", _target);
081            }
082    
083            private static final boolean _CLEAN_UP_SET_ATTRIBUTES = true;
084    
085            private static final String _END_PAGE =
086                    "/html/taglib/aui/a/end.jsp";
087    
088            private static final String _START_PAGE =
089                    "/html/taglib/aui/a/start.jsp";
090    
091            private String _cssClass;
092            private String _href;
093            private String _id;
094            private String _label;
095            private String _lang;
096            private String _target;
097    
098    }