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.ui;
016    
017    import com.liferay.taglib.util.IncludeTag;
018    
019    import javax.servlet.http.HttpServletRequest;
020    
021    /**
022     * @author Sergio González
023     */
024    public class HeaderTag extends IncludeTag {
025    
026            protected void setAttributes(HttpServletRequest request) {
027                    request.setAttribute("liferay-ui:header:backLabel", _backLabel);
028                    request.setAttribute("liferay-ui:header:backURL", _backURL);
029                    request.setAttribute("liferay-ui:header:cssClass", _cssClass);
030                    request.setAttribute(
031                            "liferay-ui:header:escapeXml", String.valueOf(_escapeXml));
032                    request.setAttribute("liferay-ui:header:title", _title);
033            }
034    
035            protected void cleanUp() {
036                    _backLabel = null;
037                    _backURL = null;
038                    _cssClass = null;
039                    _escapeXml = true;
040                    _title = null;
041            }
042    
043            protected String getPage() {
044                    return _PAGE;
045            }
046    
047            protected boolean isCleanUpSetAttributes() {
048                    return _CLEAN_UP_SET_ATTRIBUTES;
049            }
050    
051            public void setBackLabel(String backLabel) {
052                    _backLabel = backLabel;
053            }
054    
055            public void setBackURL(String backURL) {
056                    _backURL = backURL;
057            }
058    
059            public void setCssClass(String cssClass) {
060                    _cssClass = cssClass;
061            }
062    
063            public void setEscapeXml(boolean escapeXml) {
064                    _escapeXml = escapeXml;
065            }
066    
067            public void setTitle(String title) {
068                    _title = title;
069            }
070    
071            private static final boolean _CLEAN_UP_SET_ATTRIBUTES = true;
072    
073            private static final String _PAGE = "/html/taglib/ui/header/page.jsp";
074    
075            private String _backLabel;
076            private String _backURL;
077            private String _cssClass;
078            private boolean _escapeXml = true;
079            private String _title;
080    
081    }