001    /**
002     * Copyright (c) 2000-2013 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.portal.kernel.util.StringBundler;
018    import com.liferay.taglib.aui.base.BaseNavBarTag;
019    
020    import javax.servlet.jsp.JspException;
021    import javax.servlet.jsp.tagext.BodyTag;
022    
023    /**
024     * @author Eduardo Lundgren
025     * @author Bruno Basto
026     * @author Nathan Cavanaugh
027     * @author Julio Camarero
028     */
029    public class NavBarTag extends BaseNavBarTag implements BodyTag {
030    
031            @Override
032            public int doEndTag() throws JspException {
033                    setNamespacedAttribute(
034                            request, "responsiveButtons", _responsiveButtonsSB.toString());
035    
036                    return super.doEndTag();
037            }
038    
039            public StringBundler getResponsiveButtonsSB() {
040                    return _responsiveButtonsSB;
041            }
042    
043            @Override
044            protected void cleanUp() {
045                    super.cleanUp();
046    
047                    _responsiveButtonsSB.setIndex(0);
048            }
049    
050            @Override
051            protected int processStartTag() throws Exception {
052                    return EVAL_BODY_BUFFERED;
053            }
054    
055            private StringBundler _responsiveButtonsSB = new StringBundler();
056    
057    }