1
22
23 package com.liferay.taglib.ui;
24
25 import com.liferay.taglib.util.IncludeTag;
26
27 import java.text.Format;
28
29 import java.util.Set;
30
31 import javax.servlet.http.HttpServletRequest;
32
33
38 public class CalendarTag extends IncludeTag {
39
40 public int doStartTag() {
41 HttpServletRequest request =
42 (HttpServletRequest)pageContext.getRequest();
43
44 request.setAttribute("liferay-ui:calendar:data", _data);
45 request.setAttribute("liferay-ui:calendar:day", String.valueOf(_day));
46 request.setAttribute(
47 "liferay-ui:calendar:headerPattern", _headerPattern);
48 request.setAttribute("liferay-ui:calendar:headerFormat", _headerFormat);
49 request.setAttribute(
50 "liferay-ui:calendar:month", String.valueOf(_month));
51 request.setAttribute(
52 "liferay-ui:calendar:showAllPotentialWeeks",
53 String.valueOf(_showAllPotentialWeeks));
54 request.setAttribute("liferay-ui:calendar:year", String.valueOf(_year));
55
56 return EVAL_BODY_BUFFERED;
57 }
58
59 public void setData(Set<Integer> data) {
60 _data = data;
61 }
62
63 public void setDay(int day) {
64 _day = day;
65 }
66
67 public void setHeaderFormat(Format headerFormat) {
68 _headerFormat = headerFormat;
69 }
70
71 public void setHeaderPattern(String headerPattern) {
72 _headerPattern = headerPattern;
73 }
74
75 public void setMonth(int month) {
76 _month = month;
77 }
78
79 public void setShowAllPotentialWeeks(boolean showAllPotentialWeeks) {
80 _showAllPotentialWeeks = showAllPotentialWeeks;
81 }
82
83 public void setYear(int year) {
84 _year = year;
85 }
86
87 protected String getDefaultPage() {
88 return _PAGE;
89 }
90
91 private static final String _PAGE = "/html/taglib/ui/calendar/page.jsp";
92
93 private Set<Integer> _data;
94 private int _day;
95 private Format _headerFormat;
96 private String _headerPattern;
97 private int _month;
98 private boolean _showAllPotentialWeeks;
99 private int _year;
100
101 }