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="ATag.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 ATag extends IncludeTag {
29  
30      public void setCssClass(String cssClass) {
31          _cssClass = cssClass;
32      }
33  
34      public void setHref(String href) {
35          _href = href;
36      }
37  
38      public void setId(String id) {
39          _id = id;
40      }
41  
42      public void setLabel(String label) {
43          _label = label;
44      }
45  
46      public void setLang(String lang) {
47          _lang = lang;
48      }
49  
50      public void setTarget(String target) {
51          _target = target;
52      }
53  
54      protected void cleanUp() {
55          _cssClass = null;
56          _href = null;
57          _id = null;
58          _label = null;
59          _lang = null;
60          _target = null;
61      }
62  
63      protected String getEndPage() {
64          return _END_PAGE;
65      }
66  
67      protected String getStartPage() {
68          return _START_PAGE;
69      }
70  
71      protected boolean isCleanUpSetAttributes() {
72          return _CLEAN_UP_SET_ATTRIBUTES;
73      }
74  
75      protected void setAttributes(HttpServletRequest request) {
76          request.setAttribute("aui:a:cssClass", _cssClass);
77          request.setAttribute("aui:a:dynamicAttributes", getDynamicAttributes());
78          request.setAttribute("aui:a:href", _href);
79          request.setAttribute("aui:a:id", _id);
80          request.setAttribute("aui:a:label", _label);
81          request.setAttribute("aui:a:lang", _lang);
82          request.setAttribute("aui:a:target", _target);
83      }
84  
85      private static final boolean _CLEAN_UP_SET_ATTRIBUTES = true;
86  
87      private static final String _END_PAGE =
88          "/html/taglib/aui/a/end.jsp";
89  
90      private static final String _START_PAGE =
91          "/html/taglib/aui/a/start.jsp";
92  
93      private String _cssClass;
94      private String _href;
95      private String _id;
96      private String _label;
97      private String _lang;
98      private String _target;
99  
100 }