001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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    }