1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.taglib.aui;
16  
17  import com.liferay.taglib.util.IncludeTag;
18  
19  import javax.servlet.http.HttpServletRequest;
20  
21  /**
22   * <a href="LegendTag.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Julio Camarero
25   * @author Jorge Ferrer
26   * @author Brian Wing Shun Chan
27   */
28  public class LegendTag extends IncludeTag {
29  
30      protected void setAttributes(HttpServletRequest request) {
31          request.setAttribute("aui:legend:cssClass", _cssClass);
32          request.setAttribute(
33              "aui:legend:dynamicAttributes", getDynamicAttributes());
34          request.setAttribute("aui:legend:label", _label);
35      }
36  
37      protected void cleanUp() {
38          _cssClass = null;
39          _label = null;
40      }
41  
42      public void setCssClass(String cssClass) {
43          _cssClass = cssClass;
44      }
45  
46      public void setLabel(String label) {
47          _label = label;
48      }
49  
50      protected String getPage() {
51          return _PAGE;
52      }
53  
54      protected boolean isCleanUpSetAttributes() {
55          return _CLEAN_UP_SET_ATTRIBUTES;
56      }
57  
58      private static final boolean _CLEAN_UP_SET_ATTRIBUTES = true;
59  
60      private static final String _PAGE = "/html/taglib/aui/legend/page.jsp";
61  
62      private String _cssClass;
63      private String _label;
64  
65  }