View Javadoc

1   /*
2    * $Id: DateTimePickerTag.java 651946 2008-04-27 13:41:38Z apetrelli $
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  package org.apache.struts2.dojo.views.jsp.ui;
23  
24  import javax.servlet.http.HttpServletRequest;
25  import javax.servlet.http.HttpServletResponse;
26  
27  import org.apache.struts2.components.Component;
28  import org.apache.struts2.dojo.components.DateTimePicker;
29  import org.apache.struts2.views.jsp.ui.AbstractUITag;
30  
31  import com.opensymphony.xwork2.util.ValueStack;
32  
33  /***
34   * @see DateTimePicker
35   */
36  public class DateTimePickerTag extends AbstractUITag {
37  
38      private static final long serialVersionUID = 4054114507143447232L;
39  
40      protected String displayWeeks;
41      protected String adjustWeeks;
42      protected String startDate;
43      protected String endDate;
44      protected String weekStartsOn;
45      protected String staticDisplay;
46      protected String dayWidth;
47      protected String language;
48      
49      protected String iconPath;
50      protected String formatLength;
51      protected String displayFormat;
52      protected String toggleType;
53      protected String toggleDuration;
54      protected String type;
55      protected String templateCssPath;
56      protected String valueNotifyTopics;
57  
58      public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
59          return new DateTimePicker(stack, req, res);
60      }
61  
62      protected void populateParams() {
63          super.populateParams();
64  
65          final DateTimePicker dateTimePicker = (DateTimePicker) component;
66          dateTimePicker.setAdjustWeeks(adjustWeeks);
67          dateTimePicker.setDayWidth(dayWidth);
68          dateTimePicker.setDisplayWeeks(displayWeeks);
69          dateTimePicker.setEndDate(endDate);
70          dateTimePicker.setStartDate(startDate);
71          dateTimePicker.setStaticDisplay(staticDisplay);
72          dateTimePicker.setWeekStartsOn(weekStartsOn);
73          dateTimePicker.setLanguage(language);
74          dateTimePicker.setIconPath(iconPath);
75          dateTimePicker.setFormatLength(formatLength);
76          dateTimePicker.setDisplayFormat(displayFormat);
77          dateTimePicker.setToggleType(toggleType);
78          dateTimePicker.setToggleDuration(toggleDuration);
79          dateTimePicker.setType(type);
80          dateTimePicker.setTemplateCssPath(templateCssPath);
81          dateTimePicker.setValueNotifyTopics(valueNotifyTopics);
82          dateTimePicker.setDisabled(disabled);
83      }
84  
85      public void setAdjustWeeks(String adjustWeeks) {
86          this.adjustWeeks = adjustWeeks;
87      }
88  
89      public void setDayWidth(String dayWidth) {
90          this.dayWidth = dayWidth;
91      }
92  
93      public void setDisplayWeeks(String displayWeeks) {
94          this.displayWeeks = displayWeeks;
95      }
96  
97      public void setEndDate(String endDate) {
98          this.endDate = endDate;
99      }
100 
101     public void setStartDate(String startDate) {
102         this.startDate = startDate;
103     }
104 
105     public void setStaticDisplay(String staticDisplay) {
106         this.staticDisplay = staticDisplay;
107     }
108 
109     public void setWeekStartsOn(String weekStartsOn) {
110         this.weekStartsOn = weekStartsOn;
111     }
112 
113     public void setLanguage(String language) {
114         this.language = language;
115     }
116     
117     public void setDisplayFormat(String displayFormat) {
118         this.displayFormat = displayFormat;
119     }
120 
121     public void setFormatLength(String formatLength) {
122         this.formatLength = formatLength;
123     }
124 
125     public void setIconPath(String iconPath) {
126         this.iconPath = iconPath;
127     }
128 
129     public void setToggleDuration(String toggleDuration) {
130         this.toggleDuration = toggleDuration;
131     }
132 
133     public void setToggleType(String toggleType) {
134         this.toggleType = toggleType;
135     }
136 
137     public void setType(String type) {
138         this.type = type;
139     }
140     
141     public void setTemplateCssPath(String templateCssPath) {
142         this.templateCssPath = templateCssPath;
143     }
144 
145     public void setValueNotifyTopics(String valueNotifyTopics) {
146         this.valueNotifyTopics = valueNotifyTopics;
147     }
148 }