1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.taglib.ui;
24  
25  import com.liferay.taglib.util.IncludeTag;
26  
27  import javax.servlet.http.HttpServletRequest;
28  
29  /**
30   * <a href="InputTimeTag.java.html"><b><i>View Source</i></b></a>
31   *
32   * @author Brian Wing Shun Chan
33   */
34  public class InputTimeTag extends IncludeTag {
35  
36      public int doStartTag() {
37          HttpServletRequest request =
38              (HttpServletRequest)pageContext.getRequest();
39  
40          request.setAttribute("liferay-ui:input-time:cssClass", _cssClass);
41          request.setAttribute("liferay-ui:input-time:hourParam", _hourParam);
42          request.setAttribute(
43              "liferay-ui:input-time:hourValue", String.valueOf(_hourValue));
44          request.setAttribute(
45              "liferay-ui:input-time:hourNullable",
46              String.valueOf(_hourNullable));
47          request.setAttribute("liferay-ui:input-time:minuteParam", _minuteParam);
48          request.setAttribute(
49              "liferay-ui:input-time:minuteValue", String.valueOf(_minuteValue));
50          request.setAttribute(
51              "liferay-ui:input-time:minuteNullable",
52              String.valueOf(_minuteNullable));
53          request.setAttribute(
54              "liferay-ui:input-time:minuteInterval",
55              String.valueOf(_minuteInterval));
56          request.setAttribute("liferay-ui:input-time:amPmParam", _amPmParam);
57          request.setAttribute(
58              "liferay-ui:input-time:amPmValue", String.valueOf(_amPmValue));
59          request.setAttribute(
60              "liferay-ui:input-time:amPmNullable",
61              String.valueOf(_amPmNullable));
62          request.setAttribute(
63              "liferay-ui:input-time:disabled", String.valueOf(_disabled));
64  
65          return EVAL_BODY_BUFFERED;
66      }
67  
68      public void setCssClass(String cssClass) {
69          _cssClass = cssClass;
70      }
71      public void setHourParam(String hourParam) {
72          _hourParam = hourParam;
73      }
74  
75      public void setHourValue(int hourValue) {
76          _hourValue = hourValue;
77      }
78  
79      public void setHourNullable(boolean hourNullable) {
80          _hourNullable = hourNullable;
81      }
82  
83      public void setMinuteParam(String minuteParam) {
84          _minuteParam = minuteParam;
85      }
86  
87      public void setMinuteValue(int minuteValue) {
88          _minuteValue = minuteValue;
89      }
90  
91      public void setMinuteNullable(boolean minuteNullable) {
92          _minuteNullable = minuteNullable;
93      }
94  
95      public void setMinuteInterval(int minuteInterval) {
96          _minuteInterval = minuteInterval;
97      }
98  
99      public void setAmPmParam(String amPmParam) {
100         _amPmParam = amPmParam;
101     }
102 
103     public void setAmPmValue(int amPmValue) {
104         _amPmValue = amPmValue;
105     }
106 
107     public void setAmPmNullable(boolean amPmNullable) {
108         _amPmNullable = amPmNullable;
109     }
110 
111     public void setDisabled(boolean disabled) {
112         _disabled = disabled;
113     }
114 
115     protected String getDefaultPage() {
116         return _PAGE;
117     }
118 
119     private static final String _PAGE = "/html/taglib/ui/input_time/page.jsp";
120 
121     private String _cssClass;
122     private String _hourParam;
123     private int _hourValue;
124     private boolean _hourNullable;
125     private String _minuteParam;
126     private int _minuteValue;
127     private boolean _minuteNullable;
128     private int _minuteInterval;
129     private String _amPmParam;
130     private int _amPmValue;
131     private boolean _amPmNullable;
132     private boolean _disabled;
133 
134 }