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