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.ui;
16  
17  import com.liferay.taglib.util.IncludeTag;
18  
19  import javax.servlet.http.HttpServletRequest;
20  
21  /**
22   * <a href="InputSelectTag.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Brian Wing Shun Chan
25   */
26  public class InputSelectTag extends IncludeTag {
27  
28      public void setCssClass(String cssClass) {
29          _cssClass = cssClass;
30      }
31  
32      public void setDefaultValue(boolean defaultValue) {
33          _defaultValue = Boolean.valueOf(defaultValue);
34      }
35  
36      public void setDisabled(boolean disabled) {
37          _disabled = disabled;
38      }
39  
40      public void setFormName(String formName) {
41          _formName = formName;
42      }
43  
44      public void setParam(String param) {
45          _param = param;
46      }
47  
48      protected void cleanUp() {
49          _cssClass = null;
50          _defaultValue = Boolean.FALSE;
51          _disabled = false;
52          _formName = "fm";
53          _param = null;
54      }
55  
56      protected String getPage() {
57          return _PAGE;
58      }
59  
60      protected void setAttributes(HttpServletRequest request) {
61          request.setAttribute("liferay-ui:input-select:cssClass", _cssClass);
62          request.setAttribute(
63              "liferay-ui:input-select:defaultValue", _defaultValue);
64          request.setAttribute(
65              "liferay-ui:input-select:disabled", String.valueOf(_disabled));
66          request.setAttribute("liferay-ui:input-select:formName", _formName);
67          request.setAttribute("liferay-ui:input-select:param", _param);
68      }
69  
70      private static final String _PAGE =
71          "/html/taglib/ui/input_select/page.jsp";
72  
73      private String _cssClass;
74      private Boolean _defaultValue = Boolean.FALSE;
75      private boolean _disabled;
76      private String _formName = "fm";
77      private String _param;
78  
79  }