001    package railo.runtime.tag;
002    
003    import javax.servlet.jsp.JspException;
004    
005    import railo.runtime.exp.ApplicationException;
006    import railo.runtime.exp.TagNotSupported;
007    import railo.runtime.ext.tag.TagImpl;
008    import railo.runtime.type.List;
009    import railo.runtime.type.dt.DateTime;
010    
011    public final class Calendar extends TagImpl {
012    
013            private static final String[] DAY_NAMES_DEFAULT = new String[]{"S", "M", "T", "W", "Th", "F", "S"};
014    
015            private static final String[] MONTH_NAMES_DEFAULT = new String[]{"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
016            
017            private String name;
018            private int height=-1;
019            private int width=-1;
020            private DateTime selectedDate;
021            private DateTime startRange;
022            private DateTime endRange;
023            private boolean disabled;
024            private String mask="MM/DD/YYYY";
025            private int firstDayOfWeek=0;
026            private String[] dayNames=DAY_NAMES_DEFAULT;
027            private String[] monthNames=MONTH_NAMES_DEFAULT;
028            private String style;
029            private boolean enabled=true;
030            private boolean visible=true;
031            private String tooltip;
032            private String onChange;
033            private String onBlur;
034            private String onFocus;
035            
036            
037            public Calendar() throws ApplicationException {
038                    // TODO impl. tag Calendar
039                    throw new TagNotSupported("Calendar");
040            }
041    
042            /**
043             * @see railo.runtime.ext.tag.TagImpl#release()
044             */
045            public void release() {
046                    super.release();
047                    name=null;
048                    height=-1;
049                    width=-1;
050                    selectedDate=null;
051                    startRange=null;
052                    endRange=null;
053                    disabled=false;
054                    mask="MM/DD/YYYY";
055                    firstDayOfWeek=0;
056                    dayNames=DAY_NAMES_DEFAULT;
057                    monthNames=MONTH_NAMES_DEFAULT;
058                    style=null;
059                    enabled=true;
060                    visible=true;
061                    tooltip=null;
062                    onChange=null;
063                    onBlur=null;
064                    onFocus=null;
065            }
066            
067            /**
068             *
069             * @see railo.runtime.ext.tag.TagImpl#doStartTag()
070             */
071            public int doStartTag() throws JspException {
072                    return super.doStartTag();
073            }
074    
075            /**
076             * @param dayNames the dayNames to set
077             */
078            public void setDaynames(String listDayNames) {
079                    this.dayNames = List.listToStringArray(listDayNames,',');
080            }
081    
082            /**
083             * @param disabled the disabled to set
084             */
085            public void setDisabled(boolean disabled) {
086                    this.disabled = disabled;
087            }
088    
089            /**
090             * @param enabled the enabled to set
091             */
092            public void setEnabled(boolean enabled) {
093                    this.enabled = enabled;
094            }
095    
096            /**
097             * @param endRange the endRange to set
098             */
099            public void setEndrange(DateTime endRange) {
100                    this.endRange = endRange;
101            }
102    
103            /**
104             * @param firstDayOfWeek the firstDayOfWeek to set
105             */
106            public void setFirstdayofweek(double firstDayOfWeek) {
107                    this.firstDayOfWeek = (int)firstDayOfWeek;
108            }
109    
110            /**
111             * @param height the height to set
112             */
113            public void setHeight(double height) {
114                    this.height = (int)height;
115            }
116    
117            /**
118             * @param mask the mask to set
119             */
120            public void setMask(String mask) {
121                    this.mask = mask;
122            }
123    
124            /**
125             * @param monthNames the monthNames to set
126             */
127            public void setMonthnames(String listMonthNames) {
128                    this.monthNames = monthNames;
129            }
130    
131            /**
132             * @param name the name to set
133             */
134            public void setName(String name) {
135                    this.name = name;
136            }
137    
138            /**
139             * @param onBlur the onBlur to set
140             */
141            public void setOnblur(String onBlur) {
142                    this.onBlur = onBlur;
143            }
144    
145            /**
146             * @param onChange the onChange to set
147             */
148            public void setOnchange(String onChange) {
149                    this.onChange = onChange;
150            }
151    
152            /**
153             * @param onFocus the onFocus to set
154             */
155            public void setOnfocus(String onFocus) {
156                    this.onFocus = onFocus;
157            }
158    
159            /**
160             * @param selectedDate the selectedDate to set
161             */
162            public void setSelecteddate(DateTime selectedDate) {
163                    this.selectedDate = selectedDate;
164            }
165    
166            /**
167             * @param startRange the startRange to set
168             */
169            public void setStartrange(DateTime startRange) {
170                    this.startRange = startRange;
171            }
172    
173            /**
174             * @param style the style to set
175             */
176            public void setStyle(String style) {
177                    this.style = style;
178            }
179    
180            /**
181             * @param tooltip the tooltip to set
182             */
183            public void setTooltip(String tooltip) {
184                    this.tooltip = tooltip;
185            }
186    
187            /**
188             * @param visible the visible to set
189             */
190            public void setVisible(boolean visible) {
191                    this.visible = visible;
192            }
193    
194            /**
195             * @param width the width to set
196             */
197            public void setWidth(double width) {
198                    this.width = (int)width;
199            }
200    
201    }