001
014
015 package com.liferay.taglib.ui;
016
017 import com.liferay.portal.kernel.servlet.taglib.ui.ToolbarItem;
018 import com.liferay.taglib.util.IncludeTag;
019
020 import javax.servlet.http.HttpServletRequest;
021
022
025 public class ToolbarItemTag extends IncludeTag {
026
027 @Override
028 public int doStartTag() {
029 return EVAL_BODY_INCLUDE;
030 }
031
032 public void setToolbarItem(ToolbarItem toolbarItem) {
033 _toolbarItem = toolbarItem;
034 }
035
036 public void setVar(String var) {
037 _var = var;
038 }
039
040 @Override
041 protected void cleanUp() {
042 _toolbarItem = null;
043 _var = null;
044 }
045
046 @Override
047 protected String getPage() {
048 return _PAGE;
049 }
050
051 @Override
052 protected boolean isCleanUpSetAttributes() {
053 return _CLEAN_UP_SET_ATTRIBUTES;
054 }
055
056 @Override
057 protected void setAttributes(HttpServletRequest request) {
058 request.setAttribute(
059 "liferay-ui:toolbar-item:toolbarItem", _toolbarItem);
060 request.setAttribute("liferay-ui:toolbar-item:var", _var);
061 }
062
063 private static final boolean _CLEAN_UP_SET_ATTRIBUTES = true;
064
065 private static final String _PAGE = "/html/taglib/ui/toolbar_item/page.jsp";
066
067 private ToolbarItem _toolbarItem;
068 private String _var;
069
070 }