001: /*
002: * $Id: DateTimePickerTag.java 508602 2007-02-16 21:53:54Z musachy $
003: *
004: * Licensed to the Apache Software Foundation (ASF) under one
005: * or more contributor license agreements. See the NOTICE file
006: * distributed with this work for additional information
007: * regarding copyright ownership. The ASF licenses this file
008: * to you under the Apache License, Version 2.0 (the
009: * "License"); you may not use this file except in compliance
010: * with the License. You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing,
015: * software distributed under the License is distributed on an
016: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017: * KIND, either express or implied. See the License for the
018: * specific language governing permissions and limitations
019: * under the License.
020: */
021: package org.apache.struts2.views.jsp.ui;
022:
023: import javax.servlet.http.HttpServletRequest;
024: import javax.servlet.http.HttpServletResponse;
025:
026: import org.apache.struts2.components.Component;
027: import org.apache.struts2.components.DateTimePicker;
028:
029: import com.opensymphony.xwork2.util.ValueStack;
030:
031: /**
032: * @see DateTimePicker
033: */
034: public class DateTimePickerTag extends AbstractUITag {
035:
036: private static final long serialVersionUID = 4054114507143447232L;
037:
038: protected String displayWeeks;
039: protected String adjustWeeks;
040: protected String startDate;
041: protected String endDate;
042: protected String weekStartsOn;
043: protected String staticDisplay;
044: protected String dayWidth;
045: protected String language;
046:
047: protected String iconPath;
048: protected String formatLength;
049: protected String displayFormat;
050: protected String toggleType;
051: protected String toggleDuration;
052: protected String type;
053: protected String templateCssPath;
054:
055: public Component getBean(ValueStack stack, HttpServletRequest req,
056: HttpServletResponse res) {
057: return new DateTimePicker(stack, req, res);
058: }
059:
060: protected void populateParams() {
061: super .populateParams();
062:
063: final DateTimePicker dateTimePicker = (DateTimePicker) component;
064: dateTimePicker.setAdjustWeeks(adjustWeeks);
065: dateTimePicker.setDayWidth(dayWidth);
066: dateTimePicker.setDisplayWeeks(displayWeeks);
067: dateTimePicker.setEndDate(endDate);
068: dateTimePicker.setStartDate(startDate);
069: dateTimePicker.setStaticDisplay(staticDisplay);
070: dateTimePicker.setWeekStartsOn(weekStartsOn);
071: dateTimePicker.setLanguage(language);
072: dateTimePicker.setIconPath(iconPath);
073: dateTimePicker.setFormatLength(formatLength);
074: dateTimePicker.setDisplayFormat(displayFormat);
075: dateTimePicker.setToggleType(toggleType);
076: dateTimePicker.setToggleDuration(toggleDuration);
077: dateTimePicker.setType(type);
078: dateTimePicker.setTemplateCssPath(templateCssPath);
079: }
080:
081: public void setAdjustWeeks(String adjustWeeks) {
082: this .adjustWeeks = adjustWeeks;
083: }
084:
085: public void setDayWidth(String dayWidth) {
086: this .dayWidth = dayWidth;
087: }
088:
089: public void setDisplayWeeks(String displayWeeks) {
090: this .displayWeeks = displayWeeks;
091: }
092:
093: public void setEndDate(String endDate) {
094: this .endDate = endDate;
095: }
096:
097: public void setStartDate(String startDate) {
098: this .startDate = startDate;
099: }
100:
101: public void setStaticDisplay(String staticDisplay) {
102: this .staticDisplay = staticDisplay;
103: }
104:
105: public void setWeekStartsOn(String weekStartsOn) {
106: this .weekStartsOn = weekStartsOn;
107: }
108:
109: public void setLanguage(String language) {
110: this .language = language;
111: }
112:
113: public void setDisplayFormat(String displayFormat) {
114: this .displayFormat = displayFormat;
115: }
116:
117: public void setFormatLength(String formatLength) {
118: this .formatLength = formatLength;
119: }
120:
121: public void setIconPath(String iconPath) {
122: this .iconPath = iconPath;
123: }
124:
125: public void setToggleDuration(String toggleDuration) {
126: this .toggleDuration = toggleDuration;
127: }
128:
129: public void setToggleType(String toggleType) {
130: this .toggleType = toggleType;
131: }
132:
133: public void setType(String type) {
134: this .type = type;
135: }
136:
137: public void setTemplateCssPath(String templateCssPath) {
138: this.templateCssPath = templateCssPath;
139: }
140: }
|