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:hourParam", _hourParam);
41          request.setAttribute(
42              "liferay-ui:input-time:hourValue", String.valueOf(_hourValue));
43          request.setAttribute(
44              "liferay-ui:input-time:hourNullable",
45              String.valueOf(_hourNullable));
46          request.setAttribute("liferay-ui:input-time:minuteParam", _minuteParam);
47          request.setAttribute(
48              "liferay-ui:input-time:minuteValue", String.valueOf(_minuteValue));
49          request.setAttribute(
50              "liferay-ui:input-time:minuteNullable",
51              String.valueOf(_minuteNullable));
52          request.setAttribute(
53              "liferay-ui:input-time:minuteInterval",
54              String.valueOf(_minuteInterval));
55          request.setAttribute("liferay-ui:input-time:amPmParam", _amPmParam);
56          request.setAttribute(
57              "liferay-ui:input-time:amPmValue", String.valueOf(_amPmValue));
58          request.setAttribute(
59              "liferay-ui:input-time:amPmNullable",
60              String.valueOf(_amPmNullable));
61          request.setAttribute(
62              "liferay-ui:input-time:disabled", String.valueOf(_disabled));
63  
64          return EVAL_BODY_BUFFERED;
65      }
66  
67      public void setHourParam(String hourParam) {
68          _hourParam = hourParam;
69      }
70  
71      public void setHourValue(int hourValue) {
72          _hourValue = hourValue;
73      }
74  
75      public void setHourNullable(boolean hourNullable) {
76          _hourNullable = hourNullable;
77      }
78  
79      public void setMinuteParam(String minuteParam) {
80          _minuteParam = minuteParam;
81      }
82  
83      public void setMinuteValue(int minuteValue) {
84          _minuteValue = minuteValue;
85      }
86  
87      public void setMinuteNullable(boolean minuteNullable) {
88          _minuteNullable = minuteNullable;
89      }
90  
91      public void setMinuteInterval(int minuteInterval) {
92          _minuteInterval = minuteInterval;
93      }
94  
95      public void setAmPmParam(String amPmParam) {
96          _amPmParam = amPmParam;
97      }
98  
99      public void setAmPmValue(int amPmValue) {
100         _amPmValue = amPmValue;
101     }
102 
103     public void setAmPmNullable(boolean amPmNullable) {
104         _amPmNullable = amPmNullable;
105     }
106 
107     public void setDisabled(boolean disabled) {
108         _disabled = disabled;
109     }
110 
111     protected String getDefaultPage() {
112         return _PAGE;
113     }
114 
115     private static final String _PAGE = "/html/taglib/ui/input_time/page.jsp";
116 
117     private String _hourParam;
118     private int _hourValue;
119     private boolean _hourNullable;
120     private String _minuteParam;
121     private int _minuteValue;
122     private boolean _minuteNullable;
123     private int _minuteInterval;
124     private String _amPmParam;
125     private int _amPmValue;
126     private boolean _amPmNullable;
127     private boolean _disabled;
128 
129 }