001
014
015 package com.liferay.taglib.aui;
016
017 import com.liferay.portal.kernel.util.StringBundler;
018 import com.liferay.portal.kernel.util.Validator;
019 import com.liferay.taglib.aui.base.BaseNavBarTag;
020
021 import javax.servlet.jsp.JspException;
022 import javax.servlet.jsp.tagext.BodyTag;
023
024
030 public class NavBarTag extends BaseNavBarTag implements BodyTag {
031
032 @Override
033 public int doEndTag() throws JspException {
034 setNamespacedAttribute(
035 request, "responsiveButtons", _responsiveButtonsSB.toString());
036
037 return super.doEndTag();
038 }
039
040 public StringBundler getResponsiveButtonsSB() {
041 return _responsiveButtonsSB;
042 }
043
044 @Override
045 protected void cleanUp() {
046 super.cleanUp();
047
048 _responsiveButtonsSB.setIndex(0);
049 }
050
051 @Override
052 protected String getPage() {
053 String markupView = getMarkupView();
054
055 if (Validator.isNotNull(markupView)) {
056 return "/html/taglib/aui/nav_bar/" + markupView + "/page.jsp";
057 }
058
059 return "/html/taglib/aui/nav_bar/page.jsp";
060 }
061
062 @Override
063 protected int processStartTag() throws Exception {
064 return EVAL_BODY_BUFFERED;
065 }
066
067 private final StringBundler _responsiveButtonsSB = new StringBundler();
068
069 }