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 FieldsetTag extends IncludeTag {
027    
028            public void setColumn(boolean column) {
029                    _column = column;
030            }
031    
032            public void setCssClass(String cssClass) {
033                    _cssClass = cssClass;
034            }
035    
036            public void setLabel(String label) {
037                    _label = label;
038            }
039    
040            protected void cleanUp() {
041                    _column = false;
042                    _cssClass = null;
043                    _label = null;
044            }
045    
046            protected String getEndPage() {
047                    return _END_PAGE;
048            }
049    
050            protected String getStartPage() {
051                    return _START_PAGE;
052            }
053    
054            protected boolean isCleanUpSetAttributes() {
055                    return _CLEAN_UP_SET_ATTRIBUTES;
056            }
057    
058            protected void setAttributes(HttpServletRequest request) {
059                    request.setAttribute("aui:fieldset:column", String.valueOf(_column));
060                    request.setAttribute("aui:fieldset:cssClass", _cssClass);
061                    request.setAttribute(
062                            "aui:fieldset:dynamicAttributes", getDynamicAttributes());
063                    request.setAttribute("aui:fieldset:label", _label);
064            }
065    
066            private static final boolean _CLEAN_UP_SET_ATTRIBUTES = true;
067    
068            private static final String _END_PAGE =
069                    "/html/taglib/aui/fieldset/end.jsp";
070    
071            private static final String _START_PAGE =
072                    "/html/taglib/aui/fieldset/start.jsp";
073    
074            private boolean _column;
075            private String _cssClass;
076            private String _label;
077    
078    }