PageRenderTime 39ms CodeModel.GetById 28ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/src/main/java/com/googlecode/struts2yuiplugin/views/jsp/ui/DatePickerTag.java

http://struts2yuiplugin.googlecode.com/
Java | 75 lines | 59 code | 16 blank | 0 comment | 0 complexity | d988ebd4f1205df7b641254b2b5395d1 MD5 | raw file
 1package com.googlecode.struts2yuiplugin.views.jsp.ui;
 2
 3import javax.servlet.http.HttpServletRequest;
 4import javax.servlet.http.HttpServletResponse;
 5
 6import org.apache.struts2.components.Component;
 7import org.apache.struts2.views.jsp.ui.AbstractUITag;
 8
 9import com.googlecode.struts2yuiplugin.components.DatePicker;
10import com.opensymphony.xwork2.util.ValueStack;
11
12public class DatePickerTag extends AbstractUITag {
13    protected String startDate;
14    protected String endDate;
15    protected String autoClose;
16    protected String iconPath;
17    protected String iconCssClass;
18    protected String formatFunction;
19    protected String mode;
20    protected String language;
21
22    @Override
23    public Component getBean(ValueStack stack, HttpServletRequest req,
24        HttpServletResponse res) {
25        return new DatePicker(stack, req, res);
26    }
27
28    @Override
29    protected void populateParams() {
30        super.populateParams();
31
32        DatePicker datePicker = (DatePicker) this.component;
33        datePicker.setStartDate(this.startDate);
34        datePicker.setEndDate(this.endDate);
35        datePicker.setAutoClose(this.autoClose);
36        datePicker.setIconCssClass(this.iconCssClass);
37        datePicker.setIconPath(this.iconPath);
38        datePicker.setFormatFunction(this.formatFunction);
39        datePicker.setMode(this.mode);
40        datePicker.setLanguage(this.language);
41    }
42
43    public void setStartDate(String startDate) {
44        this.startDate = startDate;
45    }
46
47    public void setEndDate(String endDate) {
48        this.endDate = endDate;
49    }
50
51    public void setAutoClose(String autoClose) {
52        this.autoClose = autoClose;
53    }
54
55    public void setIconPath(String iconPath) {
56        this.iconPath = iconPath;
57    }
58
59    public void setIconCssClass(String iconCssClass) {
60        this.iconCssClass = iconCssClass;
61    }
62
63    public void setFormatFunction(String formatFunction) {
64        this.formatFunction = formatFunction;
65    }
66
67    public void setMode(String mode) {
68        this.mode = mode;
69    }
70
71    public void setLanguage(String language) {
72        this.language = language;
73    }
74
75}