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="ColumnTag.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 ColumnTag extends IncludeTag {
29  
30      public void setColumnWidth(int columnWidth) {
31          _columnWidth = columnWidth;
32      }
33  
34      public void setCssClass(String cssClass) {
35          _cssClass = cssClass;
36      }
37  
38      public void setFirst(boolean first) {
39          _first = first;
40      }
41  
42      public void setLast(boolean last) {
43          _last = last;
44      }
45  
46      protected void cleanUp() {
47          _columnWidth = 0;
48          _cssClass = null;
49          _first = false;
50          _last = false;
51      }
52  
53      protected String getEndPage() {
54          return _END_PAGE;
55      }
56  
57      protected String getStartPage() {
58          return _START_PAGE;
59      }
60  
61      protected boolean isCleanUpSetAttributes() {
62          return _CLEAN_UP_SET_ATTRIBUTES;
63      }
64  
65      protected void setAttributes(HttpServletRequest request) {
66          request.setAttribute(
67              "aui:column:columnWidth", String.valueOf(_columnWidth));
68          request.setAttribute("aui:column:cssClass", _cssClass);
69          request.setAttribute(
70              "aui:column:dynamicAttributes", getDynamicAttributes());
71          request.setAttribute("aui:column:first", String.valueOf(_first));
72          request.setAttribute("aui:column:last", String.valueOf(_last));
73      }
74  
75      private static final boolean _CLEAN_UP_SET_ATTRIBUTES = true;
76  
77      private static final String _END_PAGE =
78          "/html/taglib/aui/column/end.jsp";
79  
80      private static final String _START_PAGE =
81          "/html/taglib/aui/column/start.jsp";
82  
83      private int _columnWidth;
84      private String _cssClass;
85      private boolean _first;
86      private boolean _last;
87  
88  }