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="InputCheckBoxTag.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Brian Wing Shun Chan
25   */
26  public class InputCheckBoxTag 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 setId(String id) {
45          _id = id;
46      }
47  
48      public void setOnClick(String onClick) {
49          _onClick = onClick;
50      }
51  
52      public void setParam(String param) {
53          _param = param;
54      }
55  
56      protected void cleanUp() {
57          _cssClass = null;
58          _defaultValue = Boolean.FALSE;
59          _disabled = false;
60          _formName = "fm";
61          _id = null;
62          _onClick = null;
63          _param = null;
64      }
65  
66      protected String getPage() {
67          return _PAGE;
68      }
69  
70      protected void setAttributes(HttpServletRequest request) {
71          request.setAttribute("liferay-ui:input-checkbox:cssClass", _cssClass);
72          request.setAttribute(
73              "liferay-ui:input-checkbox:defaultValue", _defaultValue);
74          request.setAttribute(
75              "liferay-ui:input-checkbox:disabled", String.valueOf(_disabled));
76          request.setAttribute("liferay-ui:input-checkbox:formName", _formName);
77          request.setAttribute("liferay-ui:input-checkbox:id", _id);
78          request.setAttribute("liferay-ui:input-checkbox:onClick", _onClick);
79          request.setAttribute("liferay-ui:input-checkbox:param", _param);
80      }
81  
82      private static final String _PAGE =
83          "/html/taglib/ui/input_checkbox/page.jsp";
84  
85      private String _cssClass;
86      private Boolean _defaultValue = Boolean.FALSE;
87      private boolean _disabled;
88      private String _formName = "fm";
89      private String _id;
90      private String _onClick;
91      private String _param;
92  
93  }